Package org.apache.catalina.core
Class JreMemoryLeakPreventionListener
java.lang.Object
org.apache.catalina.core.JreMemoryLeakPreventionListener
- All Implemented Interfaces:
- LifecycleListener
Provide a workaround for known places where the Java Runtime environment can cause a memory leak or lock files.
 
Memory leaks occur when JRE code uses the context class loader to load a singleton as this will cause a memory leak if a web application class loader happens to be the context class loader at the time. The work-around is to initialise these singletons when Tomcat's common class loader is the context class loader.
Locked files usually occur when a resource inside a JAR is accessed without first disabling Jar URL connection caching. The workaround is to disable this caching by default.
 This listener must only be nested within Server elements.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanvoidlifecycleEvent(LifecycleEvent event) Acknowledge the occurrence of the specified event.voidsetAppContextProtection(boolean appContextProtection) voidsetClassesToInitialize(String classesToInitialize) voidsetDriverManagerProtection(boolean driverManagerProtection) voidsetInitSeedGenerator(boolean initSeedGenerator) voidsetUrlCacheProtection(boolean urlCacheProtection) 
- 
Constructor Details- 
JreMemoryLeakPreventionListenerpublic JreMemoryLeakPreventionListener()
 
- 
- 
Method Details- 
isAppContextProtectionpublic boolean isAppContextProtection()
- 
setAppContextProtectionpublic void setAppContextProtection(boolean appContextProtection) 
- 
isUrlCacheProtectionpublic boolean isUrlCacheProtection()
- 
setUrlCacheProtectionpublic void setUrlCacheProtection(boolean urlCacheProtection) 
- 
isDriverManagerProtectionpublic boolean isDriverManagerProtection()
- 
setDriverManagerProtectionpublic void setDriverManagerProtection(boolean driverManagerProtection) 
- 
getClassesToInitialize
- 
setClassesToInitialize
- 
getInitSeedGeneratorpublic boolean getInitSeedGenerator()
- 
setInitSeedGeneratorpublic void setInitSeedGenerator(boolean initSeedGenerator) 
- 
lifecycleEventDescription copied from interface:LifecycleListenerAcknowledge the occurrence of the specified event.- Specified by:
- lifecycleEventin interface- LifecycleListener
- Parameters:
- event- LifecycleEvent that has occurred
 
 
-