Class JMSResourceEventNotifier<R extends Serializable,T extends AbstractResourceEvent<?>>
- java.lang.Object
-
- org.silverpeas.core.notification.system.JMSResourceEventNotifier<R,T>
-
- 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 thegetDestination
methods. The notification by JMS is performed directly by this abstract class.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description JMSResourceEventNotifier()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
createResourceEventFrom(ResourceEvent.Type type, R... resource)
Creates a resource event about the specified cause on the specified resource.abstract javax.jms.Destination
getDestination()
Gets the destination of the notification.void
notify(T event)
Notify about the specified event.void
notifyEventOn(ResourceEvent.Type type, R... resource)
Notify about an event of the specified type and on the specified resource.
-
-
-
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.
-
notify
public void notify(T event)
Description copied from interface:ResourceEventNotifier
Notify about the specified event.- Specified by:
notify
in interfaceResourceEventNotifier<R extends Serializable,T extends AbstractResourceEvent<?>>
- Parameters:
event
- the event to fire.
-
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 interfaceResourceEventNotifier<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.
-
-