Class DelegatingJsonRpcService
java.lang.Object
org.consensusj.jsonrpc.introspection.AbstractJsonRpcService
org.consensusj.jsonrpc.introspection.DelegatingJsonRpcService
- All Implemented Interfaces:
JsonRpcServiceWrapper
,JsonRpcService
- Direct Known Subclasses:
WalletAppKitJsonRpcService
Implementation of
JsonRpcServiceWrapper
that takes a delegate
object in the constructor.
Use this class when
-
Field Summary
Fields inherited from class org.consensusj.jsonrpc.introspection.AbstractJsonRpcService
methods
Fields inherited from interface org.consensusj.jsonrpc.introspection.JsonRpcServiceWrapper
log
-
Constructor Summary
ConstructorDescriptionDelegatingJsonRpcService
(Object serviceObject) Use this constructor for simplicity and if you don't need GraalVM supportDelegatingJsonRpcService
(Map<String, Method> methods, Object serviceObject) Use this constructor for GraalVM compatibility and make sure yourmethods
Map
was statically initialized. -
Method Summary
Methods inherited from class org.consensusj.jsonrpc.introspection.AbstractJsonRpcService
exception, 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
-
Constructor Details
-
DelegatingJsonRpcService
Use this constructor for simplicity and if you don't need GraalVM support- Parameters:
serviceObject
- the service object to wrap.
-
DelegatingJsonRpcService
Use this constructor for GraalVM compatibility and make sure yourmethods
Map
was statically initialized.- Parameters:
methods
- A map that maps method-name strings toMethod
objects.serviceObject
- The service object to wrap
-
-
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
- Overrides:
getServiceObject
in classAbstractJsonRpcService
- Returns:
- the service object
-
getMethod
Description copied from interface:JsonRpcServiceWrapper
Get aMethod
object for a named JSON-RPC method- Specified by:
getMethod
in interfaceJsonRpcServiceWrapper
- Overrides:
getMethod
in classAbstractJsonRpcService
- Parameters:
methodName
- the name of the method to call- Returns:
- method handle
-