pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.event
Class XMLOutputEvent

java.lang.Object
  extended by org.torweg.pulse.service.event.XMLOutputEvent
All Implemented Interfaces:
Event

public final class XMLOutputEvent
extends java.lang.Object
implements Event

Is a stop and output Event sending an XML response.

This Event is useful for AJAX communication.

Version:
$Revision: 1984 $
Author:
Christian Schatt

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.torweg.pulse.service.event.Event
Event.Disposition
 
Method Summary
static XMLOutputEvent fromJAXBObject(java.lang.Object object)
          Creates a new XMLOutputEvent for the given JAXB enabled Object.
static XMLOutputEvent fromJDOMDocument(org.jdom.Document document)
          Creates a new XMLOutputEvent for the given Document.
static XMLOutputEvent fromJDOMElement(org.jdom.Element element)
          Creates a new XMLOutputEvent for the given Element.
 CacheMode getCacheMode()
          returns the CacheMode.
 boolean isOutputEvent()
          Returns true.
 boolean isSingularEvent()
          Indicates that the Event will only be added once to the EventManager and block all other Events.
 boolean isStopEvent()
          Returns true.
 void run(ServiceRequest request)
          Sends the XML response.
 void setCacheMode(CacheMode c)
          sets the CacheMode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromJDOMDocument

public static XMLOutputEvent fromJDOMDocument(org.jdom.Document document)
Creates a new XMLOutputEvent for the given Document.

Parameters:
document - the Document for the output.
Returns:
the XMLOutputEvent

fromJDOMElement

public static XMLOutputEvent fromJDOMElement(org.jdom.Element element)
Creates a new XMLOutputEvent for the given Element.

Parameters:
element - the Element for the output.
Returns:
the XMLOutputEvent

fromJAXBObject

public static XMLOutputEvent fromJAXBObject(java.lang.Object object)
Creates a new XMLOutputEvent for the given JAXB enabled Object.

Parameters:
object - the JAXB enabled Object for the output.
Returns:
the XMLOutputEvent

run

public void run(ServiceRequest request)
Sends the XML response.

Specified by:
run in interface Event
Parameters:
request - the current ServiceRequest.
See Also:
Event.run(org.torweg.pulse.service.request.ServiceRequest)

isStopEvent

public boolean isStopEvent()
Returns true.

Specified by:
isStopEvent in interface Event
Returns:
true.
See Also:
Event.isStopEvent()

isOutputEvent

public boolean isOutputEvent()
Returns true.

Specified by:
isOutputEvent in interface Event
Returns:
true.
See Also:
Event.isOutputEvent()

isSingularEvent

public boolean isSingularEvent()
Description copied from interface: Event
Indicates that the Event will only be added once to the EventManager and block all other Events.

If an Event of the same type has already been added to the EventManager, subsequent calls to EventManager.addEvent(Event) will return without adding the given Event.

Specified by:
isSingularEvent in interface Event
Returns:
true
See Also:
Event.isSingularEvent()

getCacheMode

public CacheMode getCacheMode()
returns the CacheMode.

Specified by:
getCacheMode in interface Event
Returns:
the cache mode
See Also:
Event.getCacheMode()

setCacheMode

public void setCacheMode(CacheMode c)
sets the CacheMode.

Specified by:
setCacheMode in interface Event
Parameters:
c - the cache mode to set
See Also:
Event.setCacheMode(org.torweg.pulse.service.request.CacheMode)