Top Fields Constructors Methods
org.apache.sshd.common.io.nio2

public abstract Class Nio2Service

extends AbstractInnerCloseable
implements IoService
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.io.IoService, org.apache.sshd.common.io.IoServiceEventListenerManager, org.apache.sshd.common.Closeable, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.apache.sshd.common.io.nio2.Nio2Acceptor, org.apache.sshd.common.io.nio2.Nio2Connector
Imports
java.io.IOException, java.net.SocketOption, .SocketTimeoutException, .StandardSocketOptions, java.nio.channels.AsynchronousChannelGroup, .NetworkChannel, java.time.Duration, java.util.AbstractMap.SimpleImmutableEntry, .Collection, .Collections, .LinkedHashMap, .Map, .Objects, java.util.concurrent.ConcurrentHashMap, .ExecutorService, java.util.concurrent.atomic.AtomicBoolean, org.apache.sshd.common.Closeable, .Property, .PropertyResolver, org.apache.sshd.common.io.IoHandler, .IoService, .IoServiceEventListener, .IoSession, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.common.util.closeable.AbstractInnerCloseable, org.apache.sshd.core.CoreModuleProperties

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final Map<Property<?>, AbstractMap.SimpleImmutableEntry<SocketOption<?>, Object>>
protected final AtomicBoolean
private IoServiceEventListener
private final ExecutorService
private final AsynchronousChannelGroup
private final IoHandler
protected final PropertyResolver
protected final Map<Long, IoSession>

Constructor Summary

AccessConstructor and Description
protected
Nio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)

Method Summary

Modifier and TypeMethod and Description
public void
protected AsynchronousChannelGroup
protected ExecutorService
protected Closeable
public IoHandler
public IoServiceEventListener
public Map<Long, IoSession>
getManagedSessions()

Implements org.apache.sshd.common.io.IoService.getManagedSessions.

Returns the map of all sessions which are currently managed by this service.

public void
public void
protected <T> boolean
setOption(NetworkChannel socket, Property<?> property, SocketOption<T> option, T defaultValue)

protected <S extends NetworkChannel> S
setSocketOptions(S socket)

protected void
unmapSession(Long sessionId)

Inherited from org.apache.sshd.common.util.closeable.AbstractInnerCloseable:
doCloseGracefullydoCloseImmediately

Field Detail

CONFIGURABLE_OPTIONSback to summary
public static final Map<Property<?>, AbstractMap.SimpleImmutableEntry<SocketOption<?>, Object>> CONFIGURABLE_OPTIONS
disposingback to summary
protected final AtomicBoolean disposing
eventListenerback to summary
private IoServiceEventListener eventListener
executorback to summary
private final ExecutorService executor
groupback to summary
private final AsynchronousChannelGroup group
handlerback to summary
private final IoHandler handler
propertyResolverback to summary
protected final PropertyResolver propertyResolver
sessionsback to summary
protected final Map<Long, IoSession> sessions

Constructor Detail

Nio2Serviceback to summary
protected Nio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)

Method Detail

disposeback to summary
public void dispose()
getChannelGroupback to summary
protected AsynchronousChannelGroup getChannelGroup()
getExecutorServiceback to summary
protected ExecutorService getExecutorService()
getInnerCloseableback to summary
protected Closeable getInnerCloseable()

Implements abstract org.apache.sshd.common.util.closeable.AbstractInnerCloseable.getInnerCloseable.

Annotations
@Override
getIoHandlerback to summary
public IoHandler getIoHandler()
getIoServiceEventListenerback to summary
public IoServiceEventListener getIoServiceEventListener()

Implements org.apache.sshd.common.io.IoServiceEventListenerManager.getIoServiceEventListener.

Annotations
@Override
getManagedSessionsback to summary
public Map<Long, IoSession> getManagedSessions()

Implements org.apache.sshd.common.io.IoService.getManagedSessions.

Doc from org.apache.sshd.common.io.IoService.getManagedSessions.

Returns the map of all sessions which are currently managed by this service. The key of map is the ID of the session.

Returns:Map<Long, IoSession>

the sessions. An empty collection if there's no session.

Annotations
@Override
sessionClosedback to summary
public void sessionClosed(Nio2Session session)
setIoServiceEventListenerback to summary
public void setIoServiceEventListener(IoServiceEventListener listener)

Implements org.apache.sshd.common.io.IoServiceEventListenerManager.setIoServiceEventListener.

Annotations
@Override
setOptionback to summary
protected <T> boolean setOption(NetworkChannel socket, Property<?> property, SocketOption<T> option, T defaultValue) throws IOException
setSocketOptionsback to summary
protected <S extends NetworkChannel> S setSocketOptions(S socket) throws IOException
Annotations
@SuppressWarnings:unchecked
unmapSessionback to summary
protected void unmapSession(Long sessionId)