org.opendoors.cache
Interface Cache

All Known Subinterfaces:
UpdateableCache

public interface Cache

The base interface for every cache regardless of implementation.

The interface supports the basic semantics of a cache inluding accessor, mutator, and invalidation.

Specific factories and cache managers will provide this interface or contain the interface to provide caching services to applications.

Author:
Lane Sharman
See Also:
UpdateableCache

Method Summary
 java.lang.Object get(java.lang.Object key)
          Gets a value from the cache.
 void invalidate(java.lang.Object key)
          Invalidate an object in the cache according to the update strategy.
 void invalidateAll()
          Invalidates all the objects in the cache in one shot.
 java.lang.Object[] keys()
          Returns all the keys in the cache.
 void put(java.lang.Object key, java.lang.Object value)
          Put an object in the cache possibly updating and replacing an existing value.
 java.lang.Object[] values()
          Returns all the values in the cache.
 

Method Detail

invalidate

public void invalidate(java.lang.Object key)
Invalidate an object in the cache according to the update strategy.

invalidateAll

public void invalidateAll()
Invalidates all the objects in the cache in one shot.

The action is performed according to the update strategy of the implementation.


put

public void put(java.lang.Object key,
                java.lang.Object value)
Put an object in the cache possibly updating and replacing an existing value.

Note: some implementations elect to defer this operation so the element may not be immediately present.


get

public java.lang.Object get(java.lang.Object key)
Gets a value from the cache.

Returning null reports that the element cannot be found or regenerate with the key provided.


values

public java.lang.Object[] values()
Returns all the values in the cache.

keys

public java.lang.Object[] keys()
Returns all the keys in the cache.