br.shob.storage
Interface Storage

All Known Implementing Classes:
MemoryMapStorage

public interface Storage

This interface describes the pluggable storage mechanism for SharedObjects. It is so simple that it requires little explanation: it maps SharedObject instances to global names.

Since:
September 8, 2002
Author:
dukejeffrie
Created:
September 8, 2002

Method Summary
 boolean contains(String globalName)
          Checks if an object is associated with the given global name in the storage
 SharedObject get(String globalName)
          Retrieves the object associated with the given global name from the storage
 List getDescriptorList()
          This method should return a list of SharedObjectDescriptors for all the objects stored (Optional operation).
 SharedObject put(String globalName, SharedObject obj)
          Saves the object to the storage.
 SharedObject remove(String globalName)
          Removes the object from the storage permanently
 

Method Detail

put

public SharedObject put(String globalName,
                        SharedObject obj)
                 throws StorageException
Saves the object to the storage. If there is already an object for the given key, it must be replaced. There is no restriction to null objects.

Parameters:
globalName - the global name associated with this object
obj - the actual object to be stored
Returns:
The old value, if any
Throws:
StorageException - when a storage error occurs

get

public SharedObject get(String globalName)
                 throws StorageException
Retrieves the object associated with the given global name from the storage

Parameters:
globalName - the global name associated with this object
Returns:
the actual object in the storage
Throws:
StorageException - when a storage error occurs

remove

public SharedObject remove(String globalName)
                    throws StorageException
Removes the object from the storage permanently

Parameters:
globalName - the global name associated with this object
Returns:
The previous value stored, if any
Throws:
StorageException - when a storage error occurs

contains

public boolean contains(String globalName)
                 throws StorageException
Checks if an object is associated with the given global name in the storage

Parameters:
globalName - the global name associated with this object
Returns:
true when an object associated with this global name is stored, false otherwise
Throws:
StorageException - when a storage error occurs

getDescriptorList

public List getDescriptorList()
                       throws StorageException
This method should return a list of SharedObjectDescriptors for all the objects stored (Optional operation).

Returns:
The descriptorList value
Throws:
StorageException - when a storage error occurs