Package javassist.scopedpool
Class ScopedClassPool
java.lang.Object
javassist.ClassPool
javassist.scopedpool.ScopedClassPool
A scoped class pool.
- Version:
- $Revision: 1.8 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Reference
<ClassLoader> protected LoaderClassPath
(package private) boolean
protected ScopedClassPoolRepository
Fields inherited from class javassist.ClassPool
cacheOpenedJarFile, childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cacheCtClass
(String classname, CtClass c, boolean dynamic) Cache a classvoid
close()
Close the class poolvoid
flushClass
(String classname) Flush a classprotected CtClass
Get the cached classprotected CtClass
getCachedLocally
(String classname) Whether the class is cached in this pooledGet the class loaderprotected ClassLoader
getLocally
(String classname) Get any local copy of the classboolean
Whether the classloader is loadervoid
Lock a class into the cachevoid
Soften a classClass
<?> toClass
(CtClass ct, ClassLoader loader, ProtectionDomain domain) Convert a javassist class to a java classMethods inherited from class javassist.ClassPool
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, toClass, toClass, toClass, toString
-
Field Details
-
repository
-
classLoader
-
classPath
-
softcache
-
isBootstrapCl
boolean isBootstrapCl
-
-
Constructor Details
-
ScopedClassPool
Create a new ScopedClassPool.- Parameters:
cl
- the classloadersrc
- the original class poolrepository
- the repository
-
ScopedClassPool
protected ScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, boolean isTemp) Create a new ScopedClassPool.- Parameters:
cl
- the classloadersrc
- the original class poolrepository
- the repositoryisTemp
- Whether this is a temporary pool used to resolve references
-
-
Method Details
-
getClassLoader
Get the class loader- Overrides:
getClassLoader
in classClassPool
- Returns:
- the class loader
- See Also:
-
getClassLoader0
-
close
public void close()Close the class pool -
flushClass
Flush a class- Parameters:
classname
- the class to flush
-
soften
Soften a class- Parameters:
clazz
- the class
-
isUnloadedClassLoader
public boolean isUnloadedClassLoader()Whether the classloader is loader- Returns:
- false always
-
getCached
Get the cached class -
cacheCtClass
Cache a class- Overrides:
cacheCtClass
in classClassPool
- Parameters:
classname
- the class namec
- the ctClassdynamic
- whether the class is dynamically generated- See Also:
-
lockInCache
Lock a class into the cache- Parameters:
c
- the class
-
getCachedLocally
Whether the class is cached in this pooled- Parameters:
classname
- the class name- Returns:
- the cached class
-
getLocally
Get any local copy of the class- Parameters:
classname
- the class name- Returns:
- the class
- Throws:
NotFoundException
- when the class is not found
-
toClass
public Class<?> toClass(CtClass ct, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException Convert a javassist class to a java class- Overrides:
toClass
in classClassPool
- Parameters:
ct
- the javassist classloader
- the loaderdomain
- the protection domain for the class. If it is null, the default domain created byjava.lang.ClassLoader
is used.- Throws:
CannotCompileException
- for any error- See Also:
-