public class ClassLoaderPool
extends java.lang.Object
| Constructor and Description |
|---|
ClassLoaderPool() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.ClassLoader |
getClassLoader(java.lang.String contextName)
Returns the class loader associated with the context name.
|
static java.lang.String |
getContextName(java.lang.ClassLoader classLoader)
Returns the context name associated with the class loader.
|
static void |
register(java.lang.String contextName,
java.lang.ClassLoader classLoader) |
static void |
unregister(java.lang.ClassLoader classLoader) |
static void |
unregister(java.lang.String contextName) |
public static java.lang.ClassLoader getClassLoader(java.lang.String contextName)
If no class loader is found for the context name, this method checks for an initialized portal class loader to return. In cases where this method is invoked from outside of a running portal, such as from a unit test or from an external tool, no portal class loader will be found. If no portal class loader is found, the thread's context class loader is returned as a fallback.
contextName - the servlet context's namepublic static java.lang.String getContextName(java.lang.ClassLoader classLoader)
If the class loader is null or if no context name is
associated with the class loader, StringPool.BLANK is returned.
classLoader - the class loaderpublic static void register(java.lang.String contextName,
java.lang.ClassLoader classLoader)
public static void unregister(java.lang.ClassLoader classLoader)
public static void unregister(java.lang.String contextName)