org.media.mn8.protocol.jabber
Class JabberDataBlockDispatcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.media.mn8.protocol.jabber.JabberDataBlockDispatcher
All Implemented Interfaces:
Runnable

public class JabberDataBlockDispatcher
extends 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.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JabberDataBlockDispatcher()
          Constructor to start the dispatcher in a thread.
 
Method Summary
 void broadcastBeginConversation()
          Method to tell the listener the stream is ready for talking to.
 void broadcastJabberDataBlock(JabberDataBlock dataBlock)
          Method to add a datablock to the dispatch queue
 void broadcastTerminatedConnection(Exception exception)
          Method to tell the listener the connection has been terminated
 void halt()
          Method to stop the dispatcher
 void run()
          The thread loop that handles dispatching any waiting datablocks
 void setJabberListener(JabberListener _listener)
          Set the listener that we are dispatching to.
 
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, 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

JabberDataBlockDispatcher

public JabberDataBlockDispatcher()
Constructor to start the dispatcher in a thread.

Method Detail

setJabberListener

public void setJabberListener(JabberListener _listener)
Set the listener that we are dispatching to. Allows for switching of clients in mid stream.

Parameters:
_listener - The listener to dispatch to.

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

Specified by:
run in interface Runnable
Overrides:
run in class Thread

halt

public void halt()
Method to stop the dispatcher


broadcastTerminatedConnection

public void broadcastTerminatedConnection(Exception exception)
Method to tell the listener the connection has been terminated

Parameters:
exception - The exception that caused the termination. This may be null for the situtations where the connection has terminated without an exception.

broadcastBeginConversation

public void broadcastBeginConversation()
Method to tell the listener the stream is ready for talking to.



"Copyright © 2000-2002 Internet Multicasting Services, media.org & noLimits Technologies. All Rights Reserved."