Class CDIResourceEventNotifier<R extends Serializable,T extends AbstractResourceEvent<?>>
- java.lang.Object
-
- org.silverpeas.core.notification.system.CDIResourceEventNotifier<R,T>
-
- Type Parameters:
T
- the type of the resource event.
- All Implemented Interfaces:
ResourceEventNotifier<R,T>
- Direct Known Subclasses:
AttachmentEventNotifier
,AttendeeLifeCycleEventNotifier
,CalendarEventLifeCycleEventNotifier
,CalendarEventOccurrenceLifeCycleEventNotifier
,CalendarLifeCycleEventNotifier
,CommentEventNotifier
,ComponentInstanceEventNotifier
,GroupEventNotifier
,GroupUserLinkEventNotifier
,NodeEventNotifier
,PublicationEventNotifier
,RelationShipEventNotifier
,ReplacementEventNotifier
,SpaceEventNotifier
,UserEventNotifier
,UserPreferenceEventNotifier
,WysiwygEventNotifier
public abstract class CDIResourceEventNotifier<R extends Serializable,T extends AbstractResourceEvent<?>> extends Object implements ResourceEventNotifier<R,T>
A synchronous event notifier 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. All synchronous notifiers should extend this class; they have just to implement thecreateResourceEventFrom
method, the notification itself is performed by this abstract class.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description CDIResourceEventNotifier()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
createResourceEventFrom(ResourceEvent.Type type, R... resource)
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
-
createResourceEventFrom
protected abstract T createResourceEventFrom(ResourceEvent.Type type, R... resource)
-
notify
public final 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 final 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.
-
-