Class Nio2Acceptor
- All Implemented Interfaces:
Closeable, AutoCloseable, Channel, Closeable, IoAcceptor, IoService, IoServiceEventListenerManager
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractCloseable
AbstractCloseable.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprotected final Map<SocketAddress, AsynchronousServerSocketChannel> private final Nio2ServiceFactoryFields inherited from class Nio2Service
CONFIGURABLE_OPTIONS, disposing, propertyResolver, sessionsFields inherited from class AbstractCloseable
closeFuture, futureLock, stateFields inherited from class AbstractLoggingBean
logFields inherited from interface IoService
DEFAULT_REUSE_ADDRESS -
Constructor Summary
ConstructorsConstructorDescriptionNio2Acceptor(Nio2ServiceFactory nio2ServiceFactory, PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks) -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(SocketAddress address) voidbind(Collection<? extends SocketAddress> addresses) protected voidprotected CompletionHandler<AsynchronousSocketChannel, ? super SocketAddress> createSocketCompletionHandler(Map<SocketAddress, AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket) protected Closeableprotected AsynchronousServerSocketChannelopenAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group) protected voidpreClose()preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.protected CloseableprotectInProgressBinding(SocketAddress address, AsynchronousServerSocketChannel asyncChannel) toString()voidunbind()voidunbind(SocketAddress address) voidunbind(Collection<? extends SocketAddress> addresses) Methods inherited from class Nio2Service
dispose, getChannelGroup, getExecutorService, getIoHandler, getIoServiceEventListener, getManagedSessions, mapSession, sessionClosed, setIoServiceEventListener, setOption, setSocketOptions, unmapSessionMethods inherited from class AbstractInnerCloseable
doCloseGracefully, doCloseImmediatelyMethods inherited from class AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListenerMethods inherited from class 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListenerMethods inherited from interface IoService
getManagedSessionsMethods inherited from interface IoServiceEventListenerManager
getIoServiceEventListener, setIoServiceEventListener
-
Field Details
-
channels
-
nio2ServiceFactory
-
backlog
private int backlog
-
-
Constructor Details
-
Nio2Acceptor
public Nio2Acceptor(Nio2ServiceFactory nio2ServiceFactory, PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
-
-
Method Details
-
bind
- Specified by:
bindin interfaceIoAcceptor- Throws:
IOException
-
protectInProgressBinding
protected Closeable protectInProgressBinding(SocketAddress address, AsynchronousServerSocketChannel asyncChannel) -
openAsynchronousServerSocketChannel
protected AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException - Throws:
IOException
-
createSocketCompletionHandler
protected CompletionHandler<AsynchronousSocketChannel, ? super SocketAddress> createSocketCompletionHandler(Map<SocketAddress, AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket) throws IOException - Throws:
IOException
-
bind
- Specified by:
bindin interfaceIoAcceptor- Throws:
IOException
-
unbind
public void unbind()- Specified by:
unbindin interfaceIoAcceptor
-
unbind
- Specified by:
unbindin interfaceIoAcceptor
-
unbind
- Specified by:
unbindin interfaceIoAcceptor
-
getBoundAddresses
- Specified by:
getBoundAddressesin interfaceIoAcceptor
-
preClose
protected void preClose()Description copied from class:AbstractCloseablepreClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true- Overrides:
preClosein classAbstractCloseable
-
getInnerCloseable
- Overrides:
getInnerCloseablein classNio2Service
-
closeImmediately0
protected void closeImmediately0() -
toString
-