- java.lang.Object
-
- io.netty5.bootstrap.AbstractBootstrap<ServerBootstrap,ServerChannel,ServerChannelFactory<? extends ServerChannel>>
-
- io.netty5.bootstrap.ServerBootstrap
-
- All Implemented Interfaces:
Cloneable
public class ServerBootstrap extends AbstractBootstrap<ServerBootstrap,ServerChannel,ServerChannelFactory<? extends 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 ServerBootstrapchannel(Class<? extends ServerChannel> channelClass)TheClasswhich is used to createServerChannelinstances from.ServerBootstrapchannelFactory(ServerChannelFactory<? extends ServerChannel> channelFactory)ServerChannelFactorywhich is used to createChannelinstances from when callingAbstractBootstrap.bind().<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.netty5.bootstrap.AbstractBootstrap
attr, bind, bind, bind, bind, bind, createUnregistered, 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,ServerChannelFactory<? extends 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.
-
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.
-
channel
public ServerBootstrap channel(Class<? extends ServerChannel> channelClass)
TheClasswhich is used to createServerChannelinstances from. You either use this orchannelFactory(ServerChannelFactory)if yourChannelimplementation has no no-args constructor.
-
channelFactory
public ServerBootstrap channelFactory(ServerChannelFactory<? extends ServerChannel> channelFactory)
ServerChannelFactorywhich is used to createChannelinstances from when callingAbstractBootstrap.bind(). This method is usually only used ifchannel(Class)is not working for you because of some more complex needs. If yourChannelimplementation has a no-args constructor, its highly recommend to just usechannel(Class)to simplify your code.
-
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,ServerChannelFactory<? extends 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,ServerChannelFactory<? extends 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,ServerChannelFactory<? extends ServerChannel>>
-
-