public interface BoltClient extends Configurable, LifeCycle
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addConnectionEventProcessor(ConnectionEventType type,
ConnectionEventProcessor processor)
Add processor to process connection event.
|
boolean |
checkConnection(String address)
check connection, the address format example - 127.0.0.1:12200?
|
boolean |
checkConnection(String address,
boolean createIfAbsent)
check connection, the address format example - 127.0.0.1:12200?
|
boolean |
checkConnection(String address,
boolean createIfAbsent,
boolean createAsync)
check connection, the address format example - 127.0.0.1:12200?
|
void |
closeConnection(String address)
Close all connections of a address
|
void |
closeConnection(Url url)
Close all connections of a
Url |
void |
closeStandaloneConnection(Connection conn)
Close a standalone connection
|
Connection |
createStandaloneConnection(String address,
int connectTimeout)
Create a stand alone connection using address, address format example - 127.0.0.1:12200
Notice: Each time you can this method, will create a new connection. |
Connection |
createStandaloneConnection(String ip,
int port,
int connectTimeout)
Create a stand alone connection using ip and port.
|
void |
disableConnectionMonitorSwitch()
disable connection monitor switch off
Notice: This api should be called before
RpcClient.init() |
void |
disableConnHeartbeat(String address)
Disable heart beat for a certain connection.
|
void |
disableConnHeartbeat(Url url)
Disable heart beat for a certain connection.
|
void |
disableReconnectSwith()
disable connection reconnect switch off
Notice: This api should be called before
RpcClient.init() |
void |
enableConnectionMonitorSwitch()
enable connection monitor switch on
|
void |
enableConnHeartbeat(String address)
Enable heart beat for a certain connection.
|
void |
enableConnHeartbeat(Url url)
Enable heart beat for a certain connection.
|
void |
enableReconnectSwitch()
enable connection reconnect switch on
Notice: This api should be called before
RpcClient.init() |
RemotingAddressParser |
getAddressParser()
Getter method for property addressParser.
|
Map<String,List<Connection>> |
getAllManagedConnections()
get all connections managed by rpc client
|
Connection |
getConnection(String addr,
int connectTimeout)
Get a connection using address, address format example - 127.0.0.1:12200?
|
Connection |
getConnection(Url url,
int connectTimeout)
Get a connection using a
Url. |
DefaultConnectionManager |
getConnectionManager()
Getter method for property connectionManager.
|
Object |
invokeSync(Connection conn,
Object request,
int timeoutMillis)
Synchronous invocation using a
Connection Notice: DO NOT modify the request object concurrently when this method is called. |
Object |
invokeSync(Connection conn,
Object request,
InvokeContext invokeContext,
int timeoutMillis)
Synchronous invocation with a
InvokeContext, common api notice please see invokeSync(Connection, Object, int) |
Object |
invokeSync(String address,
Object request,
int timeoutMillis)
Synchronous invocation using a string address, address format example - 127.0.0.1:12200?
|
Object |
invokeSync(String address,
Object request,
InvokeContext invokeContext,
int timeoutMillis)
Synchronous invocation with a
InvokeContext, common api notice please see invokeSync(String, Object, int) |
Object |
invokeSync(Url url,
Object request,
int timeoutMillis)
Synchronous invocation using a parsed
Url Notice: DO NOT modify the request object concurrently when this method is called. |
Object |
invokeSync(Url url,
Object request,
InvokeContext invokeContext,
int timeoutMillis)
Synchronous invocation with a
InvokeContext, common api notice please see invokeSync(Url, Object, int) |
void |
invokeWithCallback(Connection conn,
Object request,
InvokeCallback invokeCallback,
int timeoutMillis)
Callback invocation using a
Connection You can specify an implementation of InvokeCallback to get the result. |
void |
invokeWithCallback(Connection conn,
Object request,
InvokeContext invokeContext,
InvokeCallback invokeCallback,
int timeoutMillis)
Callback invocation with a
InvokeContext, common api notice please see invokeWithCallback(Connection, Object, InvokeCallback, int) |
void |
invokeWithCallback(String addr,
Object request,
InvokeCallback invokeCallback,
int timeoutMillis)
Callback invocation using a string address, address format example - 127.0.0.1:12200?
|
void |
invokeWithCallback(String addr,
Object request,
InvokeContext invokeContext,
InvokeCallback invokeCallback,
int timeoutMillis)
Callback invocation with a
InvokeContext, common api notice please see invokeWithCallback(String, Object, InvokeCallback, int) |
void |
invokeWithCallback(Url url,
Object request,
InvokeCallback invokeCallback,
int timeoutMillis)
Callback invocation using a parsed
Url You can specify an implementation of InvokeCallback to get the result. |
void |
invokeWithCallback(Url url,
Object request,
InvokeContext invokeContext,
InvokeCallback invokeCallback,
int timeoutMillis)
Callback invocation with a
InvokeContext, common api notice please see invokeWithCallback(Url, Object, InvokeCallback, int) |
RpcResponseFuture |
invokeWithFuture(Connection conn,
Object request,
int timeoutMillis)
|
RpcResponseFuture |
invokeWithFuture(Connection conn,
Object request,
InvokeContext invokeContext,
int timeoutMillis)
Future invocation with a
InvokeContext, common api notice please see invokeWithFuture(Connection, Object, int) |
RpcResponseFuture |
invokeWithFuture(String address,
Object request,
int timeoutMillis)
Future invocation using a string address, address format example - 127.0.0.1:12200?
|
RpcResponseFuture |
invokeWithFuture(String address,
Object request,
InvokeContext invokeContext,
int timeoutMillis)
Future invocation with a
InvokeContext, common api notice please see invokeWithFuture(String, Object, int) |
RpcResponseFuture |
invokeWithFuture(Url url,
Object request,
int timeoutMillis)
|
RpcResponseFuture |
invokeWithFuture(Url url,
Object request,
InvokeContext invokeContext,
int timeoutMillis)
Future invocation with a
InvokeContext, common api notice please see invokeWithFuture(Url, Object, int) |
boolean |
isConnectionMonitorSwitchOn()
is connection monitor switch on
|
boolean |
isReconnectSwitchOn()
is reconnect switch on
|
void |
oneway(Connection conn,
Object request)
One way invocation using a
Connection Notice: DO NOT modify the request object concurrently when this method is called. |
void |
oneway(Connection conn,
Object request,
InvokeContext invokeContext)
Oneway invocation with a
InvokeContext, common api notice please see oneway(Connection, Object) |
void |
oneway(String address,
Object request)
One way invocation using a string address, address format example - 127.0.0.1:12200?
|
void |
oneway(String address,
Object request,
InvokeContext invokeContext)
Oneway invocation with a
InvokeContext, common api notice please see oneway(Connection, Object) |
void |
oneway(Url url,
Object request)
One way invocation using a parsed
Url Notice: DO NOT modify the request object concurrently when this method is called. |
void |
oneway(Url url,
Object request,
InvokeContext invokeContext)
Oneway invocation with a
InvokeContext, common api notice please see oneway(Url, Object) |
void |
registerUserProcessor(UserProcessor<?> processor)
Use UserProcessorRegisterHelper
UserProcessorRegisterHelper to help register user processor for client side. |
void |
setAddressParser(RemotingAddressParser addressParser)
Setter method for property addressParser.
|
void |
setMonitorStrategy(ConnectionMonitorStrategy monitorStrategy)
Setter method for property monitorStrategy.
|
option, optionvoid oneway(String address, Object request) throws RemotingException, InterruptedException
Notice:
RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
closeConnection(String addr) to close it if you want.
address - target addressrequest - requestRemotingExceptionInterruptedExceptionvoid oneway(String address, Object request, InvokeContext invokeContext) throws RemotingException, InterruptedException
InvokeContext, common api notice please see oneway(Connection, Object)address - target addressrequest - requestinvokeContext - invoke contextRemotingExceptionInterruptedExceptionvoid oneway(Url url, Object request) throws RemotingException, InterruptedException
Url
Notice:
Url to find a available connection, if none then create one.Url.setConnectTimeout(int) to specify connection timeout, time unit is milliseconds.
Url.setConnNum(int) to specify connection number for each ip and port.
Url.setConnWarmup(boolean) to specify whether need warmup all connections for the first time you call this method.
closeConnection(Url url) to close it if you want.
url - target urlrequest - objectRemotingExceptionInterruptedExceptionvoid oneway(Url url, Object request, InvokeContext invokeContext) throws RemotingException, InterruptedException
InvokeContext, common api notice please see oneway(Url, Object)url - urlrequest - requestinvokeContext - invoke contextRemotingExceptionInterruptedExceptionvoid oneway(Connection conn, Object request) throws RemotingException
Connection
Notice:
DO NOT modify the request object concurrently when this method is called.
conn - target connectionrequest - requestRemotingExceptionvoid oneway(Connection conn, Object request, InvokeContext invokeContext) throws RemotingException
InvokeContext, common api notice please see oneway(Connection, Object)conn - target connectionrequest - requestinvokeContext - invoke contextRemotingExceptionObject invokeSync(String address, Object request, int timeoutMillis) throws RemotingException, InterruptedException
Notice:
RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
closeConnection(String addr) to close it if you want.
address - target addressrequest - requesttimeoutMillis - timeout millisecondRemotingExceptionInterruptedExceptionObject invokeSync(String address, Object request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeSync(String, Object, int)address - target addressrequest - requestinvokeContext - invoke contexttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionObject invokeSync(Url url, Object request, int timeoutMillis) throws RemotingException, InterruptedException
Url
Notice:
Url to find a available connection, if none then create one.Url.setConnectTimeout(int) to specify connection timeout, time unit is milliseconds.
Url.setConnNum(int) to specify connection number for each ip and port.
Url.setConnWarmup(boolean) to specify whether need warmup all connections for the first time you call this method.
closeConnection(Url url) to close it if you want.
url - target urlrequest - requesttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionObject invokeSync(Url url, Object request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeSync(Url, Object, int)url - target urlrequest - requestinvokeContext - invoke contexttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionObject invokeSync(Connection conn, Object request, int timeoutMillis) throws RemotingException, InterruptedException
Connection
Notice:
DO NOT modify the request object concurrently when this method is called.
conn - target connectionrequest - requesttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionObject invokeSync(Connection conn, Object request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeSync(Connection, Object, int)conn - target connectionrequest - requestinvokeContext - invoke contexttimeoutMillis - timeout in millisRemotingExceptionInterruptedExceptionRpcResponseFuture invokeWithFuture(String address, Object request, int timeoutMillis) throws RemotingException, InterruptedException
RpcResponseFuture.
Notice:
RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
closeConnection(String addr) to close it if you want.
address - target addressrequest - requesttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionRpcResponseFuture invokeWithFuture(String address, Object request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeWithFuture(String, Object, int)address - target addressrequest - requestinvokeContext - invoke contexttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionRpcResponseFuture invokeWithFuture(Url url, Object request, int timeoutMillis) throws RemotingException, InterruptedException
Url RpcResponseFuture.
Notice:
Url to find a available connection, if none then create one.Url.setConnectTimeout(int) to specify connection timeout, time unit is milliseconds.
Url.setConnNum(int) to specify connection number for each ip and port.
Url.setConnWarmup(boolean) to specify whether need warmup all connections for the first time you call this method.
closeConnection(Url url) to close it if you want.
url - target urlrequest - requesttimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionRpcResponseFuture invokeWithFuture(Url url, Object request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeWithFuture(Url, Object, int)url - target urlrequest - requestinvokeContext - invoke contexttimeoutMillis - timeout in millisRemotingExceptionInterruptedExceptionRpcResponseFuture invokeWithFuture(Connection conn, Object request, int timeoutMillis) throws RemotingException
Connection RpcResponseFuture.
Notice:
DO NOT modify the request object concurrently when this method is called.
conn - target connectionrequest - requesttimeoutMillis - timeout in millisRemotingExceptionRpcResponseFuture invokeWithFuture(Connection conn, Object request, InvokeContext invokeContext, int timeoutMillis) throws RemotingException
InvokeContext, common api notice please see invokeWithFuture(Connection, Object, int)conn - target connectionrequest - requestinvokeContext - contexttimeoutMillis - timeout millisecondRemotingExceptionvoid invokeWithCallback(String addr, Object request, InvokeCallback invokeCallback, int timeoutMillis) throws RemotingException, InterruptedException
InvokeCallback to get the result.
Notice:
RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
closeConnection(String addr) to close it if you want.
addr - target addressrequest - requestinvokeCallback - callbacktimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionvoid invokeWithCallback(String addr, Object request, InvokeContext invokeContext, InvokeCallback invokeCallback, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeWithCallback(String, Object, InvokeCallback, int)addr - target addressrequest - requestinvokeContext - contextinvokeCallback - callbacktimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionvoid invokeWithCallback(Url url, Object request, InvokeCallback invokeCallback, int timeoutMillis) throws RemotingException, InterruptedException
Url InvokeCallback to get the result.
Notice:
Url to find a available connection, if none then create one.Url.setConnectTimeout(int) to specify connection timeout, time unit is milliseconds.
Url.setConnNum(int) to specify connection number for each ip and port.
Url.setConnWarmup(boolean) to specify whether need warmup all connections for the first time you call this method.
closeConnection(Url url) to close it if you want.
url - target urlrequest - requestinvokeCallback - callbacktimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionvoid invokeWithCallback(Url url, Object request, InvokeContext invokeContext, InvokeCallback invokeCallback, int timeoutMillis) throws RemotingException, InterruptedException
InvokeContext, common api notice please see invokeWithCallback(Url, Object, InvokeCallback, int)url - target urlrequest - requestinvokeContext - contextinvokeCallback - callbacktimeoutMillis - timeout in millisecondRemotingExceptionInterruptedExceptionvoid invokeWithCallback(Connection conn, Object request, InvokeCallback invokeCallback, int timeoutMillis) throws RemotingException
Connection InvokeCallback to get the result.
Notice:
DO NOT modify the request object concurrently when this method is called.
conn - target connectionrequest - requestinvokeCallback - callbacktimeoutMillis - timeout in millisecondRemotingExceptionvoid invokeWithCallback(Connection conn, Object request, InvokeContext invokeContext, InvokeCallback invokeCallback, int timeoutMillis) throws RemotingException
InvokeContext, common api notice please see invokeWithCallback(Connection, Object, InvokeCallback, int)conn - target connectionrequest - requestinvokeContext - invoke contextinvokeCallback - callbacktimeoutMillis - timeout in millisecondRemotingExceptionvoid addConnectionEventProcessor(ConnectionEventType type, ConnectionEventProcessor processor)
type - connection event typeprocessor - connection event processvoid registerUserProcessor(UserProcessor<?> processor)
UserProcessorRegisterHelper to help register user processor for client side.Connection createStandaloneConnection(String ip, int port, int connectTimeout) throws RemotingException
Notice:
closeStandaloneConnection(com.alipay.remoting.Connection) to close it.ip - ipport - portconnectTimeout - timeout in millisecondRemotingExceptionConnection createStandaloneConnection(String address, int connectTimeout) throws RemotingException
Notice:
closeStandaloneConnection(com.alipay.remoting.Connection) to close it.
address - target addressconnectTimeout - timeout in millisecondRemotingExceptionvoid closeStandaloneConnection(Connection conn)
conn - target connectionConnection getConnection(String addr, int connectTimeout) throws RemotingException, InterruptedException
Notice:
RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
ConnectionPool
closeConnection(String addr) to close it.
addr - target addressconnectTimeout - this is prior to url args RpcConfigs.CONNECT_TIMEOUT_KEYRemotingExceptionInterruptedExceptionConnection getConnection(Url url, int connectTimeout) throws RemotingException, InterruptedException
Url.Notice:
ConnectionPool
closeConnection(Url url) to close it.
url - target urlconnectTimeout - this is prior to url args RpcConfigs.CONNECT_TIMEOUT_KEYRemotingExceptionInterruptedExceptionMap<String,List<Connection>> getAllManagedConnections()
boolean checkConnection(String address)
address - target addressboolean checkConnection(String address, boolean createIfAbsent)
address - target addresscreateIfAbsent - if need to createboolean checkConnection(String address, boolean createIfAbsent, boolean createAsync)
address - target addresscreateIfAbsent - if need to createcreateAsync - create connection asynchronousvoid closeConnection(String address)
address - target addressvoid enableConnHeartbeat(String address)
Notice: this method takes no effect on a stand alone connection.
address - target addressvoid enableConnHeartbeat(Url url)
Url not connected, then do nothing.
Notice: this method takes no effect on a stand alone connection.
url - target urlvoid disableConnHeartbeat(String address)
Notice: this method takes no effect on a stand alone connection.
address - target addressvoid disableConnHeartbeat(Url url)
Url not connected, then do nothing.
Notice: this method takes no effect on a stand alone connection.
url - target urlvoid enableReconnectSwitch()
Notice: This api should be called before RpcClient.init()
void disableReconnectSwith()
Notice: This api should be called before RpcClient.init()
boolean isReconnectSwitchOn()
void enableConnectionMonitorSwitch()
void disableConnectionMonitorSwitch()
Notice: This api should be called before RpcClient.init()
boolean isConnectionMonitorSwitchOn()
DefaultConnectionManager getConnectionManager()
RemotingAddressParser getAddressParser()
void setAddressParser(RemotingAddressParser addressParser)
addressParser - value to be assigned to property addressParservoid setMonitorStrategy(ConnectionMonitorStrategy monitorStrategy)
monitorStrategy - value to be assigned to property monitorStrategyCopyright © 2020. All rights reserved.