public abstract class Nio2Service extends AbstractInnerCloseable implements IoService, FactoryManagerHolder
AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
static Map<String,Pair<SocketOption<?>,Object>> |
CONFIGURABLE_OPTIONS |
protected AtomicBoolean |
disposing |
protected Map<Long,IoSession> |
sessions |
closeFuture, lock, statelogDEFAULT_REUSE_ADDRESSCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
Nio2Service(FactoryManager manager,
IoHandler handler,
AsynchronousChannelGroup group) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
protected AsynchronousChannelGroup |
getChannelGroup() |
FactoryManager |
getFactoryManager() |
protected Closeable |
getInnerCloseable() |
IoHandler |
getIoHandler() |
Map<Long,IoSession> |
getManagedSessions()
Returns the map of all sessions which are currently managed by this
service.
|
void |
sessionClosed(Nio2Session session) |
protected <T> boolean |
setOption(NetworkChannel socket,
String property,
SocketOption<T> option,
T defaultValue) |
protected <S extends NetworkChannel> |
setSocketOptions(S socket) |
doCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerpublic static final Map<String,Pair<SocketOption<?>,Object>> CONFIGURABLE_OPTIONS
protected final AtomicBoolean disposing
protected Nio2Service(FactoryManager manager, IoHandler handler, AsynchronousChannelGroup group)
protected AsynchronousChannelGroup getChannelGroup()
public FactoryManager getFactoryManager()
getFactoryManager in interface FactoryManagerHolderFactoryManagerpublic IoHandler getIoHandler()
public void dispose()
protected Closeable getInnerCloseable()
getInnerCloseable in class AbstractInnerCloseablepublic Map<Long,IoSession> getManagedSessions()
IoServiceID of the
session.getManagedSessions in interface IoServicepublic void sessionClosed(Nio2Session session)
protected <S extends NetworkChannel> S setSocketOptions(S socket) throws IOException
IOExceptionprotected <T> boolean setOption(NetworkChannel socket, String property, SocketOption<T> option, T defaultValue) throws IOException
IOExceptionCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.