|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.jcoderz.commons.connector.http.transport.ClientHandler
public class ClientHandler
Handler for http client requests.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ClientHandler(Socket incoming,
int counter)
Constructor. |
|
| Method Summary | |
|---|---|
String |
getEncoding()
Gets the encoding. |
void |
haveToStop()
Checks flag indicating to stop handler thread. |
byte[] |
read(int expectedLength)
Reads the response body. |
String |
readLine()
Reads a line from InputStream. |
void |
readRequest()
Reads the request. |
protected void |
readRequestLine()
Reads the request header line. |
void |
run()
Starting handler thread. |
void |
writeResponse()
Writes the response message. |
| Methods inherited from class java.lang.Thread |
|---|
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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClientHandler(Socket incoming,
int counter)
incoming - the incoming socketcounter - the number of handler| Method Detail |
|---|
public void run()
run in interface Runnablerun in class Thread
public void readRequest()
throws Exception
Exception - in case of an error
protected void readRequestLine()
throws Exception
Exception - in case of an error
public String readLine()
throws IOException
IOException - in case of an error
public byte[] read(int expectedLength)
throws IOException
expectedLength - the expected length of body
IOException - in case of an errorpublic String getEncoding()
public void writeResponse()
throws Exception
Exception - in case of an errorpublic void haveToStop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||