Package org.apache.bcel.util
Class MemorySensitiveClassPathRepository
java.lang.Object
org.apache.bcel.util.AbstractClassPathRepository
org.apache.bcel.util.MemorySensitiveClassPathRepository
- All Implemented Interfaces:
Repository
- Direct Known Subclasses:
SyntheticRepository
This repository is used in situations where a Class is created outside the realm of a ClassLoader. Classes are loaded
from the file systems using the paths specified in the given class path. By default, this is the value returned by
ClassPath.getClassPath(). This repository holds onto classes with SoftReferences, and will reload as needed, in cases
where memory sizes are important.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new MemorySensitiveClassPathRepository. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all entries from cache.Find an already defined (cached) JavaClass object by name.voidremoveClass(JavaClass clazz) Remove class from repositoryvoidstoreClass(JavaClass clazz) Store a new JavaClass instance into this Repository.Methods inherited from class org.apache.bcel.util.AbstractClassPathRepository
getClassPath, loadClass, loadClass
-
Field Details
-
loadedClasses
-
-
Constructor Details
-
MemorySensitiveClassPathRepository
Constructs a new MemorySensitiveClassPathRepository.- Parameters:
path- The class path.
-
-
Method Details
-
clear
public void clear()Clear all entries from cache.- Specified by:
clearin interfaceRepository- Specified by:
clearin classAbstractClassPathRepository
-
findClass
Find an already defined (cached) JavaClass object by name.- Specified by:
findClassin interfaceRepository- Specified by:
findClassin classAbstractClassPathRepository- Parameters:
className- The class name.- Returns:
- The JavaClass instance, or null.
-
removeClass
Remove class from repository- Specified by:
removeClassin interfaceRepository- Specified by:
removeClassin classAbstractClassPathRepository- Parameters:
clazz- The class to remove.
-
storeClass
Store a new JavaClass instance into this Repository.- Specified by:
storeClassin interfaceRepository- Specified by:
storeClassin classAbstractClassPathRepository- Parameters:
clazz- The class to store.
-