public abstract class AbstractSniHandler<T> extends ByteToMessageDecoder implements ChannelOutboundHandler
为服务器端SSL启用SNI (Server Name Indication)扩展。 对于支持SNI的客户端,服务器可以在单个IP上绑定多个主机名。 客户端将在握手数据中发送主机名,以便服务器可以决定为主机名选择哪个证书。
ByteToMessageDecoder.CumulatorChannelHandler.SharableCOMPOSITE_CUMULATOR, MERGE_CUMULATOR| Constructor and Description |
|---|
AbstractSniHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise)
调用一次绑定操作。
|
void |
close(ChannelHandlerContext ctx, ChannelPromise promise)
一旦进行了密切的操作,就会被调用。
|
void |
connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
连接操作完成后调用。
|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf到另一个。
|
void |
deregister(ChannelHandlerContext ctx, ChannelPromise promise)
一旦从当前注册的 EventLoop开始取消注册操作,就会被调用。
|
void |
disconnect(ChannelHandlerContext ctx, ChannelPromise promise)
调用一次断开操作。
|
void |
flush(ChannelHandlerContext ctx)
调用一次冲洗操作。
|
protected abstract Future<T> |
lookup(ChannelHandlerContext ctx, java.lang.String hostname)
开始查找给定的SNI值并返回一个 Future ,这反过来会在完成时通知onLookupComplete(ChannelHandlerContext, String, Future) 。
|
protected abstract void |
onLookupComplete(ChannelHandlerContext ctx, java.lang.String hostname, Future<T> future)
|
void |
read(ChannelHandlerContext ctx)
|
void |
write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise)
一旦写入操作被调用,就调用它。
|
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedprotected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
decode在课堂上
ByteToMessageDecoder
ctx - ByteToMessageDecoder属于的ChannelHandlerContext
in - 从中读取数据的ByteBuf
out - 应该添加解码消息的
List
java.lang.Exception - 发生错误时抛出
protected abstract Future<T> lookup(ChannelHandlerContext ctx, java.lang.String hostname) throws java.lang.Exception
Future ,这反过来会在完成时通知onLookupComplete(ChannelHandlerContext, String, Future) 。
java.lang.Exception
onLookupComplete(ChannelHandlerContext, String, Future)
protected abstract void onLookupComplete(ChannelHandlerContext ctx, java.lang.String hostname, Future<T> future) throws java.lang.Exception
java.lang.Exception
lookup(ChannelHandlerContext, String)
public void read(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler
read在界面
ChannelOutboundHandler
java.lang.Exception
public void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler复制的描述
bind在界面
ChannelOutboundHandler
ctx - 为其进行绑定操作的ChannelHandlerContext
localAddress - 它应该绑定的
SocketAddress
promise - 操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
connect在界面
ChannelOutboundHandler
ctx - 进行连接操作的ChannelHandlerContext
remoteAddress - 它应该连接到的
SocketAddress
localAddress - 用作连接源的
SocketAddress
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
disconnect在界面
ChannelOutboundHandler
ctx - 为其进行断开操作的ChannelHandlerContext
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
close在界面
ChannelOutboundHandler
ctx - 关闭操作的ChannelHandlerContext
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler
EventLoop开始取消注册操作,就会被调用。
deregister ,界面
ChannelOutboundHandler
ctx - 进行关闭操作的ChannelHandlerContext
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandler复制的描述
write ,界面
ChannelOutboundHandler
ctx - 进行写入操作的ChannelHandlerContext
msg - 要写的消息
promise - 在操作完成后通知ChannelPromise
java.lang.Exception - 发生错误时抛出
public void flush(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandler复制的描述
flush接口
ChannelOutboundHandler
ctx - 进行冲洗操作的ChannelHandlerContext
java.lang.Exception - 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.