Class Bootstrap
- All Implemented Interfaces:
Cloneable
A
Bootstrap that makes it easy to bootstrap a Channel to use
for clients.
The AbstractBootstrap.bind() methods are useful in combination with connectionless transports such as datagram (UDP).
For regular TCP connections, please use the provided connect() methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classNested classes/interfaces inherited from class AbstractBootstrap
AbstractBootstrap.PendingRegistrationPromise -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BootstrapConfigprivate booleanprivate static final InternalLoggerprivate SocketAddressFields inherited from class AbstractBootstrap
group -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a deep clone of this bootstrap which has the identical configuration.clone(EventLoopGroup group) Returns a deep clone of this bootstrap which has the identical configuration except that it uses the givenEventLoopGroup.final BootstrapConfigconfig()Returns theAbstractBootstrapConfigobject that can be used to obtain the current config of the bootstrap.connect()Connect aChannelto the remote peer.Connect aChannelto the remote peer.connect(InetAddress inetHost, int inetPort) Connect aChannelto the remote peer.connect(SocketAddress remoteAddress) Connect aChannelto the remote peer.connect(SocketAddress remoteAddress, SocketAddress localAddress) Connect aChannelto the remote peer.Disables address name resolution.private static voiddoConnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise connectPromise) private ChannelFuturedoResolveAndConnect(SocketAddress remoteAddress, SocketAddress localAddress) private ChannelFuturedoResolveAndConnect0(Channel channel, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) (package private) void(package private) final SocketAddressremoteAddress(String inetHost, int inetPort) remoteAddress(InetAddress inetHost, int inetPort) remoteAddress(SocketAddress remoteAddress) TheSocketAddressto connect to once theconnect()method is called.(package private) final AddressResolverGroup<?> resolver()resolver(AddressResolverGroup<?> resolver) Sets theNameResolverwhich will resolve the address of the unresolved named address.validate()Validate all the parameters.Methods inherited from class AbstractBootstrap
attr, attrs, attrs0, bind, bind, bind, bind, bind, channel, channelFactory, channelFactory, channelFactory, copiedMap, extensionsClassLoader, getInitializerExtensions, group, group, handler, handler, initAndRegister, localAddress, localAddress, localAddress, localAddress, localAddress, newAttributesArray, newAttributesArray, newOptionsArray, newOptionsArray, option, options, options0, register, setAttributes, setChannelOptions, toString
-
Field Details
-
logger
-
config
-
externalResolver
-
disableResolver
private volatile boolean disableResolver -
remoteAddress
-
-
Constructor Details
-
Bootstrap
public Bootstrap() -
Bootstrap
-
-
Method Details
-
resolver
Sets theNameResolverwhich will resolve the address of the unresolved named address.- Parameters:
resolver- theNameResolverfor thisBootstrap; may benull, in which case a default resolver will be used- See Also:
-
disableResolver
Disables address name resolution. Name resolution may be re-enabled withresolver(AddressResolverGroup) -
remoteAddress
TheSocketAddressto connect to once theconnect()method is called. -
remoteAddress
-
remoteAddress
- See Also:
-
connect
Connect aChannelto the remote peer. -
connect
Connect aChannelto the remote peer. -
connect
Connect aChannelto the remote peer. -
connect
Connect aChannelto the remote peer. -
connect
Connect aChannelto the remote peer. -
doResolveAndConnect
- See Also:
-
doResolveAndConnect0
private ChannelFuture doResolveAndConnect0(Channel channel, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) -
doConnect
private static void doConnect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise connectPromise) -
init
-
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<Bootstrap, Channel>
-
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<Bootstrap, Channel>
-
clone
Returns a deep clone of this bootstrap which has the identical configuration except that it uses the givenEventLoopGroup. This method is useful when making multipleChannels with similar settings. -
config
Description copied from class:AbstractBootstrapReturns theAbstractBootstrapConfigobject that can be used to obtain the current config of the bootstrap.- Specified by:
configin classAbstractBootstrap<Bootstrap, Channel>
-
remoteAddress
-
resolver
-