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 AtomicBooleanprivate IoServiceEventListenerprivate final ExecutorServiceprivate final AsynchronousChannelGroupprivate final IoHandlerprotected final PropertyResolverFields 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
ConstructorsModifierConstructorDescriptionprotectedNio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()protected AsynchronousChannelGroupprotected ExecutorServiceprotected CloseableReturns the map of all sessions which are currently managed by this service.voidsessionClosed(Nio2Session session) voidprotected <T> booleansetOption(NetworkChannel socket, Property<?> property, SocketOption<T> option, T defaultValue) protected <S extends NetworkChannel>
SsetSocketOptions(S socket) protected voidunmapSession(Long sessionId) Methods 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, 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:
getIoServiceEventListenerin interfaceIoServiceEventListenerManager
-
setIoServiceEventListener
- Specified by:
setIoServiceEventListenerin interfaceIoServiceEventListenerManager
-
getChannelGroup
-
getExecutorService
-
getIoHandler
-
dispose
public void dispose() -
getInnerCloseable
- Specified by:
getInnerCloseablein classAbstractInnerCloseable
-
getManagedSessions
Description copied from interface:IoServiceReturns the map of all sessions which are currently managed by this service. The key of map is theIDof the session.- Specified by:
getManagedSessionsin 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
-