T - RPC typeSC - server connection typepublic abstract class BasicServer<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>> extends RpcBus<T,SC>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BasicServer.ServerHandshakeHandler<T extends com.google.protobuf.MessageLite> |
RpcBus.ChannelClosedHandler, RpcBus.InboundHandler| Constructor and Description |
|---|
BasicServer(RpcConfig rpcMapping,
ByteBufAllocator alloc,
io.netty.channel.EventLoopGroup eventLoopGroup) |
| Modifier and Type | Method and Description |
|---|---|
int |
bind(int initialPort,
boolean allowPortHunting) |
void |
close() |
protected void |
closeSSL() |
protected abstract ProtobufLengthDecoder |
getDecoder(BufferAllocator allocator,
OutOfMemoryHandler outOfMemoryHandler) |
protected abstract BasicServer.ServerHandshakeHandler<?> |
getHandshakeHandler(SC connection) |
protected OutOfMemoryHandler |
getOutOfMemoryHandler() |
protected abstract com.google.protobuf.MessageLite |
getResponseDefaultInstance(int rpcType) |
protected void |
handle(SC connection,
int rpcType,
ByteBuf pBody,
ByteBuf dBody,
ResponseSender sender) |
protected SC |
initRemoteConnection(io.netty.channel.socket.SocketChannel channel) |
protected boolean |
isSslEnabled() |
void |
setSslChannel(io.netty.channel.Channel c) |
protected void |
setupSSL(io.netty.channel.ChannelPipeline pipe) |
get, getCloseHandler, send, send, send, setAddressespublic BasicServer(RpcConfig rpcMapping, ByteBufAllocator alloc, io.netty.channel.EventLoopGroup eventLoopGroup)
protected void setupSSL(io.netty.channel.ChannelPipeline pipe)
protected boolean isSslEnabled()
public void setSslChannel(io.netty.channel.Channel c)
protected void closeSSL()
protected OutOfMemoryHandler getOutOfMemoryHandler()
protected abstract ProtobufLengthDecoder getDecoder(BufferAllocator allocator, OutOfMemoryHandler outOfMemoryHandler)
protected abstract BasicServer.ServerHandshakeHandler<?> getHandshakeHandler(SC connection)
protected abstract com.google.protobuf.MessageLite getResponseDefaultInstance(int rpcType)
throws RpcException
getResponseDefaultInstance in class RpcBus<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>>RpcExceptionprotected void handle(SC connection, int rpcType, ByteBuf pBody, ByteBuf dBody, ResponseSender sender) throws RpcException
handle in class RpcBus<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>>RpcExceptionprotected SC initRemoteConnection(io.netty.channel.socket.SocketChannel channel)
initRemoteConnection in class RpcBus<T extends com.google.protobuf.Internal.EnumLite,SC extends ServerConnection<SC>>public int bind(int initialPort,
boolean allowPortHunting)
public void close()
throws IOException
IOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.