Java Code Examples for org.apache.tomcat.util.IntrospectionUtils#clear()

The following examples show how to use org.apache.tomcat.util.IntrospectionUtils#clear() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebappClassLoaderBase.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Clear references.
 */
protected void clearReferences() {

    // De-register any remaining JDBC drivers
    clearReferencesJdbc();

    // Stop any threads the web application started
    clearReferencesThreads();

    // Clear any references retained in the serialization caches
    if (clearReferencesObjectStreamClassCaches) {
        clearReferencesObjectStreamClassCaches();
    }

    // Check for leaks triggered by ThreadLocals loaded by this class loader
    if (clearReferencesThreadLocals) {
        checkThreadLocalsForLeaks();
    }

    // Clear RMI Targets loaded by this class loader
    if (clearReferencesRmiTargets) {
        clearReferencesRmiTargets();
    }

     // Clear the IntrospectionUtils cache.
    IntrospectionUtils.clear();

    // Clear the classloader reference in common-logging
    if (clearReferencesLogFactoryRelease) {
        org.apache.juli.logging.LogFactory.release(this);
    }

    // Clear the classloader reference in the VM's bean introspector
    java.beans.Introspector.flushCaches();

    // Clear any custom URLStreamHandlers
    TomcatURLStreamHandlerFactory.release(this);
}
 
Example 2
Source File: WebappClassLoaderBase.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Clear references.
 */
protected void clearReferences() {

    // De-register any remaining JDBC drivers
    clearReferencesJdbc();

    // Stop any threads the web application started
    clearReferencesThreads();

    // Check for leaks triggered by ThreadLocals loaded by this class loader
    checkThreadLocalsForLeaks();

    // Clear RMI Targets loaded by this class loader
    clearReferencesRmiTargets();

    // Null out any static or final fields from loaded classes,
    // as a workaround for apparent garbage collection bugs
    if (clearReferencesStatic) {
        clearReferencesStaticFinal();
    }

     // Clear the IntrospectionUtils cache.
    IntrospectionUtils.clear();

    // Clear the classloader reference in common-logging
    if (clearReferencesLogFactoryRelease) {
        org.apache.juli.logging.LogFactory.release(this);
    }

    // Clear the resource bundle cache
    // This shouldn't be necessary, the cache uses weak references but
    // it has caused leaks. Oddly, using the leak detection code in
    // standard host allows the class loader to be GC'd. This has been seen
    // on Sun but not IBM JREs. Maybe a bug in Sun's GC impl?
    clearReferencesResourceBundles();

    // Clear the classloader reference in the VM's bean introspector
    java.beans.Introspector.flushCaches();

}
 
Example 3
Source File: WebappClassLoaderBase.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
/**
 * Clear references.
 */
protected void clearReferences() {

    // De-register any remaining JDBC drivers
    clearReferencesJdbc();

    // Stop any threads the web application started
    clearReferencesThreads();

    // Check for leaks triggered by ThreadLocals loaded by this class loader
    checkThreadLocalsForLeaks();

    // Clear RMI Targets loaded by this class loader
    if (clearReferencesRmiTargets) {
        clearReferencesRmiTargets();
    }

    // Null out any static or final fields from loaded classes,
    // as a workaround for apparent garbage collection bugs
    if (clearReferencesStatic) {
        clearReferencesStaticFinal();
    }

     // Clear the IntrospectionUtils cache.
    IntrospectionUtils.clear();

    // Clear the classloader reference in common-logging
    if (clearReferencesLogFactoryRelease) {
        org.apache.juli.logging.LogFactory.release(this);
    }

    // Clear the resource bundle cache
    // This shouldn't be necessary, the cache uses weak references but
    // it has caused leaks. Oddly, using the leak detection code in
    // standard host allows the class loader to be GC'd. This has been seen
    // on Sun but not IBM JREs. Maybe a bug in Sun's GC impl?
    clearReferencesResourceBundles();

    // Clear the classloader reference in the VM's bean introspector
    java.beans.Introspector.flushCaches();

}