|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.emf.ecp.changebroker.internal.ChangeBrokerImpl
public class ChangeBrokerImpl
Implementation of a ChangeBroker.
Registers itself as a NotificationReceiver at all providers. Once it
gets notified it forwards the notification to all of the brokers notification receivers, as applicable.
| Constructor Summary | |
|---|---|
ChangeBrokerImpl()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addNotificationProvider(NotificationProvider provider)
Adds a notification provider. |
void |
continueNotification()
Notifying the EMFObservers is started again if ChangeBroker.stopNotification() was called
beforehand. |
void |
continueNotification(Object blocker)
Removes a blocker. |
Set<NotificationProvider> |
getNotificationProviders()
For testing purposes. |
Set<EMFObserver> |
getRegisteredObservers()
For testing purposes. |
void |
notify(org.eclipse.emf.common.notify.Notification notification)
Called whenever there is a new Notification meant for the receiver. |
void |
removeNotificationProvider(NotificationProvider provider)
Removes a notification provider. |
void |
stopNotification()
Stops notifying all EMFObservers. |
void |
stopNotification(Object blocker)
Stops notifying all EMFObservers. |
void |
subscribe(EMFObserver observer)
Adds an EMFObserver that will receive all notifications. |
void |
subscribeToEClass(EMFObserver observer,
org.eclipse.emf.ecore.EClass eClass)
Adds an EMFObserver that will receive notifications of notifiers with the given EClass. |
void |
subscribeToFeature(EMFObserver observer,
org.eclipse.emf.ecore.EStructuralFeature feature)
Adds an EMFObserver that will receive notifications when the given EStructuralFeautre is effected. |
void |
subscribeToTree(EMFObserver observer,
org.eclipse.emf.ecore.EClass eClass)
Adds an EMFObserver 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 receiver)
Removes an observer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChangeBrokerImpl()
| Method Detail |
|---|
public void addNotificationProvider(NotificationProvider provider)
provider - the providerpublic void removeNotificationProvider(NotificationProvider provider)
provider - the providerpublic void notify(org.eclipse.emf.common.notify.Notification notification)
Notification meant for the receiver.
notify in interface NotificationReceivernotification - the notificationEMFObserver.handleNotification(org.eclipse.emf.common.notify.Notification)public void subscribe(EMFObserver observer)
EMFObserver that will receive all notifications. Does nothing if already registered.
subscribe in interface ChangeBrokerobserver - the observerChangeBroker.subscribe(org.eclipse.emf.ecp.changebroker.spi.EMFObserver)
public void subscribeToEClass(EMFObserver observer,
org.eclipse.emf.ecore.EClass eClass)
EMFObserver that will receive notifications of notifiers with the given EClass. Does nothing if
already registered.
subscribeToEClass in interface ChangeBrokerobserver - the observereClass - the required EClass of the notifierChangeBroker.subscribeToEClass(org.eclipse.emf.ecp.changebroker.spi.EMFObserver,
org.eclipse.emf.ecore.EClass)
public void subscribeToTree(EMFObserver observer,
org.eclipse.emf.ecore.EClass eClass)
EMFObserver 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.
subscribeToTree in interface ChangeBrokerobserver - the observereClass - the required EClass of the notifier or of one of its parentsChangeBroker.subscribeToTree(org.eclipse.emf.ecp.changebroker.spi.EMFObserver,
org.eclipse.emf.ecore.EClass)
public void subscribeToFeature(EMFObserver observer,
org.eclipse.emf.ecore.EStructuralFeature feature)
EMFObserver that will receive notifications when the given EStructuralFeautre is effected. Does
nothing if
already registered.
subscribeToFeature in interface ChangeBrokerobserver - the observerfeature - the feature to receive changes forChangeBroker.subscribeToFeature(org.eclipse.emf.ecp.changebroker.spi.EMFObserver,
org.eclipse.emf.ecore.EStructuralFeature)public void unsubsribe(EMFObserver receiver)
unsubsribe in interface ChangeBrokerreceiver - the receiverChangeBroker.unsubsribe(org.eclipse.emf.ecp.changebroker.spi.EMFObserver)public void stopNotification()
EMFObservers. ReadOnlyEMFObservers will still
be notified.
stopNotification in interface ChangeBrokerChangeBroker.stopNotification()public void continueNotification()
EMFObservers is started again if ChangeBroker.stopNotification() was called
beforehand. Has no effect if the notification process has been blocked or if
ChangeBroker.stopNotification() wasn't called before.
continueNotification in interface ChangeBrokerChangeBroker.continueNotification()public Set<NotificationProvider> getNotificationProviders()
public Set<EMFObserver> getRegisteredObservers()
public void stopNotification(Object blocker)
EMFObservers. ReadOnlyEMFObservers will still
be notified. The notifications will we blocked until ChangeBroker.continueNotification(Object) has been called with
all blocking elements. Using the same blocker multiple times has no effect.
stopNotification in interface ChangeBrokerblocker - the key object used to block all notificationsChangeBroker.stopNotification(java.lang.Object)public void continueNotification(Object blocker)
blocker. When all blockers have been removed the
notification process will continue. This method calls ChangeBroker.continueNotification() internally in all cases,
even if the given blocker object was not used as a blocker beforehand.
continueNotification in interface ChangeBrokerblocker - the blocker object to remove.ChangeBroker.continueNotification(java.lang.Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||