@Override public <T> AnnotatedTypeConfigurator<T> addAnnotatedType(Class<T> type, String id) { checkWithinObserverNotification(); AnnotatedTypeConfiguratorImpl<T> configurator = new AnnotatedTypeConfiguratorImpl<>(getBeanManager().createAnnotatedType(type)); additionalAnnotatedTypes.add(new AnnotatedTypeRegistration<T>(configurator, id)); BootstrapLogger.LOG.addAnnotatedTypeCalledInBBD(getReceiver(), type); return configurator; }
@Override public void addInterceptorBinding(Class<? extends Annotation> bindingType, Annotation... bindingTypeDef) { checkWithinObserverNotification(); TypeStore typeStore = getTypeStore(); typeStore.add(bindingType, InterceptorBindingTypeLiteral.INSTANCE); for (Annotation a : bindingTypeDef) { typeStore.add(bindingType, a); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(bindingType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(bindingType); BootstrapLogger.LOG.addInterceptorBindingCalled(getReceiver(), bindingType); }
@Override public void addQualifier(AnnotatedType<? extends Annotation> qualifier) { checkWithinObserverNotification(); addSyntheticAnnotation(qualifier, QualifierLiteral.INSTANCE); BootstrapLogger.LOG.addQualifierCalled(getReceiver(), qualifier); }
@Override public void addScope(Class<? extends Annotation> scopeType, boolean normal, boolean passivating) { checkWithinObserverNotification(); if (normal) { getTypeStore().add(scopeType, new NormalScopeLiteral(passivating)); } else if (passivating) { throw BootstrapLogger.LOG.passivatingNonNormalScopeIllegal(scopeType); } else { getTypeStore().add(scopeType, ScopeLiteral.INSTANCE); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(ReflectionCache.class).cleanup(); BootstrapLogger.LOG.addScopeCalled(getReceiver(), scopeType); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addInterceptorBinding(AnnotatedType<? extends Annotation> bindingType) { checkWithinObserverNotification(); addSyntheticAnnotation(bindingType, InterceptorBindingTypeLiteral.INSTANCE); BootstrapLogger.LOG.addInterceptorBindingCalled(getReceiver(), bindingType); }
@Override public void addAnnotatedType(AnnotatedType<?> type, String id) { checkWithinObserverNotification(); addSyntheticAnnotatedType(type, id); BootstrapLogger.LOG.addAnnotatedTypeCalledInBBD(getReceiver(), type); }
public void addDefinitionError(Throwable t) { Preconditions.checkArgumentNotNull(t, "Throwable t"); checkWithinObserverNotification(); getErrors().add(t); BootstrapLogger.LOG.addDefinitionErrorCalled(getReceiver(), t); }
@Override public void addObserverMethod(ObserverMethod<?> observerMethod) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(observerMethod, "observerMethod"); validateObserverMethod(observerMethod, getBeanManager()); additionalObservers.add(observerMethod); BootstrapLogger.LOG.addObserverMethodCalled(getReceiver(), observerMethod); }
@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); }
public Bean<?> initBean() { if (bean != null) { return bean; } else if (beanConfigurator != null) { Bean<?> bean; try { bean = beanConfigurator.complete(); } catch (Exception e) { throw BootstrapLogger.LOG.unableToProcessConfigurator(BeanConfigurator.class.getSimpleName(), extension, e); } BootstrapLogger.LOG.addBeanCalled(extension, bean); return bean; } return interceptorBuilder.build(); }
@Override public void addAnnotatedType(AnnotatedType<?> type, String id) { checkWithinObserverNotification(); addSyntheticAnnotatedType(type, id); BootstrapLogger.LOG.addAnnotatedTypeCalled(getReceiver(), type); }
@Override public void addStereotype(Class<? extends Annotation> stereotype, Annotation... stereotypeDef) { checkWithinObserverNotification(); TypeStore typeStore = getTypeStore(); typeStore.add(stereotype, StereotypeLiteral.INSTANCE); for (Annotation a : stereotypeDef) { typeStore.add(stereotype, a); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(stereotype); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(stereotype); BootstrapLogger.LOG.addStereoTypeCalled(getReceiver(), stereotype); }
@Override public void addScope(Class<? extends Annotation> scopeType, boolean normal, boolean passivating) { checkWithinObserverNotification(); if (normal) { getTypeStore().add(scopeType, new NormalScopeLiteral(passivating)); } else if (passivating) { throw BootstrapLogger.LOG.passivatingNonNormalScopeIllegal(scopeType); } else { getTypeStore().add(scopeType, ScopeLiteral.INSTANCE); } getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(scopeType); getBeanManager().getServices().get(ReflectionCache.class).cleanup(); BootstrapLogger.LOG.addScopeCalled(getReceiver(), scopeType); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addInterceptorBinding(AnnotatedType<? extends Annotation> bindingType) { checkWithinObserverNotification(); addSyntheticAnnotation(bindingType, InterceptorBindingTypeLiteral.INSTANCE); BootstrapLogger.LOG.addInterceptorBindingCalled(getReceiver(), bindingType); }
@Override public void addAnnotatedType(AnnotatedType<?> type, String id) { checkWithinObserverNotification(); addSyntheticAnnotatedType(type, id); BootstrapLogger.LOG.addAnnotatedTypeCalledInBBD(getReceiver(), type); }
public void addDefinitionError(Throwable t) { Preconditions.checkArgumentNotNull(t, "Throwable t"); checkWithinObserverNotification(); getErrors().add(t); BootstrapLogger.LOG.addDefinitionErrorCalled(getReceiver(), t); }
@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 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); }