@ChannelHandler.Sharable public final class RmRpcClient extends AbstractRpcRemotingClient
AbstractRpcRemotingClient.MergedSendRunnableclientMessageListener, nettyClientKeyPoolbasketMap, channelHandlers, futures, isSending, mergeLock, mergeMsgMap, messageExecutor, nowMills, timerExecutor| 限定符和类型 | 方法和说明 |
|---|---|
protected io.netty.channel.Channel |
connect(String serverAddress)
Connect channel.
|
void |
destroyChannel(String serverAddress,
io.netty.channel.Channel channel)
Destroy channel.
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
String |
getCustomerKeys()
Gets customer keys.
|
static RmRpcClient |
getInstance()
Gets instance.
|
static RmRpcClient |
getInstance(String applicationId,
String transactionServiceGroup)
Gets instance.
|
String |
getMergedResourceKeys(ResourceManager resourceManager)
Gets merged resource keys.
|
protected org.apache.commons.pool.impl.GenericKeyedObjectPool.Config |
getNettyPoolConfig()
Gets netty pool config.
|
protected NettyPoolKey.TransactionRole |
getTransactionRole()
Gets transaction role.
|
void |
init()
Init.
|
void |
onRegisterMsgFail(String serverAddress,
io.netty.channel.Channel channel,
Object response,
AbstractMessage requestMessage)
On register msg fail.
|
void |
onRegisterMsgSuccess(String serverAddress,
io.netty.channel.Channel channel,
Object response,
AbstractMessage requestMessage)
On register msg success.
|
void |
registerResource(String resourceGroupId,
String resourceId)
Register new db key.
|
protected void |
releaseChannel(io.netty.channel.Channel channel,
String serverAddress)
Release channel.
|
Object |
sendMsgWithResponse(Object msg)
Send msg with response object.
|
Object |
sendMsgWithResponse(Object msg,
long timeout)
Send msg with response object.
|
Object |
sendMsgWithResponse(String serverAddress,
Object msg,
long timeout)
Send msg with response object.
|
void |
sendResponse(long msgId,
String serverAddress,
Object msg)
Send response.
|
void |
setApplicationId(String applicationId)
Sets application id.
|
void |
setCustomerKeys(String customerKeys)
Sets customer keys.
|
void |
setResourceManager(ResourceManager resourceManager)
Sets resource manager.
|
void |
setTransactionServiceGroup(String transactionServiceGroup)
Sets transaction service group.
|
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt) |
channelInactive, channelRead, destroy, dispatch, getAvailServerList, getClientMessageListener, getNewChannel, getThreadPrefix, loadBalance, reconnect, setClientMessageListener, shutdown, startaddChannelPipelineLast, channelWritabilityChanged, close, destroyChannel, getAddressFromChannel, getAddressFromContext, getGroup, sendAsyncRequestWithoutResponse, sendAsyncRequestWithResponse, sendAsyncRequestWithResponse, sendRequest, sendResponse, setChannelHandlers, setGroupbind, connect, deregister, disconnect, flush, read, writechannelActive, channelReadComplete, channelRegistered, channelUnregisteredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic void setResourceManager(ResourceManager resourceManager)
resourceManager - the resource managerpublic static RmRpcClient getInstance(String applicationId, String transactionServiceGroup)
applicationId - the application idtransactionServiceGroup - the transaction service grouppublic static RmRpcClient getInstance()
public void init()
AbstractRpcRemotinginit 在类中 AbstractRpcRemotingClientpublic void setApplicationId(String applicationId)
applicationId - the application idpublic void setTransactionServiceGroup(String transactionServiceGroup)
transactionServiceGroup - the transaction service groupprotected org.apache.commons.pool.impl.GenericKeyedObjectPool.Config getNettyPoolConfig()
AbstractRpcRemotingClientgetNettyPoolConfig 在类中 AbstractRpcRemotingClientprotected NettyPoolKey.TransactionRole getTransactionRole()
AbstractRpcRemotingClientgetTransactionRole 在类中 AbstractRpcRemotingClientpublic Object sendMsgWithResponse(Object msg, long timeout) throws TimeoutException
ClientMessageSendermsg - the msgtimeout - the timeoutTimeoutException - the timeout exceptionpublic Object sendMsgWithResponse(String serverAddress, Object msg, long timeout) throws TimeoutException
ClientMessageSenderserverAddress - the server addressmsg - the msgtimeout - the timeoutTimeoutException - the timeout exceptionpublic Object sendMsgWithResponse(Object msg) throws TimeoutException
ClientMessageSendermsg - the msgTimeoutException - the timeout exceptionpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt)
userEventTriggered 在接口中 io.netty.channel.ChannelInboundHandleruserEventTriggered 在类中 io.netty.channel.ChannelInboundHandlerAdapterprotected void releaseChannel(io.netty.channel.Channel channel,
String serverAddress)
AbstractRpcRemotingClientreleaseChannel 在类中 AbstractRpcRemotingClientchannel - the channelserverAddress - the server addressprotected io.netty.channel.Channel connect(String serverAddress)
AbstractRpcRemotingClientconnect 在类中 AbstractRpcRemotingClientserverAddress - the server addresspublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 AbstractRpcRemotingExceptionpublic void registerResource(String resourceGroupId, String resourceId)
resourceGroupId - the resource group idresourceId - the db keypublic void sendResponse(long msgId,
String serverAddress,
Object msg)
ClientMessageSendermsgId - the msg idserverAddress - the server addressmsg - the msgpublic String getCustomerKeys()
public void setCustomerKeys(String customerKeys)
customerKeys - the customer keyspublic void onRegisterMsgSuccess(String serverAddress, io.netty.channel.Channel channel, Object response, AbstractMessage requestMessage)
RegisterMsgListenerserverAddress - the server addresschannel - the channelresponse - the responserequestMessage - the request messagepublic String getMergedResourceKeys(ResourceManager resourceManager)
resourceManager - the resource managerpublic void onRegisterMsgFail(String serverAddress, io.netty.channel.Channel channel, Object response, AbstractMessage requestMessage)
RegisterMsgListenerserverAddress - the server addresschannel - the channelresponse - the responserequestMessage - the request messagepublic void destroyChannel(String serverAddress, io.netty.channel.Channel channel)
AbstractRpcRemotingdestroyChannel 在类中 AbstractRpcRemotingserverAddress - the server addresschannel - the channelCopyright © 2019 Seata. All rights reserved.