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) booleanprotected ScopedClassPoolRepositoryFields inherited from class javassist.ClassPool
cacheOpenedJarFile, childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository) Create a new ScopedClassPool.protectedScopedClassPool(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository, boolean isTemp) Create a new ScopedClassPool. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcacheCtClass(String classname, CtClass c, boolean dynamic) Cache a classvoidclose()Close the class poolvoidflushClass(String classname) Flush a classprotected CtClassGet the cached classprotected CtClassgetCachedLocally(String classname) Whether the class is cached in this pooledGet the class loaderprotected ClassLoadergetLocally(String classname) Get any local copy of the classbooleanWhether the classloader is loadervoidLock a class into the cachevoidSoften 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:
getClassLoaderin 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:
cacheCtClassin 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:
toClassin classClassPool- Parameters:
ct- the javassist classloader- the loaderdomain- the protection domain for the class. If it is null, the default domain created byjava.lang.ClassLoaderis used.- Throws:
CannotCompileException- for any error- See Also:
-