com.sap.tc.cmi.util

Interface ICMIRelationRoleChangeListener


public interface ICMIRelationRoleChangeListener

Listener interface for model consumers that want to be notified about changes in a relation role of an ICMIObservableModelClass.

When an implementation of this interface has been registered with a model object and if one of the relation roles of interest has changed, then one of the callback methods in this interface is called.

Each callback method receives an event object as a parameter that describes the change in more detail. The callback complexRoleChange(CMIRelationRoleEvent) also serves as a future extension point. If new types of changes are identified and added to CMI, then they will lead to such a complex change event.

Since:
NW Paris, MS3

Type Classification Type Classification:

This interface is part of the Common Model Interface and is intended to be implemented by applications.


Method Summary
 void complexRoleChange(CMIRelationRoleEvent event)
          Called when a relation role, that this listener has been registered for, has been changed in way that can not be described by the other events.
 void objectAddedToRole(CMIRelationRoleEvent event)
          Called when a single object has been added to a relation role that this listener has been registered for.
 void objectRemovedFromRole(CMIRelationRoleEvent event)
          Called when a single object has been removed from a relation role that this listener has been registered for.
 void objectReplacedInRole(CMIRelationRoleEvent event)
          Called when a single object has been replaced in a relation role that this listener has been registered for.
 

Method Detail

objectAddedToRole

void objectAddedToRole(CMIRelationRoleEvent event)
Called when a single object has been added to a relation role that this listener has been registered for.

The source and relation role properties of the event object describe which role in which model object has changed. The element property of the event object describes, what object has been added. If the relation has list semantic, then the from index of the event object describes at which position the element has been added.

Parameters:
event -

objectReplacedInRole

void objectReplacedInRole(CMIRelationRoleEvent event)
Called when a single object has been replaced in a relation role that this listener has been registered for. Note that the term "replacement" usually doesn't make sense for null values (neither old nor new value). Especially in the case of 0..1 relations, the transtion from 0 to 1 or 1 to 0 must not be notified with a objectReplacedInRole event. See CMIRelationRoleEvent for an overview.

The source and relation role properties of the event object describe which role in which model object has changed. The element property of the event object describes the object that has been replaced. The new object can not be identified! If the relation has list semantic, then the from index of the event object describes at which position the element has been replaced.

Parameters:
event -

objectRemovedFromRole

void objectRemovedFromRole(CMIRelationRoleEvent event)
Called when a single object has been removed from a relation role that this listener has been registered for.

The source and relation role properties of the event object describe which role in which model object has changed. The element property of the event object describes, which object has been removed. If the relation has list semantic, then the from index of the event object describes at which position the element has been removed.

Parameters:
event -

complexRoleChange

void complexRoleChange(CMIRelationRoleEvent event)
Called when a relation role, that this listener has been registered for, has been changed in way that can not be described by the other events.

The source and relation role properties of the event object describe which role in which model object has changed.

The type property of the event object describes the type of change. See CMIRelationRoleEvent for details.

Note: CMIRelationRoleEvent might introduce new event types in the future. Therefore any listener must deal with unknown event types. The only practical way to do so is to switch on the event type and in an obligatory default branch, have a look at the complete relation role. Just imagine that the relation role changed completely without further notice.

Furthermore, model implementations might introduce their own event types to synchronize with listeners more efficiently. If so, the above default reaction on events helps more general listeners to continue to work.

Parameters:
event -
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api api BC-JAS-EJB
[sap.com] FRAMEWORK [sap.com] tc/cmi default BC-WD-JAV-RUN


Copyright 2014 SAP AG Complete Copyright Notice