tigase.jaxmpp.core.client.xmpp.modules
Class AbstractStanzaModule<T extends Stanza>

java.lang.Object
  extended by tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule<T>
All Implemented Interfaces:
XmppModule
Direct Known Subclasses:
MessageModule, MucModule, PresenceModule, PubSubModule, VCardModule

public abstract class AbstractStanzaModule<T extends Stanza>
extends Object
implements XmppModule


Field Summary
protected  Logger log
           
protected  Observable observable
           
protected  SessionObject sessionObject
           
protected  PacketWriter writer
           
 
Constructor Summary
AbstractStanzaModule(Observable observable, SessionObject sessionObject, PacketWriter packetWriter)
           
 
Method Summary
 void addListener(EventType eventType, Listener<? extends BaseEvent> listener)
          Adds a listener bound by the given event type.
 void addListener(Listener<? extends BaseEvent> listener)
          Add a listener bound by the all event types.
 void process(Element element)
          Main method of module.
abstract  void process(T element)
           
 void removeAllListeners()
          Removes all listeners.
 void removeListener(EventType eventType, Listener<? extends BaseEvent> listener)
          Removes a listener.
 void removeListener(Listener<? extends BaseEvent> listener)
          Removes a listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tigase.jaxmpp.core.client.XmppModule
getCriteria, getFeatures
 

Field Detail

log

protected final Logger log

observable

protected final Observable observable

sessionObject

protected final SessionObject sessionObject

writer

protected final PacketWriter writer
Constructor Detail

AbstractStanzaModule

public AbstractStanzaModule(Observable observable,
                            SessionObject sessionObject,
                            PacketWriter packetWriter)
Method Detail

addListener

public void addListener(EventType eventType,
                        Listener<? extends BaseEvent> listener)
Adds a listener bound by the given event type.

Parameters:
eventType - type of event
listener - the listener

addListener

public void addListener(Listener<? extends BaseEvent> listener)
Add a listener bound by the all event types.

Parameters:
listener - the listener

process

public void process(Element element)
             throws JaxmppException
Description copied from interface: XmppModule
Main method of module. Module will process incoming stanza by call this method.

Specified by:
process in interface XmppModule
Parameters:
element - incoming XMPP stanza
Throws:
JaxmppException

process

public abstract void process(T element)
                      throws JaxmppException
Throws:
JaxmppException

removeAllListeners

public void removeAllListeners()
Removes all listeners.


removeListener

public void removeListener(EventType eventType,
                           Listener<? extends BaseEvent> listener)
Removes a listener.

Parameters:
eventType - type of event
listener - listener

removeListener

public void removeListener(Listener<? extends BaseEvent> listener)
Removes a listener.

Parameters:
listener - listener


Copyright © 2006-2012 Tigase. All Rights Reserved.