public interface ChangeBroker
A Change Broker maintains sets of observers
. Based on incoming notifications it forwards the
notification to the observers based on strategies.
There are two kinds of observers: regular EMFObservers
and ReadOnlyEMFObservers
.
EMFObservers may change the EMF model and therefore trigger further notifications. To prevent circular updates
between EMFObservers, notifications that arrive while the
handleNotification
method is
called, will not be forwarded to non ReadOnlyEMFObservers.
ReadOnlyEMFObservers are not allowed to change the EMF model. They will receive all notifications at any time.
Modifier and Type | Method and Description |
---|---|
void |
continueNotification()
Notifying the
ChangeObserver is started again if stopNotification() was called
beforehand. |
void |
continueNotification(Object blocker)
Removes a
blocker . |
void |
stopNotification()
Stops notifying all
ChangeObserver . |
void |
stopNotification(Object blocker)
Stops notifying all
ChangeObserver . |
void |
subscribe(EMFObserver observer)
Adds an
ChangeObserver that will receive all notifications. |
void |
subscribeToEClass(ChangeObserver observer,
org.eclipse.emf.ecore.EClass eClass)
Adds an
ChangeObserver that will receive notifications of notifiers with the given EClass. |
void |
subscribeToFeature(ChangeObserver observer,
org.eclipse.emf.ecore.EStructuralFeature feature)
Adds an
ChangeObserver that will receive notifications when the given EStructuralFeautre is effected. |
void |
subscribeToTree(ChangeObserver observer,
org.eclipse.emf.ecore.EClass eClass)
Adds an
ChangeObserver that will receive notifications of notifiers with the given EClass or which are
contained (either direct or indirect) in an EObject of the given EClass. |
void |
unsubsribe(EMFObserver observer)
Removes an observer.
|
void subscribe(EMFObserver observer)
ChangeObserver
that will receive all notifications. Does nothing if already registered.observer
- the observervoid subscribeToEClass(ChangeObserver observer, org.eclipse.emf.ecore.EClass eClass)
ChangeObserver
that will receive notifications of notifiers with the given EClass. Does nothing
if
already registered.observer
- the observereClass
- the required EClass of the notifiervoid subscribeToTree(ChangeObserver observer, org.eclipse.emf.ecore.EClass eClass)
ChangeObserver
that will receive notifications of notifiers with the given EClass or which are
contained (either direct or indirect) in an EObject of the given EClass. Does nothing if
already registered.observer
- the observereClass
- the required EClass of the notifier or of one of its parentsvoid subscribeToFeature(ChangeObserver observer, org.eclipse.emf.ecore.EStructuralFeature feature)
ChangeObserver
that will receive notifications when the given EStructuralFeautre is effected.
Does
nothing if
already registered.observer
- the observerfeature
- the feature to receive changes forvoid unsubsribe(EMFObserver observer)
observer
- the receivervoid stopNotification()
ChangeObserver
. ReadOnlyEMFObservers
will
still
be notified.void continueNotification()
ChangeObserver
is started again if stopNotification()
was called
beforehand. Has no effect if the notification process has been blocked
or if
stopNotification()
wasn't called before.void stopNotification(Object blocker)
ChangeObserver
. ReadOnlyEMFObservers
will
still
be notified. The notifications will we blocked until continueNotification(Object)
has been called with
all blocking elements. Using the same blocker multiple times has no effect.blocker
- the key object used to block all notificationsvoid continueNotification(Object blocker)
blocker
. When all blockers have been removed the
notification process will continue. This method calls continueNotification()
internally in all cases,
even if the given blocker object was not used as a blocker beforehand.blocker
- the blocker object to remove.Copyright © 2018. All rights reserved.