public class Nio2Connector extends Nio2Service implements IoConnector
Modifier and Type | Class and Description |
---|---|
protected class |
Nio2Connector.ConnectionCompletionHandler |
static class |
Nio2Connector.DefaultIoConnectFuture |
AbstractCloseable.State
CONFIGURABLE_OPTIONS, disposing, propertyResolver, sessions
closeFuture, futureLock, state
log
DEFAULT_REUSE_ADDRESS
Constructor and Description |
---|
Nio2Connector(PropertyResolver propertyResolver,
IoHandler handler,
AsynchronousChannelGroup group,
ExecutorService resumeTasks) |
Modifier and Type | Method and Description |
---|---|
IoConnectFuture |
connect(SocketAddress address,
AttributeRepository context,
SocketAddress localAddress) |
protected Nio2CompletionHandler<Void,Object> |
createConnectionCompletionHandler(IoConnectFuture future,
AsynchronousSocketChannel socket,
AttributeRepository context,
PropertyResolver propertyResolver,
IoHandler handler) |
protected Nio2Session |
createSession(PropertyResolver propertyResolver,
IoHandler handler,
AsynchronousSocketChannel socket) |
protected AsynchronousSocketChannel |
openAsynchronousSocketChannel(SocketAddress address,
AsynchronousChannelGroup group) |
dispose, getChannelGroup, getExecutorService, getInnerCloseable, getIoHandler, getIoServiceEventListener, getManagedSessions, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSession
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getManagedSessions
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
getIoServiceEventListener, setIoServiceEventListener
public Nio2Connector(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
public IoConnectFuture connect(SocketAddress address, AttributeRepository context, SocketAddress localAddress)
connect
in interface IoConnector
address
- The target address to connect tocontext
- An optional "context" to be attached to the established session if successfully
connectedlocalAddress
- The local address to use - if null
an automatic ephemeral port and bind address is
usedfuture
representing the connection requestprotected AsynchronousSocketChannel openAsynchronousSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException
IOException
protected Nio2CompletionHandler<Void,Object> createConnectionCompletionHandler(IoConnectFuture future, AsynchronousSocketChannel socket, AttributeRepository context, PropertyResolver propertyResolver, IoHandler handler)
protected Nio2Session createSession(PropertyResolver propertyResolver, IoHandler handler, AsynchronousSocketChannel socket) throws Throwable
Throwable
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.