Package org.apache.sshd.common.io.nio2
Class Nio2Connector
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,Closeable,IoConnector,IoService,IoServiceEventListenerManager
TODO Add javadoc
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State -
Field Summary
FieldsFields inherited from class org.apache.sshd.common.io.nio2.Nio2Service
CONFIGURABLE_OPTIONS, disposing, propertyResolver, sessionsFields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, stateFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.io.IoService
DEFAULT_REUSE_ADDRESS -
Constructor Summary
ConstructorsConstructorDescriptionNio2Connector(Nio2ServiceFactory nio2ServiceFactory, PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks) -
Method Summary
Modifier and TypeMethodDescriptionconnect(SocketAddress address, AttributeRepository context, SocketAddress localAddress) protected Nio2CompletionHandler<Void, Object> createConnectionCompletionHandler(IoConnectFuture future, AsynchronousSocketChannel socket, AttributeRepository context, PropertyResolver propertyResolver, IoHandler handler) protected Nio2SessioncreateSession(PropertyResolver propertyResolver, IoHandler handler, AsynchronousSocketChannel socket) protected AsynchronousSocketChannelopenAsynchronousSocketChannel(SocketAddress address, AsynchronousChannelGroup group) Methods inherited from class org.apache.sshd.common.io.nio2.Nio2Service
dispose, getChannelGroup, getExecutorService, getInnerCloseable, getIoHandler, getIoServiceEventListener, getManagedSessions, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSessionMethods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
doCloseGracefully, doCloseImmediatelyMethods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListenerMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListenerMethods inherited from interface org.apache.sshd.common.io.IoService
getManagedSessionsMethods inherited from interface org.apache.sshd.common.io.IoServiceEventListenerManager
getIoServiceEventListener, setIoServiceEventListener
-
Field Details
-
nio2ServiceFactory
-
-
Constructor Details
-
Nio2Connector
public Nio2Connector(Nio2ServiceFactory nio2ServiceFactory, PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
-
-
Method Details
-
connect
public IoConnectFuture connect(SocketAddress address, AttributeRepository context, SocketAddress localAddress) - Specified by:
connectin interfaceIoConnector- Parameters:
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 - ifnullan automatic ephemeral port and bind address is used- Returns:
- The
futurerepresenting the connection request
-
openAsynchronousSocketChannel
protected AsynchronousSocketChannel openAsynchronousSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException - Throws:
IOException
-
createConnectionCompletionHandler
protected Nio2CompletionHandler<Void,Object> createConnectionCompletionHandler(IoConnectFuture future, AsynchronousSocketChannel socket, AttributeRepository context, PropertyResolver propertyResolver, IoHandler handler) -
createSession
protected Nio2Session createSession(PropertyResolver propertyResolver, IoHandler handler, AsynchronousSocketChannel socket) throws Throwable - Throws:
Throwable
-