Class EventService

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class EventService
    extends java.lang.Object
    implements java.lang.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.

    • Method Detail

      • 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 java.lang.AutoCloseable
      • 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)