org.eclipse.ocl.examples.impactanalyzer.impl
Class DerivedPropertyNotifierImpl
java.lang.Object
org.eclipse.ocl.examples.impactanalyzer.impl.DerivedPropertyNotifierImpl
- All Implemented Interfaces:
- DerivedPropertyNotifier
public class DerivedPropertyNotifierImpl
- extends java.lang.Object
- implements DerivedPropertyNotifier
Used to observe and filter for model changes that affect derived properties
defined by OCL expression. Construct an instance for a single
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.
- Author:
- Martin Hanysz, Axel Uhl
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DerivedPropertyNotifierImpl
public DerivedPropertyNotifierImpl(ActivationOption impactAnalyzerConfiguration,
OppositeEndFinder oppositeEndFinder,
OCLFactory oclFactory,
org.eclipse.emf.ecore.EPackage pkg)
DerivedPropertyNotifierImpl
public DerivedPropertyNotifierImpl(ActivationOption impactAnalyzerConfiguration,
OppositeEndFinder oppositeEndFinder,
OCLFactory oclFactory,
org.eclipse.emf.ecore.EStructuralFeature... derivedProperties)
subscribe
public void subscribe(EventManager eventManager)
- Description copied from interface:
DerivedPropertyNotifier
- Activates the services of this notifier for the scope observed by the
eventManager
.
If the event manager is set inactive
, no notifications
are created by this notifier until the event manager is activated again.
- Specified by:
subscribe
in interface DerivedPropertyNotifier
unsubscribe
public void unsubscribe(EventManager eventManager)
- Description copied from interface:
DerivedPropertyNotifier
- Deactivates this notifier by unregistering all its internal adapters from the
eventManager
again.
- Specified by:
unsubscribe
in interface DerivedPropertyNotifier