@ChannelHandler.Sharable public class RpcServer extends AbstractRpcRemotingServer implements ServerMessageSender
| 限定符和类型 | 字段和说明 |
|---|---|
protected ServerMessageListener |
serverMessageListener
The Server message listener.
|
basketMap, channelHandlers, futures, isSending, mergeLock, mergeMsgMap, messageExecutor, nowMills, timerExecutor| 构造器和说明 |
|---|
RpcServer(ThreadPoolExecutor messageExecutor)
Instantiates a new Abstract rpc server.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
Channel inactive.
|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
Channel read.
|
void |
debugLog(String info)
Debug log.
|
void |
destroy()
Destroy.
|
void |
dispatch(long msgId,
io.netty.channel.ChannelHandlerContext ctx,
Object msg)
Dispatch.
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
Exception caught.
|
ServerMessageListener |
getServerMessageListener()
Gets server message listener.
|
void |
init()
Init.
|
void |
sendResponse(long msgId,
io.netty.channel.Channel channel,
Object msg)
Send response.
|
Object |
sendSyncRequest(String resourceId,
String clientId,
Object message)
Send request with response object.
|
Object |
sendSyncRequest(String resourceId,
String clientId,
Object message,
long timeout)
Send request with response object.
|
void |
setHandler(TransactionMessageHandler transactionMessageHandler)
Sets transactionMessageHandler.
|
void |
setHandler(TransactionMessageHandler transactionMessageHandler,
RegisterCheckAuthHandler checkAuthHandler)
Sets transactionMessageHandler.
|
void |
setServerMessageListener(ServerMessageListener serverMessageListener)
Sets server message listener.
|
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt)
User event triggered.
|
destroyChannel, getListenPort, setListenPort, shutdown, startaddChannelPipelineLast, channelWritabilityChanged, close, destroyChannel, getAddressFromChannel, getAddressFromContext, getGroup, sendAsyncRequestWithoutResponse, sendAsyncRequestWithResponse, sendAsyncRequestWithResponse, sendRequest, setChannelHandlers, setGroupbind, connect, deregister, disconnect, flush, read, writechannelActive, channelReadComplete, channelRegistered, channelUnregisteredensureNotSharable, handlerAdded, handlerRemoved, isSharableprotected ServerMessageListener serverMessageListener
public RpcServer(ThreadPoolExecutor messageExecutor)
messageExecutor - the message executorpublic void setHandler(TransactionMessageHandler transactionMessageHandler)
transactionMessageHandler - the transactionMessageHandlerpublic void setHandler(TransactionMessageHandler transactionMessageHandler, RegisterCheckAuthHandler checkAuthHandler)
transactionMessageHandler - the transactionMessageHandlercheckAuthHandler - the check auth handlerpublic ServerMessageListener getServerMessageListener()
public void setServerMessageListener(ServerMessageListener serverMessageListener)
serverMessageListener - the server message listenerpublic void debugLog(String info)
info - the infopublic void init()
init 在类中 AbstractRpcRemotingpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt)
userEventTriggered 在接口中 io.netty.channel.ChannelInboundHandleruserEventTriggered 在类中 io.netty.channel.ChannelInboundHandlerAdapterctx - the ctxevt - the evtException - the exceptionpublic void destroy()
destroy 在接口中 Disposabledestroy 在类中 AbstractRpcRemotingpublic void sendResponse(long msgId,
io.netty.channel.Channel channel,
Object msg)
sendResponse 在接口中 ServerMessageSendersendResponse 在类中 AbstractRpcRemotingmsgId - the msg idchannel - the channelmsg - the msgpublic Object sendSyncRequest(String resourceId, String clientId, Object message, long timeout) throws TimeoutException
sendSyncRequest 在接口中 ServerMessageSenderresourceId - the db keyclientId - the client ipmessage - the messagetimeout - the timeoutTimeoutException - the timeout exceptionpublic Object sendSyncRequest(String resourceId, String clientId, Object message) throws TimeoutException
sendSyncRequest 在接口中 ServerMessageSenderresourceId - the db keyclientId - the client ipmessage - the msgTimeoutException - the timeout exceptionpublic void dispatch(long msgId,
io.netty.channel.ChannelHandlerContext ctx,
Object msg)
dispatch 在类中 AbstractRpcRemotingmsgId - the msg idctx - the ctxmsg - the msgpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive 在接口中 io.netty.channel.ChannelInboundHandlerchannelInactive 在类中 io.netty.channel.ChannelInboundHandlerAdapterctx - the ctxException - the exceptionpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead 在接口中 io.netty.channel.ChannelInboundHandlerchannelRead 在类中 AbstractRpcRemotingctx - the ctxmsg - the msgException - the exceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 AbstractRpcRemotingctx - the ctxcause - the causeException - the exceptionCopyright © 2019 Seata. All rights reserved.