Class EventControllerContextImpl

java.lang.Object
org.gatein.pc.controller.impl.event.EventControllerContextImpl
All Implemented Interfaces:
EventControllerContext

public class EventControllerContextImpl extends Object implements EventControllerContext
Version:
$Revision: 630 $
Author:
Julien Viet
  • Constructor Details

    • EventControllerContextImpl

      public EventControllerContextImpl(org.gatein.pc.api.PortletInvoker invoker)
  • Method Details

    • eventProduced

      public Iterable<WindowEvent> eventProduced(EventPhaseContext context, WindowEvent producedEvent, WindowEvent sourceEvent)
      Description copied from interface: EventControllerContext

      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.

      Specified by:
      eventProduced in interface EventControllerContext
      Parameters:
      context - the session
      producedEvent - the produced event
      sourceEvent - the source event
      Returns:
      a sequence of event to consume
    • eventConsumed

      public void eventConsumed(EventPhaseContext context, WindowEvent consumedEvent, org.gatein.pc.api.invocation.response.PortletInvocationResponse consumerResponse)
      Description copied from interface: EventControllerContext

      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.

      Specified by:
      eventConsumed in interface EventControllerContext
      Parameters:
      context - the session
      consumedEvent - the consumed event
      consumerResponse - the consumer response
    • eventFailed

      public void eventFailed(EventPhaseContext context, WindowEvent failedEvent, Throwable throwable)
      Description copied from interface: EventControllerContext

      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.

      Specified by:
      eventFailed in interface EventControllerContext
      Parameters:
      context - the session
      failedEvent - the failed event
      throwable - the throwable
    • eventDiscarded

      public void eventDiscarded(EventPhaseContext context, WindowEvent discardedEvent, int cause)
      Description copied from interface: EventControllerContext

      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 constants

      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.

      Specified by:
      eventDiscarded in interface EventControllerContext
      Parameters:
      context - the session
      discardedEvent - the discarded event
      cause - the cause