Package org.apache.catalina.core
Class JreMemoryLeakPreventionListener
- java.lang.Object
-
- org.apache.catalina.core.JreMemoryLeakPreventionListener
-
- All Implemented Interfaces:
LifecycleListener
public class JreMemoryLeakPreventionListener extends java.lang.Object implements 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
Serverelements.
-
-
Constructor Summary
Constructors Constructor Description JreMemoryLeakPreventionListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClassesToInitialize()booleangetForkJoinCommonPoolProtection()booleangetInitSeedGenerator()booleanisAppContextProtection()booleanisAWTThreadProtection()booleanisDriverManagerProtection()booleanisGcDaemonProtection()booleanisLdapPoolProtection()booleanisTokenPollerProtection()booleanisUrlCacheProtection()booleanisXmlParsingProtection()voidlifecycleEvent(LifecycleEvent event)Acknowledge the occurrence of the specified event.voidsetAppContextProtection(boolean appContextProtection)voidsetAWTThreadProtection(boolean awtThreadProtection)voidsetClassesToInitialize(java.lang.String classesToInitialize)voidsetDriverManagerProtection(boolean driverManagerProtection)voidsetForkJoinCommonPoolProtection(boolean forkJoinCommonPoolProtection)voidsetGcDaemonProtection(boolean gcDaemonProtection)voidsetInitSeedGenerator(boolean initSeedGenerator)voidsetLdapPoolProtection(boolean ldapPoolProtection)voidsetTokenPollerProtection(boolean tokenPollerProtection)voidsetUrlCacheProtection(boolean urlCacheProtection)voidsetXmlParsingProtection(boolean xmlParsingProtection)
-
-
-
Method Detail
-
isAppContextProtection
public boolean isAppContextProtection()
-
setAppContextProtection
public void setAppContextProtection(boolean appContextProtection)
-
isAWTThreadProtection
public boolean isAWTThreadProtection()
-
setAWTThreadProtection
public void setAWTThreadProtection(boolean awtThreadProtection)
-
isGcDaemonProtection
public boolean isGcDaemonProtection()
-
setGcDaemonProtection
public void setGcDaemonProtection(boolean gcDaemonProtection)
-
isTokenPollerProtection
public boolean isTokenPollerProtection()
-
setTokenPollerProtection
public void setTokenPollerProtection(boolean tokenPollerProtection)
-
isUrlCacheProtection
public boolean isUrlCacheProtection()
-
setUrlCacheProtection
public void setUrlCacheProtection(boolean urlCacheProtection)
-
isXmlParsingProtection
public boolean isXmlParsingProtection()
-
setXmlParsingProtection
public void setXmlParsingProtection(boolean xmlParsingProtection)
-
isLdapPoolProtection
public boolean isLdapPoolProtection()
-
setLdapPoolProtection
public void setLdapPoolProtection(boolean ldapPoolProtection)
-
isDriverManagerProtection
public boolean isDriverManagerProtection()
-
setDriverManagerProtection
public void setDriverManagerProtection(boolean driverManagerProtection)
-
getForkJoinCommonPoolProtection
public boolean getForkJoinCommonPoolProtection()
-
setForkJoinCommonPoolProtection
public void setForkJoinCommonPoolProtection(boolean forkJoinCommonPoolProtection)
-
getClassesToInitialize
public java.lang.String getClassesToInitialize()
-
setClassesToInitialize
public void setClassesToInitialize(java.lang.String classesToInitialize)
-
getInitSeedGenerator
public boolean getInitSeedGenerator()
-
setInitSeedGenerator
public void setInitSeedGenerator(boolean initSeedGenerator)
-
lifecycleEvent
public void lifecycleEvent(LifecycleEvent event)
Description copied from interface:LifecycleListenerAcknowledge the occurrence of the specified event.- Specified by:
lifecycleEventin interfaceLifecycleListener- Parameters:
event- LifecycleEvent that has occurred
-
-