|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.discovery.resource.ClassLoaders
There are many different contexts in which loaders can be used. This provides a holder for a set of class loaders, so that they don't have to be build back up everytime...
Field Summary | |
---|---|
protected java.util.Vector |
classLoaders
|
Constructor Summary | |
---|---|
ClassLoaders()
Construct a new class loader set |
Method Summary | |
---|---|
java.lang.ClassLoader |
get(int idx)
|
static ClassLoaders |
getAppLoaders(java.lang.Class spi,
java.lang.Class factory,
boolean prune)
Utility method. |
static ClassLoaders |
getLibLoaders(java.lang.Class spi,
java.lang.Class factory,
boolean prune)
Utility method. |
boolean |
isAncestor(java.lang.ClassLoader classLoader)
Check to see if classLoader is an
ancestor of any contained class loader. |
void |
put(java.lang.ClassLoader classLoader)
Specify a new class loader to be used in searching. |
void |
put(java.lang.ClassLoader classLoader,
boolean prune)
Specify a new class loader to be used in searching. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector classLoaders
Constructor Detail |
public ClassLoaders()
Method Detail |
public int size()
public java.lang.ClassLoader get(int idx)
public void put(java.lang.ClassLoader classLoader)
public void put(java.lang.ClassLoader classLoader, boolean prune)
prune
- if true, verify that the class loader is
not an Ancestor (@see isAncestor) before
adding it to our list.public boolean isAncestor(java.lang.ClassLoader classLoader)
classLoader
is an
ancestor of any contained class loader.
This can be used to eliminate redundant class loaders
IF all class loaders defer to parent class loaders
before resolving a class.
It may be that this is not always true. Therefore,
this check is not done internally to eliminate
redundant class loaders, but left to the discretion
of the user.
public static ClassLoaders getLibLoaders(java.lang.Class spi, java.lang.Class factory, boolean prune)
spi
- WHAT is being looked for (an implementation of this class,
a default property file related to this class).factory
- WHO is performing the lookup.prune
- Determines if ancestors are allowed to be loaded or not.public static ClassLoaders getAppLoaders(java.lang.Class spi, java.lang.Class factory, boolean prune)
spi
- WHAT is being looked for (an implementation of this class,
a default property file related to this class).factory
- WHO is performing the lookup (factory).prune
- Determines if ancestors are allowed to be loaded or not.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |