Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache
In directory sc8-pr-cvs1:/tmp/cvs-serv16489/src-optional/org/opendoors/cache
Added Files:
Cache.java UpdateableCache.java
Log Message:
doc improvements;
moved sources to src-optional;
implemented build policy: build with webmacro.defaults.classic but with a property switch be able to build with webmacro.defaults.minimal
--- NEW FILE: Cache.java ---
/*
* Copyright Open Doors Software and Acctiva, 1996-2001.
*
* Software is provided according to the MPL license.
* Open Doors Software and Acctiva provide this
* software on an as-is basis and make no representation as
* to fitness for a specific purpose.
*
* Direct all questions and comments to su...@op...
*/
package org.opendoors.cache;
/**
* The base interface for every cache regardless of
* implementation.
* <p>
* The interface supports the basic semantics of
* a cache inluding accessor, mutator, and invalidation.
* <p>
* Specific factories and cache managers will provide
* this interface or contain the interface to provide
* caching services to applications.
* @see UpdateableCache
* @author Lane Sharman
*/
public interface Cache
{
/**
* Invalidate an object in the cache according
* to the update strategy.
*/
public void invalidate (Object key);
/**
* Invalidates all the objects in the cache in one shot.
* <p>
* The action is performed according to the update strategy
* of the implementation.
*/
public void invalidateAll ();
/**
* Put an object in the cache possibly
* updating and replacing an existing value.
* <p>
* Note: some implementations elect to defer
* this operation so the element may not
* be immediately present.
*/
public void put (Object key, Object value);
/**
* Gets a value from the cache.
* <p>
* Returning null reports that the element
* cannot be found or regenerate with the key
* provided.
*/
public Object get (Object key);
/**
* Returns all the values in the cache.
*/
public Object[] values ();
/**
* Returns all the keys in the cache.
*/
public Object[] keys ();
}
--- NEW FILE: UpdateableCache.java ---
/*
* Copyright Open Doors Software and Acctiva, 1996-2001.
*
* Software is provided according to the MPL license.
* Open Doors Software and Acctiva provide this
* software on an as-is basis and make no representation as
* to fitness for a specific purpose.
*
* Direct all questions and comments to su...@op...
*/
package org.opendoors.cache;
/**
* Some cache implementations will
* expose an explicit udpate method
* allowing clients to perform
* pending updates to the cache which
* brings the cache up-to-date with
* recent mutations to the cache.
*/
public interface UpdateableCache extends Cache
{
/**
* Updates the cache.
* <p>
* Upon completion, the cache is up to date
* w/respect to all pending updates.
*/
public void update ();
}
|