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
Interface Event

All Known Subinterfaces:
ResultAwareEvent
All Known Implementing Classes:
DirectOutputEvent, DownloadEvent, ForbiddenEvent, JFreeChartPNGOutputEvent, JSONOutputAsHtmlEvent, JSONOutputEvent, NotFoundEvent, PDFOutputEvent, PlainTextOutputEvent, RedirectEvent, RedirectSafelyEvent, VFSImporter.ExcelOutputEvent, XMLOutputEvent, XSLTOutputEvent

public interface Event

an Event to be processed by the event processor.

For an example take a look at DownloadEvent.

Version:
$Revision: 1393 $
Author:
Thomas Weber

Nested Class Summary
static class Event.Disposition
          represents the content disposition.
 
Method Summary
 CacheMode getCacheMode()
          returns the CacheMode for an output event and must never return null.
 boolean isOutputEvent()
          Indicates if this Event will write to the OutputStream and so render the OutputStream unwritable for future results.
 boolean isSingularEvent()
          Indicates that the Event will only be added once to the EventManager and block all other Events.
 boolean isStopEvent()
          Indicates if the Invoker should proceed executing other bundles or if it should terminate after executing this Event .
 void run(ServiceRequest req)
          will be called by the event processor.
 void setCacheMode(CacheMode c)
          sets the CacheMode for the Event, which is to be used during output (if the Event is an output event).
 

Method Detail

run

void run(ServiceRequest req)
will be called by the event processor.

Parameters:
req - the ServiceRequest

isStopEvent

boolean isStopEvent()
Indicates if the Invoker should proceed executing other bundles or if it should terminate after executing this Event .

Returns:
Returns TRUE if the Invoker should terminate after processing this Event. It returns FALSE if the other bundles should still be processed.
See Also:
Invoker

isOutputEvent

boolean isOutputEvent()
Indicates if this Event will write to the OutputStream and so render the OutputStream unwritable for future results.

Please note: After writing to the OutputStream it should be flushed and closed.

Returns:
Returns TRUE if this Event writes to the OutputStream. Returns FALSE if the OutputStream remains untouched.

isSingularEvent

boolean isSingularEvent()
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.

Returns:
true, if and only if the Event is singular. Otherwise false.

setCacheMode

void setCacheMode(CacheMode c)
sets the CacheMode for the Event, which is to be used during output (if the Event is an output event).

Parameters:
c - the cache mode to set

getCacheMode

CacheMode getCacheMode()
returns the CacheMode for an output event and must never return null.

Returns:
the cache mode for the output event