br.shob.storage
Class MemoryMapStorage

java.lang.Object
  |
  +--br.shob.storage.MemoryMapStorage
All Implemented Interfaces:
Storage

public class MemoryMapStorage
extends Object
implements Storage


Constructor Summary
MemoryMapStorage()
           
MemoryMapStorage(Map map)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryMapStorage

public MemoryMapStorage(Map map)

MemoryMapStorage

public MemoryMapStorage()
Method Detail

put

public SharedObject put(String globalName,
                        SharedObject obj)
Description copied from interface: Storage
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.

Specified by:
put in interface Storage
Parameters:
globalName - the global name associated with this object
obj - the actual object to be stored
Returns:
The old value, if any

get

public SharedObject get(String globalName)
Description copied from interface: Storage
Retrieves the object associated with the given global name from the storage

Specified by:
get in interface Storage
Parameters:
globalName - the global name associated with this object
Returns:
the actual object in the storage

remove

public SharedObject remove(String globalName)
Description copied from interface: Storage
Removes the object from the storage permanently

Specified by:
remove in interface Storage
Parameters:
globalName - the global name associated with this object
Returns:
The previous value stored, if any

contains

public boolean contains(String globalName)
Description copied from interface: Storage
Checks if an object is associated with the given global name in the storage

Specified by:
contains in interface Storage
Parameters:
globalName - the global name associated with this object
Returns:
true when an object associated with this global name is stored, false otherwise

getDescriptorList

public List getDescriptorList()
Description copied from interface: Storage
This method should return a list of SharedObjectDescriptors for all the objects stored (Optional operation).

Specified by:
getDescriptorList in interface Storage
Returns:
The descriptorList value