public class ScopedClassPool extends ClassPool
| Modifier and Type | Field | Description |
|---|---|---|
protected Reference<ClassLoader> |
classLoader |
|
protected LoaderClassPath |
classPath |
|
protected ScopedClassPoolRepository |
repository |
|
protected Map<String,CtClass> |
softcache |
childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source| Modifier | Constructor | Description |
|---|---|---|
protected |
ScopedClassPool(ClassLoader cl,
ClassPool src,
ScopedClassPoolRepository repository) |
Create a new ScopedClassPool.
|
protected |
ScopedClassPool(ClassLoader cl,
ClassPool src,
ScopedClassPoolRepository repository,
boolean isTemp) |
Create a new ScopedClassPool.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
cacheCtClass(String classname,
CtClass c,
boolean dynamic) |
Cache a class
|
void |
close() |
Close the class pool
|
void |
flushClass(String classname) |
Flush a class
|
protected CtClass |
getCached(String classname) |
Get the cached class
|
protected CtClass |
getCachedLocally(String classname) |
Whether the class is cached in this pooled
|
ClassLoader |
getClassLoader() |
Get the class loader
|
protected ClassLoader |
getClassLoader0() |
|
CtClass |
getLocally(String classname) |
Get any local copy of the class
|
boolean |
isUnloadedClassLoader() |
Whether the classloader is loader
|
void |
lockInCache(CtClass c) |
Lock a class into the cache
|
void |
soften(CtClass clazz) |
Soften a class
|
Class<?> |
toClass(CtClass ct,
ClassLoader loader,
ProtectionDomain domain) |
Convert a javassist class to a java class
|
appendClassPath, appendClassPath, appendPathList, appendSystemPath, clearImportedPackages, createCtClass, find, get, get, get0, getAndRename, getCtClass, getDefault, getImportedPackages, getMethod, getOrNull, importPackage, insertClassPath, insertClassPath, lookupCflow, makeAnnotation, makeClass, makeClass, makeClass, makeClass, makeClass, makeClass, makeClassIfNew, makeInterface, makeInterface, makePackage, recordInvalidClassName, removeCached, removeClassPath, toClass, toClass, toStringprotected ScopedClassPoolRepository repository
protected Reference<ClassLoader> classLoader
protected LoaderClassPath classPath
protected ScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
cl - the classloadersrc - the original class poolrepository - the repositoryprotected ScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, boolean isTemp)
cl - the classloadersrc - the original class poolrepository - the repositoryisTemp - Whether this is a temporary pool used to resolve referencespublic ClassLoader getClassLoader()
getClassLoader in class ClassPoolClassPool.toClass(CtClass),
CtClass.getAnnotations()protected ClassLoader getClassLoader0()
public void close()
public void flushClass(String classname)
classname - the class to flushpublic void soften(CtClass clazz)
clazz - the classpublic boolean isUnloadedClassLoader()
protected CtClass getCached(String classname)
getCached in class ClassPoolclassname - the class nameClassPool.cacheCtClass(String,CtClass,boolean),
ClassPool.removeCached(String)protected void cacheCtClass(String classname, CtClass c, boolean dynamic)
cacheCtClass in class ClassPoolclassname - the class namec - the ctClassdynamic - whether the class is dynamically generatedClassPool.getCached(String),
ClassPool.removeCached(String)public void lockInCache(CtClass c)
c - the classprotected CtClass getCachedLocally(String classname)
classname - the class namepublic CtClass getLocally(String classname) throws NotFoundException
classname - the class nameNotFoundException - when the class is not foundpublic Class<?> toClass(CtClass ct, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException
toClass in class ClassPoolct - the javassist classloader - the loaderdomain - the protection domain for the class.
If it is null, the default domain created
by java.lang.ClassLoader is used.CannotCompileException - for any errorClassPool.getClassLoader()Copyright © 2018 Shigeru Chiba, www.javassist.org. All rights reserved.