public final class ClassLoaders extends Object
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Unregisters all
ClassLoader s. |
static Set<ClassLoader> |
get()
Returns a set of all explicitly registered
ClassLoader s as well as the ClassLoader that
loaded this class and the current context class loader if set. |
static boolean |
register(ClassLoader cl)
Registers a
ClassLoader . |
static Set<ClassLoader> |
registered()
Returns a set of all explicitly registered
ClassLoader s. |
static boolean |
unregister(ClassLoader cl)
Unregisters a
ClassLoader . |
public static boolean register(ClassLoader cl)
ClassLoader
.
Please note that this class only keeps weak references to the ClassLoaders
you pass to avoid potential memory leaks.
cl
- a ClassLoader
.unregister(ClassLoader)
public static boolean unregister(ClassLoader cl)
ClassLoader
.cl
- the ClassLoader
that should be removed from the registry.register(ClassLoader)
public static void clear()
ClassLoader
s.register(ClassLoader)
,
unregister(ClassLoader)
public static Set<ClassLoader> registered()
ClassLoader
s.ClassLoader
s in the order they have been registered.get()
public static Set<ClassLoader> get()
ClassLoader
s as well as the ClassLoader
that
loaded this class and the current context class loader if set.ClassLoader
s in the order the have been registered, followed by the ClassLoader
that loaded this class and the context ClassLoader
if set.Copyright © 2012-2013. All Rights Reserved.