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:
Closeable, 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
  • Constructor Details

    • TomcatEmbeddedWebappClassLoader

      public TomcatEmbeddedWebappClassLoader()
    • TomcatEmbeddedWebappClassLoader

      public TomcatEmbeddedWebappClassLoader(ClassLoader parent)
  • Method Details

    • findResource

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

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

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

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