- java.lang.Object
-
- io.netty5.handler.address.ResolveAddressHandler
-
- All Implemented Interfaces:
ChannelHandler
public class ResolveAddressHandler extends Object implements ChannelHandler
ChannelHandler
which will resolve theSocketAddress
that is passed toconnect(ChannelHandlerContext, SocketAddress, SocketAddress)
if it is not already resolved and theAddressResolver
supports the type ofSocketAddress
.
-
-
Constructor Summary
Constructors Constructor Description ResolveAddressHandler(AddressResolverGroup<? extends SocketAddress> resolverGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Void>
connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress)
Called once a connect operation is made.boolean
isSharable()
Returnstrue
if this handler is sharable and thus can be added to more than oneChannelPipeline
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, deregister, disconnect, flush, handlerAdded, handlerRemoved, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Constructor Detail
-
ResolveAddressHandler
public ResolveAddressHandler(AddressResolverGroup<? extends SocketAddress> resolverGroup)
-
-
Method Detail
-
isSharable
public boolean isSharable()
Description copied from interface:ChannelHandler
Returnstrue
if this handler is sharable and thus can be added to more than oneChannelPipeline
. By default, this method returnsfalse
. If this method returnsfalse
, you have to create a new handler instance every time you add it to a pipeline because it has unshared state such as member variables.- Specified by:
isSharable
in interfaceChannelHandler
-
connect
public Future<Void> connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress)
Description copied from interface:ChannelHandler
Called once a connect operation is made.- Specified by:
connect
in interfaceChannelHandler
- Parameters:
ctx
- theChannelHandlerContext
for which the connect operation is maderemoteAddress
- theSocketAddress
to which it should connectlocalAddress
- theSocketAddress
which is used as source on connect- Returns:
- the
Future
which will be notified once the operation completes.
-
-