org.springframework.boot.web.embedded.tomcat

Class TomcatEmbeddedWebappClassLoader

  • java.lang.Object
    • java.lang.ClassLoader
      • java.security.SecureClassLoader
        • java.net.URLClassLoader
          • org.apache.catalina.loader.WebappClassLoaderBase
            • org.apache.catalina.loader.ParallelWebappClassLoader
              • org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader
  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.catalina.Lifecycle, org.apache.juli.WebappProperties, org.apache.tomcat.InstrumentableClassLoader, org.apache.tomcat.util.security.PermissionCheck


    public class TomcatEmbeddedWebappClassLoader
    extends org.apache.catalina.loader.ParallelWebappClassLoader
    Extension of Tomcat's ParallelWebappClassLoader that does not consider the system classloader. This is required to ensure that any custom context class loader is always used (as is the case with some executable archives).
    Since:
    2.0.0
    • Nested Class Summary

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

        org.apache.catalina.loader.WebappClassLoaderBase.PrivilegedFindClassByName, org.apache.catalina.loader.WebappClassLoaderBase.PrivilegedGetClassLoader, org.apache.catalina.loader.WebappClassLoaderBase.PrivilegedJavaseGetResource
      • Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

        org.apache.catalina.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected void addURL(java.net.URL url) 
      java.net.URL findResource(java.lang.String name) 
      java.util.Enumeration<java.net.URL> findResources(java.lang.String name) 
      java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) 
      • Methods inherited from class org.apache.catalina.loader.ParallelWebappClassLoader

        copyWithoutTransformers
      • Methods inherited from class org.apache.catalina.loader.WebappClassLoaderBase

        addLifecycleListener, addTransformer, check, checkStateForClassLoading, checkStateForResourceLoading, clearReferences, copyStateWithoutTransformers, destroy, doDefineClass, filter, findClass, findClassInternal, findLifecycleListeners, findLoadedClass0, 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, 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, getClassLoadingLock, 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

      • TomcatEmbeddedWebappClassLoader

        public TomcatEmbeddedWebappClassLoader()
      • TomcatEmbeddedWebappClassLoader

        public TomcatEmbeddedWebappClassLoader(java.lang.ClassLoader parent)
    • Method Detail

      • findResource

        public java.net.URL findResource(java.lang.String name)
        Overrides:
        findResource in class org.apache.catalina.loader.WebappClassLoaderBase
      • findResources

        public java.util.Enumeration<java.net.URL> findResources(java.lang.String name)
                                                          throws java.io.IOException
        Overrides:
        findResources in class org.apache.catalina.loader.WebappClassLoaderBase
        Throws:
        java.io.IOException
      • loadClass

        public java.lang.Class<?> loadClass(java.lang.String name,
                                            boolean resolve)
                                     throws java.lang.ClassNotFoundException
        Overrides:
        loadClass in class org.apache.catalina.loader.WebappClassLoaderBase
        Throws:
        java.lang.ClassNotFoundException
      • addURL

        protected void addURL(java.net.URL url)
        Overrides:
        addURL in class org.apache.catalina.loader.WebappClassLoaderBase