public abstract class Nio2Service extends AbstractInnerCloseable implements IoService, FactoryManagerHolder
AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
static Map<String,AbstractMap.SimpleImmutableEntry<SocketOption<?>,Object>> |
CONFIGURABLE_OPTIONS |
protected AtomicBoolean |
disposing |
protected Map<Long,IoSession> |
sessions |
closeFuture, lock, state
log
DEFAULT_REUSE_ADDRESS
CLOSE_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() |
IoServiceEventListener |
getIoServiceEventListener() |
Map<Long,IoSession> |
getManagedSessions()
Returns the map of all sessions which are currently managed by this
service.
|
void |
sessionClosed(Nio2Session session) |
void |
setIoServiceEventListener(IoServiceEventListener listener) |
protected <T> boolean |
setOption(NetworkChannel socket,
String property,
SocketOption<T> option,
T defaultValue) |
protected <S extends NetworkChannel> |
setSocketOptions(S socket) |
protected void |
unmapSession(Long sessionId) |
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
public static final Map<String,AbstractMap.SimpleImmutableEntry<SocketOption<?>,Object>> CONFIGURABLE_OPTIONS
protected final AtomicBoolean disposing
protected Nio2Service(FactoryManager manager, IoHandler handler, AsynchronousChannelGroup group)
public IoServiceEventListener getIoServiceEventListener()
getIoServiceEventListener
in interface IoServiceEventListenerManager
public void setIoServiceEventListener(IoServiceEventListener listener)
setIoServiceEventListener
in interface IoServiceEventListenerManager
protected AsynchronousChannelGroup getChannelGroup()
public FactoryManager getFactoryManager()
getFactoryManager
in interface FactoryManagerHolder
FactoryManager
public IoHandler getIoHandler()
public void dispose()
protected Closeable getInnerCloseable()
getInnerCloseable
in class AbstractInnerCloseable
public Map<Long,IoSession> getManagedSessions()
IoService
ID
of the
session.getManagedSessions
in interface IoService
public void sessionClosed(Nio2Session session)
protected void unmapSession(Long sessionId)
protected <S extends NetworkChannel> S setSocketOptions(S socket) throws IOException
IOException
protected <T> boolean setOption(NetworkChannel socket, String property, SocketOption<T> option, T defaultValue) throws IOException
IOException
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.