com.echomine.jabber
Class JabberProtocol

java.lang.Object
  extended by com.echomine.jabber.JabberProtocol
All Implemented Interfaces:
SocketHandler

public class JabberProtocol
extends java.lang.Object
implements SocketHandler

The main Jabber protocol handler. It actually delegates all the incoming data processing to the xml SAX handlers. This handler actually works more as a state manager. The way it works is that when incoming xml message comes in, it will select the proper message processor to parse the rest of the data.


Nested Class Summary
 class JabberProtocol.SAXReaderThread
          Used by the low level protocol handler to read in the data.
 
Field Summary
protected  JabberContentHandler contentHandler
           
static java.lang.String DEFAULT_PARSER
           
protected  JabberErrorHandler errorHandler
           
protected  MessageRequestQueue queue
           
protected  JabberProtocol.SAXReaderThread reader
           
protected  alt.java.net.Socket socket
           
protected static int SOCKETBUF
           
 
Constructor Summary
JabberProtocol(JabberContentHandler contentHandler, MessageRequestQueue queue)
           
 
Method Summary
 void handle(alt.java.net.Socket socket)
          Handles the connection details, including handshaking and data processing.
 void send(JabberMessage msg)
          queues up the data and wait for thread to send out the data
 void shutdown()
          Shuts down the protocol
 void start()
          Does all the resetting before a connection begins
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PARSER

public static final java.lang.String DEFAULT_PARSER
See Also:
Constant Field Values

SOCKETBUF

protected static final int SOCKETBUF
See Also:
Constant Field Values

queue

protected MessageRequestQueue queue

errorHandler

protected JabberErrorHandler errorHandler

contentHandler

protected JabberContentHandler contentHandler

reader

protected JabberProtocol.SAXReaderThread reader

socket

protected alt.java.net.Socket socket
Constructor Detail

JabberProtocol

public JabberProtocol(JabberContentHandler contentHandler,
                      MessageRequestQueue queue)
Method Detail

handle

public void handle(alt.java.net.Socket socket)
            throws java.io.IOException
Description copied from interface: SocketHandler
Handles the connection details, including handshaking and data processing. The handler should NOT close the socket. Rather, it is up to the caller of this method to close the socket when all processing is done.

Specified by:
handle in interface SocketHandler
Throws:
java.io.IOException - when any processing error occurs

shutdown

public void shutdown()
Shuts down the protocol

Specified by:
shutdown in interface SocketHandler

start

public void start()
Does all the resetting before a connection begins

Specified by:
start in interface SocketHandler

send

public void send(JabberMessage msg)
queues up the data and wait for thread to send out the data



Copyright © 2001-2005 Echomine. All Rights Reserved.