public class LruCacheClassPathRepository extends Object
JavaClass with maximum size cacheSize.
This repository supports a class path consisting of too many JAR files to handle in ClassPathRepository or
MemorySensitiveClassPathRepository without causing OutOfMemoryError.
| Constructor and Description |
|---|
LruCacheClassPathRepository(ClassPath path,
int cacheSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all entries from cache.
|
JavaClass |
findClass(String className)
Finds the class with the name provided, if the class isn't there, return NULL.
|
ClassPath |
getClassPath()
Gets the ClassPath associated with this Repository
|
JavaClass |
loadClass(Class<?> clazz)
Finds the JavaClass object for a runtime Class object.
|
JavaClass |
loadClass(String className)
Finds a JavaClass object by name.
|
void |
removeClass(JavaClass javaClass)
Removes class from repository
|
void |
storeClass(JavaClass javaClass)
Stores the provided class under "clazz.getClassName()"
|
public LruCacheClassPathRepository(ClassPath path, int cacheSize)
public void clear()
Repositoryclear in interface Repositorypublic JavaClass findClass(String className)
RepositoryfindClass in interface Repositorypublic void removeClass(JavaClass javaClass)
RepositoryremoveClass in interface Repositorypublic void storeClass(JavaClass javaClass)
RepositorystoreClass in interface Repositorypublic ClassPath getClassPath()
RepositorygetClassPath in interface Repositorypublic JavaClass loadClass(Class<?> clazz) throws ClassNotFoundException
loadClass in interface Repositoryclazz - the runtime Class objectClassNotFoundException - if the class is not in the Repository, and its representation could not be foundClasspublic JavaClass loadClass(String className) throws ClassNotFoundException
loadClass in interface RepositoryclassName - the name of the classClassNotFoundException - if the class is not in the Repository, and could not be found on the classpathCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.