|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.tranche.httpd.SocketHandler
public class SocketHandler
This class services the next socket from the queue. From the HTTP request it looksup the appropriate AbstractHttpHandler. It then initializes the state of the handler. Currently on HTTP-GET is supported.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static boolean |
DEBUG
Debug flag reserved for midium level of stdout vebrocity. |
static boolean |
DEBUG_VERBOSE
Debug flag reserver for a higher level of stdout vebrocity. |
static boolean |
ECHO
Flag for debugging an input stream. |
static int |
READ_AHEAD
Size to be used in marking an input stream. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Fields inherited from interface org.tranche.httpd.IFileResources |
|---|
HTTP_PAGE_DIRECTORY, HTTP_PROPERTIES_DIRECTORY, HTTP_RESPONSE_MESSAGES_PROP_FILE, LOCALE |
| Constructor Summary | |
|---|---|
SocketHandler(Queue queue,
int threadNumber)
Constructor |
|
| Method Summary | |
|---|---|
void |
dropConnection()
Cleans up any streams to the sockets and sets the working state to false. |
void |
finilize()
Drops connections if this object is about to be deleted. |
boolean |
isWorking()
Getter method for isWorking attribute. |
void |
killThread()
Sets the isRunning variable to false. |
void |
run()
The main loop of this thread is acomplished. |
protected void |
sendError(HttpConstant errorNumber,
java.lang.String errorDetails)
Helper method for reporting any errors. |
| 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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final boolean DEBUG_VERBOSE
public static final boolean ECHO
public static final int READ_AHEAD
| Constructor Detail |
|---|
public SocketHandler(Queue queue,
int threadNumber)
queue - Reference to the queue to look for sockets to servicethreadNumber - The thread number assigned by the calling object to this object| Method Detail |
|---|
public void finilize()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic boolean isWorking()
public void killThread()
public void dropConnection()
protected void sendError(HttpConstant errorNumber,
java.lang.String errorDetails)
throws java.io.IOException
errorNumber - The HTTP error number.errorDetails - A description of the error
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||