org.eclipse.viatra.transformation.evm.api.event.adapter

## Class EventHandlerAdapter<EventAtom>

- java.lang.Object
- - org.eclipse.viatra.transformation.evm.api.event.adapter.EventHandlerAdapter<EventAtom>

- All Implemented Interfaces:
    EventHandler<EventAtom>
  Direct Known Subclasses:
    ViatraQueryEventHandler

      public abstract class EventHandlerAdapter<EventAtom>
      extends java.lang.Object
      implements EventHandler<EventAtom>

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `EventHandlerAdapter(EventSource<EventAtom> source, EventFilter<? super EventAtom> filter, RuleInstance<EventAtom> instance)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EventFilter<? super EventAtom>` | `getEventFilter()`
    `protected RuleInstance<EventAtom>` | `getInstance()`
    `EventSource<EventAtom>` | `getSource()`
    `void` | `handleEvent(Event<EventAtom> event)`
    `protected void` | `prepareEventHandler()`
    `protected abstract java.util.Map<EventType,EventProcessorAdapter<EventAtom>>` | `prepareEventProcessors()` Returns a map of event processor adapters related to the different event types.

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

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

    - ### Methods inherited from interface org.eclipse.viatra.transformation.evm.api.event.EventHandler

      `dispose`

- - ### Constructor Detail

    - #### EventHandlerAdapter

          protected EventHandlerAdapter(EventSource<EventAtom> source,
                                        EventFilter<? super EventAtom> filter,
                                        RuleInstance<EventAtom> instance)

  - ### Method Detail

    - #### prepareEventHandler

          protected void prepareEventHandler()

    - #### prepareEventProcessors

          protected abstract java.util.Map<EventType,EventProcessorAdapter<EventAtom>> prepareEventProcessors()

      Returns a map of event processor adapters related to the different event types. The method will be only called once, so there is no need to cache the results internally.
      Returns:

    - #### handleEvent

          public void handleEvent(Event<EventAtom> event)

      Specified by:
        `handleEvent` in interface `EventHandler<EventAtom>`

    - #### getSource

          public EventSource<EventAtom> getSource()

      Specified by:
        `getSource` in interface `EventHandler<EventAtom>`

    - #### getEventFilter

          public EventFilter<? super EventAtom> getEventFilter()

      Specified by:
        `getEventFilter` in interface `EventHandler<EventAtom>`

    - #### getInstance

          protected RuleInstance<EventAtom> getInstance()

      Returns:
        the instance