Package org.jppf.client
Class ClasspathCache
java.lang.Object
org.jppf.client.ClasspathCache
A cache of claspath resources on the client side.
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the cache.byte[]get(ClassLoader loader, String path) Get a resource at the specified path of the specified class loader's classpath.longCompute the cache size.static ClasspathCachevoidput(ClassLoader loader, String path, byte[] resource) Add a classpath resource to the cache..toString()
-
Method Details
-
get
Get a resource at the specified path of the specified class loader's classpath.- Parameters:
loader- the class loader to lookup.path- the resource path.- Returns:
- an array of bytes containing the rsource content.
-
put
Add a classpath resource to the cache..- Parameters:
loader- the class loader to lookup.path- the resource path.resource- the byte content of the resource.
-
clear
public void clear()Clear the cache. -
getCacheSize
public long getCacheSize()Compute the cache size.- Returns:
- the total number of esources in the cache.
-
getInstance
- Returns:
- the signleton instance of this cache.
-
toString
-