WebappClassLoader (Apache Tomcat 9.0.43 API Documentation)

org.apache.catalina.loader

## Class WebappClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - java.security.SecureClassLoader
    - - java.net.URLClassLoader
      - - org.apache.catalina.loader.WebappClassLoaderBase
        - - org.apache.catalina.loader.WebappClassLoader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Lifecycle, WebappProperties, InstrumentableClassLoader, PermissionCheck

      public class WebappClassLoader
      extends WebappClassLoaderBase

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.catalina.loader.WebappClassLoaderBase

      `WebappClassLoaderBase.PrivilegedFindClassByName, WebappClassLoaderBase.PrivilegedGetClassLoader, WebappClassLoaderBase.PrivilegedJavaseGetResource`

    - ### Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

      `Lifecycle.SingleUse`

  - ### Field Summary

    - ### Fields inherited from class org.apache.catalina.loader.WebappClassLoaderBase

      `delegate, loaderPC, parent, permissionList, resourceEntries, resources, securityManager, sm`

    - ### Fields inherited from interface org.apache.catalina.Lifecycle

      `AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WebappClassLoader()`
    `WebappClassLoader(ClassLoader parent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `WebappClassLoader` | `copyWithoutTransformers()` Returns a copy of this class loader without any class file transformers.
    `protected Object` | `getClassLoadingLock(String className)` This class loader is not parallel capable so lock on the class loader rather than a per-class lock.

    - ### Methods inherited from class org.apache.catalina.loader.WebappClassLoaderBase

      `addLifecycleListener, addTransformer, addURL, check, checkStateForClassLoading, checkStateForResourceLoading, clearReferences, copyStateWithoutTransformers, destroy, doDefineClass, filter, findClass, findClassInternal, findLifecycleListeners, findLoadedClass0, findResource, findResources, getClearReferencesHttpClientKeepAliveThread, getClearReferencesLogFactoryRelease, getClearReferencesObjectStreamClassCaches, getClearReferencesRmiTargets, getClearReferencesStopThreads, getClearReferencesStopTimerThreads, getClearReferencesThreadLocals, getContextName, getDelegate, getHostName, getJavaseClassLoader, getPermissions, getResource, getResourceAsStream, getResources, getResources, getServiceName, getSkipMemoryLeakChecksOnJvmShutdown, getState, getStateName, getURLs, getWebappName, hasLoggingConfig, init, isPackageSealed, loadClass, loadClass, modified, refreshPolicy, removeLifecycleListener, removeTransformer, setClearReferencesHttpClientKeepAliveThread, setClearReferencesLogFactoryRelease, setClearReferencesObjectStreamClassCaches, setClearReferencesRmiTargets, setClearReferencesStopThreads, setClearReferencesStopTimerThreads, setClearReferencesThreadLocals, setDelegate, setJavaseClassLoader, setResources, setSkipMemoryLeakChecksOnJvmShutdown, start, stop, toString`

    - ### Methods inherited from class java.net.URLClassLoader

      `close, definePackage, newInstance, newInstance`

    - ### Methods inherited from class java.security.SecureClassLoader

      `defineClass, defineClass`

    - ### Methods inherited from class java.lang.ClassLoader

      `clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### WebappClassLoader

          public WebappClassLoader()

    - #### WebappClassLoader

          public WebappClassLoader(ClassLoader parent)

  - ### Method Detail

    - #### copyWithoutTransformers

          public WebappClassLoader copyWithoutTransformers()

      Returns a copy of this class loader without any class file transformers. This is a tool often used by Java Persistence API providers to inspect entity classes in the absence of any instrumentation, something that can't be guaranteed within the context of a `ClassFileTransformer`'s `transform` method.

      The returned class loader's resource cache will have been cleared so that classes already instrumented will not be retained or returned.

      Returns:
        the transformer-free copy of this class loader.

    - #### getClassLoadingLock

          protected Object getClassLoadingLock(String className)

      This class loader is not parallel capable so lock on the class loader rather than a per-class lock.
      Overrides:
        `getClassLoadingLock` in class `ClassLoader`

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.