Interface IEventChannel

All Superinterfaces:
Serializable
All Known Subinterfaces:
IAttributeValue, IComposerContext, IEntityInstance, IEventDispatcher, InferenceContext, IProfile
All Known Implementing Classes:
AttributeState, ComposerContext, ConcurrentEntityInstance, ConcurrentInferenceContext, DefaultContext, DependencyInstance, DependencyProfile, DependentValueContext, EntityInstance, EventDispatcher, InferenceContextDelegate, InstanceContext, InstanceDelegate, InstanceStackContext, PortalProfile, Profile, ProfileDelegate, ReadonlyInferenceContext, ReadonlyInstance, ReadonlyProfile, TmsAttributeState, TmsEntityInstance, TmsProfile, TxAttributeValue, TxEntityInstance, TxInferenceContext, TxProfile, UsedValuesInferenceContext

public interface IEventChannel extends Serializable
The event channel interface exposes methods that classes should implement in order to function as a source for events for listeners. An event channel should indicate what type of listeners are supported by returning a mask containing all the event masks in the getSupportedEvents method.
Since:
5.0
Author:
O. Kerpershoek
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This method will add the passed event listener to the list of listeners.
    int
    This method returns a bit-mask containing all event types that are supported by this event channel.
    boolean
    This method will remove the specified event listener from the list of listeners.
  • Method Details

    • getSupportedEvents

      int getSupportedEvents()
      This method returns a bit-mask containing all event types that are supported by this event channel. The bit-mask is a bitwise OR of the diverse event types. To check whether a specific event-listener is supported, you can do the following:
       // This checks if a VALUE listener is supported
       if ((channel.getSupportedEvents() & IEvent.Mask.VALUE) != 0) {
         // VALUE event listeners that are supported
       }
       
      Returns:
      Bit-mask containing the event types that are supported by this event channel.
    • addEventListener

      boolean addEventListener(IEventListener listener)
      This method will add the passed event listener to the list of listeners.
      Parameters:
      listener - The event listener that should be added.
      Returns:
      boolean indicating is the listener was actually added.
    • removeEventListener

      boolean removeEventListener(IEventListener listener)
      This method will remove the specified event listener from the list of listeners.
      Parameters:
      listener - The event listener that should be removed.
      Returns:
      boolean indicating if the listener was actually removed.