@Override protected void destroySingletonContext() { singletonContext.destroy(); } }
@Override protected void createSingletonContext() { singletonContext = new SingletonContext(); singletonContext.setActive(true); }
private void initSingletonContext() { singletonContext.setActive(true); }
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); }
@Override protected void createSingletonContext() { final SingletonContext ctx = new SingletonContext(); ctx.setActive(true); singletonContext.set(ctx); }
private void destroySingletonContext() { singletonContext.destroy(); }
/** * Initialize singleton context. * @param startupObject servlet context */ protected void initSingletonContext(Object startupObject) { if (singletonContext != null) { return; } synchronized (this) { if (singletonContext == null) { singletonContext = new SingletonContext(); singletonContext.setActive(true); Object payLoad = startupObject instanceof ServletContext ? (ServletContext) startupObject : new Object(); webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( payLoad, InitializedLiteral.INSTANCE_SINGLETON_SCOPED); } } }
@Override protected void destroySingletonContext() { if(singletonContext.get() != null) { singletonContext.get().destroy(); } singletonContext.set(null); singletonContext.remove(); } }
@Override protected void destroyGlobalContexts() { SingletonContext singletonCtx = singletonContext.get(); if (singletonCtx != null) { singletonCtx.destroy(); singletonContext.set(null); singletonContext.remove(); } super.destroyGlobalContexts(); }
singletonContext.destroy(); singletonContext = null;
/** * Destroy singleton context. * @param endObject servlet context or other payload */ protected void destroySingletonContext(Object endObject) { if (singletonContext != null) { Object payload = endObject != null ? endObject : new Object(); webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( payload, BeforeDestroyedLiteral.INSTANCE_SINGLETON_SCOPED); singletonContext.destroy(); singletonContext = null; webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( payload, DestroyedLiteral.INSTANCE_SINGLETON_SCOPED); } }