public abstract class AbstractStanzaModule<T extends Stanza> extends Object implements XmppModule, InitializingModule, ContextAware
Modifier and Type | Field and Description |
---|---|
protected Context |
context |
protected Logger |
log |
Constructor and Description |
---|
AbstractStanzaModule() |
Modifier and Type | Method and Description |
---|---|
void |
afterRegister()
Called when module is registered.
|
void |
beforeRegister()
Called just before registration module in XmppModulesManager
.
|
void |
beforeUnregister()
Called when module is unregistered.
|
protected void |
fireEvent(Event<?> event) |
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 |
setContext(Context context) |
protected void |
write(Element stanza) |
protected void |
write(Element stanza,
AsyncCallback asyncCallback) |
protected void |
write(Element stanza,
Long timeout,
AsyncCallback asyncCallback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCriteria, getFeatures
protected static Element getFirstChild(Element element, String elementName) throws XMLException
XMLException
public void afterRegister()
InitializingModule
afterRegister
in interface InitializingModule
public void beforeRegister()
InitializingModule
beforeRegister
in interface InitializingModule
public void beforeUnregister()
InitializingModule
beforeUnregister
in interface InitializingModule
protected void fireEvent(Event<?> event)
public void process(Element element) throws JaxmppException
XmppModule
process
in interface XmppModule
element
- incoming XMPP stanzaJaxmppException
public abstract void process(T stanza) throws JaxmppException
element
- incoming stanzaJaxmppException
public void setContext(Context context)
setContext
in interface ContextAware
protected void write(Element stanza) throws JaxmppException
JaxmppException
protected void write(Element stanza, AsyncCallback asyncCallback) throws JaxmppException
JaxmppException
protected void write(Element stanza, Long timeout, AsyncCallback asyncCallback) throws JaxmppException
JaxmppException
Copyright © 2006–2018 Tigase. All rights reserved.