Class ClasspathCache

java.lang.Object
org.jppf.client.ClasspathCache

public final class ClasspathCache extends Object
A cache of claspath resources on the client side.
Author:
Laurent Cohen
  • Method Details

    • get

      public byte[] get(ClassLoader loader, String path)
      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

      public void put(ClassLoader loader, String path, byte[] resource)
      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

      public static ClasspathCache getInstance()
      Returns:
      the signleton instance of this cache.
    • toString

      public String toString()
      Overrides:
      toString in class Object