net.ex_337.xmpp.fwork.examples
Class DemoGradientService
java.lang.Object
net.ex_337.xmpp.fwork.XMPPService
net.ex_337.xmpp.fwork.BaseGradientService
net.ex_337.xmpp.fwork.examples.DemoGradientService
- All Implemented Interfaces:
- org.jivesoftware.smack.PacketListener
- public class DemoGradientService
- extends BaseGradientService
This is a demonstration extension of BaseGradientService. It returns three documents.
One is a normal SVG document, returned via XMPP.
One is a very nice SVG map (courtesy of the Andreas Neuman and the Batik project) that is loaded via HTTP
One is a rectangles document that is updated over time by the server, and can send messages from ECMAScript back to the server.
- Author:
- Ian
| Methods inherited from class net.ex_337.xmpp.fwork.XMPPService |
close, getInitParameter, getInitParameterNames, getIntInitParameter, getListInitParameter, log, log, open, setInitParameter, setServletContext, setXMPPConnection, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RECTANGLES_PATH
static final String RECTANGLES_PATH
- This is accessed by helper classes.
The helper classes were put in different files to help make this example clearer.
- See Also:
- Constant Field Values
RECTANGLES_NAMESPACE
static final String RECTANGLES_NAMESPACE
- See Also:
- Constant Field Values
DemoGradientService
public DemoGradientService()
init
public void init()
- Loads in the documents we return via XMPP.
- Overrides:
init in class XMPPService
destroy
public void destroy()
- closes the rectangle broadcaster
then sells it to Clear Channel.
- Overrides:
destroy in class XMPPService
processDocumentRequest
public Element processDocumentRequest(String remoteJID,
String path,
Map parameters)
- Processes document requests.
- Specified by:
processDocumentRequest in class BaseGradientService
- Parameters:
remoteJID - the document requester.path - the document pathparameters - the request parameters. Ignored here.
- Returns:
- the document response IQ child element.
newSession
protected GradientSession newSession()
- Description copied from class:
BaseGradientService
- Creates a new session. Should be overridden to return an extension of GradientSession
if you want to do anything useful at the session level.
- Overrides:
newSession in class BaseGradientService
- Returns:
- a new DemoGradientSession.