Package io.netty.handler.codec.http2
Class Http2StreamChannelBootstrap
- java.lang.Object
-
- io.netty.handler.codec.http2.Http2StreamChannelBootstrap
-
@UnstableApi public final class Http2StreamChannelBootstrap extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<AttributeKey<?>,java.lang.Object>attrsprivate Channelchannelprivate static java.util.Map.Entry<AttributeKey<?>,java.lang.Object>[]EMPTY_ATTRIBUTE_ARRAYprivate static java.util.Map.Entry<ChannelOption<?>,java.lang.Object>[]EMPTY_OPTION_ARRAYprivate ChannelHandlerhandlerprivate static InternalLoggerloggerprivate ChannelHandlerContextmultiplexCtxprivate java.util.Map<ChannelOption<?>,java.lang.Object>options
-
Constructor Summary
Constructors Constructor Description Http2StreamChannelBootstrap(Channel channel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T> Http2StreamChannelBootstrapattr(AttributeKey<T> key, T value)Allow to specify an initial attribute of the newly createdHttp2StreamChannel.private ChannelHandlerContextfindCtx()Http2StreamChannelBootstraphandler(ChannelHandler handler)theChannelHandlerto use for serving the requests.private voidinit(Channel channel)Future<Http2StreamChannel>open()Open a newHttp2StreamChannelto use.Future<Http2StreamChannel>open(Promise<Http2StreamChannel> promise)Open a newHttp2StreamChannelto use and notifies the givenPromise.voidopen0(ChannelHandlerContext ctx, Promise<Http2StreamChannel> promise)Deprecated.should not be used directly.<T> Http2StreamChannelBootstrapoption(ChannelOption<T> option, T value)Allow to specify aChannelOptionwhich is used for theHttp2StreamChannelinstances once they got created.private static voidsetAttributes(Channel channel, java.util.Map.Entry<AttributeKey<?>,java.lang.Object>[] options)private static voidsetChannelOption(Channel channel, ChannelOption<?> option, java.lang.Object value)private static voidsetChannelOptions(Channel channel, java.util.Map.Entry<ChannelOption<?>,java.lang.Object>[] options)
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
-
EMPTY_OPTION_ARRAY
private static final java.util.Map.Entry<ChannelOption<?>,java.lang.Object>[] EMPTY_OPTION_ARRAY
-
EMPTY_ATTRIBUTE_ARRAY
private static final java.util.Map.Entry<AttributeKey<?>,java.lang.Object>[] EMPTY_ATTRIBUTE_ARRAY
-
options
private final java.util.Map<ChannelOption<?>,java.lang.Object> options
-
attrs
private final java.util.Map<AttributeKey<?>,java.lang.Object> attrs
-
channel
private final Channel channel
-
handler
private volatile ChannelHandler handler
-
multiplexCtx
private volatile ChannelHandlerContext multiplexCtx
-
-
Constructor Detail
-
Http2StreamChannelBootstrap
public Http2StreamChannelBootstrap(Channel channel)
-
-
Method Detail
-
option
public <T> Http2StreamChannelBootstrap option(ChannelOption<T> option, T value)
Allow to specify aChannelOptionwhich is used for theHttp2StreamChannelinstances once they got created. Use a value ofnullto remove a previous setChannelOption.
-
attr
public <T> Http2StreamChannelBootstrap attr(AttributeKey<T> key, T value)
Allow to specify an initial attribute of the newly createdHttp2StreamChannel. If thevalueisnull, the attribute of the specifiedkeyis removed.
-
handler
public Http2StreamChannelBootstrap handler(ChannelHandler handler)
theChannelHandlerto use for serving the requests.
-
open
public Future<Http2StreamChannel> open()
Open a newHttp2StreamChannelto use.- Returns:
- the
Futurethat will be notified once the channel was opened successfully or it failed.
-
open
public Future<Http2StreamChannel> open(Promise<Http2StreamChannel> promise)
Open a newHttp2StreamChannelto use and notifies the givenPromise.- Returns:
- the
Futurethat will be notified once the channel was opened successfully or it failed.
-
findCtx
private ChannelHandlerContext findCtx() throws java.nio.channels.ClosedChannelException
- Throws:
java.nio.channels.ClosedChannelException
-
open0
@Deprecated public void open0(ChannelHandlerContext ctx, Promise<Http2StreamChannel> promise)
Deprecated.should not be used directly. Useopen()oropen(Promise)
-
init
private void init(Channel channel)
-
setChannelOptions
private static void setChannelOptions(Channel channel, java.util.Map.Entry<ChannelOption<?>,java.lang.Object>[] options)
-
setChannelOption
private static void setChannelOption(Channel channel, ChannelOption<?> option, java.lang.Object value)
-
setAttributes
private static void setAttributes(Channel channel, java.util.Map.Entry<AttributeKey<?>,java.lang.Object>[] options)
-
-