public class OverallResourceEventBroker extends Object implements IResourceEventBroker, IComponentListener
Created 4. April 2003
PRIO_MAX, PRIO_MIN| Modifier and Type | Method and Description |
|---|---|
IEventList |
clearHoldEvents(IEventReceiver receiver)
Remove all hold but not yet sent events for the given receiver.
|
IEventList |
getEvents()
Returns a list of event templates for all possible events this broker can
send (determined by querying all registered senders).
|
IEventList |
getEvents(IResource resource)
Returns a list of event templates for all possible events this broker can
send for the given resource (determined by querying all registered
senders).
|
IEventList |
getHoldEvents(IEventReceiver receiver)
Get all hold but not yet sent events for the given receiver.
|
static OverallResourceEventBroker |
getInstance()
Get singleton instance of this class.
|
SenderMode |
getMode(IEventReceiver receiver)
Get the receiver mode of the receiver, i.e. off, sending and so on.
|
void |
hold(IEventReceiver receiver,
boolean collect)
TBD: Unknown function.
|
boolean |
mustSendResourceEventType(int type)
Check if the given type of a
ResourceEvent has to be
sent at all. |
void |
notify(ComponentEvent event)
Handle component add, reconfiguration or removal.
|
void |
register(IEventReceiver receiver,
IEvent template)
Registers an event receiver.
|
void |
register(IEventReceiver receiver,
IEvent template,
IEventMapper mapper)
See the general contract of the
register(IEventReceiver, IEvent)
method. |
void |
register(IEventReceiver receiver,
IEvent template,
IEventMapper mapper,
int priority,
boolean async)
See the general contract of the
register(IEventReceiver, IEvent,
IEventMapper) and register(IEventReceiver, IEvent, int, boolean)
method. |
void |
register(IEventReceiver receiver,
IEvent template,
int priority,
boolean async)
See the general contract of the
register(IEventReceiver, IEvent)
method. |
void |
register(IEventSender sender)
Registers an event sender instance.
|
void |
registerForSerializedResourceEvents(IEventReceiver receiver,
SerializedResourceEventTemplate template,
IEventMapper mapping)
When this method is used instead of the
IEventBroker registration methods the broker will persist
all events in the database before delivering them to the receiver asynchronously. |
void |
resume(IEventReceiver receiver)
Resumes a previously suspended event receiver.
|
void |
send(IEvent event,
IEventSender sender)
Sends the specified event to all receivers that have registered for this
kind of event.
|
void |
suspend(IEventReceiver receiver)
Suspend the event receiver.
|
void |
unregister(IEventReceiver receiver,
IEvent template)
Unregisteres an event receiver instance.
|
void |
unregister(IEventSender sender)
Unregisteres an event sender instance.
|
public static OverallResourceEventBroker getInstance()
public void notify(ComponentEvent event)
notify in interface IComponentListenerevent - CRT component eventComponentEvent.Typepublic void send(IEvent event, IEventSender sender) throws WcmException
send in interface IEventBrokerevent - event to be sentsender - event sender instance sending the eventWcmException - when the event sender is not registeredpublic void register(IEventSender sender) throws WcmException
register in interface IEventBrokersender - event sender to be registeredWcmException - when the registration failspublic void register(IEventReceiver receiver, IEvent template) throws WcmException
IEvent.isLike(IEvent) method. Usually the event's instance and
type are relevant. It is allowed to register the same event receiver
instance several times with different templates.register in interface IEventBrokerreceiver - event receiver to be registeredtemplate - event template on which the event receiver will receive
eventsWcmException - when the registration failspublic void register(IEventReceiver receiver, IEvent template, IEventMapper mapper) throws WcmException
register(IEventReceiver, IEvent)
method. This regstration method has an additional IEventMapper
argument, i.e. that the mapper will be called prior to giving the event to
the receiver.register in interface IEventBrokerreceiver - event receiver to be registeredtemplate - event template on which the event receiver will receive
eventsmapper - event mapper to be called prior to giving the event to the
receiverWcmException - when the registration failsIEventMapperpublic void register(IEventReceiver receiver, IEvent template, int priority, boolean async) throws WcmException
register(IEventReceiver, IEvent)
method. This regstration method has two additional arguments for priority
and asynchronous events. The priority controls the order of multible receivers which have registered for the same event(s). Receivers with higher priority (smaller values) will receive an event before receivers with lower priority (greater values).
An event receiver can choose to receive events asynchronously. This means that a dedicated event queue and sender thread is created for each receiver and template. The event sender will not be blocked, that means the send() method puts the event into the queue and returns immediatelly.
register in interface IEventBrokerreceiver - event receiver to be registeredtemplate - event template on which the event receiver will receive
eventspriority - priority of this receiver and templateasync - true when the receiver whould receive the events on a seperate
threadWcmException - when the registration failspublic void register(IEventReceiver receiver, IEvent template, IEventMapper mapper, int priority, boolean async) throws WcmException
register(IEventReceiver, IEvent,
IEventMapper) and register(IEventReceiver, IEvent, int, boolean)
method.register in interface IEventBrokerreceiver - event receiver to be registeredtemplate - event template on which the event receiver will receive
eventsmapper - event mapper to be called prior to giving the event to the
receiverpriority - priority of this receiver and templateasync - true when the receiver whould receive the events on a seperate
threadWcmException - when the registration failsIEventMapperpublic void unregister(IEventSender sender) throws WcmException
unregister in interface IEventBrokersender - event sender to be unregisteredWcmException - when the unregistration failspublic void unregister(IEventReceiver receiver, IEvent template) throws WcmException
unregister in interface IEventBrokerreceiver - event receiver to be unregisteredtemplate - event template on which the event receiver will no longer
receive eventsWcmException - when the unregistration failspublic void suspend(IEventReceiver receiver)
resume(IEventReceiver) is called.suspend in interface IEventBrokerreceiver - event receiverpublic void resume(IEventReceiver receiver)
resume in interface IEventBrokerreceiver - event receiverpublic void hold(IEventReceiver receiver, boolean collect)
hold in interface IEventBrokerreceiver - TBD: Unknown parametercollect - TBD: Unknown parameterpublic SenderMode getMode(IEventReceiver receiver)
getMode in interface IEventBrokerreceiver - event receiverSenderModepublic IEventList getHoldEvents(IEventReceiver receiver)
getHoldEvents in interface IEventBrokerreceiver - event receiverpublic IEventList clearHoldEvents(IEventReceiver receiver)
clearHoldEvents in interface IEventBrokerreceiver - event receiverpublic IEventList getEvents()
getEvents in interface IEventBrokerpublic IEventList getEvents(IResource resource)
getEvents in interface IResourceEventBrokerresource - resource for which event templates should be checkedpublic boolean mustSendResourceEventType(int type)
ResourceEvent has to be
sent at all.mustSendResourceEventType in interface IResourceEventBrokertype - the ResourceEvent-type to check for.true if at least one receiver is registered for
this ResourceEvent type.public void registerForSerializedResourceEvents(IEventReceiver receiver, SerializedResourceEventTemplate template, IEventMapper mapping) throws WcmException
IResourceEventBrokerIEventBroker registration methods the broker will persist
all events in the database before delivering them to the receiver asynchronously. As a consequence for the receiver
the argument of the IEventReceiver.received(IEvent) and
IEventMapper.map(IEvent) methods will be an instance of
ISerializedResourceEvent. Registration with this method is not supported for certain event
types and an exception is thrown: ResourceEvent.ALL, GET, GET_CHILDREN,
PROPERTY_GET and all PRE_XXX types. A template for
serialized events has to be used which can be created from a ResourceEvent template using this
helper method: SerializedResourceEventTemplate.createFromResourceEventTemplate(ResourceEvent).
A KM component / service might want to use this feature to avoid the following shortcomings of the non-persistent
asynchronous delivery: The event broker uses an event queue in memory which causes events contained in the queue
not to be delivered to the receiver if the KM system is shut down (or the j2ee engine crashes) while the queue is
not empty. Also, the memory queue has a fixed maximum size to protect the system from out-of-memory situations in
case a receiver is processing the events very slowly - but this can also cause event objects not to be delivered if
the queue is full. These problems will not occur with persistent events. As a downside the
looks different than a ISerializedResourceEventIResourceEvent because it is
not possible to serialize all the attached data.
registerForSerializedResourceEvents in interface IResourceEventBrokerreceiver - see IEventBroker.register(IEventReceiver, IEvent, IEventMapper)template - see IEventBroker.register(IEventReceiver, IEvent, IEventMapper)mapping - see IEventBroker.register(IEventReceiver, IEvent, IEventMapper)WcmException - If the event type is not allowed for serialized events.| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2017 SAP AG Complete Copyright Notice