public class LoaderUtil
extends java.lang.Object
Constructor and Description |
---|
LoaderUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
activateTLCache() |
static void |
clearTLCache()
Forget the loaders presently in the cache.
|
static void |
dumpClassLoaderHierarchy(java.lang.ClassLoader loader,
java.lang.StringBuilder buf,
java.lang.String prefix,
java.lang.String incr)
Dump the hierarchy of class loaders into the buf starting with this one.
|
static java.lang.ClassLoader |
getAndCacheLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
A large percentage of the callers of the getLoader method use it to support
the adding of one or more jars to the classpath of a project and for multiple
components to respond to that.
|
static java.lang.ClassLoader |
getLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
This is an easy way to add a collection of URL's on top of an existing
loader so that the existing resources of the loader will also be visible.
|
static java.lang.ClassLoader |
getNOPParent() |
static boolean |
isTLCacheActive() |
public static java.lang.ClassLoader getLoader(java.net.URL[] urls, java.lang.ClassLoader parent)
urls
- the array (0-n) of the desired locations to includeparent
- the loader to become the direct parent of the returned loader
which may be null to include only the URL's passed in.public static java.lang.ClassLoader getAndCacheLoader(java.net.URL[] urls, java.lang.ClassLoader parent)
urls
- parent
- public static boolean activateTLCache()
public static void clearTLCache()
public static boolean isTLCacheActive()
public static void dumpClassLoaderHierarchy(java.lang.ClassLoader loader, java.lang.StringBuilder buf, java.lang.String prefix, java.lang.String incr)
loader
- Use this as the beginning loaderbuf
- Put the output here (one loader per line)prefix
- starting space before each output lineincr
- bump prefix by this much for each linepublic static java.lang.ClassLoader getNOPParent()