protected void destroyGlobalContexts() { if (applicationContext != null) { applicationContext.destroy(); applicationContext.destroySystemBeans(); } }
private void destroyApplicationContext() { applicationContext.destroy(); }
applicationContext.destroy(); applicationContext.destroySystemBeans();
private void stopApplicationContext() { if(applicationContext != null && !applicationContext.isDestroyed()) { webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( new Object(), BeforeDestroyedLiteral.INSTANCE_APPLICATION_SCOPED); applicationContext.destroy(); // this is needed to get rid of ApplicationScoped beans which are cached inside the proxies... WebBeansContext.currentInstance().getBeanManagerImpl().clearCacheProxies(); webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( new Object(), DestroyedLiteral.INSTANCE_APPLICATION_SCOPED); } }
/** * Destroys the application context and all of its components at the end of * the application. * @param endObject servlet context object or other payload */ protected void destroyApplicationContext(Object endObject) { //Destroy context if(applicationContext != null && !applicationContext.isDestroyed()) { webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( endObject != null ? endObject : new Object(), BeforeDestroyedLiteral.INSTANCE_APPLICATION_SCOPED); applicationContext.destroy(); // this is needed to get rid of ApplicationScoped beans which are cached inside the proxies... webBeansContext.getBeanManagerImpl().clearCacheProxies(); Object payload = endObject instanceof ServletContext ? endObject : new Object(); webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( payload, DestroyedLiteral.INSTANCE_APPLICATION_SCOPED); } }