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 DirectOutputEvent

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

public class DirectOutputEvent
extends java.lang.Object
implements Event

is an Event that causes the pulse service to provide instance output committing the underlying HttpServletResponse.

Version:
$Revision: 1393 $
Author:
Thomas Weber

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.torweg.pulse.service.event.Event
Event.Disposition
 
Constructor Summary
DirectOutputEvent(Event event, ServiceRequest req)
          create a new DirectOutputEvent for the specified Event.
 
Method Summary
 CacheMode getCacheMode()
          returns the CacheMode.
 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 return immediately as the output is already produced at construction time.
 void setCacheMode(CacheMode c)
          throws an UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectOutputEvent

public DirectOutputEvent(Event event, ServiceRequest req)
create a new DirectOutputEvent for the specified Event.

Parameters:
event - the event to be processed directly
req - the current ServiceRequest
Throws:
java.lang.IllegalArgumentException - if the given Event is not an output event
Method Detail

run

public final void run(ServiceRequest req)
will return immediately as the output is already produced at construction time.

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

isStopEvent

public final boolean isStopEvent()
Description copied from interface: Event
Indicates if the Invoker should proceed executing other bundles or if it should terminate after executing this Event .

Specified by:
isStopEvent in interface Event
Returns:
true, if the event is a stop event
See Also:
Event.isStopEvent()

isOutputEvent

public final boolean isOutputEvent()
Description copied from interface: Event
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.

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

isSingularEvent

public final 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, if the event is singular
See Also:
Event.isSingularEvent()

getCacheMode

public final CacheMode getCacheMode()
returns the CacheMode.

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

setCacheMode

public final void setCacheMode(CacheMode c)
throws an UnsupportedOperationException.

Specified by:
setCacheMode in interface Event
Parameters:
c - is ignored
Throws:
java.lang.UnsupportedOperationException - always