Class EventPublisher

  • All Implemented Interfaces:
    Publisher<java.util.Map<java.lang.String,​java.lang.Object>,​EventSubscriber>

    public class EventPublisher
    extends java.lang.Object
    implements Publisher<java.util.Map<java.lang.String,​java.lang.Object>,​EventSubscriber>
    Jsonrpc implementation of Publisher
    • Constructor Detail

      • EventPublisher

        public EventPublisher​(java.util.concurrent.ExecutorService executorService,
                              int eventTimeoutInHours)
    • Method Detail

      • cleanupOldEvents

        public void cleanupOldEvents()
      • publish

        public void publish​(java.lang.String subscriptionId,
                            java.util.Map<java.lang.String,​java.lang.Object> params)
                     throws java.io.IOException
        Description copied from interface: Publisher
        Request Publisher to send data.
        Specified by:
        publish in interface Publisher<java.util.Map<java.lang.String,​java.lang.Object>,​EventSubscriber>
        Parameters:
        subscriptionId - the identifier for Subscriber who will consume the event
        params - the data that needs to be sent to the Subscriber
        Throws:
        java.io.IOException - an exception is thrown if the params cannot be serialized
      • process

        public void process​(JsonRpcEvent event)
        This method is used by @link ResponseWorker to submit an @link JsonRpcEvent for processing.
        Parameters:
        event - which is submitted for processing.
      • countEvents

        public int countEvents​(JsonRpcEvent event)
      • close

        public void close()