|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--amber.server.application.SendThread
Thread to deal with the transmission of messages destined for the Client.
ApplicationHandler,
ComponentHandler,
amber.server.application| Field Summary | |
static long |
TerminationTimeout
Time taken for the termination routine to timeout. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
SendThread(java.lang.ThreadGroup group,
java.net.Socket socket,
ApplicationInterface parent)
Construct the thread, with it's parent class so it may pass back messages. |
|
| Method Summary | |
void |
addPacket(Packet packet)
Adds a packet for transmission to the remote client. |
void |
deactivate()
This function causes the flag to be set disabling this thread. |
ApplicationInterface |
getParent()
This function returns the parent application to which messages will be sent. |
protected void |
init(java.net.Socket socket)
Initialises the socket system for this thread. |
boolean |
isActive()
Returns whether the thread is active. |
boolean |
isOperating()
Returns the state of the thread. |
void |
restart(java.net.Socket socket)
Forces the thread to restart using the new socket. |
void |
run()
Main operating function. |
protected void |
sendQueue()
This function sends all outstanding packets in the transmission queue. |
void |
setParent(ApplicationInterface parent)
This function sets the parent application to which messages will be sent. |
void |
terminate()
This function causes the flag to be set terminating this thread. |
| 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 |
public static final long TerminationTimeout
| Constructor Detail |
public SendThread(java.lang.ThreadGroup group,
java.net.Socket socket,
ApplicationInterface parent)
group - ThreadGroup this thread belongs to.socket - Socket which is the connection to the remote client.parent - ApplicationInterface which is the parent of this thread.| Method Detail |
public void restart(java.net.Socket socket)
protected void init(java.net.Socket socket)
socket - Socket used to send the data to.public void addPacket(Packet packet)
packet - Packet to send to the client.public void run()
run in class java.lang.Thread
protected void sendQueue()
throws java.io.IOException
java.io.IOException - if there is a problem sending the packet.public void terminate()
public void deactivate()
public boolean isOperating()
public boolean isActive()
public void setParent(ApplicationInterface parent)
parent - ApplicationInterface which is to be the new parent.public ApplicationInterface getParent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||