|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--gumbo.net.NetThread | +--gumbo.net.msg.MessageThread
Abstract base class for network threads intended for messaging using Gumbo's message protocol (see Message). Includes a default message router with a ping responder.
Field Summary |
Fields inherited from class gumbo.net.NetThread |
DEFAULT_PROXY_HOST, DEFAULT_PROXY_PORT, DEFAULT_SERVER_HOST, DEFAULT_SERVER_PORT |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
MessageThread(java.lang.String appName)
|
Method Summary | |
protected void |
closeMessageReader()
Closes the thread's dynamic message reader. |
protected void |
closeMessageWriter()
Closes the thread's dynamic message writer. |
MessageReader |
getMessageReader()
Gets the thread's dynamic message reader, which is set and updated at run time. |
MessageRouter |
getMessageRouter()
Gets the thread's static message router, which is set at init time. |
MessageWriter |
getMessageWriter()
Gets the thread's dynamic message writer, which is set and updated at run time. |
protected void |
implPleaseStop()
Called by pleaseStop() after setting the stop flag true. |
protected MessageReader |
newMessageReader()
Returns a new message reader for this thread's current client connection. |
protected MessageWriter |
newMessageWriter()
Returns a new message writer for this thread's current client connection. |
protected void |
setMessageReader(MessageReader reader)
Sets the thread's dynamic message reader. |
protected void |
setMessageWriter(MessageWriter writer)
Sets the thread's message writer. |
void |
showPingStatus(java.awt.Component parent,
MsgPingStatus msg)
Shows a dialog with ping status information. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, 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 |
Constructor Detail |
public MessageThread(java.lang.String appName)
appName
- Name of the app associated with this thread (for status
messages). If null, a default is used.Method Detail |
public final MessageRouter getMessageRouter()
public final MessageReader getMessageReader()
protected final void setMessageReader(MessageReader reader)
protected final void closeMessageReader()
public final MessageWriter getMessageWriter()
protected final void setMessageWriter(MessageWriter writer)
protected final void closeMessageWriter()
public void showPingStatus(java.awt.Component parent, MsgPingStatus msg)
parent
- Dialog parent component. Null if none.msg
- The ping status message. Never null.protected MessageReader newMessageReader() throws java.io.IOException
Note that on some systems the ObjectMessageWriter must be created for the socket before the ObjectMessageReader, otherwise the thread will hang. Also, a DataInputStream is used to wrap the socket to assure machine-independence.
java.io.IOException
protected MessageWriter newMessageWriter() throws java.io.IOException
Note that on some systems the ObjectMessageWriter must be created for the socket before the ObjectMessageReader, otherwise the thread will hang. Also, a DataOutputStream is used to wrap the socket to assure machine-independence.
java.io.IOException
protected void implPleaseStop()
NetThread
implPleaseStop
in class NetThread
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |