public static void init(Bundle owbBundle) { bundle = owbBundle; WebBeansFinder.setSingletonService(INSTANCE); }
@Override public void setup(OwbStandaloneConfiguration owbStandaloneConfiguration) { LOG.fine("OpenWebBeans Arquillian setup started"); singletonService = new OwbArquillianSingletonService(owbStandaloneConfiguration.properties()); WebBeansFinder.setSingletonService(singletonService); useOnlyArchiveResources = owbStandaloneConfiguration.isUseOnlyArchiveResources(); if (useOnlyArchiveResources && owbStandaloneConfiguration.getUseOnlyArchiveResourcesExcludes() != null) { useOnlyArchiveResourcesExcludes = Arrays.asList(owbStandaloneConfiguration.getUseOnlyArchiveResourcesExcludes().split(",")); } }
@Override protected SeContainer newContainer(WebBeansContext context) { SingletonService<WebBeansContext> singletonService = WebBeansFinder.getSingletonService(); if(singletonService instanceof HolderSingletonService) { ((HolderSingletonService) singletonService).register(context); } else { try { WebBeansFinder.setSingletonService(new HolderSingletonService(context)); } catch (Exception e) { logger.info("Unable to override OWB SingletonService", e); } } return super.newContainer(context); } }
public static synchronized ThreadSingletonService initializeOWB() { logger.info("Created new singletonService " + SINGLETON_SERVICE); SystemInstance.get().setComponent(ThreadSingletonService.class, SINGLETON_SERVICE); try { WebBeansFinder.setSingletonService(SINGLETON_SERVICE); logger.info("Succeeded in installing singleton service"); } catch (final Exception e) { //ignore // not logging the exception since it is nto an error logger.debug("Could not install our singleton service"); } //TODO there must be a better place to initialize this ThreadContext.addThreadContextListener(new OWBContextThreadListener()); return SINGLETON_SERVICE; }
public static synchronized ThreadSingletonService initializeOWB(final ClassLoader classLoader) { logger.info("Created new singletonService " + SINGLETON_SERVICE); SystemInstance.get().setComponent(ThreadSingletonService.class, SINGLETON_SERVICE); try { WebBeansFinder.setSingletonService(SINGLETON_SERVICE); logger.info("Succeeded in installing singleton service"); } catch (final Exception e) { //ignore // not logging the exception since it is nto an error logger.debug("Could not install our singleton service"); } //TODO there must be a better place to initialize this ThreadContext.addThreadContextListener(new OWBContextThreadListener()); return SINGLETON_SERVICE; }