|
||||||||||
| 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.ServerToClientConnection
public class ServerToClientConnection
Interface Ecology Lab Distributed Computing Services framework
Runs the connection from the server to a client.
| Field Summary | |
|---|---|
protected java.net.Socket |
incomingSocket
|
protected java.io.InputStream |
inputStream
|
protected java.io.PrintStream |
outputStreamWriter
|
protected boolean |
running
|
protected ServicesServer |
servicesServer
|
| Fields inherited from interface ecologylab.services.distributed.common.ServerConstants |
|---|
GARBAGE_CONNECTION_CLEANUP_TIMEOUT, MAX_CONNECTIONS, MAXIMUM_TRANSMISSION_ERRORS |
| 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 | |
|---|---|
ServerToClientConnection(java.net.Socket incomingSocket,
ServicesServer servicesServer)
|
|
| Method Summary | |
|---|---|
protected ResponseMessage |
performService(RequestMessage requestMessage)
Perform the service specified by the request method. |
java.lang.String |
readToMax(java.io.InputStream in)
Limit the data size and send exception if the request data is bigger than defined size. |
void |
run()
Service the client connection. |
protected void |
sendResponse(java.lang.CharSequence responseString)
|
protected boolean |
sendResponse(RequestMessage requestMessage,
ResponseMessage responseMessage)
Send the response message back to the client. |
void |
shutdown(java.util.Collection<java.lang.Object> objectsToBeNotified)
Causes this to stop accepting new requests, completes all pending requests, closes, then notifies objectsToBeNotified. |
void |
stop()
|
java.lang.String |
toString()
|
protected RequestMessage |
translateXMLStringToRequestMessage(java.lang.String messageString)
Use the ServicesServer and its ObjectRegistry to do the translation. |
| 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 |
|---|
protected java.io.InputStream inputStream
protected java.io.PrintStream outputStreamWriter
protected ServicesServer servicesServer
protected java.net.Socket incomingSocket
protected boolean running
| Constructor Detail |
|---|
public ServerToClientConnection(java.net.Socket incomingSocket,
ServicesServer servicesServer)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public java.lang.String toString()
toString in class Debugpublic final void run()
run in interface java.lang.Runnable
protected RequestMessage translateXMLStringToRequestMessage(java.lang.String messageString)
throws XMLTranslationException,
java.io.UnsupportedEncodingException
messageString -
XMLTranslationException
java.io.UnsupportedEncodingExceptionprotected ResponseMessage performService(RequestMessage requestMessage)
requestMessage -
protected boolean sendResponse(RequestMessage requestMessage,
ResponseMessage responseMessage)
throws XMLTranslationException
requestMessage - Provide context for response sending, when needed. May be
ignored in some cases.responseMessage -
XMLTranslationException
protected void sendResponse(java.lang.CharSequence responseString)
throws XMLTranslationException
XMLTranslationExceptionpublic void stop()
public java.lang.String readToMax(java.io.InputStream in)
throws java.lang.Exception
in -
java.lang.Exceptionpublic void shutdown(java.util.Collection<java.lang.Object> objectsToBeNotified)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||