org.eclipse.viatra.transformation.evm.notification

## 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 and Description
    `ActivationNotificationProvider()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addActivationNotificationListener(IActivationNotificationListener listener, boolean fireNow)` Registers an `IActivationNotificationListener` 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 by `IActivationNotificationProvider.addActivationNotificationListener(IActivationNotificationListener, boolean)`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ActivationNotificationProvider

          public ActivationNotificationProvider()

  - ### Method Detail

    - #### addActivationNotificationListener

          public boolean addActivationNotificationListener(IActivationNotificationListener listener,
                                                           boolean fireNow)

      Description copied from interface: `IActivationNotificationProvider`
      Registers an `IActivationNotificationListener` to receive updates on activation appearance and disappearance.

      The listener can be unregistered via `IActivationNotificationProvider.removeActivationNotificationListener(IActivationNotificationListener)`.

      Specified by:
        `addActivationNotificationListener` in interface `IActivationNotificationProvider`
      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 by `IActivationNotificationProvider.addActivationNotificationListener(IActivationNotificationListener, boolean)`.
      Specified by:
        `removeActivationNotificationListener` in interface `IActivationNotificationProvider`
      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.