use of org.jboss.weld.bean.builtin.BeanManagerProxy in project aries by apache.
the class HttpExtension method afterDeploymentValidation.
void afterDeploymentValidation(@Observes AfterDeploymentValidation adv, BeanManager beanManager) {
processWebClasses();
BeanManagerImpl beanManagerImpl = ((BeanManagerProxy) beanManager).delegate();
Dictionary<String, Object> properties = new Hashtable<>();
properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT, getSelectedContext());
properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, Boolean.TRUE.toString());
properties.put(Constants.SERVICE_RANKING, Integer.MAX_VALUE - 100);
_registrations.add(_bundle.getBundleContext().registerService(LISTENER_CLASSES, new WeldInitialListener(beanManagerImpl), properties));
}
use of org.jboss.weld.bean.builtin.BeanManagerProxy in project aries by apache.
the class ReferenceExtension method processInjectionTarget.
void processInjectionTarget(@Observes @SuppressWarnings("rawtypes") ProcessInjectionPoint pip, BeanManager manager) {
InjectionPoint injectionPoint = pip.getInjectionPoint();
Annotated annotated = injectionPoint.getAnnotated();
Reference reference = annotated.getAnnotation(Reference.class);
if (reference == null) {
return;
}
try {
BeanManagerImpl beanManagerImpl = ((BeanManagerProxy) manager).delegate();
ReferenceDependency referenceDependency = new ReferenceDependency(beanManagerImpl, reference, injectionPoint);
_referenceDependencies.add(referenceDependency);
if (_log.isDebugEnabled()) {
_log.debug("CDIe - Found OSGi service reference {}", referenceDependency);
}
} catch (Exception e) {
if (_log.isErrorEnabled()) {
_log.error("CDIe - Error on reference {}", reference, e);
}
}
}
use of org.jboss.weld.bean.builtin.BeanManagerProxy in project core by weld.
the class CustomExtension method getEnhancedAnnotatedType.
protected <T> EnhancedAnnotatedType<T> getEnhancedAnnotatedType(BeanManager manager, Class<T> javaClass) {
if (manager instanceof BeanManagerProxy) {
BeanManagerProxy proxy = (BeanManagerProxy) manager;
manager = proxy.delegate();
}
if (manager instanceof BeanManagerImpl) {
BeanManagerImpl bmi = (BeanManagerImpl) manager;
return ((BeanManagerImpl) manager).createEnhancedAnnotatedType(javaClass);
} else {
throw new IllegalStateException();
}
}
use of org.jboss.weld.bean.builtin.BeanManagerProxy in project core by weld.
the class ELImpl method createELContext.
public ELContext createELContext(BeanManager beanManager) {
if (beanManager instanceof BeanManagerProxy) {
BeanManagerProxy proxy = (BeanManagerProxy) beanManager;
beanManager = proxy.delegate();
}
if (beanManager instanceof BeanManagerImpl) {
return createELContext((BeanManagerImpl) beanManager);
} else {
throw new IllegalStateException("Wrong manager");
}
}
use of org.jboss.weld.bean.builtin.BeanManagerProxy in project wildfly by wildfly.
the class BeanManagerService method start.
@Override
public void start(final StartContext context) throws StartException {
beanManager = new BeanManagerProxy(weldContainerSupplier.get().getBeanManager(beanDeploymentArchiveId));
beanManagerConsumer.accept(beanManager);
}
Aggregations