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-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> ServerBootstrapchildAttr(AttributeKey<T> childKey, T value) Set the specificAttributeKeywith the given value on every childChannel.Deprecated.childHandler(ChannelHandler childHandler) Set theChannelHandlerwhich is used to serve the request for theChannel's.<T> ServerBootstrapchildOption(ChannelOption<T> childOption, T value) Allow to specify aChannelOptionwhich is used for theChannelinstances once they get created (after the acceptor accepted theChannel).clone()Returns a deep clone of this bootstrap which has the identical configuration.final ServerBootstrapConfigconfig()Returns theAbstractBootstrapConfigobject that can be used to obtain the current config of the bootstrap.group(EventLoopGroup group) Specify theEventLoopGroupwhich is used for the parent (acceptor) and the child (client).group(EventLoopGroup parentGroup, EventLoopGroup childGroup) Set theEventLoopGroupfor the parent (acceptor) and the child (client).validate()Validate all the parameters.Methods inherited from class AbstractBootstrap
attr, bind, bind, bind, bind, bind, channel, channelFactory, channelFactory, extensionsClassLoader, group, handler, localAddress, localAddress, localAddress, localAddress, option, register, toString
-
Constructor Details
-
ServerBootstrap
public ServerBootstrap()
-
-
Method Details
-
group
Specify theEventLoopGroupwhich is used for the parent (acceptor) and the child (client).- Overrides:
groupin classAbstractBootstrap<ServerBootstrap, ServerChannel>
-
group
Set theEventLoopGroupfor the parent (acceptor) and the child (client). TheseEventLoopGroup's are used to handle all the events and IO forServerChannelandChannel's.Important: Usually this is only useful for advanced use-cases and usually
group(EventLoopGroup)is the preferred way to configure the group. -
childOption
Allow to specify aChannelOptionwhich is used for theChannelinstances once they get created (after the acceptor accepted theChannel). Use a value ofnullto remove a previous setChannelOption. -
childAttr
Set the specificAttributeKeywith the given value on every childChannel. If the value isnulltheAttributeKeyis removed -
childHandler
Set theChannelHandlerwhich is used to serve the request for theChannel's. -
validate
Description copied from class:AbstractBootstrapValidate all the parameters. Sub-classes may override this, but should call the super method in that case.- Overrides:
validatein classAbstractBootstrap<ServerBootstrap, ServerChannel>
-
clone
Description copied from class:AbstractBootstrapReturns a deep clone of this bootstrap which has the identical configuration. This method is useful when making multipleChannels with similar settings. Please note that this method does not clone theEventLoopGroupdeeply but shallowly, making the group a shared resource.- Specified by:
clonein classAbstractBootstrap<ServerBootstrap, ServerChannel>
-
childGroup
Deprecated.Useconfig()instead.Return the configuredEventLoopGroupwhich will be used for the child channels ornullif non is configured yet. -
config
Description copied from class:AbstractBootstrapReturns theAbstractBootstrapConfigobject that can be used to obtain the current config of the bootstrap.- Specified by:
configin classAbstractBootstrap<ServerBootstrap, ServerChannel>
-
config()instead.