logger.error("the mbean " + mbeanClass + " can't be registered", e);
}
}
private void ensureWebBeansContext(AppContext appContext) {
WebBeansContext webBeansContext = appContext.get(WebBeansContext.class);
if (webBeansContext == null) webBeansContext = appContext.getWebBeansContext();
if (webBeansContext == null) {
final Map<Class<?>, Object> services = new HashMap<Class<?>, Object>();
services.put(AppContext.class, appContext);
services.put(TransactionService.class, new OpenEJBTransactionService());
services.put(ContextsService.class, new CdiAppContextsService(true));
services.put(ResourceInjectionService.class, new CdiResourceInjectionService());
services.put(ScannerService.class, new CdiScanner());
services.put(ELAdaptor.class, new CustomELAdapter(appContext));
services.put(LoaderService.class, new OptimizedLoaderService());
final Properties properties = new Properties();
properties.setProperty(org.apache.webbeans.spi.SecurityService.class.getName(), ManagedSecurityService.class.getName());
webBeansContext = new WebBeansContext(services, properties);
appContext.setCdiEnabled(false);
}
appContext.set(WebBeansContext.class, webBeansContext);
appContext.setWebBeansContext(webBeansContext);