Class ClassWorld
java.lang.Object
org.codehaus.plexus.classworlds.ClassWorld
- All Implemented Interfaces:
- Closeable,- AutoCloseable
- Direct Known Subclasses:
- ClassWorldReverseAdapter
A collection of 
ClassRealms, indexed by id.- Author:
- bob mcwhirter
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddListener(ClassWorldListener listener) voidclose()Closes all contained class realms.voiddisposeRealm(String id) getClassRealm(String id) newRealm(String id, ClassLoader classLoader) newRealm(String id, ClassLoader classLoader, Predicate<String> filter) Adds a class realm with filtering.voidremoveListener(ClassWorldListener listener) 
- 
Constructor Details- 
ClassWorld
- 
ClassWorldpublic ClassWorld()
 
- 
- 
Method Details- 
newRealm- Throws:
- DuplicateRealmException
 
- 
newRealm- Throws:
- DuplicateRealmException
 
- 
newRealmpublic ClassRealm newRealm(String id, ClassLoader classLoader, Predicate<String> filter) throws DuplicateRealmException Adds a class realm with filtering. Only resources/classes whose name matches a given predicate are exposed.- Parameters:
- id- The identifier for this realm, must not be- null.
- classLoader- The base class loader for this realm, may be- nullto use the bootstrap class loader.
- filter- a predicate to apply to each resource name to determine if it should be loaded through this class loader
- Returns:
- the created class realm
- Throws:
- DuplicateRealmException- in case a realm with the given id does already exist
- Since:
- 2.7.0
- See Also:
 
- 
closeCloses all contained class realms.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
- Since:
- 2.7.0
 
- 
disposeRealm- Throws:
- NoSuchRealmException
 
- 
getRealm- Throws:
- NoSuchRealmException
 
- 
getRealms
- 
getClassRealm
- 
addListener
- 
removeListener
 
-