net.ex_337.xmpp.fwork.examples
Class SimpleGradientService

java.lang.Object
  extended bynet.ex_337.xmpp.fwork.XMPPService
      extended bynet.ex_337.xmpp.fwork.BaseGradientService
          extended bynet.ex_337.xmpp.fwork.examples.SimpleGradientService
All Implemented Interfaces:
org.jivesoftware.smack.PacketListener

public class SimpleGradientService
extends BaseGradientService

A simple Gradient service that doesn't do much except log whatever lifecycle events are inflicted upon it. Cruel XMPPServiceServiceManagerServlet! How thoughtlessly you crush'd the life from my instances. (Why yes, I do need a holiday.)

Author:
Ian

Field Summary
 
Fields inherited from class net.ex_337.xmpp.fwork.BaseGradientService
sessions
 
Fields inherited from class net.ex_337.xmpp.fwork.XMPPService
filter, sc, xmppConnection
 
Constructor Summary
SimpleGradientService()
           
 
Method Summary
 void init()
          Initialisation code could go here.
protected  GradientSession newSession()
          In this case, the only thing we want to do is log session lifecycle events, so it's easier to extend GradientSession as an anonymous inner class.
 Element processDocumentRequest(String remoteJID, String path, Map parameters)
          Should be overridden.
 
Methods inherited from class net.ex_337.xmpp.fwork.BaseGradientService
getSession, getSessions, processDocRequestIQ, processIncomingMessage, processPacket, processPresence, processRPCStyleIQ, sendStanza, sendStanza
 
Methods inherited from class net.ex_337.xmpp.fwork.XMPPService
close, destroy, 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
 

Constructor Detail

SimpleGradientService

public SimpleGradientService()
Method Detail

init

public void init()
Initialisation code could go here. In this case we're simply loading the SVG element for the document.

Overrides:
init in class XMPPService

processDocumentRequest

public Element processDocumentRequest(String remoteJID,
                                      String path,
                                      Map parameters)
Description copied from class: BaseGradientService
Should be overridden. Should return something based on XMPPUtils.newDocResponseElement().

Specified by:
processDocumentRequest in class BaseGradientService
Parameters:
remoteJID - the JID that requested this document
path - the path that was requested. Ignored here.
parameters - the request parameters. Ignored here.
Returns:
the index.svg document loaded above.

newSession

protected GradientSession newSession()
In this case, the only thing we want to do is log session lifecycle events, so it's easier to extend GradientSession as an anonymous inner class.

Overrides:
newSession in class BaseGradientService
Returns:
a new GradientSession.