|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opencyc.webserver.WebServer.Task
Class Task processes a single HTTP request.
Field Summary | |
protected java.lang.String |
bodyLine
Contains the body of a POST method. |
protected java.net.Socket |
cycHtmlSocket
Client socket to the Cyc KB HTML server. |
protected java.lang.String |
methodLine
Contains the first line of a request message. |
protected java.lang.String |
notFoundPath
Contains the file request path for a not-found error message. |
protected java.io.DataOutputStream |
out
Output tcp stream. |
protected java.net.Socket |
sock
Socket for the incoming request. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
WebServer.Task(java.net.Socket sock)
Constructs a Task object. |
Method Summary | |
void |
run()
Processes the HTTP request. |
void |
writeDataBytes(byte[] bytes)
Responds to the HTTP client with data content from the requested URL. |
void |
writeTextBytes(byte[] bytes)
Respond to the HTTP client with text content from the requested URL. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.net.Socket sock
protected java.net.Socket cycHtmlSocket
protected java.io.DataOutputStream out
protected java.lang.String notFoundPath
protected java.lang.String methodLine
protected java.lang.String bodyLine
Constructor Detail |
public WebServer.Task(java.net.Socket sock)
sock
- the socket assigned for this request.Method Detail |
public void run()
run
in class java.lang.Thread
public void writeDataBytes(byte[] bytes) throws java.io.IOException
bytes
- the array of bytes from the URL.java.io.IOException
- if there is an error writing to the HTTP client.public void writeTextBytes(byte[] bytes) throws java.io.IOException
bytes
- the array of bytes from the URL.java.io.IOException
- if there is an error writing to the HTTP client.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |