Package org.apache.sshd.netty
Class NettyIoAcceptor
- 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.netty.NettyIoService
-
- org.apache.sshd.netty.NettyIoAcceptor
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.Channel
,org.apache.sshd.common.Closeable
,org.apache.sshd.common.io.IoAcceptor
,org.apache.sshd.common.io.IoService
,org.apache.sshd.common.io.IoServiceEventListenerManager
public class NettyIoAcceptor extends NettyIoService implements org.apache.sshd.common.io.IoAcceptor
The Netty based IoAcceptor implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected io.netty.bootstrap.ServerBootstrap
bootstrap
protected java.util.Map<java.net.SocketAddress,io.netty.channel.Channel>
boundAddresses
private static io.netty.handler.logging.LoggingHandler
LOGGING_TRACE
-
Fields inherited from class org.apache.sshd.netty.NettyIoService
channelGroup, CONNECT_FUTURE_KEY, factory, handler, sessions, sessionSeq
-
-
Constructor Summary
Constructors Constructor Description NettyIoAcceptor(NettyIoServiceFactory factory, org.apache.sshd.common.io.IoHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(java.net.SocketAddress address)
void
bind(java.util.Collection<? extends java.net.SocketAddress> addresses)
protected io.netty.channel.Channel
bindInternal(java.net.SocketAddress address)
protected void
closeChannel(io.netty.channel.Channel channel)
protected org.apache.sshd.common.future.CloseFuture
doCloseGracefully()
protected void
doCloseImmediately()
java.util.Set<java.net.SocketAddress>
getBoundAddresses()
void
unbind()
void
unbind(java.net.SocketAddress address)
void
unbind(java.util.Collection<? extends java.net.SocketAddress> addresses)
-
Methods inherited from class org.apache.sshd.netty.NettyIoService
getIoServiceEventListener, getManagedSessions, setIoServiceEventListener
-
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
-
-
-
-
Constructor Detail
-
NettyIoAcceptor
public NettyIoAcceptor(NettyIoServiceFactory factory, org.apache.sshd.common.io.IoHandler handler)
-
-
Method Detail
-
bind
public void bind(java.util.Collection<? extends java.net.SocketAddress> addresses) throws java.io.IOException
- Specified by:
bind
in interfaceorg.apache.sshd.common.io.IoAcceptor
- Throws:
java.io.IOException
-
bind
public void bind(java.net.SocketAddress address) throws java.io.IOException
- Specified by:
bind
in interfaceorg.apache.sshd.common.io.IoAcceptor
- Throws:
java.io.IOException
-
bindInternal
protected io.netty.channel.Channel bindInternal(java.net.SocketAddress address) throws java.io.IOException
- Throws:
java.io.IOException
-
closeChannel
protected void closeChannel(io.netty.channel.Channel channel)
-
unbind
public void unbind(java.util.Collection<? extends java.net.SocketAddress> addresses)
- Specified by:
unbind
in interfaceorg.apache.sshd.common.io.IoAcceptor
-
unbind
public void unbind(java.net.SocketAddress address)
- Specified by:
unbind
in interfaceorg.apache.sshd.common.io.IoAcceptor
-
unbind
public void unbind()
- Specified by:
unbind
in interfaceorg.apache.sshd.common.io.IoAcceptor
-
getBoundAddresses
public java.util.Set<java.net.SocketAddress> getBoundAddresses()
- Specified by:
getBoundAddresses
in interfaceorg.apache.sshd.common.io.IoAcceptor
-
doCloseGracefully
protected org.apache.sshd.common.future.CloseFuture doCloseGracefully()
- Overrides:
doCloseGracefully
in classorg.apache.sshd.common.util.closeable.AbstractCloseable
-
doCloseImmediately
protected void doCloseImmediately()
- Overrides:
doCloseImmediately
in classorg.apache.sshd.common.util.closeable.AbstractCloseable
-
-