@ManagedObject public class CachingWebAppClassLoader extends WebAppClassLoader
getResource(String)
results.
Specifically this ClassLoader caches not found classes and resources,
which can greatly increase performance for applications that search
for resources.WebAppClassLoader.Context
Constructor and Description |
---|
CachingWebAppClassLoader(ClassLoader parent,
WebAppClassLoader.Context context) |
CachingWebAppClassLoader(WebAppClassLoader.Context context) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
protected Class<?> |
findClass(String name) |
URL |
getResource(String name)
Get a resource from the classloader
NOTE: this method provides a convenience of hacking off a leading /
should one be present.
|
protected Class<?> |
loadClass(String name,
boolean resolve) |
String |
toString() |
addClassFileTransformer, addClassPath, addClassPath, addJars, addTransformer, close, getContext, getName, getPermissions, getResources, loadClass, removeClassFileTransformer, removeTransformer, setName
addURL, definePackage, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public CachingWebAppClassLoader(ClassLoader parent, WebAppClassLoader.Context context) throws IOException
IOException
public CachingWebAppClassLoader(WebAppClassLoader.Context context) throws IOException
IOException
public URL getResource(String name)
WebAppClassLoader
getResource
in class WebAppClassLoader
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class WebAppClassLoader
ClassNotFoundException
protected Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class WebAppClassLoader
ClassNotFoundException
@ManagedOperation public void clearCache()
public String toString()
toString
in class WebAppClassLoader
Copyright © 1995-2016 Webtide. All Rights Reserved.