|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.services.distributed.legacy.ServicesServerBase
ecologylab.services.distributed.legacy.ServicesServer
public class ServicesServer
Interface Ecology Lab Distributed Computing Services framework
Multi-threaded services server. Accepts XML RequestMessages via TCP/IP. Translates these into ElementState objects via ecologylab.xml (using reflection). Performs services based on the messages, and acknowledges with responses. In some cases, you may wish to extend this class to provided application specific functionalities. In many cases, all you will need to do is define your messaging semantics, and let the framework do the work.
| Field Summary | |
|---|---|
static int |
HTTP_GET_SERVER
|
static int |
HTTP_POST_SERVER
|
static int |
NORMAL_SERVER
|
| Fields inherited from class ecologylab.services.distributed.legacy.ServicesServerBase |
|---|
connectionCount, finished, objectRegistry, portNumber, requestTranslationSpace, serverListeners, serverSocket, shuttingDown |
| Constructor Summary | |
|---|---|
protected |
ServicesServer(int portNumber,
int serverType,
TranslationSpace requestTranslationSpace,
Scope objectRegistry)
Create a services server, that listens on the specified port, and uses the specified TranslationSpaces for operating on messages. |
| Method Summary | |
|---|---|
protected void |
connectionTerminated(ServerToClientConnection serverToClientConnection)
Remove the argument passed in from the set of connections we know about. |
static ServicesServer |
get(int portNumber,
int serverType,
TranslationSpace requestTranslationSpace,
Scope objectRegistry)
This is the actual way to create an instance of this. |
protected ServerToClientConnection |
getConnection(java.net.Socket incomingSocket)
Create a ServerToClientConnection, the object that handles the connection to each incoming client. |
static int |
parseHeader(java.lang.String header)
Parses the header to an incoming RequestMessage to determine the length of the message, which it returns. |
void |
run()
|
void |
shutdown()
See ecologylab.services.ServicesServerBase#shutdownAndNotify(java.util.Collection) |
void |
start()
|
void |
start(int priority)
Start the ServicesServer, at the specified priority. |
void |
stop()
|
java.lang.String |
toString()
|
RequestMessage |
translateXMLStringToRequestMessage(java.lang.String messageString,
boolean doRecursiveDescent)
|
| Methods inherited from class ecologylab.services.distributed.legacy.ServicesServerBase |
|---|
addServerListener, connectionTerminated, fireServerEvent, generateSessionToken, getAddress, getObjectRegistry, getPortNumber, getRequestTranslationSpace, performService, terminationAction |
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NORMAL_SERVER
public static final int HTTP_POST_SERVER
public static final int HTTP_GET_SERVER
| Constructor Detail |
|---|
protected ServicesServer(int portNumber,
int serverType,
TranslationSpace requestTranslationSpace,
Scope objectRegistry)
throws java.io.IOException,
java.net.BindException
portNumber - serverType - translationSpace - objectRegistry - Provides a context for request processing.
java.io.IOException
java.net.BindException| Method Detail |
|---|
public static ServicesServer get(int portNumber,
int serverType,
TranslationSpace requestTranslationSpace,
Scope objectRegistry)
portNumber - serverType - TODOtranslationSpace - objectRegistry - TODO
public java.lang.String toString()
toString in class Debugprotected void connectionTerminated(ServerToClientConnection serverToClientConnection)
serverToClientConnection - public void run()
protected ServerToClientConnection getConnection(java.net.Socket incomingSocket)
throws java.io.IOException
incomingSocket -
java.io.IOException
public RequestMessage translateXMLStringToRequestMessage(java.lang.String messageString,
boolean doRecursiveDescent)
throws XMLTranslationException
translateXMLStringToRequestMessage in class ServicesServerBaseXMLTranslationExceptionpublic void start(int priority)
priority - public void stop()
public void start()
public void shutdown()
public static int parseHeader(java.lang.String header)
throws java.lang.IllegalStateException,
java.lang.IndexOutOfBoundsException
header -
java.lang.IllegalStateException
java.lang.IndexOutOfBoundsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||