Package io.netty.bootstrap
Class ServerBootstrap
java.lang.Object
io.netty.bootstrap.AbstractBootstrap<ServerBootstrap,ServerChannel>
io.netty.bootstrap.ServerBootstrap
- All Implemented Interfaces:
Cloneable
Bootstrap
sub-class which allows easy bootstrap of ServerChannel
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.bootstrap.AbstractBootstrap
AbstractBootstrap.PendingRegistrationPromise
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<AttributeKey<?>, Object> private EventLoopGroup
private ChannelHandler
private final Map
<ChannelOption<?>, Object> private final ServerBootstrapConfig
private static final InternalLogger
Fields inherited from class io.netty.bootstrap.AbstractBootstrap
group
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> ServerBootstrap
childAttr
(AttributeKey<T> childKey, T value) Set the specificAttributeKey
with the given value on every childChannel
.(package private) final Map
<AttributeKey<?>, Object> Deprecated.(package private) final ChannelHandler
childHandler
(ChannelHandler childHandler) Set theChannelHandler
which is used to serve the request for theChannel
's.<T> ServerBootstrap
childOption
(ChannelOption<T> childOption, T value) Allow to specify aChannelOption
which is used for theChannel
instances once they get created (after the acceptor accepted theChannel
).(package private) final Map
<ChannelOption<?>, Object> clone()
Returns a deep clone of this bootstrap which has the identical configuration.final ServerBootstrapConfig
config()
Returns theAbstractBootstrapConfig
object that can be used to obtain the current config of the bootstrap.group
(EventLoopGroup group) Specify theEventLoopGroup
which is used for the parent (acceptor) and the child (client).group
(EventLoopGroup parentGroup, EventLoopGroup childGroup) Set theEventLoopGroup
for the parent (acceptor) and the child (client).(package private) void
validate()
Validate all the parameters.Methods inherited from class io.netty.bootstrap.AbstractBootstrap
attr, attrs, attrs0, bind, bind, bind, bind, bind, channel, channelFactory, channelFactory, channelFactory, copiedMap, extensionsClassLoader, getInitializerExtensions, group, handler, handler, initAndRegister, localAddress, localAddress, localAddress, localAddress, localAddress, newAttributesArray, newAttributesArray, newOptionsArray, newOptionsArray, option, options, options0, register, setAttributes, setChannelOptions, toString
-
Field Details
-
logger
-
childOptions
-
childAttrs
-
config
-
childGroup
-
childHandler
-
-
Constructor Details
-
ServerBootstrap
public ServerBootstrap() -
ServerBootstrap
-
-
Method Details
-
group
Specify theEventLoopGroup
which is used for the parent (acceptor) and the child (client).- Overrides:
group
in classAbstractBootstrap<ServerBootstrap,
ServerChannel>
-
group
Set theEventLoopGroup
for the parent (acceptor) and the child (client). TheseEventLoopGroup
's are used to handle all the events and IO forServerChannel
andChannel
's. -
childOption
Allow to specify aChannelOption
which is used for theChannel
instances once they get created (after the acceptor accepted theChannel
). Use a value ofnull
to remove a previous setChannelOption
. -
childAttr
Set the specificAttributeKey
with the given value on every childChannel
. If the value isnull
theAttributeKey
is removed -
childHandler
Set theChannelHandler
which is used to serve the request for theChannel
's. -
init
- Specified by:
init
in classAbstractBootstrap<ServerBootstrap,
ServerChannel>
-
validate
Description copied from class:AbstractBootstrap
Validate all the parameters. Sub-classes may override this, but should call the super method in that case.- Overrides:
validate
in classAbstractBootstrap<ServerBootstrap,
ServerChannel>
-
clone
Description copied from class:AbstractBootstrap
Returns a deep clone of this bootstrap which has the identical configuration. This method is useful when making multipleChannel
s with similar settings. Please note that this method does not clone theEventLoopGroup
deeply but shallowly, making the group a shared resource.- Specified by:
clone
in classAbstractBootstrap<ServerBootstrap,
ServerChannel>
-
childGroup
Deprecated.Useconfig()
instead.Return the configuredEventLoopGroup
which will be used for the child channels ornull
if non is configured yet. -
childHandler
-
childOptions
-
childAttrs
-
config
Description copied from class:AbstractBootstrap
Returns theAbstractBootstrapConfig
object that can be used to obtain the current config of the bootstrap.- Specified by:
config
in classAbstractBootstrap<ServerBootstrap,
ServerChannel>
-
config()
instead.