/** * Specify the {@link EventLoopGroup} which is used for the parent (acceptor) and the child (client). */ @Override public ServerBootstrap group(EventLoopGroup group) { return group(group, group); }
/** * Create a new {@link Channel} and register it with an {@link EventLoop}. */ public ChannelFuture register() { validate(); return initAndRegister(); }
/** * {@link io.netty.channel.ChannelFactory} which is used to create {@link Channel} instances from * when calling {@link #bind()}. This method is usually only used if {@link #channel(Class)} * is not working for you because of some more complex needs. If your {@link Channel} implementation * has a no-args constructor, its highly recommend to just use {@link #channel(Class)} to * simplify your code. */ @SuppressWarnings({ "unchecked", "deprecation" }) public B channelFactory(io.netty.channel.ChannelFactory<? extends C> channelFactory) { return channelFactory((ChannelFactory<C>) channelFactory); }
/** * Returns the configured {@link ChannelHandler} be used for the child channels or {@code null} * if non is configured yet. */ public ChannelHandler childHandler() { return bootstrap.childHandler(); }
@Override @SuppressWarnings("CloneDoesntCallSuperClone") public ServerBootstrap clone() { return new ServerBootstrap(this); }
@Override @SuppressWarnings("CloneDoesntCallSuperClone") public Bootstrap clone() { return new Bootstrap(this); }
/** * Bootstrap a new {@link Channel}. The default implementation uses {@link Bootstrap#connect()}, sub-classes may * override this. * <p> * The {@link Bootstrap} that is passed in here is cloned via {@link Bootstrap#clone()}, so it is safe to modify. */ protected ChannelFuture connectChannel(Bootstrap bs) { return bs.connect(); }
/** * Returns the configured remote address or {@code null} if non is configured yet. */ public SocketAddress remoteAddress() { return bootstrap.remoteAddress(); }
/** * Returns the configured {@link AddressResolverGroup} or the default if non is configured yet. */ public AddressResolverGroup<?> resolver() { return bootstrap.resolver(); }
/** * Returns the configured {@link EventLoopGroup} which will be used for the child channels or {@code null} * if non is configured yet. */ @SuppressWarnings("deprecation") public EventLoopGroup childGroup() { return bootstrap.childGroup(); }
/** * Returns the configured {@link EventLoopGroup} or {@code null} if non is configured yet. */ @SuppressWarnings("deprecation") public final EventLoopGroup group() { return bootstrap.group(); }
/** * Returns a copy of the configured attributes which will be used for the child channels. */ public Map<AttributeKey<?>, Object> childAttrs() { return bootstrap.childAttrs(); }
/** * Returns the configured local address or {@code null} if non is configured yet. */ public final SocketAddress localAddress() { return bootstrap.localAddress(); }
/** * Returns a copy of the configured attributes. */ public final Map<AttributeKey<?>, Object> attrs() { return bootstrap.attrs(); }
/** * The {@link SocketAddress} which is used to bind the local "end" to. */ public B localAddress(SocketAddress localAddress) { this.localAddress = localAddress; return self(); }
/** * Returns the configured {@link ChannelHandler} or {@code null} if non is configured yet. */ public final ChannelHandler handler() { return bootstrap.handler(); }
/** * Returns a copy of the configured options. */ public final Map<ChannelOption<?>, Object> options() { return bootstrap.options(); }
/** * Returns a copy of the configured options which will be used for the child channels. */ public Map<ChannelOption<?>, Object> childOptions() { return bootstrap.childOptions(); }
/** * Returns a deep clone of this bootstrap which has the identical configuration except that it uses * the given {@link EventLoopGroup}. This method is useful when making multiple {@link Channel}s with similar * settings. */ public Bootstrap clone(EventLoopGroup group) { Bootstrap bs = new Bootstrap(this); bs.group = group; return bs; }
/** * Returns the configured {@link ChannelFactory} or {@code null} if non is configured yet. */ @SuppressWarnings("deprecation") public final ChannelFactory<? extends C> channelFactory() { return bootstrap.channelFactory(); }