use of org.jboss.weld.environment.se.WeldContainer in project Payara by payara.
the class ACCJCDIServiceImpl method injectManagedObject.
@Override
public <T> void injectManagedObject(T managedObject, BundleDescriptor bundle) {
WeldContainer wc = getWeldContainer();
if (wc != null) {
BeanManager beanManager = wc.getBeanManager();
@SuppressWarnings("unchecked") AnnotatedType<T> annotatedType = beanManager.createAnnotatedType((Class<T>) managedObject.getClass());
InjectionTarget<T> target = beanManager.createInjectionTarget(annotatedType);
CreationalContext<T> cc = beanManager.createCreationalContext(null);
target.inject(managedObject, cc);
}
}
Aggregations