Package org.knime.core.webui.data
Class RpcDataService
java.lang.Object
org.knime.core.webui.data.RpcDataService
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe builder.Nested classes/interfaces inherited from interface org.knime.core.webui.data.DataService
DataService.DataServiceBuilder -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static <S> RpcDataService.RpcDataServiceBuilderbuilder(S handler) voidCalled whenever the data service can free-up resources.voiddispose()Called whenever the data service won't be used anymore.handleRpcRequest(String request) static StringjsonRpcRequest(String method, String... params) Helper to create a json rpc request string.
-
Method Details
-
handleRpcRequest
- Parameters:
request- the rpc request (e.g. encoded in json-rpc)- Returns:
- the rpc-response (e.g. a json-rpc response)
-
getRpcServer
- Returns:
- the rpc server being used
-
jsonRpcRequest
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:DataServiceCalled 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:
disposein interfaceDataService
-
deactivate
public void deactivate()Description copied from interface:DataServiceCalled 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:
deactivatein interfaceDataService
-
builder
- Type Parameters:
S-- Parameters:
handler- the handler whose methods are called. Whenever any of the methods are being called, aDataServiceContextis available within the method.- Returns:
- a new builder instance
-
builder
- Returns:
- a new builder instance
-