org.jboss.aop.classpool
Class AOPClassPool

java.lang.Object
  extended by javassist.ClassPool
      extended by javassist.scopedpool.ScopedClassPool
          extended by org.jboss.aop.classpool.AOPClassPool
Direct Known Subclasses:
StandaloneClassPool

public class AOPClassPool
extends javassist.scopedpool.ScopedClassPool

Version:
$Revision: 86859 $
Author:
Bill Burke

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.aop.classpool.AOPClassPool.SearchAllRegisteredLoadersSearchStrategy> SEARCH_ALL_STRATEGY
          Causes the AOPClassPool.getCached() method to search all ClassPools registered in the repository
static Class<org.jboss.aop.classpool.AOPClassPool.SearchLocalLoaderLoaderSearchStrategy> SEARCH_LOCAL_ONLY_STRATEGY
          Causes the AOPClassPool.getCached() method to search only itself
 
Fields inherited from class javassist.scopedpool.ScopedClassPool
classLoader, classPath, repository, softcache
 
Fields inherited from class javassist.ClassPool
childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source
 
Constructor Summary
  AOPClassPool(ClassLoader cl, javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository)
           
  AOPClassPool(ClassLoader cl, javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository, Class<? extends AOPCLassPoolSearchStrategy> searchStrategy)
           
protected AOPClassPool(javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository)
           
  AOPClassPool(javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository, Class<? extends AOPCLassPoolSearchStrategy> searchStrategy)
           
 
Method Summary
 void cacheCtClass(String classname, javassist.CtClass c, boolean dynamic)
           
 void close()
           
static AOPClassPool createAOPClassPool(ClassLoader cl, javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository)
           
static AOPClassPool createAOPClassPool(javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository)
           
 javassist.CtClass createCtClass(String classname, boolean useCache)
          Make createCtClass public so that we can override it
 void doneGeneratingClass(String className)
           
 javassist.CtClass getCached(String classname)
           
protected  javassist.CtClass getCachedLocally(String classname)
           
protected  String getClassPoolLogStringForClass(javassist.CtClass clazz)
           
 javassist.CtClass getLocally(String classname)
           
protected  String getResourceName(String classname)
           
protected  boolean includeInGlobalSearch()
           
 javassist.CtClass internalGet0(String classname, boolean useCache)
           
 boolean isClassLoadedButNotWoven(String classname)
           
 boolean isGeneratedClass(String className)
           
protected  boolean isLocalClassLoaderResource(String classResourceName)
           
protected  boolean isLocalResource(String resourceName, boolean trace)
           
 void lockInCache(javassist.CtClass c)
           
 void registerGeneratedClass(String className)
           
 void setClassLoadedButNotWoven(String classname)
           
 String toString()
           
 
Methods inherited from class javassist.scopedpool.ScopedClassPool
flushClass, getClassLoader, getClassLoader0, isUnloadedClassLoader, soften, toClass
 
Methods inherited from class javassist.ClassPool
appendClassPath, appendClassPath, appendPathList, appendSystemPath, clearImportedPackages, find, get, get, get0, getAndRename, getCtClass, getDefault, getImportedPackages, getMethod, 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.aop.classpool.AOPClassPool.SearchAllRegisteredLoadersSearchStrategy> SEARCH_ALL_STRATEGY
Causes the AOPClassPool.getCached() method to search all ClassPools registered in the repository


SEARCH_LOCAL_ONLY_STRATEGY

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

Constructor Detail

AOPClassPool

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

AOPClassPool

protected AOPClassPool(javassist.ClassPool src,
                       javassist.scopedpool.ScopedClassPoolRepository repository)

AOPClassPool

public AOPClassPool(ClassLoader cl,
                    javassist.ClassPool src,
                    javassist.scopedpool.ScopedClassPoolRepository repository,
                    Class<? extends AOPCLassPoolSearchStrategy> searchStrategy)

AOPClassPool

public AOPClassPool(javassist.ClassPool src,
                    javassist.scopedpool.ScopedClassPoolRepository repository,
                    Class<? extends AOPCLassPoolSearchStrategy> 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()
Overrides:
close in class javassist.scopedpool.ScopedClassPool

getCached

public javassist.CtClass getCached(String classname)
Overrides:
getCached in class javassist.scopedpool.ScopedClassPool

createCtClass

public javassist.CtClass createCtClass(String classname,
                                       boolean useCache)
Make createCtClass public so that we can override it

Overrides:
createCtClass in class javassist.ClassPool

cacheCtClass

public void cacheCtClass(String classname,
                         javassist.CtClass c,
                         boolean dynamic)
Overrides:
cacheCtClass in class javassist.scopedpool.ScopedClassPool

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)

getLocally

public javassist.CtClass getLocally(String classname)
                             throws javassist.NotFoundException
Overrides:
getLocally in class javassist.scopedpool.ScopedClassPool
Throws:
javassist.NotFoundException

getCachedLocally

protected javassist.CtClass getCachedLocally(String classname)
Overrides:
getCachedLocally in class javassist.scopedpool.ScopedClassPool

lockInCache

public void lockInCache(javassist.CtClass c)
Overrides:
lockInCache in class javassist.scopedpool.ScopedClassPool

setClassLoadedButNotWoven

public void setClassLoadedButNotWoven(String classname)

isClassLoadedButNotWoven

public boolean isClassLoadedButNotWoven(String classname)

createAOPClassPool

public static AOPClassPool createAOPClassPool(ClassLoader cl,
                                              javassist.ClassPool src,
                                              javassist.scopedpool.ScopedClassPoolRepository repository)

createAOPClassPool

public static AOPClassPool createAOPClassPool(javassist.ClassPool src,
                                              javassist.scopedpool.ScopedClassPoolRepository repository)

toString

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

internalGet0

public javassist.CtClass internalGet0(String classname,
                                      boolean useCache)
                               throws javassist.NotFoundException
Throws:
javassist.NotFoundException

getClassPoolLogStringForClass

protected String getClassPoolLogStringForClass(javassist.CtClass clazz)


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