|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectClassPool
org.jboss.lang.javassist.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
|
Constructor Summary | |
---|---|
protected |
ScopedClassPool(java.lang.ClassLoader cl,
ClassPool src,
ScopedClassPoolRepository repository)
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 |
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)
Convert a javassist class to a java class |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 repositoryMethod Detail |
---|
public java.lang.ClassLoader getClassLoader()
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)
classname
- the class name
protected void cacheCtClass(java.lang.String classname, CtClass c, boolean dynamic)
classname
- the class namec
- the ctClassdynamic
- whether the class is dynamically generatedpublic 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) throws CannotCompileException
ct
- the javassist classloader
- the loader
CannotCompileException
- for any error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |