org.apache.cocoon.components.store
Interface Store

All Superinterfaces:
org.apache.avalon.framework.component.Component
All Known Implementing Classes:
FilesystemStore, JispFilesystemStore, MRUMemoryStore, MemoryStore

public interface Store
extends org.apache.avalon.framework.component.Component

Version:
CVS $Id: Store.java,v 1.6 2002/02/22 07:00:13 cziegeler Exp $
Author:
Federico Barbieri (Betaversion Productions), Stefano Mazzocchi (Apache Software Foundation), Pierpaolo Fumagalli (Apache Software Foundation, Exoffice Technologies)

Field Summary
static java.lang.String PERSISTENT_CACHE
           
static java.lang.String ROLE
           
static java.lang.String TRANSIENT_CACHE
           
 
Method Summary
 boolean containsKey(java.lang.Object key)
          Indicates if the given key is associated to a contained object.
 void free()
           
 java.lang.Object get(java.lang.Object key)
          Get the object associated to the given unique key.
 void hold(java.lang.Object key, java.lang.Object value)
          Holds the given object in a volatile state.
 java.util.Enumeration keys()
          Returns the list of used keys as an Enumeration of Objects.
 void remove(java.lang.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(java.lang.Object key, java.lang.Object value)
          Store the given object in a persistent state.
 

Field Detail

ROLE

public static final java.lang.String ROLE

TRANSIENT_CACHE

public static final java.lang.String TRANSIENT_CACHE

PERSISTENT_CACHE

public static final java.lang.String PERSISTENT_CACHE
Method Detail

get

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

store

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

hold

public void hold(java.lang.Object key,
                 java.lang.Object value)
          throws java.io.IOException
Holds the given object in a volatile state. This means the object store will discard held objects if the virtual machine is restarted or some error happens.

free

public void free()

remove

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

containsKey

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

keys

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

size

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


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.