private void initApplicationContext() { // in case contexts are stop/start applicationContext.setActive(true); }
/** * This method should only get called at container shutdown. * It will destroy the Extensions as well */ public void destroySystemBeans() { super.destroy(); setActive(false); }
/** * Creates the application context at the application startup * @param startupObject servlet context object or other startup * */ protected void initApplicationContext(Object startupObject) { if (applicationContext != null && !applicationContext.isDestroyed()) { applicationContext.setActive(true); return; } ApplicationContext newApplicationContext = new ApplicationContext(); newApplicationContext.setActive(true); if (applicationContext == null) { applicationContext = newApplicationContext; } }
public CdiAppContextsService(final WebBeansContext wbc, final boolean supportsConversation) { if (wbc != null) { webBeansContext = wbc; } else { webBeansContext = WebBeansContext.currentInstance(); } dependentContext.setActive(true); if (supportsConversation) { conversationContext = new ThreadLocal<ConversationContext>(); } else { conversationContext = null; } applicationContext.setActive(true); singletonContext.setActive(true); }
/** * Creates a new instance. */ public WebContextsService(WebBeansContext webBeansContext) { super(webBeansContext); conversationManager = webBeansContext.getConversationManager(); applicationContext = new ApplicationContext(); applicationContext.setActive(true); requestContexts = new ThreadLocal<>(); sessionContexts = new ThreadLocal<>(); conversationContexts = new ThreadLocal<>(); //Dependent context is always active dependentContext = new DependentContext(); dependentContext.setActive(true); configureEagerSessionInitialisation(webBeansContext); }
private void startApplicationContext() { if (applicationContext != null && !applicationContext.isDestroyed()) { // applicationContext is already started return; } ApplicationContext ctx = new ApplicationContext(); ctx.setActive(true); applicationContext = ctx; // We do ALSO send the @Initialized(ApplicationScoped.class) at this // location but this is WAY to early for userland apps // This also gets sent in the application startup code after AfterDeploymentValidation got fired. // see AbstractLifecycle#afterStartApplication webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( new Object(), InitializedLiteral.INSTANCE_APPLICATION_SCOPED); }