Class Nio2Service

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.util.closeable.IoBaseCloseable
org.apache.sshd.common.util.closeable.AbstractCloseable
org.apache.sshd.common.util.closeable.AbstractInnerCloseable
org.apache.sshd.common.io.nio2.Nio2Service
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, org.apache.sshd.common.Closeable, org.apache.sshd.common.io.IoService, org.apache.sshd.common.io.IoServiceEventListenerManager
Direct Known Subclasses:
Nio2Acceptor, Nio2Connector

public abstract class Nio2Service extends org.apache.sshd.common.util.closeable.AbstractInnerCloseable implements org.apache.sshd.common.io.IoService
Author:
Apache MINA SSHD Project
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable

    org.apache.sshd.common.util.closeable.AbstractCloseable.State
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Map<org.apache.sshd.common.Property<?>, AbstractMap.SimpleImmutableEntry<SocketOption<?>, Object>>
     
    protected final AtomicBoolean
     
    protected final org.apache.sshd.common.PropertyResolver
     
    protected final Map<Long, org.apache.sshd.common.io.IoSession>
     

    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(org.apache.sshd.common.PropertyResolver propertyResolver, org.apache.sshd.common.io.IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    protected ExecutorService
     
    protected org.apache.sshd.common.Closeable
     
    org.apache.sshd.common.io.IoHandler
     
    org.apache.sshd.common.io.IoServiceEventListener
     
    Map<Long, org.apache.sshd.common.io.IoSession>
     
    protected org.apache.sshd.common.io.IoSession
    mapSession(org.apache.sshd.common.io.IoSession session)
     
    void
     
    void
    setIoServiceEventListener(org.apache.sshd.common.io.IoServiceEventListener listener)
     
    protected <T> boolean
    setOption(NetworkChannel socket, org.apache.sshd.common.Property<?> property, SocketOption<T> option, T defaultValue)
     
    protected <S extends NetworkChannel>
    S
    setSocketOptions(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 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<org.apache.sshd.common.Property<?>, AbstractMap.SimpleImmutableEntry<SocketOption<?>, Object>> CONFIGURABLE_OPTIONS
    • sessions

      protected final Map<Long, org.apache.sshd.common.io.IoSession> sessions
    • disposing

      protected final AtomicBoolean disposing
    • propertyResolver

      protected final org.apache.sshd.common.PropertyResolver propertyResolver
  • Constructor Details

    • Nio2Service

      protected Nio2Service(org.apache.sshd.common.PropertyResolver propertyResolver, org.apache.sshd.common.io.IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
  • Method Details

    • getIoServiceEventListener

      public org.apache.sshd.common.io.IoServiceEventListener getIoServiceEventListener()
      Specified by:
      getIoServiceEventListener in interface org.apache.sshd.common.io.IoServiceEventListenerManager
    • setIoServiceEventListener

      public void setIoServiceEventListener(org.apache.sshd.common.io.IoServiceEventListener listener)
      Specified by:
      setIoServiceEventListener in interface org.apache.sshd.common.io.IoServiceEventListenerManager
    • getChannelGroup

      protected AsynchronousChannelGroup getChannelGroup()
    • getExecutorService

      protected ExecutorService getExecutorService()
    • getIoHandler

      public org.apache.sshd.common.io.IoHandler getIoHandler()
    • dispose

      public void dispose()
    • getInnerCloseable

      protected org.apache.sshd.common.Closeable getInnerCloseable()
      Specified by:
      getInnerCloseable in class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
    • getManagedSessions

      public Map<Long, org.apache.sshd.common.io.IoSession> getManagedSessions()
      Specified by:
      getManagedSessions in interface org.apache.sshd.common.io.IoService
    • sessionClosed

      public void sessionClosed(Nio2Session session)
    • mapSession

      protected org.apache.sshd.common.io.IoSession mapSession(org.apache.sshd.common.io.IoSession 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, org.apache.sshd.common.Property<?> property, SocketOption<T> option, T defaultValue) throws IOException
      Throws:
      IOException