Class ExtensionEventFilter

java.lang.Object
net.sf.basedb.util.extensions.events.ExtensionEventFilter
All Implemented Interfaces:
EventFilter

public class ExtensionEventFilter
extends Object
implements EventFilter
Event filter that only passes events for a specific extension.
Since:
3.10
Author:
nicklas
  • Field Details

    • id

      private final String id
    • eventType

      private final EventType eventType
  • Constructor Details

    • ExtensionEventFilter

      public ExtensionEventFilter​(Extension<?> extension, EventType eventType)
      Create a new extension event filter.
      Parameters:
      extension - The extension to pass events for
      eventType - The event type to pass events for, or null to pass all event types
    • ExtensionEventFilter

      public ExtensionEventFilter​(String id, EventType eventType)
      Create a new extension event filter.
      Parameters:
      id - The ID of the extension point
      eventType - The event type to pass events for, or null to pass all event types
  • Method Details

    • shouldSend

      public boolean shouldSend​(EventType event, ExtensionPoint<?> extensionPoint, Extension<?> extension)
      Description copied from interface: EventFilter
      Determine if the event should be sent to the event handler or not.
      Specified by:
      shouldSend in interface EventFilter
      Parameters:
      event - The event that happend
      extensionPoint - The extension point that the extension extends, or that the event happened to
      extension - The extension the event happend to, or null if the event happended to the extension point
      Returns:
      TRUE if the extension has the same ID as the one given in the constructor and if the event type matches