Class JMSResourceEventNotifier<R extends Serializable,​T extends AbstractResourceEvent>

  • Type Parameters:
    T - the type of the resource event.
    All Implemented Interfaces:
    ResourceEventNotifier<R,​T>

    public abstract class JMSResourceEventNotifier<R extends Serializable,​T extends AbstractResourceEvent>
    extends Object
    implements ResourceEventNotifier<R,​T>
    An asynchronous notifier of resource events based on JMS. It is dedicated to be used in a notification implying external or remote software components. It shouldn't be used to notify Silverpeas inner components.

    The asynchronous notifiers should extend this class; they have just to implement the createResourceEventFrom and the getDestination methods. The notification by JMS is performed directly by this abstract class.

    Author:
    mmoquillon
    • Constructor Detail

      • JMSResourceEventNotifier

        public JMSResourceEventNotifier()
    • Method Detail

      • getDestination

        public abstract javax.jms.Destination getDestination()
        Gets the destination of the notification. It is either a queue or a topic in JMS.
        Returns:
        the destination of the notifications sent by this notifier.
      • createResourceEventFrom

        protected abstract T createResourceEventFrom​(ResourceEvent.Type type,
                                                     R... resource)
        Creates a resource event about the specified cause on the specified resource.
        Parameters:
        type - the event type.
        resource - the resource related by the event. In the case of an update, two instances of the same resource are expected: the first being the resource before the update, the second being the resource after the update (the result of the update).
        Returns:
        a resource event.
      • notifyEventOn

        public void notifyEventOn​(ResourceEvent.Type type,
                                  R... resource)
        Description copied from interface: ResourceEventNotifier
        Notify about an event of the specified type and on the specified resource.
        Specified by:
        notifyEventOn in interface ResourceEventNotifier<R extends Serializable,​T extends AbstractResourceEvent>
        Parameters:
        type - the type of the event that defines its cause.
        resource - the resource related by the event. In the case of an update, two instances of the same resource is expected: the first being the resource before the update, the second being the resource after the update.