Add some more debugging on cache shutdown - if Debug level is set, report which caches get shutdown

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19128 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-03-08 17:16:18 +00:00
parent d2c2565599
commit 724d28279b
3 changed files with 43 additions and 4 deletions

View File

@@ -93,6 +93,12 @@ public class EhCacheManagerFactoryBean implements FactoryBean, InitializingBean,
public void destroy()
{
logger.info("Shutting down EHCache CacheManager");
if(logger.isDebugEnabled()) {
String[] caches = this.cacheManager.getCacheNames();
for(String cache : caches) {
logger.debug("Shutting down EHCache instance " + cache);
}
}
this.cacheManager.shutdown();
}
}

View File

@@ -61,7 +61,7 @@ import org.springframework.util.ResourceUtils;
*
* @author Derek Hulley
*/
public class InternalEhCacheManagerFactoryBean implements FactoryBean, CacheProvider
public class InternalEhCacheManagerFactoryBean implements FactoryBean<CacheManager>, CacheProvider
{
public static final String CUSTOM_CONFIGURATION_FILE = "classpath:alfresco/extension/ehcache-custom.xml";
public static final String DEFAULT_CONFIGURATION_FILE = "classpath:alfresco/ehcache-default.xml";
@@ -192,6 +192,13 @@ public class InternalEhCacheManagerFactoryBean implements FactoryBean, CacheProv
{
synchronized (getClass())
{
if(logger.isDebugEnabled()) {
String[] caches = InternalEhCacheManagerFactoryBean.getInstance().getCacheNames();
for(String regionName : caches) {
logger.debug("Stopped EHCache region: " + regionName);
}
}
InternalEhCacheManagerFactoryBean.getInstance().shutdown();
initialized = false;
}
@@ -202,7 +209,7 @@ public class InternalEhCacheManagerFactoryBean implements FactoryBean, CacheProv
*
* @see #initCacheManager()
*/
public Object getObject() throws Exception
public CacheManager getObject() throws Exception
{
return InternalEhCacheManagerFactoryBean.getInstance();
}
@@ -210,7 +217,7 @@ public class InternalEhCacheManagerFactoryBean implements FactoryBean, CacheProv
/**
* @return Returns the singleton cache manager type
*/
public Class getObjectType()
public Class<CacheManager> getObjectType()
{
return CacheManager.class;
}