net.sf.ehcache.store
Interface Store

All Known Implementing Classes:
DiskStore, MemoryStore

public interface Store

This is the interface for all stores. A store is a physical counterpart to a cache, which is a logical concept.

Version:
$Id: Store.java,v 1.3 2003/11/15 04:36:30 gregluck Exp $
Author:
Greg Luck

Field Summary
static int CACHE_HUB
          Composite, including memory cache, type and central hub.
static int DISK_CACHE
          Disk cache type.
static int STATUS_ALIVE
          Store alive status.
static int STATUS_DISPOSED
          Store disposed status.
static int STATUS_ERROR
          Store in error.
static int STATUS_UNINITIALISED
          Store alive status.
 
Method Summary
 void dispose()
          Prepares for shutdown.
 Element get(java.io.Serializable key)
          Gets an item from the cache.
 int getCacheType()
          Returns the cache type.
 java.lang.String getName()
          Returns the cache name.
 int getSize()
          Returns the current cache size.
 int getStatus()
          Returns the cache status.
 void put(Element element)
          Puts an item into the cache.
 boolean remove(java.io.Serializable key)
          Removes an item from the cache.
 void removeAll()
          Removes all cached items from the cache.
 

Field Detail

CACHE_HUB

public static final int CACHE_HUB
Composite, including memory cache, type and central hub.

See Also:
Constant Field Values

DISK_CACHE

public static final int DISK_CACHE
Disk cache type.

See Also:
Constant Field Values

STATUS_UNINITIALISED

public static final int STATUS_UNINITIALISED
Store alive status.

See Also:
Constant Field Values

STATUS_ALIVE

public static final int STATUS_ALIVE
Store alive status.

See Also:
Constant Field Values

STATUS_DISPOSED

public static final int STATUS_DISPOSED
Store disposed status.

See Also:
Constant Field Values

STATUS_ERROR

public static final int STATUS_ERROR
Store in error.

See Also:
Constant Field Values
Method Detail

put

public void put(Element element)
         throws java.io.IOException
Puts an item into the cache.

Throws:
java.io.IOException

get

public Element get(java.io.Serializable key)
            throws java.io.IOException
Gets an item from the cache.

Throws:
java.io.IOException

remove

public boolean remove(java.io.Serializable key)
               throws java.io.IOException
Removes an item from the cache.

Throws:
java.io.IOException

removeAll

public void removeAll()
               throws java.io.IOException
Removes all cached items from the cache.

Throws:
java.io.IOException

dispose

public void dispose()
             throws java.io.IOException
Prepares for shutdown.

Throws:
java.io.IOException

getSize

public int getSize()
Returns the current cache size.


getStatus

public int getStatus()
Returns the cache status.


getName

public java.lang.String getName()
Returns the cache name.


getCacheType

public int getCacheType()
Returns the cache type.

Returns:
The cacheType value