public abstract class ServerConnection
extends java.lang.Thread
Channel
to pass information and a ServerHandler
to process the message.Modifier and Type | Field and Description |
---|---|
protected java.nio.channels.Channel |
channel
The listener channel
|
protected static java.lang.String |
HTTPGSTART
Message start and end between HTTP data
|
protected static java.lang.String |
HTTPMEND |
protected static java.lang.String |
HTTPPSTART |
protected int |
port
The port to listen on
|
protected ServerHandler |
serverHandler
The server handler that processes the message
|
protected java.lang.Object |
syncOn
To synchronize on
|
protected long |
timeOut
Timeout for recieving continuous message
|
Constructor and Description |
---|
ServerConnection(java.nio.channels.Channel theChannel,
long theTimeOut,
ServerHandler theServerHandler)
Create a new instance of ServerConnection.
|
Modifier and Type | Method and Description |
---|---|
protected HttpEntity |
convertRequest(java.lang.String message)
Parse the input request string to re-construct the MethodInfo objects.
|
protected java.lang.String |
httpHeaders(HttpEntity request)
Determine of the request is an HTTP-type that requires headers at the start
and create them if it does.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected static java.lang.String HTTPGSTART
protected static java.lang.String HTTPPSTART
protected static java.lang.String HTTPMEND
protected int port
protected long timeOut
protected ServerHandler serverHandler
protected java.nio.channels.Channel channel
protected final java.lang.Object syncOn
public ServerConnection(java.nio.channels.Channel theChannel, long theTimeOut, ServerHandler theServerHandler) throws java.lang.Exception
theChannel
- the listener channel.theTimeOut
- timeout for recieving continuous message.theServerHandler
- the server handler that processes the message.java.lang.Exception
- any error.protected HttpEntity convertRequest(java.lang.String message) throws java.lang.Exception
message
- the request message, an be Xml-RPC, or Rest, for example.java.lang.Exception
- any error.protected java.lang.String httpHeaders(HttpEntity request)
request
- the message as an HttpEntity.