Class WebAppClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.eclipse.jetty.ee.webapp.WebAppClassLoader
org.eclipse.jetty.ee10.webapp.WebAppClassLoader
All Implemented Interfaces:
Closeable, AutoCloseable, org.eclipse.jetty.util.ClassVisibilityChecker

@Deprecated(since="12.0.0", forRemoval=true) public class WebAppClassLoader extends org.eclipse.jetty.ee.webapp.WebAppClassLoader
Deprecated, for removal: This API element is subject to removal in a future version.
use the core WebAppClassLoader directly instead.
ClassLoader for HttpContext.

Specializes URLClassLoader with some utility and file mapping methods.

This loader implements the Servlet specification behavior that may invert the normal Java classloader parent priority behaviour. The ClassVisibilityChecker API of the WebAppClassLoader.Context implementation is used to determine which classes from the parent classloader are hidden from the context, and which are protected from being overridden by the context.

Java compliant loading, where the parent loader always has priority, can be selected with the WebAppContext.setParentLoaderPriority(boolean) method.

  • Constructor Details

    • WebAppClassLoader

      public WebAppClassLoader(org.eclipse.jetty.ee.webapp.WebAppClassLoader.Context context)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • WebAppClassLoader

      public WebAppClassLoader(ClassLoader parent, org.eclipse.jetty.ee.webapp.WebAppClassLoader.Context context)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • runWithServerClassAccess

      @Deprecated(since="12.1.0", forRemoval=true) public static <T> T runWithServerClassAccess(PrivilegedExceptionAction<T> action) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      use WebAppClassLoader.runWithHiddenClassAccess(PrivilegedExceptionAction) instead
      Run an action with access to ServerClasses

      Run the passed PrivilegedExceptionAction with the classloader configured so as to allow server classes to be visible

      Type Parameters:
      T - the type of PrivilegedExceptionAction and the type returned by the action
      Parameters:
      action - The action to run
      Returns:
      The return from the action
      Throws:
      Exception - if thrown by the action