java.lang.Object
java.lang.Thread
org.media.mn8.protocol.jabber.JabberDataBlockDispatcher
- All Implemented Interfaces:
- java.lang.Runnable
- public class JabberDataBlockDispatcher
- extends java.lang.Thread
The dispatcher for blocks that have arrived. Adds new blocks to the
dispatch queue, and then dispatches waiting blocks in their own thread to
avoid holding up the stream reader.
| Nested classes inherited from class java.lang.Thread |
java.lang.Thread.UncaughtExceptionHandler |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, 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 |
listener
private JabberListener listener
- The recipient waiting on this stream
waitingQueue
private java.util.Vector waitingQueue
- The list of messages waiting to be dispatched
dispatcherActive
private boolean dispatcherActive
- Flag to watch the dispatching loop
JabberDataBlockDispatcher
public JabberDataBlockDispatcher()
- Constructor to start the dispatcher in a thread.
setJabberListener
public void setJabberListener(JabberListener _listener)
- Set the listener that we are dispatching to. Allows for switching
of clients in mid stream.
broadcastJabberDataBlock
public void broadcastJabberDataBlock(JabberDataBlock dataBlock)
- Method to add a datablock to the dispatch queue
run
public void run()
- The thread loop that handles dispatching any waiting datablocks
halt
public void halt()
- Method to stop the dispatcher
broadcastTerminatedConnection
public void broadcastTerminatedConnection(java.lang.Exception exception)
- Method to tell the listener the connection has been terminated
broadcastBeginConversation
public void broadcastBeginConversation()
- Method to tell the listener the stream is ready for talking to.