net.sf.jso
Interface StorageEnvironment

All Known Implementing Classes:
JSOEnvironment

public interface StorageEnvironment

Class that represents the storage environment of an application. An environment is formed of one storage controller and zero, one or more storage managers. Storage controller coordinates transactions and storage schema, while storage managers perform storage operations.

A StorageEnvironment instance holds references (local or remote) to application's storage controller and storage manager. If application is local only one storage manger will run and startLocal() method should be used. If application is distributed along various nodes StorageEnvironment instances will hold references to application's storage controller and local node's storage manager. startLocalShared(String appName) method starts both controller and manager and references hold by StorageEnvironment instance are local. startDistributed(String host, String appName) starts a manager in the current node (local reference) and points to application's controller run host's node. Optionally local node may run only application's controller, started by startDistributed(String appName).

Configuration files manager.properties and controller.properties are used to load configuration properties. These files must be at application's current directory.

stop() method will stop entire application if this StorageEnvironment instance started application's controller or only current node's manager otherwise.

See Also:
StorageController, StorageManager

Method Summary
 java.lang.String getApplicationName()
          Return application's name.
 StorageController getController()
          Returns applications's storage controller.
 StorageManager getManager()
          Returns local node's storage manager.
 void startDistributed(java.lang.String appName)
          Starts a storage controller in the current JVM and binds it to local node's object registry, so that it become available to other nodes.
 void startDistributed(java.lang.String host, java.lang.String appName)
          Starts a storage manager and points to a storage controller bound to a specific host's object registry.
 void startLocal()
          Starts a storage manager and a storage controller in the current JVM.
 void startLocalShared(java.lang.String appName)
          Starts a storage manager and a storage controller in the current JVM, but binds controller to local node's object registry, so that it become available to other nodes.
 void stop()
          Stops either a storage controller or a storage manager.
 

Method Detail

startLocal

public void startLocal()
                throws StorageException
Starts a storage manager and a storage controller in the current JVM.

Throws:
StorageException

startLocalShared

public void startLocalShared(java.lang.String appName)
                      throws StorageException
Starts a storage manager and a storage controller in the current JVM, but binds controller to local node's object registry, so that it become available to other nodes.

Parameters:
appName - Application's name.
Throws:
StorageException

startDistributed

public void startDistributed(java.lang.String host,
                             java.lang.String appName)
                      throws StorageException
Starts a storage manager and points to a storage controller bound to a specific host's object registry.

Parameters:
host - Node that hosts object registry to which controller is bound.
appName - Application's name.
Throws:
StorageException

startDistributed

public void startDistributed(java.lang.String appName)
                      throws StorageException
Starts a storage controller in the current JVM and binds it to local node's object registry, so that it become available to other nodes. No storage manager is started.

Parameters:
appName - Application's name.
Throws:
StorageException

stop

public void stop()
          throws StorageException
Stops either a storage controller or a storage manager. If a storage controller has been started by this enviroment instance it is stopped. If only a storage manager has been started by this enviroment instance then it is stopped.

Throws:
StorageException

getController

public StorageController getController()
Returns applications's storage controller.

Returns:
Applications's storage controller.

getManager

public StorageManager getManager()
Returns local node's storage manager.

Returns:
Local node's storage manager.

getApplicationName

public java.lang.String getApplicationName()
Return application's name.

Returns:
Application's name or null if applications is local.