public class DerivedPropertyNotifierImpl extends java.lang.Object implements DerivedPropertyNotifier
EStructuralFeature
or all properties of an EPackage
and
subscribe
for change notifications at an
EventManager
. When changes affecting a derived property's value are
received, the actual changes are determined, and new Notification
s
are created for those objects on which the derived property's value did
change.
To achieve this service, this class makes use of an ImpactAnalyzer
for each derivation expression. This allows us to construct event filters
catching the subset of change notifications which may affect the derivation
expression's value. The ImpactAnalyzer
is then used to further reduce
the number of possible context objects on which to check for actual changes.
The changes observed are then assembled into an according change
Notification
for the derived property itself and forwarded by calling
Notifier.eNotify(Notification)
on the object where it changed.
Constructor and Description |
---|
DerivedPropertyNotifierImpl(ActivationOption impactAnalyzerConfiguration,
OppositeEndFinder oppositeEndFinder,
OCLFactory oclFactory,
org.eclipse.emf.ecore.EPackage pkg) |
DerivedPropertyNotifierImpl(ActivationOption impactAnalyzerConfiguration,
OppositeEndFinder oppositeEndFinder,
OCLFactory oclFactory,
org.eclipse.emf.ecore.EStructuralFeature... derivedProperties) |
Modifier and Type | Method and Description |
---|---|
void |
subscribe(EventManager eventManager)
Activates the services of this notifier for the scope observed by the
eventManager . |
void |
unsubscribe(EventManager eventManager)
Deactivates this notifier by unregistering all its internal adapters from the
eventManager again. |
public DerivedPropertyNotifierImpl(ActivationOption impactAnalyzerConfiguration, OppositeEndFinder oppositeEndFinder, OCLFactory oclFactory, org.eclipse.emf.ecore.EPackage pkg)
public DerivedPropertyNotifierImpl(ActivationOption impactAnalyzerConfiguration, OppositeEndFinder oppositeEndFinder, OCLFactory oclFactory, org.eclipse.emf.ecore.EStructuralFeature... derivedProperties)
public void subscribe(EventManager eventManager)
DerivedPropertyNotifier
eventManager
.
If the event manager is set inactive
, no notifications
are created by this notifier until the event manager is activated again.subscribe
in interface DerivedPropertyNotifier
public void unsubscribe(EventManager eventManager)
DerivedPropertyNotifier
eventManager
again.unsubscribe
in interface DerivedPropertyNotifier