public abstract class AbstractRpcRemotingClient extends AbstractRpcRemoting implements RemotingService, RegisterMsgListener, ClientMessageSender
| 限定符和类型 | 类和说明 |
|---|---|
class |
AbstractRpcRemotingClient.MergedSendRunnable
The type Merged send runnable.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected ClientMessageListener |
clientMessageListener
The Client message listener.
|
protected org.apache.commons.pool.impl.GenericKeyedObjectPool<NettyPoolKey,io.netty.channel.Channel> |
nettyClientKeyPool
The Netty client key pool.
|
basketMap, channelHandlers, futures, isSending, mergeLock, mergeMsgMap, messageExecutor, nowMills, timerExecutor| 构造器和说明 |
|---|
AbstractRpcRemotingClient(NettyClientConfig nettyClientConfig)
Instantiates a new Rpc remoting client.
|
AbstractRpcRemotingClient(NettyClientConfig nettyClientConfig,
io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup,
ThreadPoolExecutor messageExecutor)
Instantiates a new Rpc remoting client.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected abstract io.netty.channel.Channel |
connect(String serverAddress)
Connect channel.
|
void |
destroy()
Destroy.
|
void |
dispatch(long msgId,
io.netty.channel.ChannelHandlerContext ctx,
Object msg)
Dispatch.
|
protected List<String> |
getAvailServerList(String transactionServiceGroup)
Gets avail server list.
|
ClientMessageListener |
getClientMessageListener()
Gets client message listener.
|
protected abstract org.apache.commons.pool.impl.GenericKeyedObjectPool.Config |
getNettyPoolConfig()
Gets netty pool config.
|
protected io.netty.channel.Channel |
getNewChannel(InetSocketAddress address)
Gets new channel.
|
protected String |
getThreadPrefix(String threadPrefix)
Gets thread prefix.
|
protected abstract NettyPoolKey.TransactionRole |
getTransactionRole()
Gets transaction role.
|
void |
init()
Init.
|
protected String |
loadBalance(String transactionServiceGroup) |
protected void |
reconnect(String transactionServiceGroup) |
protected abstract void |
releaseChannel(io.netty.channel.Channel channel,
String serverAddress)
Release channel.
|
void |
setClientMessageListener(ClientMessageListener clientMessageListener)
Sets client message listener.
|
void |
shutdown()
Shutdown.
|
void |
start()
Start.
|
addChannelPipelineLast, channelWritabilityChanged, close, destroyChannel, destroyChannel, exceptionCaught, getAddressFromChannel, getAddressFromContext, getGroup, sendAsyncRequestWithoutResponse, sendAsyncRequestWithResponse, sendAsyncRequestWithResponse, sendRequest, sendResponse, setChannelHandlers, setGroupbind, connect, deregister, disconnect, flush, read, writechannelActive, channelReadComplete, channelRegistered, channelUnregistered, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonRegisterMsgFail, onRegisterMsgSuccesssendMsgWithResponse, sendMsgWithResponse, sendMsgWithResponse, sendResponseprotected org.apache.commons.pool.impl.GenericKeyedObjectPool<NettyPoolKey,io.netty.channel.Channel> nettyClientKeyPool
protected ClientMessageListener clientMessageListener
public AbstractRpcRemotingClient(NettyClientConfig nettyClientConfig)
nettyClientConfig - the netty client configpublic AbstractRpcRemotingClient(NettyClientConfig nettyClientConfig, io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup, ThreadPoolExecutor messageExecutor)
nettyClientConfig - the netty client configeventExecutorGroup - the event executor groupmessageExecutor - the message executorpublic void init()
AbstractRpcRemotinginit 在类中 AbstractRpcRemotingpublic void start()
RemotingServicestart 在接口中 RemotingServiceprotected io.netty.channel.Channel getNewChannel(InetSocketAddress address)
address - the addresspublic void shutdown()
RemotingServiceshutdown 在接口中 RemotingServicepublic void destroy()
AbstractRpcRemotingdestroy 在接口中 Disposabledestroy 在类中 AbstractRpcRemotingpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead 在接口中 io.netty.channel.ChannelInboundHandlerchannelRead 在类中 AbstractRpcRemotingExceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive 在接口中 io.netty.channel.ChannelInboundHandlerchannelInactive 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic ClientMessageListener getClientMessageListener()
public void setClientMessageListener(ClientMessageListener clientMessageListener)
clientMessageListener - the client message listenerpublic void dispatch(long msgId,
io.netty.channel.ChannelHandlerContext ctx,
Object msg)
AbstractRpcRemotingdispatch 在类中 AbstractRpcRemotingmsgId - the msg idctx - the ctxmsg - the msgprotected void reconnect(String transactionServiceGroup)
protected List<String> getAvailServerList(String transactionServiceGroup) throws Exception
transactionServiceGroup - the transaction service groupException - the exceptionprotected String getThreadPrefix(String threadPrefix)
threadPrefix - the thread prefixprotected abstract io.netty.channel.Channel connect(String serverAddress)
serverAddress - the server addressprotected abstract void releaseChannel(io.netty.channel.Channel channel,
String serverAddress)
channel - the channelserverAddress - the server addressprotected abstract org.apache.commons.pool.impl.GenericKeyedObjectPool.Config getNettyPoolConfig()
protected abstract NettyPoolKey.TransactionRole getTransactionRole()
Copyright © 2019 Seata. All rights reserved.