@Override public ProducerConfigurator<T> disposeWith(Consumer<T> callback) { checkArgumentNotNull(callback); this.disposeCallback = cast(callback); return this; }
Singleton(Set<T> set) { Preconditions.checkNotNull(set); Preconditions.checkArgument(set.size() == 1, set); this.element = set.iterator().next(); }
@Override public <T> Iterable<AnnotatedType<T>> getAnnotatedTypes(Class<T> type) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(type, TYPE_ARGUMENT_NAME); return cast(slimAnnotatedTypeStore.get(type)); }
@Override public void addBean(Bean<?> bean) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(bean, "bean"); ExternalBeanAttributesFactory.validateBeanAttributes(bean, getBeanManager()); validateBean(bean); additionalBeans.add(bean); BootstrapLogger.LOG.addBeanCalled(getReceiver(), bean); }
@Override public void addObserverMethod(ObserverMethod<?> observerMethod) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(observerMethod, "observerMethod"); validateObserverMethod(observerMethod, getBeanManager()); additionalObservers.add(observerMethod); BootstrapLogger.LOG.addObserverMethodCalled(getReceiver(), observerMethod); }
@Override public <T> AnnotatedType<T> getAnnotatedType(Class<T> type, String id) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(type, TYPE_ARGUMENT_NAME); return slimAnnotatedTypeStore.get(type, id); }
public void setProducer(Producer<X> producer) { if (configurator != null) { throw BootstrapLogger.LOG.configuratorAndSetMethodBothCalled(ProcessProducer.class.getSimpleName(), getReceiver()); } checkArgumentNotNull(producer, "producer"); checkWithinObserverNotification(); BootstrapLogger.LOG.setProducerCalled(getReceiver(), getProducer(), producer); this.bean.setProducer(producer); producerSet = true; }
private static Object[] checkElementsNotNull(Object[] objects) { for (Object object : objects) { Preconditions.checkNotNull(object); } return objects; }
public void addDefinitionError(Throwable t) { Preconditions.checkArgumentNotNull(t, "Throwable t"); checkWithinObserverNotification(); getErrors().add(t); BootstrapLogger.LOG.addDefinitionErrorCalled(getReceiver(), t); }
@Override public void setObserverMethod(ObserverMethod<T> observerMethod) { if (configurator != null) { throw BootstrapLogger.LOG.configuratorAndSetMethodBothCalled(ProcessObserverMethod.class.getSimpleName(), getReceiver()); } Preconditions.checkArgumentNotNull(observerMethod, "observerMethod"); checkWithinObserverNotification(); replaceObserverMethod(observerMethod); observerMethodSet = true; }
@Override public boolean add(Class<?> element) { checkNotNull(element); List<Item> list = getDelegate(); synchronized (list) { if (getExtension() != null) { BootstrapLogger.LOG.typeModifiedInAfterTypeDiscovery(getExtension(), element, ADD_OPERATION, getViewType()); } return list.add(createSource(element, list.isEmpty() ? null : list.get(list.size() - 1), null)); } }
@Override public <T> BeanAttributes<T> createSessionBeanAttributes(EnhancedAnnotatedType<T> annotated, BeanManagerImpl manager) { final InternalEjbDescriptor<?> descriptor = ejbDescriptors.getUnique(annotated.getJavaClass()); Preconditions.checkArgument(descriptor != null, annotated.getJavaClass() + " is not an EJB."); return createSessionBeanAttributes(annotated, descriptor, manager); }
@Override public <T> Iterable<AnnotatedType<T>> getAnnotatedTypes(Class<T> type) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(type, TYPE_ARGUMENT_NAME); return cast(slimAnnotatedTypeStore.get(type)); }
@Override public void addBean(Bean<?> bean) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(bean, "bean"); ExternalBeanAttributesFactory.validateBeanAttributes(bean, getBeanManager()); validateBean(bean); additionalBeans.add(BeanRegistration.of(bean, getReceiver())); BootstrapLogger.LOG.addBeanCalled(getReceiver(), bean); }
@Override public void addObserverMethod(ObserverMethod<?> observerMethod) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(observerMethod, "observerMethod"); validateObserverMethod(observerMethod, getBeanManager(), null); additionalObservers.add(ObserverRegistration.of(observerMethod, getReceiver())); BootstrapLogger.LOG.addObserverMethodCalled(getReceiver(), observerMethod); }
@Override public <T> AnnotatedType<T> getAnnotatedType(Class<T> type, String id) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(type, TYPE_ARGUMENT_NAME); return slimAnnotatedTypeStore.get(type, id); }
public void setProducer(Producer<X> producer) { if (configurator != null) { throw BootstrapLogger.LOG.configuratorAndSetMethodBothCalled(ProcessProducer.class.getSimpleName(), getReceiver()); } checkArgumentNotNull(producer, "producer"); checkWithinObserverNotification(); BootstrapLogger.LOG.setProducerCalled(getReceiver(), getProducer(), producer); this.bean.setProducer(producer); producerSet = true; }
private static Object[] checkElementsNotNull(Object[] objects) { for (Object object : objects) { Preconditions.checkNotNull(object); } return objects; }
public void addDefinitionError(Throwable t) { Preconditions.checkArgumentNotNull(t, "Throwable t"); checkWithinObserverNotification(); getErrors().add(t); BootstrapLogger.LOG.addDefinitionErrorCalled(getReceiver(), t); }
@Override public void setObserverMethod(ObserverMethod<T> observerMethod) { if (configurator != null) { throw BootstrapLogger.LOG.configuratorAndSetMethodBothCalled(ProcessObserverMethod.class.getSimpleName(), getReceiver()); } Preconditions.checkArgumentNotNull(observerMethod, "observerMethod"); checkWithinObserverNotification(); replaceObserverMethod(observerMethod); observerMethodSet = true; }