|
||||||||||
| 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.ServicesClientBase
public abstract class ServicesClientBase
Abstract base class for building ecologylab.services clients.
| Field Summary | |
|---|---|
protected Scope |
objectRegistry
|
protected int |
port
|
protected java.lang.String |
server
|
protected java.net.Socket |
socket
|
protected TranslationSpace |
translationSpace
|
| Fields inherited from interface ecologylab.services.distributed.common.ClientConstants |
|---|
RECONNECT_ATTEMPTS, WAIT_BEWTEEN_RECONNECT_ATTEMPTS |
| Fields inherited from interface ecologylab.services.distributed.common.NetworkingConstants |
|---|
CHARACTER_ENCODING, CONTENT_LENGTH_STRING, CONTENT_LENGTH_STRING_LENGTH, DECODER, ENCODER, HTTP_HEADER_LINE_DELIMITER, HTTP_HEADER_TERMINATOR, MAX_HTTP_HEADER_LENGTH, MAX_PACKET_SIZE_BYTES, MAX_PACKET_SIZE_CHARACTERS, UNIQUE_IDENTIFIER_STRING |
| Constructor Summary | |
|---|---|
ServicesClientBase(java.lang.String server,
int port,
TranslationSpace messageSpace,
Scope objectRegistry)
|
|
| Method Summary | |
|---|---|
boolean |
connect()
Connect to the server (if not already connected). |
abstract boolean |
connected()
|
protected abstract boolean |
createConnection()
|
abstract void |
disconnect()
|
long |
generateUid()
Increments the internal tracker of the next UID, and returns the current one. |
java.lang.String |
getServer()
|
long |
getUidNoIncrement()
As getUid(), but does not increment the internal uidIndex. |
boolean |
isServerRunning()
Check to see if the server is running. |
protected void |
processResponse(ResponseMessage responseMessage)
|
abstract ResponseMessage |
sendMessage(RequestMessage request)
Performs a blocking send: sends request, waits for a ResponseMessage, processes the response, then returns it. |
void |
setServer(java.lang.String server)
|
protected ResponseMessage |
translateXMLStringToResponseMessage(java.lang.String messageString)
Use the ServicesClient and its NameSpace to do the translation. |
ResponseMessage |
translateXMLStringToResponseMessage(java.lang.String messageString,
boolean doRecursiveDescent)
|
void |
waitForConnect()
Try and connect to the server. |
| 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, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.net.Socket socket
protected int port
protected java.lang.String server
protected TranslationSpace translationSpace
protected Scope objectRegistry
| Constructor Detail |
|---|
public ServicesClientBase(java.lang.String server,
int port,
TranslationSpace messageSpace,
Scope objectRegistry)
| Method Detail |
|---|
protected void processResponse(ResponseMessage responseMessage)
public boolean connect()
public abstract void disconnect()
public abstract boolean connected()
protected abstract boolean createConnection()
public abstract ResponseMessage sendMessage(RequestMessage request)
request - the request to send to the server.
public boolean isServerRunning()
public void waitForConnect()
protected ResponseMessage translateXMLStringToResponseMessage(java.lang.String messageString)
throws XMLTranslationException
messageString -
XMLTranslationException
public ResponseMessage translateXMLStringToResponseMessage(java.lang.String messageString,
boolean doRecursiveDescent)
throws XMLTranslationException
XMLTranslationExceptionpublic long generateUid()
public long getUidNoIncrement()
public java.lang.String getServer()
public void setServer(java.lang.String server)
server - The server to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||