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 EventManagerImpl

java.lang.Object
  extended by org.torweg.pulse.service.event.EventManagerImpl
All Implemented Interfaces:
EventManager

public final class EventManagerImpl
extends java.lang.Object
implements EventManager

This class manages the Events produced by the different Bundles or their Controllers. It also provides a method to process all collected Events.

Version:
$Revision: 1956 $
Author:
Thomas Weber
See Also:
Bundle, BundleInvoker

Constructor Summary
EventManagerImpl(ServiceRequest req)
          This standard (and only) constructor initialises its instance-variables.
 
Method Summary
 void addEvent(Event event)
          Adds an Event to the (internal) list of events.
 java.util.Collection<Event> getEvents()
          returns an unmodifiable Collection of all Events.
 Event getOutputEvent()
          Returns the StopEvent, or null, if neither a StopEvent nor an internal server error has been set.
 Event getStopEvent()
          Returns the StopEvent or null if no StopEvent has been added.
 boolean isInternalServerErrorEvent()
          returns whether an internal server error event has been set.
 void runEvents(ResultSet rs)
          runs all Events.
 void setInternalServerErrorEvent()
          sets an Internal Server Error event}.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventManagerImpl

public EventManagerImpl(ServiceRequest req)
This standard (and only) constructor initialises its instance-variables.

Parameters:
req - the ServiceRequest for running the Events.
Method Detail

getStopEvent

public Event getStopEvent()
Returns the StopEvent or null if no StopEvent has been added.

Specified by:
getStopEvent in interface EventManager
Returns:
Returns the StopEvent or null if no StopEvent has been added.

getOutputEvent

public Event getOutputEvent()
Returns the StopEvent, or null, if neither a StopEvent nor an internal server error has been set.

Specified by:
getOutputEvent in interface EventManager
Returns:
Returns the StopEvent or null, if neither a StopEvent nor an internal server error has been set.

setInternalServerErrorEvent

public void setInternalServerErrorEvent()
sets an Internal Server Error event}.

Specified by:
setInternalServerErrorEvent in interface EventManager

isInternalServerErrorEvent

public boolean isInternalServerErrorEvent()
returns whether an internal server error event has been set.

Specified by:
isInternalServerErrorEvent in interface EventManager
Returns:
true, if and only if, setInternalServerErrorEvent() has been called on this EventManager. Otherwise false.

addEvent

public void addEvent(Event event)
              throws IllegalEventException
Adds an Event to the (internal) list of events.

Specified by:
addEvent in interface EventManager
Parameters:
event - the Event to add.
Throws:
IllegalEventException - if the Event is a StopEvent and the StopEvent is already set OR the Event is a OutputEvent and the OutputEvent is already set.

getEvents

public java.util.Collection<Event> getEvents()
returns an unmodifiable Collection of all Events.

Specified by:
getEvents in interface EventManager
Returns:
an unmodifiable collection of all Events

runEvents

public void runEvents(ResultSet rs)
runs all Events.

Specified by:
runEvents in interface EventManager
Parameters:
rs - the ResultSet
See Also:
Event.run(ServiceRequest)