Class AbstractJsonRpcService
java.lang.Object
org.consensusj.jsonrpc.introspection.AbstractJsonRpcService
- All Implemented Interfaces:
JsonRpcServiceWrapper
,JsonRpcService
- Direct Known Subclasses:
DelegatingJsonRpcService
,EchoJsonRpcService
,MathService
GraalVM-compatible implementation of
JsonRpcServiceWrapper
that takes a map of Method
s in the constructor
so that introspection can be done at static initialization time (which means during native image generation).
Since getServiceObject()
returns this
you typically directly subclass AbstractJsonRpcService
.
For example see MathService
.-
Field Summary
Fields inherited from interface org.consensusj.jsonrpc.introspection.JsonRpcServiceWrapper
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <RSLT> CompletableFuture
<RSLT> Get aMethod
object for a named JSON-RPC methodGet the service object.protected <RSLT> CompletableFuture
<RSLT> result
(RSLT result) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.consensusj.jsonrpc.introspection.JsonRpcServiceWrapper
call
-
Field Details
-
methods
-
-
Constructor Details
-
AbstractJsonRpcService
-
-
Method Details
-
getServiceObject
Description copied from interface:JsonRpcServiceWrapper
Get the service object.Implementations will return their configured service object here.
- Specified by:
getServiceObject
in interfaceJsonRpcServiceWrapper
- Returns:
- the service object
-
getMethod
Description copied from interface:JsonRpcServiceWrapper
Get aMethod
object for a named JSON-RPC method- Specified by:
getMethod
in interfaceJsonRpcServiceWrapper
- Parameters:
methodName
- the name of the method to call- Returns:
- method handle
-
result
-
exception
-