Class CDIAfterSuccessfulTransactionResourceEventListener<T extends ResourceEvent>

  • All Implemented Interfaces:
    ResourceEventListener<T>
    Direct Known Subclasses:
    AbstractNotifier, ChatGroupUserLinkEventListener, ReplacementNotifier

    public abstract class CDIAfterSuccessfulTransactionResourceEventListener<T extends ResourceEvent>
    extends Object
    implements ResourceEventListener<T>
    A synchronous event listener using the notification bus of CDI. This bus is based on the Observer pattern but by using the annotations in place of code lines to setup listeners and so on.

    Synchronous events are carried within a specific CDI event and are collected by this abstract class. All concrete listeners have just to extend this abstract class and to implement some of the following methods to transparently receive the events on which they are interested:

    If the observation is performed into a transaction, all the events are performed just after a successful commit.

    • org.silverpeas.core.notification.system.ResourceEventListener#onCreation(ResourceEvent to receive events about the creation of a resource,
    • org.silverpeas.core.notification.system.ResourceEventListener#onUpdate(ResourceEvent to receive events about the update of a resource,
    • org.silverpeas.core.notification.system.ResourceEventListener#onRemoving(ResourceEvent to receive events about the removing of a resource,
    • org.silverpeas.core.notification.system.ResourceEventListener#onDeletion(ResourceEvent to receive events about the deletion of a resource,
    Author:
    mmoquillon
    • Constructor Detail

      • CDIAfterSuccessfulTransactionResourceEventListener

        public CDIAfterSuccessfulTransactionResourceEventListener()
    • Method Detail

      • onEvent

        public void onEvent​(@Observes(during=AFTER_SUCCESS)
                            T event)
                     throws Exception
        Listens for events related to a resource managed in Silverpeas.

        The event is decoded from the specified message and according to the type of the event, the adequate method is then invoked.

        Parameters:
        event - an event.
        Throws:
        Exception - if the processing of the event fails.
        See Also:
        ResourceEventListener.dispatchEvent(ResourceEvent)