SAP NetWeaver '04

com.sapportals.wcm.repository.manager
Class OverallResourceEventBroker

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.framework_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.repository.manager.OverallResourceEventBroker
All Implemented Interfaces:
IComponentListener, IEventBroker, IResourceEventBroker

public class OverallResourceEventBroker
extends java.lang.Object
implements IResourceEventBroker, IComponentListener

Class implementing overall resource event broker, which can be used to send and register for events for all repositories.


Fields inherited from interface com.sapportals.wcm.util.events.IEventBroker
PRIO_MAX, PRIO_MIN
 
Method Summary
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static OverallResourceEventBroker getInstance()
Get singleton instance of this class.
Returns:
singleton instance of this class

notify

public void notify(ComponentEvent event)
Handle component add, reconfiguration or removal. Extract the resource event broker in case the event relates to an repository manager. Note: Component reconfiguration or removal events are not yet available.
Specified by:
notify in interface IComponentListener
Parameters:
event - CRT component event

send

public void send(IEvent event,
                 IEventSender sender)
          throws WcmException
Sends the specified event to all receivers that have registered for this kind of event.
Specified by:
send in interface IEventBroker
Parameters:
event - event to be sent
sender - event sender instance sending the event
Throws:
WcmException - when the event sender is not registered

register

public void register(IEventSender sender)
              throws WcmException
Registers an event sender instance.
Specified by:
register in interface IEventBroker
Parameters:
sender - event sender to be registered
Throws:
WcmException - when the registration fails

register

public void register(IEventReceiver receiver,
                     IEvent template)
              throws WcmException
Registers an event receiver. The receiver will only receive events which match the template event. This depends on the matching rules implemented in the events 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.
Specified by:
register in interface IEventBroker
Parameters:
receiver - event receiver to be registered
template - event template on which the event receiver will receive events
Throws:
WcmException - when the registration fails

register

public void register(IEventReceiver receiver,
                     IEvent template,
                     IEventMapper mapper)
              throws WcmException
See the general contract of the 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.
Specified by:
register in interface IEventBroker
Parameters:
receiver - event receiver to be registered
template - event template on which the event receiver will receive events
mapper - event mapper to be called prior to giving the event to the receiver
Throws:
WcmException - when the registration fails
See Also:
IEventMapper

register

public void register(IEventReceiver receiver,
                     IEvent template,
                     int priority,
                     boolean async)
              throws WcmException
See the general contract of the 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.

Specified by:
register in interface IEventBroker
Parameters:
receiver - event receiver to be registered
template - event template on which the event receiver will receive events
priority - priority of this receiver and template
async - true when the receiver whould receive the events on a seperate thread
Throws:
WcmException - when the registration fails

register

public void register(IEventReceiver receiver,
                     IEvent template,
                     IEventMapper mapper,
                     int priority,
                     boolean async)
              throws WcmException
See the general contract of the register(IEventReceiver, IEvent, IEventMapper) and register(IEventReceiver, IEvent, int, boolean) method.
Specified by:
register in interface IEventBroker
Parameters:
receiver - event receiver to be registered
template - event template on which the event receiver will receive events
mapper - event mapper to be called prior to giving the event to the receiver
priority - priority of this receiver and template
async - true when the receiver whould receive the events on a seperate thread
Throws:
WcmException - when the registration fails
See Also:
IEventMapper

unregister

public void unregister(IEventSender sender)
                throws WcmException
Unregisteres an event sender instance.
Specified by:
unregister in interface IEventBroker
Parameters:
sender - event sender to be unregistered
Throws:
WcmException - when the unregistration fails

unregister

public void unregister(IEventReceiver receiver,
                       IEvent template)
                throws WcmException
Unregisteres an event receiver instance.
Specified by:
unregister in interface IEventBroker
Parameters:
receiver - event receiver to be unregistered
template - event template on which the event receiver will no longer receive events
Throws:
WcmException - when the unregistration fails

suspend

public void suspend(IEventReceiver receiver)
Suspend the event receiver. The broker will stop delivering any events until resume(IEventReceiver) is called.
Specified by:
suspend in interface IEventBroker
Parameters:
receiver - event receiver

resume

public void resume(IEventReceiver receiver)
Resumes a previously suspended event receiver. The broker will continue delivering events to the receiver.
Specified by:
resume in interface IEventBroker
Parameters:
receiver - event receiver

hold

public void hold(IEventReceiver receiver,
                 boolean collect)
TBD: Unknown function.
Specified by:
hold in interface IEventBroker
Parameters:
receiver - TBD: Unknown parameter
collect - TBD: Unknown parameter

getMode

public SenderMode getMode(IEventReceiver receiver)
Get the receiver mode of the receiver, i.e. off, sending and so on.
Specified by:
getMode in interface IEventBroker
Parameters:
receiver - event receiver
Returns:
receiver mode of the receiver
See Also:
SenderMode

getHoldEvents

public IEventList getHoldEvents(IEventReceiver receiver)
Get all hold but not yet sent events for the given receiver.
Specified by:
getHoldEvents in interface IEventBroker
Parameters:
receiver - event receiver
Returns:
all hold but not yet sent events for the given receiver

clearHoldEvents

public IEventList clearHoldEvents(IEventReceiver receiver)
Remove all hold but not yet sent events for the given receiver.
Specified by:
clearHoldEvents in interface IEventBroker
Parameters:
receiver - event receiver
Returns:
all hold but not yet sent events for the given receiver

getEvents

public IEventList getEvents()
Returns a list of event templates for all possible events this broker can send (determined by querying all registered senders). The event instances contained in the list are "templates", that means the event parameter is not relevant.
Specified by:
getEvents in interface IEventBroker
Returns:
list of event templates for all possible events this broker can send

getEvents

public 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). The resource event instances contained in the list are "templates", that means the resource event parameter is not relevant.
Specified by:
getEvents in interface IResourceEventBroker
Parameters:
resource - resource for which event templates should be checked
Returns:
list of resource event templates for all possible resource events this broker can send

mustSendResourceEventType

public boolean mustSendResourceEventType(int type)
Check if the given type of a ResourceEvent has to be sent at all.
Specified by:
mustSendResourceEventType in interface IResourceEventBroker
Parameters:
type - the ResourceEvent-type to check for.
Returns:
true if at least one receiver is registered for this ResourceEvent type.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.