Class ResourceStoreClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- org.nuxeo.ecm.webengine.loader.store.ResourceStoreClassLoader
-
- All Implemented Interfaces:
Cloneable
public class ResourceStoreClassLoader extends ClassLoader implements Cloneable
The class loader allows modifying the stores (adding/removing). Mutable operations are thread safe.- Author:
- Bogdan Stefanescu
-
-
Constructor Summary
Constructors Modifier Constructor Description ResourceStoreClassLoader(ClassLoader pParent)
protected
ResourceStoreClassLoader(ClassLoader pParent, LinkedHashSet<ResourceStore> cp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addStore(ResourceStore store)
ResourceStoreClassLoader
clone()
static String
convertClassToResourcePath(String pName)
org.my.Class -> org/my/Class.classprotected void
doDefinePackage(String name)
Without this method getPackage() returns nullprotected Class<?>
fastFindClass(String name)
protected Class<?>
findClass(String name)
protected URL
findResource(String name)
protected Enumeration<URL>
findResources(String name)
protected String
getId()
URL
getResource(String name)
Enumeration<URL>
getResources(String name)
ResourceStore[]
getStores()
Class<?>
loadClass(String name, boolean resolve)
boolean
removeStore(ResourceStore store)
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
ResourceStoreClassLoader
public ResourceStoreClassLoader(ClassLoader pParent)
-
ResourceStoreClassLoader
protected ResourceStoreClassLoader(ClassLoader pParent, LinkedHashSet<ResourceStore> cp)
-
-
Method Detail
-
addStore
public boolean addStore(ResourceStore store)
-
removeStore
public boolean removeStore(ResourceStore store)
-
clone
public ResourceStoreClassLoader clone()
-
getStores
public ResourceStore[] getStores()
-
doDefinePackage
protected void doDefinePackage(String name)
Without this method getPackage() returns null
-
findResource
protected URL findResource(String name)
- Overrides:
findResource
in classClassLoader
-
findResources
protected Enumeration<URL> findResources(String name) throws IOException
- Overrides:
findResources
in classClassLoader
- Throws:
IOException
-
loadClass
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findClass
protected Class<?> findClass(String name) throws ClassNotFoundException
- Overrides:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
-
getResources
public Enumeration<URL> getResources(String name) throws IOException
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
getResource
public URL getResource(String name)
- Overrides:
getResource
in classClassLoader
-
getId
protected String getId()
-
-