JBoss ClassPool Parent POM 1.0.0.GA

org.jboss.classpool.spi
Class ClassPoolRepository

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

public class ClassPoolRepository
extends ScopedClassPoolRepositoryImpl

Singleton classpool repository.

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

Field Summary
 
Fields inherited from class org.jboss.classpool.scoped.ScopedClassPoolRepositoryImpl
classpool, factory, registeredCLs
 
Constructor Summary
protected ClassPoolRepository()
          Constructor.
 
Method Summary
 void addClassPoolRepositoryCallback(ClassPoolRepositoryCallback callback)
          Adds a callback object for notifications on classloader registration.
 List<ClassPoolRepositoryCallback> getClassPoolRepositoryCallbacks()
          Returns the callback objects.
static ClassPoolRepository getInstance()
          Returns the singleton instance.
 javassist.ClassPool registerClassLoader(ClassLoader classLoader)
          Registers classLoader and returns the corresponding ClassPool.
 boolean removeClassPoolRepositoryCallback(ClassPoolRepositoryCallback callback)
          Removes a callback object.
 void setClassPoolFactory(ScopedClassPoolFactory factory)
          Defines the ClassPoolFactory that will be used by this repository.
 void unregisterClassLoader(ClassLoader classLoader)
          Unregisters classLoader.
 
Methods inherited from class org.jboss.classpool.scoped.ScopedClassPoolRepositoryImpl
clearUnregisteredClassLoaders, createScopedClassPool, findClassPool, getClassPoolFactory, getRegisteredCLs, insertDelegate, isPrune, setPrune
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPoolRepository

protected ClassPoolRepository()
Constructor.

Method Detail

getInstance

public static ClassPoolRepository getInstance()
Returns the singleton instance.

Returns:
the singleton repository instance

setClassPoolFactory

public void setClassPoolFactory(ScopedClassPoolFactory factory)
Defines the ClassPoolFactory that will be used by this repository.

Specified by:
setClassPoolFactory in interface ScopedClassPoolRepository
Overrides:
setClassPoolFactory in class ScopedClassPoolRepositoryImpl
Parameters:
factory - the ClassPoolFactory that is responsible for creating ClassPools for this repository. if this factory implements ClassLoaderRegistryHandlerFactory interface, it will also be responsible for creating a ClassLoaderRegistryHandler for this repository

addClassPoolRepositoryCallback

public void addClassPoolRepositoryCallback(ClassPoolRepositoryCallback callback)
Adds a callback object for notifications on classloader registration.

Parameters:
callback - the callback object
Throws:
IllegalArgumentException - if the passed in callback was null
See Also:
ClassPoolRepositoryCallback

getClassPoolRepositoryCallbacks

public List<ClassPoolRepositoryCallback> getClassPoolRepositoryCallbacks()
Returns the callback objects.

Returns:
the callback objects in an unmodifiable list. If there are none an empty list is returned

removeClassPoolRepositoryCallback

public boolean removeClassPoolRepositoryCallback(ClassPoolRepositoryCallback callback)
Removes a callback object. If the callback object is null, or it cannot be found in the list, no error is thrown.

Parameters:
callback - the callback object

registerClassLoader

public javassist.ClassPool registerClassLoader(ClassLoader classLoader)
Registers classLoader and returns the corresponding ClassPool.

Specified by:
registerClassLoader in interface ScopedClassPoolRepository
Overrides:
registerClassLoader in class ScopedClassPoolRepositoryImpl
Parameters:
classLoader - the ClassLoader to be added to this repository
Returns:
the ClassPool corresponding to classLoader

unregisterClassLoader

public void unregisterClassLoader(ClassLoader classLoader)
Unregisters classLoader.

Specified by:
unregisterClassLoader in interface ScopedClassPoolRepository
Overrides:
unregisterClassLoader in class ScopedClassPoolRepositoryImpl
Parameters:
classLoader - the ClassLoader to be removed from this repository

JBoss ClassPool Parent POM 1.0.0.GA

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