Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Dispatcher Class Reference

Stanza dispatcher object. More...

Inheritance diagram for Dispatcher:

Inheritance graph
[legend]
Collaboration diagram for Dispatcher:

Collaboration graph
[legend]
List of all members.

Public Member Functions


Detailed Description

Stanza dispatcher object.

This object is central point for all communication throught XMLStreams. All received stanzas are delivered to correct handlers, and all sended stanzas, go throught correct XMLStream.

Todo:
Add error handling.


Member Function Documentation

Object addDispatcherEventsHandler Condition  condition,
StanzaListener  handler,
Object  token,
int  priority
 

Register new stanza handler for received stanzas.

Parameters:
condition Condition object used to determine that this handler should be invoked for stanza
handler Handler object.
token Token which will be pass to handler.
priority Priority of handler. Handlers with lower priority values will be selected before those with higher values.
Returns:
Object which should be used to remove handler in removeInputHandler() method.

Object addInputHandler Condition  condition,
StanzaListener  handler,
Object  token,
int  priority
 

Register new stanza handler for received stanzas.

Parameters:
condition Condition object used to determine that this handler should be invoked for stanza
handler Handler object.
token Token which will be pass to handler.
priority Priority of handler. Handlers with lower priority values will be selected before those with higher values.
Returns:
Object which should be used to remove handler in removeInputHandler() method.

Object addOutputHandler Condition  condition,
StanzaListener  handler,
Object  token,
int  priority
 

Register new stanza handler for send stanzas.

Handlers are called before actual send operation, so any changes to stanza object will be reflected in sended stanza.

Parameters:
condition Condition object used to determine that this handler should be invoked for stanza
handler Handler object.
token Token which will be pass to handler.
priority Priority of handler. Handlers with lower priority values will be selected before those with higher values.
Returns:
Object which should be used to remove handler in removeOutputHandler() method.

void removeDispatcherEventHandler Object  htoken  ) 
 

Unregister stanza handler for send stanzas.

Parameters:
htoken Object returned by addInputHandler(), which describe, which handler should be removed.

void removeInputHandler Object  htoken  ) 
 

Unregister stanza handler for received stanzas.

Parameters:
htoken Object returned by addInputHandler(), which describe, which handler should be removed.

void removeOutputHandler Object  htoken  ) 
 

Unregister stanza handler for send stanzas.

Parameters:
htoken Object returned by addInputHandler(), which describe, which handler should be removed.

void send Stanza  stanza,
Object  handler,
Object  token,
XMLStream  stream
 

Send stanza.

When response to this stanza arrives, handler will be used to notify caller of this method.

Parameters:
stanza Stanza object to send.
handler Handler, which will be used to notify about response to stanza. This can be instance of StanzaListener object, or function with signature similar to StanzaListener.onStanza.
token Object which will be passed as token parameter to handler.
stream Stream to which stanza should be sent. (optional)


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 01:03:50 2005 for JabberZilla by  doxygen 1.4.0