use of org.jboss.weld.manager.api.WeldInjectionTarget in project wildfly by wildfly.
the class WeldComponentService method start.
@Override
public synchronized void start(final StartContext context) throws StartException {
final ClassLoader cl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader);
beanManager = weldContainerSupplier.get().getBeanManager(beanDeploymentArchiveId);
for (final Class<?> interceptor : interceptorClasses) {
AnnotatedType<?> type = beanManager.createAnnotatedType(interceptor);
@SuppressWarnings("rawtypes") InjectionTarget injectionTarget = beanManager.getInjectionTargetFactory(type).createInterceptorInjectionTarget();
interceptorInjections.put(interceptor, beanManager.fireProcessInjectionTarget(type, injectionTarget));
}
if (ejbName != null) {
EjbDescriptor<Object> descriptor = beanManager.getEjbDescriptor(ejbName);
// may happen if the Jakarta Enterprise Beans were vetoed
if (descriptor != null) {
bean = beanManager.getBean(descriptor);
}
}
if (bean instanceof SessionBean<?>) {
SessionBean<?> sessionBean = (SessionBean<?>) bean;
this.injectionTarget = sessionBean.getProducer();
return;
}
WeldInjectionTarget<?> injectionTarget = InjectionTargets.createInjectionTarget(componentClass, bean, beanManager, !isComponentWithView);
for (ComponentSupport support : ServiceLoader.load(ComponentSupport.class, WildFlySecurityManager.getClassLoaderPrivileged(WeldComponentService.class))) {
if (support.isProcessing(componentDescription)) {
this.injectionTarget = support.processInjectionTarget(injectionTarget, componentDescription, beanManager);
break;
}
}
if (this.injectionTarget == null) {
this.injectionTarget = injectionTarget;
}
beanManager.getServices().get(InjectionTargetService.class).validateProducer(injectionTarget);
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(cl);
}
}
Aggregations