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 boolean
addActivationNotificationListener(IActivationNotificationListener listener, boolean fireNow)
Registers anIActivationNotificationListener
to receive updates on activation appearance and disappearance.void
dispose()
Disposes of the provider by unregistering all listeners.protected abstract void
listenerAdded(IActivationNotificationListener listener, boolean fireNow)
Called when a new listener is added to the provider.void
notifyActivationChanged(Activation<?> activation, ActivationState oldState, EventType event)
Notifies listeners about an activation change.void
notifyActivationCreated(Activation<?> activation, ActivationState inactiveState)
Notifies listeners about an activation creation.void
notifyActivationRemoved(Activation<?> activation, ActivationState oldState)
Notifies listeners about an activation removal.boolean
removeActivationNotificationListener(IActivationNotificationListener listener)
Unregisters a listener registered byIActivationNotificationProvider.addActivationNotificationListener(IActivationNotificationListener, boolean)
.
-
-
-
Method Detail
-
addActivationNotificationListener
public boolean addActivationNotificationListener(IActivationNotificationListener listener, boolean fireNow)
Description copied from interface:IActivationNotificationProvider
Registers anIActivationNotificationListener
to receive updates on activation appearance and disappearance.The listener can be unregistered via
IActivationNotificationProvider.removeActivationNotificationListener(IActivationNotificationListener)
.- Specified by:
addActivationNotificationListener
in 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:IActivationNotificationProvider
Unregisters a listener registered byIActivationNotificationProvider.addActivationNotificationListener(IActivationNotificationListener, boolean)
.- Specified by:
removeActivationNotificationListener
in 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.
-
-