public class ServerBootstrap extends AbstractBootstrap<ServerBootstrap>
Bootstrap sub-class which allows easy bootstrap of ServerChannelAbstractBootstrap.ChannelFactory| Constructor and Description |
|---|
ServerBootstrap() |
| Modifier and Type | Method and Description |
|---|---|
ChannelFuture |
bind(ChannelFuture future)
Bind the
Channel of the given AbstractBootstrap.ChannelFactory. |
ServerBootstrap |
channel(Class<? extends Channel> channelClass)
The
Class which is used to create the ServerChannel from (for the acceptor). |
<T> ServerBootstrap |
childAttr(io.netty.util.AttributeKey<T> childKey,
T value) |
ServerBootstrap |
childHandler(ChannelHandler childHandler)
Set the
ChannelHandler which is used to server the request for the Channel's. |
<T> ServerBootstrap |
childOption(ChannelOption<T> childOption,
T value)
Allow to specify a
ChannelOption which is used for the Channel instances once they get created
(after the acceptor accepted the Channel). |
ServerBootstrap |
group(EventLoopGroup group)
Specify the
EventLoopGroup which is used for the parent (acceptor) and the child (client). |
ServerBootstrap |
group(EventLoopGroup parentGroup,
EventLoopGroup childGroup)
Set the
EventLoopGroup for the parent (acceptor) and the child (client). |
void |
shutdown()
Shutdown the
AbstractBootstrap and the EventLoopGroup which is
used by it. |
protected void |
validate()
Validate all the parameters.
|
attr, attrs, bind, channelFactory, ensureOpen, factory, group, handler, handler, localAddress, localAddress, localAddress, localAddress, localAddress, option, options, validatepublic ServerBootstrap group(EventLoopGroup group)
EventLoopGroup which is used for the parent (acceptor) and the child (client).group in class AbstractBootstrap<ServerBootstrap>public ServerBootstrap group(EventLoopGroup parentGroup, EventLoopGroup childGroup)
EventLoopGroup for the parent (acceptor) and the child (client). These
EventLoopGroup's are used to handle all the events and IO for SocketChannel and
Channel's.public ServerBootstrap channel(Class<? extends Channel> channelClass)
Class which is used to create the ServerChannel from (for the acceptor).channel in class AbstractBootstrap<ServerBootstrap>public <T> ServerBootstrap childOption(ChannelOption<T> childOption, T value)
ChannelOption which is used for the Channel instances once they get created
(after the acceptor accepted the Channel). Use a value of null to remove a previous set
ChannelOption.public <T> ServerBootstrap childAttr(io.netty.util.AttributeKey<T> childKey, T value)
public ServerBootstrap childHandler(ChannelHandler childHandler)
ChannelHandler which is used to server the request for the Channel's.public ChannelFuture bind(ChannelFuture future)
AbstractBootstrapChannel of the given AbstractBootstrap.ChannelFactory.bind in class AbstractBootstrap<ServerBootstrap>public void shutdown()
AbstractBootstrapAbstractBootstrap and the EventLoopGroup which is
used by it. Only call this if you don't share the EventLoopGroup
between different AbstractBootstrap's.shutdown in class AbstractBootstrap<ServerBootstrap>protected void validate()
AbstractBootstrapvalidate in class AbstractBootstrap<ServerBootstrap>Copyright © 2008-2012 The Netty Project. All Rights Reserved.