public abstract class AbstractStanzaModule<T extends Stanza> extends Object implements XmppModule
| Modifier and Type | Field and Description |
|---|---|
protected Logger |
log |
protected Observable |
observable |
protected SessionObject |
sessionObject |
protected PacketWriter |
writer |
| Constructor and Description |
|---|
AbstractStanzaModule(Observable observable,
SessionObject sessionObject,
PacketWriter packetWriter) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected static Element |
getFirstChild(Element element,
String elementName) |
void |
process(Element element)
Main method of module.
|
abstract void |
process(T stanza)
Method for processing incoming stanza.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCriteria, getFeaturesprotected final Logger log
protected final Observable observable
protected final SessionObject sessionObject
protected final PacketWriter writer
public AbstractStanzaModule(Observable observable, SessionObject sessionObject, PacketWriter packetWriter)
protected static Element getFirstChild(Element element, String elementName) throws XMLException
XMLExceptionpublic void addListener(EventType eventType, Listener<? extends BaseEvent> listener)
eventType - type of eventlistener - the listenerpublic void addListener(Listener<? extends BaseEvent> listener)
listener - the listenerpublic void process(Element element) throws JaxmppException
XmppModuleprocess in interface XmppModuleelement - incoming XMPP stanzaJaxmppExceptionpublic abstract void process(T stanza) throws JaxmppException
element - incoming stanzaJaxmppExceptionpublic void removeAllListeners()
public void removeListener(EventType eventType, Listener<? extends BaseEvent> listener)
eventType - type of eventlistener - listenerCopyright © 2006–2014 Tigase. All rights reserved.