Package org.apache.sshd.common.io.nio2
Class Nio2Acceptor
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,Closeable
,IoAcceptor
,IoService
,IoServiceEventListenerManager
public class Nio2Acceptor extends Nio2Service implements IoAcceptor
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Nio2Acceptor.AcceptCompletionHandler
-
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<SocketAddress,AsynchronousServerSocketChannel>
channels
-
Fields inherited from class org.apache.sshd.common.io.nio2.Nio2Service
CONFIGURABLE_OPTIONS, disposing, propertyResolver, sessions
-
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.io.IoService
DEFAULT_REUSE_ADDRESS
-
-
Constructor Summary
Constructors Constructor Description Nio2Acceptor(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(SocketAddress address)
void
bind(Collection<? extends SocketAddress> addresses)
protected void
closeImmediately0()
protected CompletionHandler<AsynchronousSocketChannel,? super SocketAddress>
createSocketCompletionHandler(Map<SocketAddress,AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket)
Set<SocketAddress>
getBoundAddresses()
protected Closeable
getInnerCloseable()
protected AsynchronousServerSocketChannel
openAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group)
protected void
preClose()
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.protected Closeable
protectInProgressBinding(SocketAddress address, AsynchronousServerSocketChannel asyncChannel)
String
toString()
void
unbind()
void
unbind(SocketAddress address)
void
unbind(Collection<? extends SocketAddress> addresses)
-
Methods inherited from class org.apache.sshd.common.io.nio2.Nio2Service
dispose, getChannelGroup, getIoHandler, getIoServiceEventListener, getManagedSessions, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSession
-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
doCloseGracefully, doCloseImmediately
-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListener
-
Methods 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, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
Methods inherited from interface org.apache.sshd.common.io.IoService
getManagedSessions
-
Methods inherited from interface org.apache.sshd.common.io.IoServiceEventListenerManager
getIoServiceEventListener, setIoServiceEventListener
-
-
-
-
Field Detail
-
channels
protected final Map<SocketAddress,AsynchronousServerSocketChannel> channels
-
-
Constructor Detail
-
Nio2Acceptor
public Nio2Acceptor(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group)
-
-
Method Detail
-
bind
public void bind(Collection<? extends SocketAddress> addresses) throws IOException
- Specified by:
bind
in 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
public void bind(SocketAddress address) throws IOException
- Specified by:
bind
in interfaceIoAcceptor
- Throws:
IOException
-
unbind
public void unbind()
- Specified by:
unbind
in interfaceIoAcceptor
-
unbind
public void unbind(Collection<? extends SocketAddress> addresses)
- Specified by:
unbind
in interfaceIoAcceptor
-
unbind
public void unbind(SocketAddress address)
- Specified by:
unbind
in interfaceIoAcceptor
-
getBoundAddresses
public Set<SocketAddress> getBoundAddresses()
- Specified by:
getBoundAddresses
in interfaceIoAcceptor
-
preClose
protected void preClose()
Description copied from class:AbstractCloseable
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true- Overrides:
preClose
in classAbstractCloseable
-
getInnerCloseable
protected Closeable getInnerCloseable()
- Overrides:
getInnerCloseable
in classNio2Service
-
closeImmediately0
protected void closeImmediately0()
-
-