Class WebAppClassLoading

java.lang.Object
org.eclipse.jetty.ee.webapp.WebAppClassLoading

public class WebAppClassLoading extends Object
Common attributes and methods for configuring the Class loading of web application:
  • Protected (a.k.a. System) classes are classes typically provided by the JVM, that cannot be replaced by the web application, and they are always loaded via the environment or system classloader. They are visible but protected.
  • Hidden (a.k.a. Server) classes are those used to implement the Server and are not made available to the web application. They are hidden from the web application ClassLoader.

These protections are set to reasonable defaults DEFAULT_PROTECTED_CLASSES and DEFAULT_HIDDEN_CLASSES, which may be programmatically configured and will affect the defaults applied to all web applications in the same JVM.

The defaults applied by a specific Server can be configured using addProtectedClasses(Server, String...) and addHiddenClasses(Server, String...). Alternately the Server attributes PROTECTED_CLASSES_ATTRIBUTE and HIDDEN_CLASSES_ATTRIBUTE may be used to direct set a ClassMatcher to use for all web applications within the server instance.

The defaults applied by a specific Environment can be configured using addProtectedClasses(Environment, String...) and addHiddenClasses(Environment, String...). Alternately the Environment attributes PROTECTED_CLASSES_ATTRIBUTE and HIDDEN_CLASSES_ATTRIBUTE may be used to direct set a ClassMatcher to use for all web applications within the server instance.

Ultimately, the configurations set by this class only affects the defaults applied to each web application Context and the ClassMatcher fields of the web applications can be directly access to configure a specific context.