Interface EventManager


  • public interface EventManager
    Event manager that is entry point for handling events generated during execution.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addPublisher​(EventPublisher publisher)
      Adds given publisher to the event manager's list of publishers.
      EventBatch newBatch()
      Returns new batch instance, that should be used just by one processing thread
      void publish​(EventBatch batch)
      Publishes events of the batch with main restriction that the batch is processed only when there are any publishers available.
      void setAddons​(Addons addons)
      Optionally adds available addons in the running service
      void setService​(String service)
      Sets the service information that will be attached to events as source.
    • Method Detail

      • newBatch

        EventBatch newBatch()
        Returns new batch instance, that should be used just by one processing thread
        Returns:
        new batch instance
      • publish

        void publish​(EventBatch batch)
        Publishes events of the batch with main restriction that the batch is processed only when there are any publishers available.
        Parameters:
        batch - batch to be published
      • addPublisher

        void addPublisher​(EventPublisher publisher)
        Adds given publisher to the event manager's list of publishers. Multiple publishers can be added and each will be invoked with exact same events.
        Parameters:
        publisher - publisher to be added
      • setService

        void setService​(String service)
        Sets the service information that will be attached to events as source. This is expected to be URL like structure that will allow consumer of the events to navigate back.
        Parameters:
        service - endpoint of the service
      • setAddons

        void setAddons​(Addons addons)
        Optionally adds available addons in the running service
        Parameters:
        addons - addons available in the service