Package org.apache.sshd.common.io.nio2
Class Nio2Service
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,Closeable
,IoService
,IoServiceEventListenerManager
- Direct Known Subclasses:
Nio2Acceptor
,Nio2Connector
public abstract class Nio2Service extends AbstractInnerCloseable implements IoService
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
-
Field Summary
Fields Modifier and Type Field Description static Map<Property<?>,AbstractMap.SimpleImmutableEntry<SocketOption<?>,Object>>
CONFIGURABLE_OPTIONS
protected AtomicBoolean
disposing
protected PropertyResolver
propertyResolver
protected Map<Long,IoSession>
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 Modifier Constructor Description protected
Nio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
protected AsynchronousChannelGroup
getChannelGroup()
protected ExecutorService
getExecutorService()
protected Closeable
getInnerCloseable()
IoHandler
getIoHandler()
IoServiceEventListener
getIoServiceEventListener()
Map<Long,IoSession>
getManagedSessions()
void
sessionClosed(Nio2Session session)
void
setIoServiceEventListener(IoServiceEventListener listener)
protected <T> boolean
setOption(NetworkChannel socket, Property<?> property, SocketOption<T> option, T defaultValue)
protected <S extends NetworkChannel>
SsetSocketOptions(S socket)
protected void
unmapSession(Long sessionId)
-
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, preClose, 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, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
-
-
-
Field Detail
-
CONFIGURABLE_OPTIONS
public static final Map<Property<?>,AbstractMap.SimpleImmutableEntry<SocketOption<?>,Object>> CONFIGURABLE_OPTIONS
-
disposing
protected final AtomicBoolean disposing
-
propertyResolver
protected final PropertyResolver propertyResolver
-
-
Constructor Detail
-
Nio2Service
protected Nio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
-
-
Method Detail
-
getIoServiceEventListener
public IoServiceEventListener getIoServiceEventListener()
- Specified by:
getIoServiceEventListener
in interfaceIoServiceEventListenerManager
-
setIoServiceEventListener
public void setIoServiceEventListener(IoServiceEventListener listener)
- Specified by:
setIoServiceEventListener
in interfaceIoServiceEventListenerManager
-
getChannelGroup
protected AsynchronousChannelGroup getChannelGroup()
-
getExecutorService
protected ExecutorService getExecutorService()
-
getIoHandler
public IoHandler getIoHandler()
-
dispose
public void dispose()
-
getInnerCloseable
protected Closeable getInnerCloseable()
- Specified by:
getInnerCloseable
in classAbstractInnerCloseable
-
getManagedSessions
public Map<Long,IoSession> getManagedSessions()
- Specified by:
getManagedSessions
in interfaceIoService
-
sessionClosed
public void sessionClosed(Nio2Session session)
-
unmapSession
protected void unmapSession(Long sessionId)
-
setSocketOptions
protected <S extends NetworkChannel> S setSocketOptions(S socket) throws IOException
- Throws:
IOException
-
setOption
protected <T> boolean setOption(NetworkChannel socket, Property<?> property, SocketOption<T> option, T defaultValue) throws IOException
- Throws:
IOException
-
-