public class Nio2Acceptor extends Nio2Service implements IoAcceptor
AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BACKLOG |
disposing, group, handler, manager, sessions
closeFuture, lock, state
log
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.
|
void |
doCloseImmediately()
doCloseImmediately is called once and only once
with state == Immediate
|
Set<SocketAddress> |
getBoundAddresses() |
void |
unbind() |
void |
unbind(Collection<? extends SocketAddress> addresses) |
void |
unbind(SocketAddress address) |
dispose, getInnerCloseable, getManagedSessions, sessionClosed, setOption
doCloseGracefully
builder, isClosed, isClosing, preClose
close, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getManagedSessions
public static final int DEFAULT_BACKLOG
public Nio2Acceptor(FactoryManager manager, IoHandler handler, AsynchronousChannelGroup group)
public void bind(Collection<? extends SocketAddress> addresses) throws IOException
bind
in interface IoAcceptor
IOException
public void bind(SocketAddress address) throws IOException
bind
in interface IoAcceptor
IOException
public void unbind()
unbind
in interface IoAcceptor
public void unbind(Collection<? extends SocketAddress> addresses)
unbind
in interface IoAcceptor
public void unbind(SocketAddress address)
unbind
in interface IoAcceptor
public Set<SocketAddress> getBoundAddresses()
getBoundAddresses
in interface IoAcceptor
public CloseFuture close(boolean immediately)
Closeable
close
in class AbstractCloseable
immediately
- true
if the resource should be shut down abruptly,
false
for a graceful closepublic void doCloseImmediately()
AbstractCloseable
doCloseImmediately 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 AbstractInnerCloseable
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.