JBoss ClassPool Parent POM 1.0.0.GA

org.jboss.classpool.spi
Class AbstractClassPool

java.lang.Object
  extended by javassist.ClassPool
      extended by org.jboss.classpool.scoped.ScopedClassPool
          extended by org.jboss.classpool.spi.AbstractClassPool
Direct Known Subclasses:
BaseClassPool, TempJBossClassPool, TempJBossDelegatingClassPool

public class AbstractClassPool
extends ScopedClassPool

A ClassPool tailored for usage with JBoss AS.

Version:
$Revision: 101497 $
Author:
Bill Burke, Flavia Rainone

Nested Class Summary
static interface AbstractClassPool.ClassPoolSearchStrategy
           
 
Field Summary
protected  ConcurrentHashMap<String,String> generatedClasses
          Classnames of classes that will be created - we do not want to look for these in other pools.
protected  ConcurrentHashMap<String,Boolean> loadedButNotWovenClasses
          Classnames of classes that have been loaded, but were not woven
protected  ConcurrentHashMap<String,Boolean> localResources
           
protected  org.jboss.logging.Logger logger
           
static Class<org.jboss.classpool.spi.AbstractClassPool.SearchAllRegisteredLoadersSearchStrategy> SEARCH_ALL_STRATEGY
          Causes the AbstractClassPool.getCached() method to search all ClassPools registered in the repository
static Class<org.jboss.classpool.spi.AbstractClassPool.SearchLocalLoaderLoaderSearchStrategy> SEARCH_LOCAL_ONLY_STRATEGY
          Causes the AbstractClassPool.getCached() method to search only itself
 
Fields inherited from class org.jboss.classpool.scoped.ScopedClassPool
classLoader, classPath, repository, softcache
 
Fields inherited from class javassist.ClassPool
childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source
 
Constructor Summary
  AbstractClassPool(ClassLoader cl, javassist.ClassPool src, ScopedClassPoolRepository repository)
           
  AbstractClassPool(ClassLoader cl, javassist.ClassPool src, ScopedClassPoolRepository repository, Class<? extends AbstractClassPool.ClassPoolSearchStrategy> searchStrategy)
           
protected AbstractClassPool(javassist.ClassPool src, ScopedClassPoolRepository repository)
           
  AbstractClassPool(javassist.ClassPool src, ScopedClassPoolRepository repository, Class<? extends AbstractClassPool.ClassPoolSearchStrategy> searchStrategy)
           
 
Method Summary
 void cacheCtClass(String classname, javassist.CtClass c, boolean dynamic)
          Caches a class
 void close()
          Closes the class pool
 void doneGeneratingClass(String className)
           
 javassist.CtClass getCached(String classname)
          Get the cached class
protected  String getClassPoolLogStringForClass(javassist.CtClass clazz)
           
protected  String getResourceName(String classname)
           
protected  boolean includeInGlobalSearch()
           
 boolean isGeneratedClass(String className)
           
protected  boolean isLocalClassLoaderResource(String classResourceName)
           
protected  boolean isLocalResource(String resourceName, boolean trace)
           
 void registerGeneratedClass(String className)
           
 String toString()
           
 
Methods inherited from class org.jboss.classpool.scoped.ScopedClassPool
flushClass, getCachedLocally, getClassLoader, getClassLoader0, getLocally, isUnloadedClassLoader, lockInCache, soften, toClass
 
Methods inherited from class javassist.ClassPool
appendClassPath, appendClassPath, appendPathList, appendSystemPath, clearImportedPackages, createCtClass, find, get, get, get0, getAndRename, getCtClass, getDefault, getImportedPackages, getMethod, getOrNull, importPackage, insertClassPath, insertClassPath, lookupCflow, makeClass, makeClass, makeClass, makeClass, makeClassIfNew, makeInterface, makeInterface, recordInvalidClassName, removeCached, removeClassPath, toClass, toClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.jboss.logging.Logger logger

generatedClasses

protected final ConcurrentHashMap<String,String> generatedClasses
Classnames of classes that will be created - we do not want to look for these in other pools. The main use for this is when a class is created in a parent pool, and we then want to create a class with the same name in a parent-last child pool. As part of the create process javassist.ClassPool will check if that class is frozen (which in turn will call getCached() and get0()). If the classname exists in this map, get0() and getCached() should return null;


localResources

protected final ConcurrentHashMap<String,Boolean> localResources

loadedButNotWovenClasses

protected final ConcurrentHashMap<String,Boolean> loadedButNotWovenClasses
Classnames of classes that have been loaded, but were not woven


SEARCH_ALL_STRATEGY

public static final Class<org.jboss.classpool.spi.AbstractClassPool.SearchAllRegisteredLoadersSearchStrategy> SEARCH_ALL_STRATEGY
Causes the AbstractClassPool.getCached() method to search all ClassPools registered in the repository


SEARCH_LOCAL_ONLY_STRATEGY

public static final Class<org.jboss.classpool.spi.AbstractClassPool.SearchLocalLoaderLoaderSearchStrategy> SEARCH_LOCAL_ONLY_STRATEGY
Causes the AbstractClassPool.getCached() method to search only itself

Constructor Detail

AbstractClassPool

public AbstractClassPool(ClassLoader cl,
                         javassist.ClassPool src,
                         ScopedClassPoolRepository repository)

AbstractClassPool

protected AbstractClassPool(javassist.ClassPool src,
                            ScopedClassPoolRepository repository)

AbstractClassPool

public AbstractClassPool(ClassLoader cl,
                         javassist.ClassPool src,
                         ScopedClassPoolRepository repository,
                         Class<? extends AbstractClassPool.ClassPoolSearchStrategy> searchStrategy)

AbstractClassPool

public AbstractClassPool(javassist.ClassPool src,
                         ScopedClassPoolRepository repository,
                         Class<? extends AbstractClassPool.ClassPoolSearchStrategy> searchStrategy)
Method Detail

registerGeneratedClass

public void registerGeneratedClass(String className)

isGeneratedClass

public boolean isGeneratedClass(String className)

doneGeneratingClass

public void doneGeneratingClass(String className)

close

public void close()
Description copied from class: ScopedClassPool
Closes the class pool

Overrides:
close in class ScopedClassPool

getCached

public javassist.CtClass getCached(String classname)
Description copied from class: ScopedClassPool
Get the cached class

Overrides:
getCached in class ScopedClassPool
Parameters:
classname - the class name
Returns:
the class

cacheCtClass

public void cacheCtClass(String classname,
                         javassist.CtClass c,
                         boolean dynamic)
Description copied from class: ScopedClassPool
Caches a class

Overrides:
cacheCtClass in class ScopedClassPool
Parameters:
classname - the class name
c - the ctClass
dynamic - whether the class is dynamically generated

includeInGlobalSearch

protected boolean includeInGlobalSearch()

getResourceName

protected String getResourceName(String classname)

isLocalResource

protected final boolean isLocalResource(String resourceName,
                                        boolean trace)

isLocalClassLoaderResource

protected boolean isLocalClassLoaderResource(String classResourceName)

toString

public String toString()
Overrides:
toString in class javassist.ClassPool

getClassPoolLogStringForClass

protected String getClassPoolLogStringForClass(javassist.CtClass clazz)

JBoss ClassPool Parent POM 1.0.0.GA

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