|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavassist.ClassPool
javassist.scopedpool.ScopedClassPool
public class ScopedClassPool
A scoped class pool.
Field Summary | |
---|---|
protected java.lang.ref.WeakReference |
classLoader
|
protected LoaderClassPath |
classPath
|
protected ScopedClassPoolRepository |
repository
|
protected SoftValueHashMap |
softcache
|
Fields inherited from class javassist.ClassPool |
---|
childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source |
Constructor Summary | |
---|---|
protected |
ScopedClassPool(java.lang.ClassLoader cl,
ClassPool src,
ScopedClassPoolRepository repository)
Deprecated. |
protected |
ScopedClassPool(java.lang.ClassLoader cl,
ClassPool src,
ScopedClassPoolRepository repository,
boolean isTemp)
Create a new ScopedClassPool. |
Method Summary | |
---|---|
protected void |
cacheCtClass(java.lang.String classname,
CtClass c,
boolean dynamic)
Cache a class |
void |
close()
Close the class pool |
void |
flushClass(java.lang.String classname)
Flush a class |
protected CtClass |
getCached(java.lang.String classname)
Get the cached class |
protected CtClass |
getCachedLocally(java.lang.String classname)
Whether the class is cached in this pooled |
java.lang.ClassLoader |
getClassLoader()
Get the class loader |
protected java.lang.ClassLoader |
getClassLoader0()
|
CtClass |
getLocally(java.lang.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 |
java.lang.Class |
toClass(CtClass ct,
java.lang.ClassLoader loader,
java.security.ProtectionDomain domain)
Convert a javassist class to a java class |
Methods inherited from class javassist.ClassPool |
---|
appendClassPath, appendClassPath, appendPathList, appendSystemPath, clearImportedPackages, createCtClass, 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, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ScopedClassPoolRepository repository
protected java.lang.ref.WeakReference classLoader
protected LoaderClassPath classPath
protected SoftValueHashMap softcache
Constructor Detail |
---|
protected ScopedClassPool(java.lang.ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
cl
- the classloadersrc
- the original class poolrepository
- the repositoryprotected ScopedClassPool(java.lang.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 referencesMethod Detail |
---|
public java.lang.ClassLoader getClassLoader()
getClassLoader
in class ClassPool
ClassPool.toClass(CtClass)
,
CtClass.getAnnotations()
protected java.lang.ClassLoader getClassLoader0()
public void close()
public void flushClass(java.lang.String classname)
classname
- the class to flushpublic void soften(CtClass clazz)
clazz
- the classpublic boolean isUnloadedClassLoader()
protected CtClass getCached(java.lang.String classname)
getCached
in class ClassPool
classname
- the class name
ClassPool.cacheCtClass(String,CtClass,boolean)
,
ClassPool.removeCached(String)
protected void cacheCtClass(java.lang.String classname, CtClass c, boolean dynamic)
cacheCtClass
in class ClassPool
classname
- the class namec
- the ctClassdynamic
- whether the class is dynamically generatedClassPool.getCached(String)
,
#removeCached(String,CtClass)
public void lockInCache(CtClass c)
c
- the classprotected CtClass getCachedLocally(java.lang.String classname)
classname
- the class name
public CtClass getLocally(java.lang.String classname) throws NotFoundException
classname
- the class name
NotFoundException
- when the class is not foundpublic java.lang.Class toClass(CtClass ct, java.lang.ClassLoader loader, java.security.ProtectionDomain domain) throws CannotCompileException
toClass
in class ClassPool
ct
- 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |