@UnstableApi public class Http2StreamChannelBootstrap extends Object
Channel
.
The bootstrap requires a registered parent Channel
with a ChannelPipeline
that contains the
Http2MultiplexCodec
.
A child channel becomes active as soon as it is registered to an eventloop. Therefore, an active channel does not
map to an active HTTP/2 stream immediately. Only once a Http2HeadersFrame
has been sent or received, does
the channel map to an active HTTP/2 stream. In case it was not possible to open a new HTTP/2 stream (i.e. due to
the maximum number of active streams being exceeded), the child channel receives an exception indicating the reason
and is closed immediately thereafter.
This class is thread-safe.
Constructor and Description |
---|
Http2StreamChannelBootstrap() |
Modifier and Type | Method and Description |
---|---|
<T> Http2StreamChannelBootstrap |
attr(AttributeKey<T> key,
T value)
Specify attributes with an initial value to be set on newly created channels.
|
Map<AttributeKey<?>,Object> |
attributes() |
ChannelFuture |
connect()
Creates a new channel that will eventually map to a local/outbound HTTP/2 stream.
|
EventLoopGroup |
group() |
Http2StreamChannelBootstrap |
group(EventLoopGroup group)
Sets the
EventLoop to which channels created with this bootstrap are registered. |
ChannelHandler |
handler() |
Http2StreamChannelBootstrap |
handler(ChannelHandler handler)
Sets the channel handler that should be added to the channels's pipeline.
|
<T> Http2StreamChannelBootstrap |
option(ChannelOption<T> option,
T value)
Specify
ChannelOption s to be set on newly created channels. |
Map<ChannelOption<?>,Object> |
options() |
Channel |
parentChannel() |
Http2StreamChannelBootstrap |
parentChannel(Channel parent)
Sets the parent channel that must have the
Http2MultiplexCodec in its pipeline. |
public ChannelFuture connect()
public Http2StreamChannelBootstrap parentChannel(Channel parent)
Http2MultiplexCodec
in its pipeline.parent
- a registered channel with the Http2MultiplexCodec
in its pipeline. This channel will
be the Channel.parent()
of all channels created via connect()
.this
public Http2StreamChannelBootstrap handler(ChannelHandler handler)
handler
- the channel handler to add to the channel's pipeline. The handler must be
ChannelHandler.Sharable
.this
public Http2StreamChannelBootstrap group(EventLoopGroup group)
EventLoop
to which channels created with this bootstrap are registered.group
- the eventloop or null
if the eventloop of the parent channel should be used.this
public <T> Http2StreamChannelBootstrap option(ChannelOption<T> option, T value)
ChannelOption
s to be set on newly created channels. An option can be removed by specifying a
value of null
.public <T> Http2StreamChannelBootstrap attr(AttributeKey<T> key, T value)
null
.public Channel parentChannel()
public ChannelHandler handler()
public EventLoopGroup group()
public Map<ChannelOption<?>,Object> options()
public Map<AttributeKey<?>,Object> attributes()
Copyright © 2008–2017 The Netty Project. All rights reserved.