public static void fire(BeanManagerImpl beanManager, Deployment deployment, BeanDeploymentArchiveMapping bdaMapping, Collection<ContextHolder<? extends Context>> contexts) { BeforeBeanDiscoveryImpl event = new BeforeBeanDiscoveryImpl(beanManager, deployment, bdaMapping, contexts); event.fire(); event.finish(); }
@Override public void addAnnotatedType(AnnotatedType<?> source) { checkWithinObserverNotification(); BootstrapLogger.LOG.deprecatedAddAnnotatedTypeMethodUsed(source.getJavaClass()); addAnnotatedType(source, null); }
@Override public void addAnnotatedType(AnnotatedType<?> type, String id) { checkWithinObserverNotification(); addSyntheticAnnotatedType(type, id); BootstrapLogger.LOG.addAnnotatedTypeCalledInBBD(getReceiver(), type); }
@Override public void addAnnotatedType(AnnotatedType<?> source) { checkWithinObserverNotification(); addAnnotatedType(source, null); }
public static void fire(BeanManagerImpl beanManager, Deployment deployment, BeanDeploymentArchiveMapping bdaMapping, Collection<ContextHolder<? extends Context>> contexts) { new BeforeBeanDiscoveryImpl(beanManager, deployment, bdaMapping, contexts).fire(); }
@Override public void addQualifier(Class<? extends Annotation> bindingType) { checkWithinObserverNotification(); getTypeStore().add(bindingType, QualifierLiteral.INSTANCE); getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(bindingType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(bindingType); BootstrapLogger.LOG.addQualifierCalled(getReceiver(), bindingType); }
@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); }
private <A extends Annotation> void addSyntheticAnnotation(AnnotatedType<A> annotation, Annotation requiredMetaAnnotation) { if (requiredMetaAnnotation != null && !annotation.isAnnotationPresent(requiredMetaAnnotation.annotationType())) { // Add required meta annotation annotation = new AnnotatedTypeWrapper<A>(annotation, requiredMetaAnnotation); } getBeanManager().getServices().get(ClassTransformer.class).addSyntheticAnnotation(annotation, getBeanManager().getId()); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(annotation.getJavaClass()); } }
public void startInitialization() { if (deploymentManager == null) { throw BootstrapLogger.LOG.managerNotInitialized(); extensionBeanDeployer.deployBeans(); installFastProcessAnnotatedTypeResolver(deploymentManager.getServices()); deploymentManager.addBean(new BeanManagerBean(deploymentManager)); deploymentManager.addBean(new BeanManagerImplBean(deploymentManager)); BeforeBeanDiscoveryImpl.fire(deploymentManager, deployment, bdaMapping, contexts); tracker.end();
@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 <T extends Annotation> AnnotatedTypeConfigurator<T> configureInterceptorBinding(Class<T> bindingType) { checkWithinObserverNotification(); AnnotatedTypeConfiguratorImpl<T> configurator = new AnnotatedTypeConfiguratorImpl<>(getBeanManager().createAnnotatedType(bindingType)); additionalInterceptorBindings.add(configurator); BootstrapLogger.LOG.configureInterceptorBindingCalled(getReceiver(), bindingType); return configurator; }
@Override public <T extends Annotation> AnnotatedTypeConfigurator<T> configureQualifier(Class<T> qualifier) { checkWithinObserverNotification(); AnnotatedTypeConfiguratorImpl<T> configurator = new AnnotatedTypeConfiguratorImpl<>(getBeanManager().createAnnotatedType(qualifier)); additionalQualifiers.add(configurator); BootstrapLogger.LOG.configureQualifierCalled(getReceiver(), qualifier); return configurator; }
@Override public void addInterceptorBinding(AnnotatedType<? extends Annotation> bindingType) { checkWithinObserverNotification(); addSyntheticAnnotation(bindingType, InterceptorBindingTypeLiteral.INSTANCE); BootstrapLogger.LOG.addInterceptorBindingCalled(getReceiver(), bindingType); }
@Override public void addQualifier(AnnotatedType<? extends Annotation> qualifier) { checkWithinObserverNotification(); addSyntheticAnnotation(qualifier, QualifierLiteral.INSTANCE); BootstrapLogger.LOG.addQualifierCalled(getReceiver(), qualifier); }
@Override protected void finish() { super.finish(); try { for (AnnotatedTypeConfiguratorImpl<? extends Annotation> qualifierAsAnnotatedType : additionalQualifiers) { addSyntheticAnnotation(qualifierAsAnnotatedType.complete(), QualifierLiteral.INSTANCE); } for (AnnotatedTypeConfiguratorImpl<? extends Annotation> interceptorBindingAsAnnotatedType : additionalInterceptorBindings) { addSyntheticAnnotation(interceptorBindingAsAnnotatedType.complete(), InterceptorBindingTypeLiteral.INSTANCE); } } catch (Exception e) { throw new DefinitionException(e); } }
@Override public void addQualifier(Class<? extends Annotation> bindingType) { checkWithinObserverNotification(); getTypeStore().add(bindingType, QualifierLiteral.INSTANCE); getBeanManager().getServices().get(ClassTransformer.class).clearAnnotationData(bindingType); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(bindingType); BootstrapLogger.LOG.addQualifierCalled(getReceiver(), bindingType); }
@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); }
private <A extends Annotation> void addSyntheticAnnotation(AnnotatedType<A> annotation, Annotation requiredMetaAnnotation) { if (requiredMetaAnnotation != null && !annotation.isAnnotationPresent(requiredMetaAnnotation.annotationType())) { // Add required meta annotation annotation = new AnnotatedTypeWrapper<A>(annotation, requiredMetaAnnotation); } getBeanManager().getServices().get(ClassTransformer.class).addSyntheticAnnotation(annotation, getBeanManager().getId()); getBeanManager().getServices().get(MetaAnnotationStore.class).clearAnnotationData(annotation.getJavaClass()); }
public void startInitialization() { if (deploymentManager == null) { throw BootstrapLogger.LOG.managerNotInitialized(); extensionBeanDeployer.deployBeans(); installFastProcessAnnotatedTypeResolver(deploymentManager.getServices()); deploymentManager.addBean(new BeanManagerBean(deploymentManager)); deploymentManager.addBean(new BeanManagerImplBean(deploymentManager)); BeforeBeanDiscoveryImpl.fire(deploymentManager, deployment, bdaMapping, contexts); tracker.end();
@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; }