Package org.eclipse.jetty.webapp
Class CachingWebAppClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.eclipse.jetty.webapp.WebAppClassLoader
org.eclipse.jetty.webapp.CachingWebAppClassLoader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassVisibilityChecker
A WebAppClassLoader that caches
getResource(String)
results.
Specifically this ClassLoader caches not found classes and resources,
which can greatly increase performance for applications that search
for resources.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.webapp.WebAppClassLoader
WebAppClassLoader.Context
-
Constructor Summary
ConstructorDescriptionCachingWebAppClassLoader
(ClassLoader parent, WebAppClassLoader.Context context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
getResource
(String name) Get a resource from the classloader NOTE: this method provides a convenience of hacking off a leading / should one be present.Class<?>
toString()
Methods inherited from class org.eclipse.jetty.webapp.WebAppClassLoader
addClassPath, addClassPath, addJars, addTransformer, close, findClass, foundClass, getContext, getName, getPermissions, getResources, isServerClass, isSystemClass, loadAsResource, loadClass, removeTransformer, runWithServerClassAccess, setName
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
CachingWebAppClassLoader
public CachingWebAppClassLoader(ClassLoader parent, WebAppClassLoader.Context context) throws IOException - Throws:
IOException
-
CachingWebAppClassLoader
- Throws:
IOException
-
-
Method Details
-
getResource
Description copied from class:WebAppClassLoader
Get a resource from the classloader NOTE: this method provides a convenience of hacking off a leading / should one be present. This is non-standard and it is recommended to not rely on this behavior- Overrides:
getResource
in classWebAppClassLoader
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
clearCache
-
toString
- Overrides:
toString
in classWebAppClassLoader
-