public class Nio2Acceptor extends Nio2Service implements IoAcceptor
| Modifier and Type | Class and Description |
|---|---|
protected class |
Nio2Acceptor.AcceptCompletionHandler |
AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
protected Map<SocketAddress,AsynchronousServerSocketChannel> |
channels |
CONFIGURABLE_OPTIONS, disposing, sessionscloseFuture, lock, statelogDEFAULT_BACKLOGDEFAULT_REUSE_ADDRESSCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Constructor and Description |
|---|
Nio2Acceptor(FactoryManager manager,
IoHandler handler,
AsynchronousChannelGroup group) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(Collection<? extends SocketAddress> addresses) |
void |
bind(SocketAddress address) |
CloseFuture |
close(boolean immediately)
Close this resource asynchronously and return a future.
|
protected CompletionHandler<AsynchronousSocketChannel,? super SocketAddress> |
createSocketCompletionHandler(Map<SocketAddress,AsynchronousServerSocketChannel> channelsMap,
AsynchronousServerSocketChannel socket) |
void |
doCloseImmediately()
doCloseImmediately is called once and only once
with state == Immediate
Overriding methods should always call the base implementation.
|
Set<SocketAddress> |
getBoundAddresses() |
protected AsynchronousServerSocketChannel |
openAsynchronousServerSocketChannel(SocketAddress address,
AsynchronousChannelGroup group) |
void |
unbind() |
void |
unbind(Collection<? extends SocketAddress> addresses) |
void |
unbind(SocketAddress address) |
dispose, getChannelGroup, getFactoryManager, getInnerCloseable, getIoHandler, getManagedSessions, sessionClosed, setOption, setSocketOptionsdoCloseGracefullyaddCloseFutureListener, builder, isClosed, isClosing, preClose, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetManagedSessionsaddCloseFutureListener, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerprotected final Map<SocketAddress,AsynchronousServerSocketChannel> channels
public Nio2Acceptor(FactoryManager manager, IoHandler handler, AsynchronousChannelGroup group)
public void bind(Collection<? extends SocketAddress> addresses) throws IOException
bind in interface IoAcceptorIOExceptionprotected AsynchronousServerSocketChannel openAsynchronousServerSocketChannel(SocketAddress address, AsynchronousChannelGroup group) throws IOException
IOExceptionprotected CompletionHandler<AsynchronousSocketChannel,? super SocketAddress> createSocketCompletionHandler(Map<SocketAddress,AsynchronousServerSocketChannel> channelsMap, AsynchronousServerSocketChannel socket) throws IOException
IOExceptionpublic void bind(SocketAddress address) throws IOException
bind in interface IoAcceptorIOExceptionpublic void unbind()
unbind in interface IoAcceptorpublic void unbind(Collection<? extends SocketAddress> addresses)
unbind in interface IoAcceptorpublic void unbind(SocketAddress address)
unbind in interface IoAcceptorpublic Set<SocketAddress> getBoundAddresses()
getBoundAddresses in interface IoAcceptorpublic CloseFuture close(boolean immediately)
Closeableclose in class AbstractCloseableimmediately - true if the resource should be shut down abruptly,
false for a graceful closeCloseFuture representing the close requestpublic void doCloseImmediately()
AbstractCloseabledoCloseImmediately is called once and only once with state == Immediate
Overriding methods should always call the base implementation. It may be called concurrently while preClose() or doCloseGracefully is executing
doCloseImmediately in class AbstractInnerCloseableCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.