|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
marquee.xmlrpc.XmlRpcServerConnection
public class XmlRpcServerConnection
Handles a connection to a client in a separate thread. The XmlRpcServerConnection threads are pooled to increase performance.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static byte[] |
CLOSE_CONNECTION
Byte array for a Close Connection header |
static byte[] |
CONTENT_LENGTH
Byte array for the Content Length header |
static byte[] |
CONTENT_TYPE
Byte array for the Content Type header |
static byte[] |
CRLF
Byte array for the end of HTTP headers mark |
static byte[] |
ERROR
Byte array for an HTTP IE header |
static byte[] |
GZIP_ENCODING
Byte array for the GZIP Encoding header |
static byte[] |
KEEP_CONNECTION
Byte array for a Keep Connection header |
static byte[] |
OK
Byte array for an HTTP OK header |
static byte[] |
SERVER
Byte array for the server header |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
XmlRpcServerConnection()
Marks the thread with a prefix and sequence number so we may trace which thread is doing what. |
Method Summary | |
---|---|
static XmlRpcServerConnection |
getConnection(XmlRpcDispatcher dispatcher)
Retrieves a connection from the pool or creates a new one, assuming we have not reached the connection limit. |
void |
handleConnection(java.net.Socket socket)
The thread executing the handleConnection() is the thread that is accepting connections in the XmlRpcServer.runAsService() method. |
static java.lang.String |
readHttpHeader(java.io.InputStream is,
byte[] httpBuffer)
Reads a string from the supplied input string. |
void |
run()
The XmlRpcServerConnection thread runs indefinitely, or until interrupted, handling XML-RPC messages on the socket assigned in handleConnection(). |
static void |
setLimits(int connectionLimit,
int poolLimit)
Sets the maximum allowed number of simultaneously active connections, and the number of connections that should be pooled. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte[] OK
public static final byte[] ERROR
public static final byte[] SERVER
public static final byte[] CLOSE_CONNECTION
public static final byte[] KEEP_CONNECTION
public static final byte[] CONTENT_TYPE
public static final byte[] GZIP_ENCODING
public static final byte[] CONTENT_LENGTH
public static final byte[] CRLF
Constructor Detail |
---|
public XmlRpcServerConnection()
Method Detail |
---|
public static XmlRpcServerConnection getConnection(XmlRpcDispatcher dispatcher)
dispatcher
- The dispatcher this connection shall use when the HTTP information ha
been extracted from the call.
public static void setLimits(int connectionLimit, int poolLimit)
Lowering the connection limit or pool limit during operation will not immediately affect the number of connections or connections in the pool. They will be decreased as requests are handled and connections are disposed after those requests.
connectionLimit
- The maximum allowed number of active connectionspoolLimit
- The number of connections to poolpublic void handleConnection(java.net.Socket socket)
socket
- The socket containing the XML-RPC post to be handled.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static java.lang.String readHttpHeader(java.io.InputStream is, byte[] httpBuffer) throws java.io.IOException
is
- The input stream to read an HTTP header from
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |