org.jabber.jabberbeans.sax
Class InputStreamHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.jabber.jabberbeans.sax.InputStreamHandler

public final class InputStreamHandler
extends java.lang.Thread

Creates a thread and handles the input part of an XMLStream via a SAX parser

Version:
$Revision: 1.1.1.1 $
Author:
David Waite <dwaite@jabber.com>, $Author: lucky $

Field Summary
private static java.lang.String CHANGE_PARSER_TOO_LATE
           
private static java.lang.String DEFAULT_PARSER
          Default parser (AElfred)
private  java.io.InputStream in
          InputStream which we are parsing XML from
private  ConnectionBean.InputStreamInterface isi
          parent ConnectionBean object, for passing messages back
private  java.lang.String parsername
          Holds the name of the SAX-enabled parser.
private  boolean parsingDone
          flag to indicate parsing in progress
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
InputStreamHandler(ConnectionBean.InputStreamInterface isi)
          Creates a new InputStreamHandler instance.
 
Method Summary
 java.lang.String getParser()
           
 void received(Packet p)
          received is a method for other objects to broadcast packets recognised on the inputStream up to the ConnectionBean
 void run()
          Main thread body, creates the parser, associates the XMLStream DocumentHandler, and starts everything running.
 void setInputStream(java.io.InputStream in)
           
 void setParser(java.lang.String parsername)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

in

private java.io.InputStream in
InputStream which we are parsing XML from

isi

private ConnectionBean.InputStreamInterface isi
parent ConnectionBean object, for passing messages back

parsingDone

private boolean parsingDone
flag to indicate parsing in progress

parsername

private java.lang.String parsername
Holds the name of the SAX-enabled parser.

CHANGE_PARSER_TOO_LATE

private static final java.lang.String CHANGE_PARSER_TOO_LATE

DEFAULT_PARSER

private static final java.lang.String DEFAULT_PARSER
Default parser (AElfred)
Constructor Detail

InputStreamHandler

public InputStreamHandler(ConnectionBean.InputStreamInterface isi)
Creates a new InputStreamHandler instance.
Parameters:
in - an InputStream for the server connection
Method Detail

setInputStream

public void setInputStream(java.io.InputStream in)

run

public final void run()
Main thread body, creates the parser, associates the XMLStream DocumentHandler, and starts everything running.
Overrides:
run in class java.lang.Thread

received

public void received(Packet p)
received is a method for other objects to broadcast packets recognised on the inputStream up to the ConnectionBean
Parameters:
p - a Packet which was just received and recognised.

shutdown

public void shutdown()

setParser

public void setParser(java.lang.String parsername)

getParser

public java.lang.String getParser()