Class ResponseWorker

java.lang.Object
java.lang.Thread
org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker
All Implemented Interfaces:
Runnable

public final class ResponseWorker extends Thread
ResponseWorker is responsible to process responses for all the JsonRpcClient and it is produced by ReactorFactory.
  • Field Details

    • queue

      private final LinkedBlockingQueue<MessageContext> queue
    • MAPPER

      private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
    • tracker

      private final ResponseTracker tracker
    • publisher

      private final EventPublisher publisher
    • log

      private static final org.slf4j.Logger log
    • SENSITIVE_DATA_PATTERN

      private static final Pattern SENSITIVE_DATA_PATTERN
  • Constructor Details

    • ResponseWorker

      public ResponseWorker(int parallelism, int eventTimeoutInHours)
  • Method Details

    • register

      public JsonRpcClient register(ReactorClient client)
      Registers new client with ResponseWorker.
      Parameters:
      client - - JsonRpcClient to be registered.
      Returns:
      Client wrapper.
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • processIncomingObject

      private void processIncomingObject(JsonRpcClient client, com.fasterxml.jackson.databind.JsonNode node)
    • processNotifications

      private void processNotifications(JsonRpcEvent notification)
    • close

      public void close()
    • getPublisher

      public EventPublisher getPublisher()
      Returns:
      publisher which can be used to subscribe to events defined by subscription id.