org.sourceforge.jemm
Interface Store

All Known Implementing Classes:
AbstractStore, MemoryStore, PersistentStore, RemoteStore

public interface Store

Main interface into the JEMM storage mechanism providing access to the root object.

Author:
Rory Graves, Paul Keeble

Method Summary
 java.lang.Object getRoot(java.lang.String rootName)
          Return the model object set for the root named 'rootName'
 void initialise()
          Called by the Session.setStore method to inform the Store that is should start.
 void setRoot(java.lang.String rootName, java.lang.Object value)
          Set the store root object with the given rootName to hold a reference to the specified model object.
 java.lang.Object setRootIfNull(java.lang.String rootName, java.lang.Object value)
          Set the store root object with the given rootName to hold a reference to the specified model object if the value is currently null.
 void shutdown()
          Shutdown should be called before the JVM is exited.
 

Method Detail

setRoot

void setRoot(java.lang.String rootName,
             java.lang.Object value)
Set the store root object with the given rootName to hold a reference to the specified model object.

Parameters:
rootName - The name of the root.
value - The model object to store.

setRootIfNull

java.lang.Object setRootIfNull(java.lang.String rootName,
                               java.lang.Object value)
Set the store root object with the given rootName to hold a reference to the specified model object if the value is currently null.

Parameters:
rootName - The name of the root.
value - The model object to store.
Returns:
The new root value, either the old one if it was not null, or the newly set one.

getRoot

java.lang.Object getRoot(java.lang.String rootName)
Return the model object set for the root named 'rootName'

Parameters:
rootName - The name of the root to fetch.
Returns:
Object reference if set, null otherwise.

shutdown

void shutdown()
Shutdown should be called before the JVM is exited. The shutdown could be called multiple times and repeated runs should always succeed. Once the store is shutdown it should be able to be reinitialised with a call to initialise.


initialise

void initialise()
Called by the Session.setStore method to inform the Store that is should start. In particular implementations should register a ConstructorListener with ConstructorLifecycle via its static methods so that object construction events are received.



Copyright © 2009. All Rights Reserved.