javassist.scopedpool
Class ScopedClassPoolRepositoryImpl

java.lang.Object
  extended by javassist.scopedpool.ScopedClassPoolRepositoryImpl
All Implemented Interfaces:
ScopedClassPoolRepository

public class ScopedClassPoolRepositoryImpl
extends java.lang.Object
implements ScopedClassPoolRepository

An implementation of ScopedClassPoolRepository. It is an singleton.

Version:
$Revision: 1.4 $
Author:
Kabir Khan

Field Summary
protected  ClassPool classpool
          The default class pool
protected  ScopedClassPoolFactory factory
          The factory for creating class pools
protected  java.util.Map registeredCLs
          The registered classloaders
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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:
isPrune in interface ScopedClassPoolRepository
Returns:
the prune.

setPrune

public void setPrune(boolean prune)
Set the prune attribute.

Specified by:
setPrune in interface ScopedClassPoolRepository
Parameters:
prune - a new value.

createScopedClassPool

public ScopedClassPool createScopedClassPool(java.lang.ClassLoader cl,
                                             ClassPool src)
Create a scoped classpool.

Specified by:
createScopedClassPool in interface ScopedClassPoolRepository
Parameters:
cl - the classloader.
src - the original classpool.
Returns:
the classpool

findClassPool

public ClassPool findClassPool(java.lang.ClassLoader cl)
Description copied from interface: ScopedClassPoolRepository
Finds a scoped classpool registered under the passed in classloader.

Specified by:
findClassPool in interface ScopedClassPoolRepository
Parameters:
cl - the classloader.
Returns:
the classpool.

registerClassLoader

public ClassPool registerClassLoader(java.lang.ClassLoader ucl)
Register a classloader.

Specified by:
registerClassLoader in interface ScopedClassPoolRepository
Parameters:
ucl - the classloader.
Returns:
the classpool

getRegisteredCLs

public java.util.Map getRegisteredCLs()
Get the registered classloaders.

Specified by:
getRegisteredCLs in interface ScopedClassPoolRepository
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 interface ScopedClassPoolRepository

unregisterClassLoader

public void unregisterClassLoader(java.lang.ClassLoader cl)
Description copied from interface: ScopedClassPoolRepository
Unregisters a classpool and unregisters its classloader.

Specified by:
unregisterClassLoader in interface ScopedClassPoolRepository
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: ScopedClassPoolRepository
Records a factory.

Specified by:
setClassPoolFactory in interface ScopedClassPoolRepository

getClassPoolFactory

public ScopedClassPoolFactory getClassPoolFactory()
Description copied from interface: ScopedClassPoolRepository
Obtains the recorded factory.

Specified by:
getClassPoolFactory in interface ScopedClassPoolRepository


Copyright © 2011. All Rights Reserved.