Package javassist.scopedpool
Class ScopedClassPoolRepositoryImpl
java.lang.Object
javassist.scopedpool.ScopedClassPoolRepositoryImpl
- All Implemented Interfaces:
ScopedClassPoolRepository
An implementation of
ScopedClassPoolRepository
.
It is an singleton.- Version:
- $Revision: 1.4 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassPool
The default class poolprotected ScopedClassPoolFactory
The factory for creating class poolsprivate static final ScopedClassPoolRepositoryImpl
The instanceprivate boolean
Whether to prune(package private) boolean
Whether to prune when added to the classpool's cacheprotected Map
<ClassLoader, ScopedClassPool> The registered classloaders -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method will check to see if a register classloader has been undeployed (as in JBoss)createScopedClassPool
(ClassLoader cl, ClassPool src) Create a scoped classpool.Finds a scoped classpool registered under the passed in classloader.Obtains the recorded factory.static ScopedClassPoolRepository
Get the instance.Get the registered classloaders.void
insertDelegate
(ScopedClassPoolRepository delegate) boolean
isPrune()
Returns the value of the prune attribute.Register a classloader.void
Records a factory.void
setPrune
(boolean prune) Set the prune attribute.void
Unregisters a classpool and unregisters its classloader.
-
Field Details
-
instance
The instance -
prune
private boolean pruneWhether to prune -
pruneWhenCached
boolean pruneWhenCachedWhether to prune when added to the classpool's cache -
registeredCLs
The registered classloaders -
classpool
The default class pool -
factory
The factory for creating class pools
-
-
Constructor Details
-
ScopedClassPoolRepositoryImpl
private ScopedClassPoolRepositoryImpl()Singleton.
-
-
Method Details
-
getInstance
Get the instance.- Returns:
- the instance.
-
isPrune
public boolean isPrune()Returns the value of the prune attribute.- Specified by:
isPrune
in interfaceScopedClassPoolRepository
- Returns:
- the prune.
-
setPrune
public void setPrune(boolean prune) Set the prune attribute.- Specified by:
setPrune
in interfaceScopedClassPoolRepository
- Parameters:
prune
- a new value.
-
createScopedClassPool
Create a scoped classpool.- Specified by:
createScopedClassPool
in interfaceScopedClassPoolRepository
- Parameters:
cl
- the classloader.src
- the original classpool.- Returns:
- the classpool
-
findClassPool
Description copied from interface:ScopedClassPoolRepository
Finds a scoped classpool registered under the passed in classloader.- Specified by:
findClassPool
in interfaceScopedClassPoolRepository
- Parameters:
cl
- the classloader.- Returns:
- the classpool.
-
registerClassLoader
Register a classloader.- Specified by:
registerClassLoader
in interfaceScopedClassPoolRepository
- Parameters:
ucl
- the classloader.- Returns:
- the classpool
-
getRegisteredCLs
Get the registered classloaders.- Specified by:
getRegisteredCLs
in interfaceScopedClassPoolRepository
- Returns:
- the registered classloaders.
-
clearUnregisteredClassLoaders
public void clearUnregisteredClassLoaders()This method will check to see if a register classloader has been undeployed (as in JBoss)- Specified by:
clearUnregisteredClassLoaders
in interfaceScopedClassPoolRepository
-
unregisterClassLoader
Description copied from interface:ScopedClassPoolRepository
Unregisters a classpool and unregisters its classloader.- Specified by:
unregisterClassLoader
in interfaceScopedClassPoolRepository
- Parameters:
cl
- the classloader the pool is stored under.
-
insertDelegate
-
setClassPoolFactory
Description copied from interface:ScopedClassPoolRepository
Records a factory.- Specified by:
setClassPoolFactory
in interfaceScopedClassPoolRepository
-
getClassPoolFactory
Description copied from interface:ScopedClassPoolRepository
Obtains the recorded factory.- Specified by:
getClassPoolFactory
in interfaceScopedClassPoolRepository
-