public class BoltRpcClient extends Object implements RpcClient
| Modifier and Type | Field and Description |
|---|---|
static String |
BOLT_CTX |
static String |
BOLT_REJECTED_EXECUTION_POLICY |
| Constructor and Description |
|---|
BoltRpcClient(com.alipay.remoting.rpc.RpcClient rpcClient) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkConnection(Endpoint endpoint)
Check connection for given address.
|
boolean |
checkConnection(Endpoint endpoint,
boolean createIfAbsent)
Check connection for given address and async to create a new one if there is no connection.
|
void |
closeConnection(Endpoint endpoint)
Close all connections of a address.
|
com.alipay.remoting.rpc.RpcClient |
getRpcClient() |
boolean |
init(RpcOptions opts)
Initialize the service.
|
void |
invokeAsync(Endpoint endpoint,
Object request,
InvokeContext ctx,
InvokeCallback callback,
long timeoutMs)
Asynchronous invocation with a callback.
|
Object |
invokeSync(Endpoint endpoint,
Object request,
InvokeContext ctx,
long timeoutMs)
Synchronous invocation using a invoke context.
|
void |
registerConnectEventListener(ReplicatorGroup replicatorGroup)
Register a connect event listener for the replicator group.
|
void |
shutdown()
Dispose the resources for service.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvokeAsync, invokeSyncpublic static final String BOLT_CTX
public static final String BOLT_REJECTED_EXECUTION_POLICY
public boolean init(RpcOptions opts)
Lifecycleinit in interface Lifecycle<RpcOptions>public void shutdown()
Lifecycleshutdown in interface Lifecycle<RpcOptions>public boolean checkConnection(Endpoint endpoint)
RpcClientcheckConnection in interface RpcClientendpoint - target addresspublic boolean checkConnection(Endpoint endpoint, boolean createIfAbsent)
RpcClientcheckConnection in interface RpcClientendpoint - target addresscreateIfAbsent - create a new one if there is no connectionpublic void closeConnection(Endpoint endpoint)
RpcClientcloseConnection in interface RpcClientendpoint - target addresspublic void registerConnectEventListener(ReplicatorGroup replicatorGroup)
RpcClientregisterConnectEventListener in interface RpcClientreplicatorGroup - replicator grouppublic Object invokeSync(Endpoint endpoint, Object request, InvokeContext ctx, long timeoutMs) throws InterruptedException, RemotingException
RpcClientinvokeSync in interface RpcClientendpoint - target addressrequest - request objectctx - invoke contexttimeoutMs - timeout millisecondInterruptedExceptionRemotingExceptionpublic void invokeAsync(Endpoint endpoint, Object request, InvokeContext ctx, InvokeCallback callback, long timeoutMs) throws InterruptedException, RemotingException
RpcClientinvokeAsync in interface RpcClientendpoint - target addressrequest - request objectctx - invoke contextcallback - invoke callbacktimeoutMs - timeout millisecondInterruptedExceptionRemotingExceptionpublic com.alipay.remoting.rpc.RpcClient getRpcClient()
Copyright © 2024. All rights reserved.