Package org.apache.sshd.common.io.nio2
Class Nio2Service
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,Closeable
,IoService
,IoServiceEventListenerManager
- Direct Known Subclasses:
Nio2Acceptor
,Nio2Connector
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map
<Property<?>, AbstractMap.SimpleImmutableEntry<SocketOption<?>, Object>> protected final AtomicBoolean
private IoServiceEventListener
private final ExecutorService
private final AsynchronousChannelGroup
private final IoHandler
protected final PropertyResolver
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
ConstructorsModifierConstructorDescriptionprotected
Nio2Service
(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
protected AsynchronousChannelGroup
protected ExecutorService
protected Closeable
Returns the map of all sessions which are currently managed by this service.void
sessionClosed
(Nio2Session session) void
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 Details
-
CONFIGURABLE_OPTIONS
public static final Map<Property<?>,AbstractMap.SimpleImmutableEntry<SocketOption<?>, CONFIGURABLE_OPTIONSObject>> -
sessions
-
disposing
-
propertyResolver
-
handler
-
group
-
executor
-
eventListener
-
-
Constructor Details
-
Nio2Service
protected Nio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
-
-
Method Details
-
getIoServiceEventListener
- Specified by:
getIoServiceEventListener
in interfaceIoServiceEventListenerManager
-
setIoServiceEventListener
- Specified by:
setIoServiceEventListener
in interfaceIoServiceEventListenerManager
-
getChannelGroup
-
getExecutorService
-
getIoHandler
-
dispose
public void dispose() -
getInnerCloseable
- Specified by:
getInnerCloseable
in classAbstractInnerCloseable
-
getManagedSessions
Description copied from interface:IoService
Returns the map of all sessions which are currently managed by this service. The key of map is theID
of the session.- Specified by:
getManagedSessions
in interfaceIoService
- Returns:
- the sessions. An empty collection if there's no session.
-
sessionClosed
-
unmapSession
-
setSocketOptions
- Throws:
IOException
-
setOption
protected <T> boolean setOption(NetworkChannel socket, Property<?> property, SocketOption<T> option, T defaultValue) throws IOException - Throws:
IOException
-