Package javassist.scopedpool
Class ScopedClassPoolRepositoryImpl
- java.lang.Object
-
- javassist.scopedpool.ScopedClassPoolRepositoryImpl
-
- All Implemented Interfaces:
ScopedClassPoolRepository
public class ScopedClassPoolRepositoryImpl extends java.lang.Object implements ScopedClassPoolRepository
An implementation ofScopedClassPoolRepository. It is an singleton.- Version:
- $Revision: 1.4 $
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassPoolclasspoolThe default class poolprotected ScopedClassPoolFactoryfactoryThe factory for creating class poolsprivate static ScopedClassPoolRepositoryImplinstanceThe instanceprivate booleanpruneWhether to prune(package private) booleanpruneWhenCachedWhether to prune when added to the classpool's cacheprotected java.util.MapregisteredCLsThe registered classloaders
-
Constructor Summary
Constructors Modifier Constructor Description privateScopedClassPoolRepositoryImpl()Singleton.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearUnregisteredClassLoaders()This method will check to see if a register classloader has been undeployed (as in JBoss)ScopedClassPoolcreateScopedClassPool(java.lang.ClassLoader cl, ClassPool src)Create a scoped classpool.ClassPoolfindClassPool(java.lang.ClassLoader cl)Finds a scoped classpool registered under the passed in classloader.ScopedClassPoolFactorygetClassPoolFactory()Obtains the recorded factory.static ScopedClassPoolRepositorygetInstance()Get the instance.java.util.MapgetRegisteredCLs()Get the registered classloaders.voidinsertDelegate(ScopedClassPoolRepository delegate)booleanisPrune()Returns the value of the prune attribute.ClassPoolregisterClassLoader(java.lang.ClassLoader ucl)Register a classloader.voidsetClassPoolFactory(ScopedClassPoolFactory factory)Records a factory.voidsetPrune(boolean prune)Set the prune attribute.voidunregisterClassLoader(java.lang.ClassLoader cl)Unregisters a classpool and unregisters its classloader.
-
-
-
Field Detail
-
instance
private static final ScopedClassPoolRepositoryImpl instance
The instance
-
prune
private boolean prune
Whether to prune
-
pruneWhenCached
boolean pruneWhenCached
Whether to prune when added to the classpool's cache
-
registeredCLs
protected java.util.Map registeredCLs
The registered classloaders
-
classpool
protected ClassPool classpool
The default class pool
-
factory
protected ScopedClassPoolFactory factory
The factory for creating class pools
-
-
Method Detail
-
getInstance
public static ScopedClassPoolRepository getInstance()
Get the instance.- Returns:
- the instance.
-
isPrune
public boolean isPrune()
Returns the value of the prune attribute.- Specified by:
isPrunein interfaceScopedClassPoolRepository- Returns:
- the prune.
-
setPrune
public void setPrune(boolean prune)
Set the prune attribute.- Specified by:
setPrunein interfaceScopedClassPoolRepository- Parameters:
prune- a new value.
-
createScopedClassPool
public ScopedClassPool createScopedClassPool(java.lang.ClassLoader cl, ClassPool src)
Create a scoped classpool.- Specified by:
createScopedClassPoolin interfaceScopedClassPoolRepository- Parameters:
cl- the classloader.src- the original classpool.- Returns:
- the classpool
-
findClassPool
public ClassPool findClassPool(java.lang.ClassLoader cl)
Description copied from interface:ScopedClassPoolRepositoryFinds a scoped classpool registered under the passed in classloader.- Specified by:
findClassPoolin interfaceScopedClassPoolRepository- Parameters:
cl- the classloader.- Returns:
- the classpool.
-
registerClassLoader
public ClassPool registerClassLoader(java.lang.ClassLoader ucl)
Register a classloader.- Specified by:
registerClassLoaderin interfaceScopedClassPoolRepository- Parameters:
ucl- the classloader.- Returns:
- the classpool
-
getRegisteredCLs
public java.util.Map getRegisteredCLs()
Get the registered classloaders.- Specified by:
getRegisteredCLsin 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:
clearUnregisteredClassLoadersin interfaceScopedClassPoolRepository
-
unregisterClassLoader
public void unregisterClassLoader(java.lang.ClassLoader cl)
Description copied from interface:ScopedClassPoolRepositoryUnregisters a classpool and unregisters its classloader.- Specified by:
unregisterClassLoaderin interfaceScopedClassPoolRepository- Parameters:
cl- the classloader the pool is stored under.
-
insertDelegate
public void insertDelegate(ScopedClassPoolRepository delegate)
-
setClassPoolFactory
public void setClassPoolFactory(ScopedClassPoolFactory factory)
Description copied from interface:ScopedClassPoolRepositoryRecords a factory.- Specified by:
setClassPoolFactoryin interfaceScopedClassPoolRepository
-
getClassPoolFactory
public ScopedClassPoolFactory getClassPoolFactory()
Description copied from interface:ScopedClassPoolRepositoryObtains the recorded factory.- Specified by:
getClassPoolFactoryin interfaceScopedClassPoolRepository
-
-