public class ClassFactoryClassPool extends javassist.ClassPool
ClassPool.appendClassPath(javassist.ClassPath)
is invoked within a synchronized
lock, and also handles tricky class loading issues (caused by the creation of classes, and class loaders, at
runtime).Constructor and Description |
---|
ClassFactoryClassPool(ClassLoader contextClassLoader) |
Modifier and Type | Method and Description |
---|---|
void |
addClassLoaderIfNeeded(ClassLoader loader)
Convienience method for adding to the ClassPath for a particular class loader.
|
Class |
importClass(Class clazz)
Returns the nearest super-class of the provided class that can be converted to a
CtClass . |
Class |
toClass(javassist.CtClass ct,
ClassLoader loader,
ProtectionDomain domain)
Overriden to remove a deadlock producing synchronized block.
|
appendClassPath, appendClassPath, appendPathList, appendSystemPath, cacheCtClass, clearImportedPackages, createCtClass, find, get, get, get0, getAndRename, getCached, getClassLoader, getCtClass, getDefault, getImportedPackages, getMethod, getOrNull, importPackage, insertClassPath, insertClassPath, lookupCflow, makeClass, makeClass, makeClass, makeClass, makeClassIfNew, makeInterface, makeInterface, recordInvalidClassName, removeCached, removeClassPath, toClass, toClass, toString
public ClassFactoryClassPool(ClassLoader contextClassLoader)
public Class importClass(Class clazz)
CtClass
. This is used to
filter out Hibernate-style proxies (created as subclasses of oridnary classes). This will automatically add the
class' classLoader to the pool's class path.clazz
- class to importpublic void addClassLoaderIfNeeded(ClassLoader loader)
loader
- the class loader to add (derived from a loaded class, and may be null for some system classes)public Class toClass(javassist.CtClass ct, ClassLoader loader, ProtectionDomain domain) throws javassist.CannotCompileException
toClass
in class javassist.ClassPool
javassist.CannotCompileException
Copyright © 2003-2012 The Apache Software Foundation.