|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader org.abstracthorizon.extend.server.deployment.support.ModuleClassLoader
public class ModuleClassLoader
Class loader for Module
.
It searches for class in current class loader and then in class loaders
of all modules Module
depends on.
Nested Class Summary | |
---|---|
protected class |
ModuleClassLoader.Enumerations<T>
Class that implements enumeration interface and enumerates through all enumeration passed to it |
Field Summary | |
---|---|
protected Module |
context
Context this class loader depends on |
protected ClassLoader |
serverClassLoader
Top level - server's class loader |
protected boolean |
useThreadContextLoader
Should module class loader use thread's context class loader in searching for the resource |
Constructor Summary | |
---|---|
ModuleClassLoader(ClassLoader parent,
Module context)
Constructor |
Method Summary | |
---|---|
protected Set<Module> |
collectAllModules()
|
protected void |
collectAllModules(Module module,
Set<Module> modules)
|
Class<?> |
findClass(String name)
Searches for the class in dependent modules and server's class loader at the end. |
URL |
findResource(String name)
Searches for resource in dependent modules and server's class loader at the end. |
Enumeration<URL> |
findResources(String name)
Searches for resources in dependent modules and server's class loader at the end. |
URL |
getLocalResource(String name)
|
Enumeration<URL> |
getLocalResources(String name)
|
Module |
getModule()
Returns module this class loader belongs to |
ClassLoader |
getServerClassLoader()
Returns server's class loader |
boolean |
getUseThreadClassLoader()
Returns should this class loader use context class loader or not |
Class<?> |
loadLocalClass(String name)
|
void |
setServerClassLoader(ClassLoader serverClassLoader)
Sets server's class loader |
void |
setUserThreadClassLoader(boolean useThreadContextLoader)
Sets should this class loader use context class loader or not |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Module context
protected ClassLoader serverClassLoader
protected boolean useThreadContextLoader
Constructor Detail |
---|
public ModuleClassLoader(ClassLoader parent, Module context)
parent
- parent class loadercontext
- module this class loader belongs to.Method Detail |
---|
public boolean getUseThreadClassLoader()
true
if this class loader should use context class loader or notpublic void setUserThreadClassLoader(boolean useThreadContextLoader)
useThreadContextLoader
- flagpublic Class<?> findClass(String name) throws ClassNotFoundException
findClass
in class ClassLoader
name
- class name
ClassNotFoundException
public URL findResource(String name)
findResource
in class ClassLoader
name
- resource namepublic Enumeration<URL> findResources(String name) throws IOException
findResources
in class ClassLoader
name
- resource name
IOException
protected Set<Module> collectAllModules()
protected void collectAllModules(Module module, Set<Module> modules)
public Module getModule()
public ClassLoader getServerClassLoader()
public void setServerClassLoader(ClassLoader serverClassLoader)
serverClassLoader
- server's class loaderpublic URL getLocalResource(String name)
getLocalResource
in interface LocalClassLoader
public Enumeration<URL> getLocalResources(String name) throws IOException
getLocalResources
in interface LocalClassLoader
IOException
public Class<?> loadLocalClass(String name) throws ClassNotFoundException
loadLocalClass
in interface LocalClassLoader
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |