Class EventService

java.lang.Object
org.projectnessie.events.service.EventService
All Implemented Interfaces:
AutoCloseable

public class EventService extends Object implements AutoCloseable
Base class for event services.

This class takes care of starting and stopping the subscribers, and provides helper methods for handling incoming results from the version store, and for firing events.

This class is meant to be used as a singleton. It provides all the required functionality to process and deliver events. Subclasses may override some of the protected methods to add support for tracing, or to implement more sophisticated delivery logic.

  • Field Details

  • Constructor Details

  • Method Details

    • start

      public void start()
      Starts event delivery by activating the subscribers.
    • close

      public void close()
      Closes the event service by deactivating the subscribers.
      Specified by:
      close in interface AutoCloseable
    • onVersionStoreEvent

      public void onVersionStoreEvent(VersionStoreEvent event)
      Invoked when a result is received from the version store by ResultCollector, then forwarded to this service for delivery.
      See Also:
    • fireEvent

      protected void fireEvent(org.projectnessie.events.api.Event event)
      Forwards the event to all subscribers.
    • deliverEvent

      protected void deliverEvent(org.projectnessie.events.api.Event event, org.projectnessie.events.spi.EventSubscriber subscriber, org.projectnessie.events.spi.EventSubscription subscription)