Package org.eclipse.jetty.ee10.webapp
Class CachingWebAppClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.eclipse.jetty.ee10.webapp.WebAppClassLoader
org.eclipse.jetty.ee10.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.ee10.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.ee10.webapp.WebAppClassLoader
addClassPath, addClassPath, addJars, addTransformer, close, findClass, foundClass, getContext, getName, getPermissions, getResources, isHiddenClass, isProtectedClass, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.ClassVisibilityChecker
isServerClass, isSystemClass
-
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
-