Package org.apache.sshd.common.io.nio2
Class Nio2Acceptor
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,Closeable,IoAcceptor,IoService,IoServiceEventListenerManager
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprotected final Map<SocketAddress, AsynchronousServerSocketChannel> private final Nio2ServiceFactoryFields 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
ConstructorsConstructorDescriptionNio2Acceptor(Nio2ServiceFactory nio2ServiceFactory, PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks) -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(SocketAddress address) voidbind(Collection<? extends SocketAddress> addresses) protected voidprotected CompletionHandler<AsynchronousSocketChannel, ? super SocketAddress> createSocketCompletionHandler(Map<SocketAddress, AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket) protected Closeableprotected AsynchronousServerSocketChannelopenAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group) protected voidpreClose()preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.protected CloseableprotectInProgressBinding(SocketAddress address, AsynchronousServerSocketChannel asyncChannel) toString()voidunbind()voidunbind(SocketAddress address) voidunbind(Collection<? extends SocketAddress> addresses) Methods inherited from class org.apache.sshd.common.io.nio2.Nio2Service
dispose, getChannelGroup, getExecutorService, 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, 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, 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
-
channels
-
nio2ServiceFactory
-
backlog
private int backlog
-
-
Constructor Details
-
Nio2Acceptor
public Nio2Acceptor(Nio2ServiceFactory nio2ServiceFactory, PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
-
-
Method Details
-
bind
- Specified by:
bindin interfaceIoAcceptor- Throws:
IOException
-
protectInProgressBinding
protected Closeable protectInProgressBinding(SocketAddress address, AsynchronousServerSocketChannel asyncChannel) -
openAsynchronousServerSocketChannel
protected AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException - Throws:
IOException
-
createSocketCompletionHandler
protected CompletionHandler<AsynchronousSocketChannel,? super SocketAddress> createSocketCompletionHandler(Map<SocketAddress, AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket) throws IOException- Throws:
IOException
-
bind
- Specified by:
bindin interfaceIoAcceptor- Throws:
IOException
-
unbind
public void unbind()- Specified by:
unbindin interfaceIoAcceptor
-
unbind
- Specified by:
unbindin interfaceIoAcceptor
-
unbind
- Specified by:
unbindin interfaceIoAcceptor
-
getBoundAddresses
- Specified by:
getBoundAddressesin interfaceIoAcceptor
-
preClose
protected void preClose()Description copied from class:AbstractCloseablepreClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true- Overrides:
preClosein classAbstractCloseable
-
getInnerCloseable
- Overrides:
getInnerCloseablein classNio2Service
-
closeImmediately0
protected void closeImmediately0() -
toString
-