ecologylab.services.distributed.legacy
Class ServicesClient
java.lang.Object
ecologylab.generic.Debug
ecologylab.services.distributed.legacy.ServicesClientBase
ecologylab.services.distributed.legacy.ServicesClient
- All Implemented Interfaces:
- ClientConstants, NetworkingConstants, ServerConstants
public class ServicesClient
- extends ServicesClientBase
- implements ServerConstants
Interface Ecology Lab Distributed Computing Services framework
Client to connect to ServicesServer.
- Author:
- blake, andruid
| 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 |
| 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 |
ServicesClient
public ServicesClient(int port)
- Create a client that will connect on the provided port. Assume localhost
- Parameters:
port - The localhost port to connect.
ServicesClient
public ServicesClient(int port,
TranslationSpace messageSpace)
ServicesClient
public ServicesClient(java.lang.String server,
int port)
ServicesClient
public ServicesClient(java.lang.String server,
int port,
TranslationSpace messageSpace)
ServicesClient
public ServicesClient(java.lang.String server,
int port,
TranslationSpace messageSpace,
Scope objectRegistry)
createConnection
protected boolean createConnection()
- Specified by:
createConnection in class ServicesClientBase
toString
public java.lang.String toString()
- Overrides:
toString in class Debug
connected
public boolean connected()
- Determine if we are connected.
- Specified by:
connected in class ServicesClientBase
- Returns:
- True if connected, false if not.
disconnect
public void disconnect()
- Disconnect from the server (if connected).
- Specified by:
disconnect in class ServicesClientBase
sendMessage
public ResponseMessage sendMessage(RequestMessage requestMessage)
- Send a message to the ServicesServer to get a service performed,
- Specified by:
sendMessage in class ServicesClientBase
- Parameters:
requestMessage -
- Returns:
- The ResponseMessage from the server. This could be null, which means that
communication with the server failed. Reasons for failure include:
- 1) IOException: the socket connection broke somehow.
- 2) XmlTranslationException: The message was malformed or translation failed
strangely.
- 3) The server closed its output stream (occurs whenever a StopMessage is sent).