Interface EventControllerContext
-
- All Known Implementing Classes:
AbstractEventControllerContext,EventControllerContextImpl
public interface EventControllerContext- Version:
- $Revision: 630 $
- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description static intCONSUMED_EVENT_FLOODED.static intEVENT_CONSUMER_INFO_NOT_AVAILABLE.static intEVENT_CONSUMER_NOT_AVAILABLE.static intEVENT_PRODUCER_INFO_NOT_AVAILABLE.static intEVENT_PRODUCER_NOT_AVAILABLE.static intPORTLET_DOES_NOT_CONSUME_EVENT.static intPRODUCED_EVENT_FLOODED.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voideventConsumed(EventPhaseContext context, WindowEvent consumedEvent, org.gatein.pc.api.invocation.response.PortletInvocationResponse consumerResponse)Context call back when an event is consumed by a portlet.voideventDiscarded(EventPhaseContext context, WindowEvent discardedEvent, int cause)Context call back when an event is discarded by the controller for a specific reason.voideventFailed(EventPhaseContext context, WindowEvent failedEvent, Throwable throwable)Context call back when an event failed to be delivered because the invoker threw an exception.Iterable<WindowEvent>eventProduced(EventPhaseContext context, WindowEvent producedEvent, WindowEvent sourceEvent)Context call back when an event is produced.
-
-
-
Field Detail
-
EVENT_PRODUCER_NOT_AVAILABLE
static final int EVENT_PRODUCER_NOT_AVAILABLE
.- See Also:
- Constant Field Values
-
EVENT_PRODUCER_INFO_NOT_AVAILABLE
static final int EVENT_PRODUCER_INFO_NOT_AVAILABLE
.- See Also:
- Constant Field Values
-
EVENT_CONSUMER_NOT_AVAILABLE
static final int EVENT_CONSUMER_NOT_AVAILABLE
.- See Also:
- Constant Field Values
-
EVENT_CONSUMER_INFO_NOT_AVAILABLE
static final int EVENT_CONSUMER_INFO_NOT_AVAILABLE
.- See Also:
- Constant Field Values
-
PORTLET_DOES_NOT_CONSUME_EVENT
static final int PORTLET_DOES_NOT_CONSUME_EVENT
.- See Also:
- Constant Field Values
-
CONSUMED_EVENT_FLOODED
static final int CONSUMED_EVENT_FLOODED
.- See Also:
- Constant Field Values
-
PRODUCED_EVENT_FLOODED
static final int PRODUCED_EVENT_FLOODED
.- See Also:
- Constant Field Values
-
-
Method Detail
-
eventProduced
Iterable<WindowEvent> eventProduced(EventPhaseContext context, WindowEvent producedEvent, WindowEvent sourceEvent)
Context call back when an event is produced. The session argument gives to the context the capability to queue events in response of the produced event or to interrupt the phase by returning a null value. It has also access to the full history of distributed events in order to provide advanced implementation of event cycle detection.
The method can translate produced event to event to consume by returning an serie of events. When the context wants to interrupt the phase it should return the null value instead of an iterable.
During the invocation of this method, any error thrown will be propagated to the portlet controller invoker.
- Parameters:
context- the sessionproducedEvent- the produced eventsourceEvent- the source event- Returns:
- a sequence of event to consume
-
eventConsumed
void eventConsumed(EventPhaseContext context, WindowEvent consumedEvent, org.gatein.pc.api.invocation.response.PortletInvocationResponse consumerResponse)
Context call back when an event is consumed by a portlet. The session argument only provides querying capabilities and it is not possible to queue event or interrupt the session.
During the invocation of this method, any runtime exception thrown will be ignored by the controller.
During the invocation of this method, any error thrown will be propagated to the portlet controller invoker.
- Parameters:
context- the sessionconsumedEvent- the consumed eventconsumerResponse- the consumer response
-
eventFailed
void eventFailed(EventPhaseContext context, WindowEvent failedEvent, Throwable throwable)
Context call back when an event failed to be delivered because the invoker threw an exception. The session argument only provides querying capabilities and it is not possible to queue event or interrupt the session.
During the invocation of this method, any runtime exception thrown will be ignored by the controller.
During the invocation of this method, any error thrown will be propagated to the portlet controller invoker.
- Parameters:
context- the sessionfailedEvent- the failed eventthrowable- the throwable
-
eventDiscarded
void eventDiscarded(EventPhaseContext context, WindowEvent discardedEvent, int cause)
Context call back when an event is discarded by the controller for a specific reason. The session argument only provides querying capabilities and it is not possible to queue event or interrupt the session.
The cause value is an integer among the constantsCONSUMED_EVENT_FLOODEDEVENT_CONSUMER_INFO_NOT_AVAILABLEEVENT_CONSUMER_NOT_AVAILABLEEVENT_PRODUCER_INFO_NOT_AVAILABLEEVENT_PRODUCER_NOT_AVAILABLEPORTLET_DOES_NOT_CONSUME_EVENTPRODUCED_EVENT_FLOODED
During the invocation of this method, any runtime exception thrown will be ignored by the controller.
During the invocation of this method, any error thrown will be propagated to the portlet controller invoker.
- Parameters:
context- the sessiondiscardedEvent- the discarded eventcause- the cause
-
-