JBoss ClassPool Parent POM 1.0.0.GA

org.jboss.classpool.scoped
Class ScopedClassPoolRepositoryImpl

java.lang.Object
  extended by org.jboss.classpool.scoped.ScopedClassPoolRepositoryImpl
All Implemented Interfaces:
ScopedClassPoolRepository
Direct Known Subclasses:
ClassPoolRepository

public abstract class ScopedClassPoolRepositoryImpl
extends Object
implements ScopedClassPoolRepository

An implementation of ScopedClassPoolRepository. It is an singleton.

Version:
$Revision: 102187 $
Author:
Kabir Khan, Flavia Rainone

Field Summary
protected  javassist.ClassPool classpool
          The default class pool
protected  ScopedClassPoolFactory factory
          The factory for creating class pools
protected  Map<ClassLoader,ScopedClassPool> registeredCLs
          The registered classloaders
 
Constructor Summary
protected ScopedClassPoolRepositoryImpl(javassist.ClassPool systemClassPool)
          Constructor
 
Method Summary
 void clearUnregisteredClassLoaders()
          This method will check to see if a register classloader has been undeployed (as in JBoss)
 ScopedClassPool createScopedClassPool(ClassLoader cl, javassist.ClassPool src)
          Creates a ClassPool corresponding to classLoader.
 javassist.ClassPool findClassPool(ClassLoader cl)
          Finds the ClassPool corresponding to cl
 ScopedClassPoolFactory getClassPoolFactory()
          Returns the classpool factory.
 Map<ClassLoader,ScopedClassPool> getRegisteredCLs()
          Get the registered classloaders
 void insertDelegate(ScopedClassPoolRepository delegate)
           
 boolean isPrune()
          Returns the value of the prune attribute.
 javassist.ClassPool registerClassLoader(ClassLoader ucl)
          Register a classloader.
 void setClassPoolFactory(ScopedClassPoolFactory factory)
          Sets the classpool factory that should be used.
 void setPrune(boolean prune)
          Set the prune attribute.
 void unregisterClassLoader(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 Map<ClassLoader,ScopedClassPool> registeredCLs
The registered classloaders


classpool

protected javassist.ClassPool classpool
The default class pool


factory

protected ScopedClassPoolFactory factory
The factory for creating class pools

Constructor Detail

ScopedClassPoolRepositoryImpl

protected ScopedClassPoolRepositoryImpl(javassist.ClassPool systemClassPool)
Constructor

Parameters:
systemClassPool - the systemClassPool
Method Detail

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(ClassLoader cl,
                                             javassist.ClassPool src)
Creates a ClassPool corresponding to classLoader.

Specified by:
createScopedClassPool in interface ScopedClassPoolRepository
Parameters:
cl - the classLoader corresponding to the created ClassPool
src - the source ClassPool
Returns:
the created ClassPool

findClassPool

public javassist.ClassPool findClassPool(ClassLoader cl)
Finds the ClassPool corresponding to cl

Specified by:
findClassPool in interface ScopedClassPoolRepository
Parameters:
cl - the classLoader
Returns:
the ClassPoool that corresponds to cl

registerClassLoader

public javassist.ClassPool registerClassLoader(ClassLoader ucl)
Register a classloader.

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

getRegisteredCLs

public Map<ClassLoader,ScopedClassPool> 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(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)
Sets the classpool factory that should be used. This method should always be called before the repository is used.

Specified by:
setClassPoolFactory in interface ScopedClassPoolRepository

getClassPoolFactory

public ScopedClassPoolFactory getClassPoolFactory()
Returns the classpool factory.

Specified by:
getClassPoolFactory in interface ScopedClassPoolRepository

JBoss ClassPool Parent POM 1.0.0.GA

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.