org.apache.excalibur.store
Interface Store

All Known Implementing Classes:
AbstractFilesystemStore, AbstractJispFilesystemStore, AbstractReadWriteStore, JispFilesystemStore, MemoryStore, MRUMemoryStore

public interface Store

A Store is an object managing arbitrary data. It holds data stored under a given key persistently. So if you put something in a store you can be sure that the next time (even if the application restarted) your data is in the store (of course unless noone else did remove it). In some cases (like for example a cache) the data needs not to be persistent. Therefore with the two role TRANSIENT_STORE and PERSISTENT_STORE you get a store with exactly that behaviour.

Version:
CVS $Id: Store.java,v 1.5 2004/02/28 11:47:34 cziegeler Exp $
Author:
Avalon Development Team

Field Summary
static String PERSISTENT_STORE
          The role for a persistent store
static String ROLE
          The role for a persistent store
static String TRANSIENT_STORE
          The role for a transient store
 
Method Summary
 void clear()
          Clear the Store of all data it holds
 boolean containsKey(Object key)
          Indicates if the given key is associated to a contained object.
 void free()
          Try to free some used memory.
 Object get(Object key)
          Get the object associated to the given unique key.
 Enumeration keys()
          Returns the list of used keys as an Enumeration of Objects.
 void remove(Object key)
          Remove the object associated to the given key.
 int size()
          Returns count of the objects in the store, or -1 if could not be obtained.
 void store(Object key, Object value)
          Store the given object.
 

Field Detail

ROLE

static final String ROLE
The role for a persistent store


TRANSIENT_STORE

static final String TRANSIENT_STORE
The role for a transient store


PERSISTENT_STORE

static final String PERSISTENT_STORE
The role for a persistent store

Method Detail

get

Object get(Object key)
Get the object associated to the given unique key.


store

void store(Object key,
           Object value)
           throws IOException
Store the given object. It is up to the caller to ensure that the key has a persistent state across different JVM executions.

Throws:
IOException

free

void free()
Try to free some used memory. The transient store can simply remove some hold data, the persistent store can free all memory by writing the data to a persistent store etc.


remove

void remove(Object key)
Remove the object associated to the given key.


clear

void clear()
Clear the Store of all data it holds


containsKey

boolean containsKey(Object key)
Indicates if the given key is associated to a contained object.


keys

Enumeration keys()
Returns the list of used keys as an Enumeration of Objects.


size

int size()
Returns count of the objects in the store, or -1 if could not be obtained.



Copyright © 1997-2012 The Apache Software Foundation. All Rights Reserved.