org.enhydra.shark.api.internal.caching
Interface ObjectCache

All Known Subinterfaces:
ProcessCache, ResourceCache

public interface ObjectCache

Interface for basic cache methods.

Author:
Sasa Bojanic, Tanja Jovanovic

Method Summary
 void configure(CallbackUtilities cus)
          Configures cache.
 java.util.List getAll()
          Returns all values from the cache.
 int getSize()
          Returns the size of the cache.
 int howManyEntries()
          Returns the number of entries in the cache.
 void setSize(int size)
          Sets size of the cache to value size.
 

Method Detail

configure

public void configure(CallbackUtilities cus)
               throws java.lang.Exception
Configures cache.

Parameters:
cus - an instance of CallbackUtilities used to get properties for configuring cache.
Throws:
java.lang.Exception - Thrown if an error occurs.

setSize

public void setSize(int size)
             throws java.lang.Exception
Sets size of the cache to value size. The value 0 means that the cache is disabled. The negative value means that the cache is unbounded. The positive number defines max number of cache entries.

Parameters:
size - new size of the cache.
Throws:
java.lang.Exception - Thrown if an error occurs.

getSize

public int getSize()
            throws java.lang.Exception
Returns the size of the cache.

Returns:
Size of the cache.
Throws:
java.lang.Exception - Thrown if an error occurs.

howManyEntries

public int howManyEntries()
                   throws java.lang.Exception
Returns the number of entries in the cache.

Returns:
The number of entries in the cache.
Throws:
java.lang.Exception - Thrown if an error occurs.

getAll

public java.util.List getAll()
                      throws java.lang.Exception
Returns all values from the cache.

Returns:
All values from the cache as List.
Throws:
java.lang.Exception - Thrown if an error occurs.