factory.destroySingletons(); applicationContext.close();
/** * Destroy definition in separate method so subclass may work with other definition types. * @param groupDef the factory returned by {@link #createDefinition createDefinition()} * @param selector the resource location for this factory group */ protected void destroyDefinition(BeanFactory groupDef, String selector) { if (groupDef instanceof ConfigurableBeanFactory) { if (logger.isTraceEnabled()) { logger.trace("Factory group with selector '" + selector + "' being released, as there are no more references to it"); } ((ConfigurableBeanFactory) groupDef).destroySingletons(); } }
protected void doClose(ConfigurableBeanFactory beanFactory) { beanFactory.destroySingletons(); } };
/** * Destroy definition in separate method so subclass may work with other definition types. * @param groupDef the factory returned by {@link #createDefinition createDefinition()} * @param selector the resource location for this factory group */ protected void destroyDefinition(BeanFactory groupDef, String selector) { if (groupDef instanceof ConfigurableBeanFactory) { if (logger.isTraceEnabled()) { logger.trace("Factory group with selector '" + selector + "' being released, as there are no more references to it"); } ((ConfigurableBeanFactory) groupDef).destroySingletons(); } }
/** * Destroy definition in separate method so subclass may work with other definition types. */ protected void destroyDefinition(BeanFactory groupDef, String resourceName) throws BeansException { if (groupDef instanceof ConfigurableBeanFactory) { // debugging trace only if (logger.isDebugEnabled()) { logger.debug("Factory group with resource name '" + resourceName + "' being released, as there are no more references to it."); } ((ConfigurableBeanFactory) groupDef).destroySingletons(); } }
public void destroy() throws BeansException { for (Iterator it = this.cachedFactories.values().iterator(); it.hasNext();) { ConfigurableBeanFactory factory = (ConfigurableBeanFactory) it.next(); factory.destroySingletons(); } this.cachedFactories.clear(); }
/** * @see org.apache.avalon.framework.activity.Disposable#dispose() */ public void dispose() { if (this.disposableNodes != null) { // we must dispose the nodes in reverse order // otherwise selector nodes are freed before the components node for (int i = this.disposableNodes.size() - 1; i > -1; i--) { ((Disposable) disposableNodes.get(i)).dispose(); } this.disposableNodes = null; } // Ensure it won't be used anymore this.rootNode = null; this.sitemapExecutor = null; // clear listeners this.enterSitemapEventListeners.clear(); this.leaveSitemapEventListeners.clear(); if ( this.webAppContext != null ) { if ( webAppContext instanceof ConfigurableApplicationContext ) { ((ConfigurableApplicationContext)webAppContext).close(); } else if ( webAppContext instanceof ConfigurableBeanFactory ) { ((ConfigurableBeanFactory)webAppContext).destroySingletons(); } this.webAppContext = null; } }