|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
stella.net.Handler
stella.net.ErrorReceiver.ErrorHandler
protected class ErrorReceiver.ErrorHandler
Handles the error protocol. To allow fast-return of the
error-receiving end of the outer class, ErrorReceiver.protocol(java.net.Socket), the actual
error handling is done with a seperate class that is an extension to
Thread. It is constructed with the socket connected to the client and
a reference to the calling class. A threadgroup and a name for this
handler should also be specified. Note that changes in the handlers
name and running priority using the apropriate Thread methods
must occur prior to starting the error handler.
This thread wraps the superclass's generic I/O-Streams into BufferedReader/Writers, first to allow buffering and second to allow character stream reading (remeber our protocol is based on ascii strings).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private BufferedReader |
buffIn
The buffered reader wrapped around the socket's input stream. |
private BufferedWriter |
buffOut
The print writer wrapped around the socket's output stream. |
private boolean |
cancel
Becomes true if the protocol should be terminated. |
| Fields inherited from class stella.net.Handler |
|---|
in, out, spawner |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
ErrorReceiver.ErrorHandler(ReceiverServer spawn,
Socket client,
ThreadGroup group,
String name)
Constructs a new command-handling thread. |
| Method Summary | |
|---|---|
void |
cancel()
Indicates that the protocol submission should be terminated. |
void |
init()
Wrapps buffered readers/writers around the generic socket streams. |
protected void |
runProtocol()
The main method of the error receiver protocol. |
| Methods inherited from class stella.net.Handler |
|---|
close, run |
| 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 |
| Field Detail |
|---|
private BufferedReader buffIn
private BufferedWriter buffOut
private boolean cancel
| Constructor Detail |
|---|
protected ErrorReceiver.ErrorHandler(ReceiverServer spawn,
Socket client,
ThreadGroup group,
String name)
Handler.
spawn - A reference to the spawning receiver server.client - The client-connection socket.group - The thread group this command handler should run in.name - The name of the handler thread.| Method Detail |
|---|
public void init()
init in class Handlerpublic void cancel()
protected void runProtocol()
runProtocol in class Handler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||