Package io.netty.bootstrap
Class ServerBootstrap
- java.lang.Object
-
- io.netty.bootstrap.AbstractBootstrap<ServerBootstrap,ServerChannel>
-
- io.netty.bootstrap.ServerBootstrap
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ServerBootstrap extends AbstractBootstrap<ServerBootstrap,ServerChannel>
Bootstrapsub-class which allows easy bootstrap ofServerChannel
-
-
Constructor Summary
Constructors Constructor Description ServerBootstrap()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T> ServerBootstrapchildAttr(AttributeKey<T> childKey, T value)Set the specificAttributeKeywith the given value on every childChannel.EventLoopGroupchildGroup()Deprecated.Useconfig()instead.ServerBootstrapchildHandler(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).ServerBootstrapclone()Returns a deep clone of this bootstrap which has the identical configuration.ServerBootstrapConfigconfig()Returns theAbstractBootstrapConfigobject that can be used to obtain the current config of the bootstrap.ServerBootstrapgroup(EventLoopGroup group)Specify theEventLoopGroupwhich is used for the parent (acceptor) and the child (client).ServerBootstrapgroup(EventLoopGroup parentGroup, EventLoopGroup childGroup)Set theEventLoopGroupfor the parent (acceptor) and the child (client).ServerBootstrapvalidate()Validate all the parameters.-
Methods inherited from class io.netty.bootstrap.AbstractBootstrap
attr, bind, bind, bind, bind, bind, channel, channelFactory, channelFactory, extensionsClassLoader, group, handler, localAddress, localAddress, localAddress, localAddress, option, register, toString
-
-
-
-
Method Detail
-
group
public ServerBootstrap group(EventLoopGroup group)
Specify theEventLoopGroupwhich is used for the parent (acceptor) and the child (client).- Overrides:
groupin classAbstractBootstrap<ServerBootstrap,ServerChannel>
-
group
public ServerBootstrap group(EventLoopGroup parentGroup, EventLoopGroup childGroup)
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
public <T> ServerBootstrap childOption(ChannelOption<T> childOption, T value)
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
public <T> ServerBootstrap childAttr(AttributeKey<T> childKey, T value)
Set the specificAttributeKeywith the given value on every childChannel. If the value isnulltheAttributeKeyis removed
-
childHandler
public ServerBootstrap childHandler(ChannelHandler childHandler)
Set theChannelHandlerwhich is used to serve the request for theChannel's.
-
validate
public ServerBootstrap 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
public ServerBootstrap 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 public EventLoopGroup childGroup()
Deprecated.Useconfig()instead.Return the configuredEventLoopGroupwhich will be used for the child channels ornullif non is configured yet.
-
config
public final ServerBootstrapConfig 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>
-
-