com.javageeks.gjas
Interface IServer

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
LocalServer, RMIServer

public interface IServer
extends java.io.Serializable

The "public" interface for Servers; note that the Server instance type will vary directly with the ServerManager used, in order to best support the location transparency concept. IServer serves as the Proxy to the Service instances loaded into the ServerManager; any control of the Services must come through the Server, since the client, if it tries to hold a Service instance within its own JVM for "faster" access, may be holding a stale or otherwise unstable reference.


Method Summary
 ConfigProperties getConfigInfo()
          Returns the Properties instance to use for configuration
 java.lang.String getInstanceID()
          Returns the instance ID of the wrapped Service.
 java.lang.Exception getLastError()
          Returns the last Exception thrown, if any, by the wrapped Service.
 java.lang.String getState()
          Returns the state of the wrapped Service.
 void kill()
          Kills the wrapped Service.
 boolean pause()
          Pauses the wrapped Service.
 boolean resume()
          Resumes the wrapped Service.
 void setConfigInfo(ConfigProperties info)
          Set the Properties instance for this Service
 boolean start()
          Start the wrapped Service instance.
 boolean stop()
          Stop the wrapped Service instance; as with start, the Service gets 15 seconds to stop itself before the ServerManager is free to take more drastic steps.
 

Method Detail

start

public boolean start()
Start the wrapped Service instance. Services have 15 seconds in which to either initialize, or else start a thread to perform the necessary initialization and return. If a Service fails to respond within 15 seconds of the start of its start call, the Server and/or ServerManager are free to destroy it.

stop

public boolean stop()
Stop the wrapped Service instance; as with start, the Service gets 15 seconds to stop itself before the ServerManager is free to take more drastic steps.

pause

public boolean pause()
Pauses the wrapped Service. The Service should respond within 15 seconds of the start of this call; however, failure to do so is not sufficient grounds for the ServerManager or Server to destroy it.

resume

public boolean resume()
Resumes the wrapped Service. The Service should respond within 15 seconds of the start of this call; however, failure to do so is not sufficient grounds for the ServerManager or Server to destroy it.

kill

public void kill()
Kills the wrapped Service.

getState

public java.lang.String getState()
Returns the state of the wrapped Service.

getInstanceID

public java.lang.String getInstanceID()
Returns the instance ID of the wrapped Service.

getLastError

public java.lang.Exception getLastError()
Returns the last Exception thrown, if any, by the wrapped Service.

getConfigInfo

public ConfigProperties getConfigInfo()
Returns the Properties instance to use for configuration

setConfigInfo

public void setConfigInfo(ConfigProperties info)
Set the Properties instance for this Service