org.jabber.jabberbeans.sax
Class OutputStreamHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.jabber.jabberbeans.sax.OutputStreamHandler
All Implemented Interfaces:
java.lang.Runnable

public final class OutputStreamHandler
extends java.lang.Thread

Threaded queue for outgoing data, so that packets send asynchronously


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
OutputStreamHandler(ConnectionBean.OutputStreamInterface osi)
          Creates a new OutputStreamHandler instance.
 
Method Summary
 void handleThreadDeath(java.lang.Exception ex)
           
 void handleThreadDeath(java.lang.Exception ex, Packet p)
           
 void run()
          Thread which loops sending packets to the server, and sending out messages when the packets have been sent out
 void send(Packet p)
          Adds an element to the queue for sending.
 void setOutputStream(java.io.OutputStream out)
           
 void shutdown()
          shutdown is used to notify the thread to shutdown (such as in the case of a client-requested disconnect).
 
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

OutputStreamHandler

public OutputStreamHandler(ConnectionBean.OutputStreamInterface osi)
Creates a new OutputStreamHandler instance.

Method Detail

setOutputStream

public void setOutputStream(java.io.OutputStream out)

send

public final void send(Packet p)
Adds an element to the queue for sending.

Parameters:
p - Packet to send

shutdown

public void shutdown()
shutdown is used to notify the thread to shutdown (such as in the case of a client-requested disconnect).


handleThreadDeath

public void handleThreadDeath(java.lang.Exception ex,
                              Packet p)

handleThreadDeath

public void handleThreadDeath(java.lang.Exception ex)

run

public final void run()
Thread which loops sending packets to the server, and sending out messages when the packets have been sent out

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread