net.sf.jso.engine
Class JSOEnvironment

java.lang.Object
  extended bynet.sf.jso.engine.JSOEnvironment
All Implemented Interfaces:
StorageEnvironment

public class JSOEnvironment
extends java.lang.Object
implements StorageEnvironment

Class that represents the storage environment of an application.


Constructor Summary
JSOEnvironment()
           
 
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.
static void main(java.lang.String[] args)
          Starts a distributed application.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSOEnvironment

public JSOEnvironment()
Method Detail

startLocal

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

Specified by:
startLocal in interface StorageEnvironment
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.

Specified by:
startLocalShared in interface StorageEnvironment
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.

Specified by:
startDistributed in interface StorageEnvironment
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.

Specified by:
startDistributed in interface StorageEnvironment
Parameters:
appName - Application's name.
Throws:
StorageException

stop

public void stop()
          throws StorageException
Stops either a storage controller or a storage manager.

Specified by:
stop in interface StorageEnvironment
Throws:
StorageException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Starts a distributed application. args[0] must contain application's name.

Throws:
java.lang.Exception
See Also:
startDistributed(String)

getController

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

Specified by:
getController in interface StorageEnvironment
Returns:
Applications's storage controller.

getManager

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

Specified by:
getManager in interface StorageEnvironment
Returns:
Local node's storage manager.

getApplicationName

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

Specified by:
getApplicationName in interface StorageEnvironment
Returns:
Application's name or null if applications is local.