|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CacheAdapter
Used in conjunction with the Cache class.
Clients should implement this interface and call setCacheAdapter on the Cache with an instance of their class.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Method Summary | |
---|---|
java.lang.Object |
getCacheElement(java.lang.Object key)
Gets the element to be stored in the cache with the given key. |
java.lang.Object[] |
getCacheElements(java.lang.Object[] keys)
Returns the array of elements corresponding to the given array of keys. |
int |
getCacheElementSize(java.lang.Object element,
java.lang.Object key)
Returns the approximate size in bytes of the given cache element. |
int |
getCacheKeySize(java.lang.Object key)
Returns the approximate size in bytes of the given cache key. |
void |
removeCacheElement(java.lang.Object element,
java.lang.Object key)
This method is called by the synchronized method Cache.remove to allow the adapter to do any related clean up, if necessary, when an element is removed from the cache. |
Field Detail |
---|
static final java.lang.String CLASS_VERSION
Method Detail |
---|
java.lang.Object getCacheElement(java.lang.Object key) throws java.lang.Exception
java.lang.Exception
- if some form of exception occurs while
attempting to retrieve the element (e.g., SQLException). Since
the type of exceptions possible depend upon the implementation of
the adapter, the interface allows for generic exceptions.java.lang.Object[] getCacheElements(java.lang.Object[] keys) throws java.lang.Exception
java.lang.Exception
- if some form of exception occurs while
attempting to retrieve the elements (e.g., SQLException). Since
the type of exceptions possible depend upon the implementation of
the adapter, the interface allows for generic exceptions.int getCacheKeySize(java.lang.Object key)
int getCacheElementSize(java.lang.Object element, java.lang.Object key)
void removeCacheElement(java.lang.Object element, java.lang.Object key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |