Class RpcDataService

java.lang.Object
org.knime.core.webui.data.RpcDataService
All Implemented Interfaces:
DataService

public final class RpcDataService extends Object implements DataService
A RpcDataService where the requests result in actual method-calls of registered handler(s) (aka remote procedure calls).
Since:
4.5
Author:
Martin Horn, KNIME GmbH, Konstanz, Germany
  • Method Details

    • handleRpcRequest

      public String handleRpcRequest(String request)
      Parameters:
      request - the rpc request (e.g. encoded in json-rpc)
      Returns:
      the rpc-response (e.g. a json-rpc response)
    • getRpcServer

      public RpcServer getRpcServer()
      Returns:
      the rpc server being used
    • jsonRpcRequest

      public static String jsonRpcRequest(String method, String... params)
      Helper to create a json rpc request string.
      Parameters:
      method -
      params -
      Returns:
      the json rpc request as json string
    • dispose

      public void dispose()
      Description copied from interface: DataService
      Called whenever the data service won't be used anymore. I.e. resources can be freed-up such as clearing caches or shutting down external processes etc.
      Specified by:
      dispose in interface DataService
    • deactivate

      public void deactivate()
      Description copied from interface: DataService
      Called whenever the data service can free-up resources. E.g. clearing caches or shutting down external processes etc. Though, it does not necessarily mean, that the data service instance is not used anymore some time later.
      Specified by:
      deactivate in interface DataService
    • builder

      public static <S> RpcDataService.RpcDataServiceBuilder builder(S handler)
      Type Parameters:
      S -
      Parameters:
      handler - the handler whose methods are called. Whenever any of the methods are being called, a DataServiceContext is available within the method.
      Returns:
      a new builder instance
    • builder

      public static RpcDataService.RpcDataServiceBuilder builder()
      Returns:
      a new builder instance