Class ActivationNotificationProvider
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.notification.ActivationNotificationProvider
-
- All Implemented Interfaces:
IActivationNotificationProvider
public abstract class ActivationNotificationProvider extends java.lang.Object implements IActivationNotificationProvider
Classes implement this interface to provide notifications about the changes in the collection of activations within the AbstractRule Engine.
-
-
Constructor Summary
Constructors Constructor Description ActivationNotificationProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddActivationNotificationListener(IActivationNotificationListener listener, boolean fireNow)Registers anIActivationNotificationListenerto receive updates on activation appearance and disappearance.voiddispose()Disposes of the provider by unregistering all listeners.protected abstract voidlistenerAdded(IActivationNotificationListener listener, boolean fireNow)Called when a new listener is added to the provider.voidnotifyActivationChanged(Activation<?> activation, ActivationState oldState, EventType event)Notifies listeners about an activation change.voidnotifyActivationCreated(Activation<?> activation, ActivationState inactiveState)Notifies listeners about an activation creation.voidnotifyActivationRemoved(Activation<?> activation, ActivationState oldState)Notifies listeners about an activation removal.booleanremoveActivationNotificationListener(IActivationNotificationListener listener)Unregisters a listener registered byIActivationNotificationProvider.addActivationNotificationListener(IActivationNotificationListener, boolean).
-
-
-
Method Detail
-
addActivationNotificationListener
public boolean addActivationNotificationListener(IActivationNotificationListener listener, boolean fireNow)
Description copied from interface:IActivationNotificationProviderRegisters anIActivationNotificationListenerto receive updates on activation appearance and disappearance.The listener can be unregistered via
IActivationNotificationProvider.removeActivationNotificationListener(IActivationNotificationListener).- Specified by:
addActivationNotificationListenerin interfaceIActivationNotificationProvider- Parameters:
listener- the listener that will be notified of each new activation that appears or disappears, starting from now.fireNow- if true, listener will be immediately invoked on all current activations as a one-time effect.
-
listenerAdded
protected abstract void listenerAdded(IActivationNotificationListener listener, boolean fireNow)
Called when a new listener is added to the provider.- Parameters:
listener-fireNow- if true, all existing activations should be sent as appear notifications, with inactive old state.
-
removeActivationNotificationListener
public boolean removeActivationNotificationListener(IActivationNotificationListener listener)
Description copied from interface:IActivationNotificationProviderUnregisters a listener registered byIActivationNotificationProvider.addActivationNotificationListener(IActivationNotificationListener, boolean).- Specified by:
removeActivationNotificationListenerin interfaceIActivationNotificationProvider- Parameters:
listener- the listener that will no longer be notified.
-
notifyActivationChanged
public void notifyActivationChanged(Activation<?> activation, ActivationState oldState, EventType event)
Notifies listeners about an activation change.- Parameters:
activation-oldState-event-
-
notifyActivationCreated
public void notifyActivationCreated(Activation<?> activation, ActivationState inactiveState)
Notifies listeners about an activation creation.- Parameters:
activation-inactiveState-
-
notifyActivationRemoved
public void notifyActivationRemoved(Activation<?> activation, ActivationState oldState)
Notifies listeners about an activation removal.- Parameters:
activation-oldState-
-
dispose
public void dispose()
Disposes of the provider by unregistering all listeners.
-
-