public class ScopedClassPoolRepositoryImpl extends java.lang.Object implements ScopedClassPoolRepository
ScopedClassPoolRepository.
It is an singleton.| Modifier and Type | Field and Description |
|---|---|
protected ClassPool |
classpool
The default class pool
|
protected ScopedClassPoolFactory |
factory
The factory for creating class pools
|
private static ScopedClassPoolRepositoryImpl |
instance
The instance
|
private boolean |
prune
Whether to prune
|
(package private) boolean |
pruneWhenCached
Whether to prune when added to the classpool's cache
|
protected java.util.Map |
registeredCLs
The registered classloaders
|
| Modifier | Constructor and Description |
|---|---|
private |
ScopedClassPoolRepositoryImpl()
Singleton.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearUnregisteredClassLoaders()
This method will check to see if a register classloader has been
undeployed (as in JBoss)
|
ScopedClassPool |
createScopedClassPool(java.lang.ClassLoader cl,
ClassPool src)
Create a scoped classpool.
|
ClassPool |
findClassPool(java.lang.ClassLoader cl)
Finds a scoped classpool registered under the passed in classloader.
|
ScopedClassPoolFactory |
getClassPoolFactory()
Obtains the recorded factory.
|
static ScopedClassPoolRepository |
getInstance()
Get the instance.
|
java.util.Map |
getRegisteredCLs()
Get the registered classloaders.
|
void |
insertDelegate(ScopedClassPoolRepository delegate) |
boolean |
isPrune()
Returns the value of the prune attribute.
|
ClassPool |
registerClassLoader(java.lang.ClassLoader ucl)
Register a classloader.
|
void |
setClassPoolFactory(ScopedClassPoolFactory factory)
Records a factory.
|
void |
setPrune(boolean prune)
Set the prune attribute.
|
void |
unregisterClassLoader(java.lang.ClassLoader cl)
Unregisters a classpool and unregisters its classloader.
|
private static final ScopedClassPoolRepositoryImpl instance
private boolean prune
boolean pruneWhenCached
protected java.util.Map registeredCLs
protected ClassPool classpool
protected ScopedClassPoolFactory factory
public static ScopedClassPoolRepository getInstance()
public boolean isPrune()
isPrune in interface ScopedClassPoolRepositorypublic void setPrune(boolean prune)
setPrune in interface ScopedClassPoolRepositoryprune - a new value.public ScopedClassPool createScopedClassPool(java.lang.ClassLoader cl, ClassPool src)
createScopedClassPool in interface ScopedClassPoolRepositorycl - the classloader.src - the original classpool.public ClassPool findClassPool(java.lang.ClassLoader cl)
ScopedClassPoolRepositoryfindClassPool in interface ScopedClassPoolRepositorycl - the classloader.public ClassPool registerClassLoader(java.lang.ClassLoader ucl)
registerClassLoader in interface ScopedClassPoolRepositoryucl - the classloader.public java.util.Map getRegisteredCLs()
getRegisteredCLs in interface ScopedClassPoolRepositorypublic void clearUnregisteredClassLoaders()
clearUnregisteredClassLoaders in interface ScopedClassPoolRepositorypublic void unregisterClassLoader(java.lang.ClassLoader cl)
ScopedClassPoolRepositoryunregisterClassLoader in interface ScopedClassPoolRepositorycl - the classloader the pool is stored under.public void insertDelegate(ScopedClassPoolRepository delegate)
public void setClassPoolFactory(ScopedClassPoolFactory factory)
ScopedClassPoolRepositorysetClassPoolFactory in interface ScopedClassPoolRepositorypublic ScopedClassPoolFactory getClassPoolFactory()
ScopedClassPoolRepositorygetClassPoolFactory in interface ScopedClassPoolRepository