public abstract class Nio2Service extends AbstractInnerCloseable implements IoService
AbstractCloseable.State
Modifier and Type | Field and Description |
---|---|
static Map<Property<?>,AbstractMap.SimpleImmutableEntry<SocketOption<?>,Object>> |
CONFIGURABLE_OPTIONS |
protected AtomicBoolean |
disposing |
protected PropertyResolver |
propertyResolver |
protected Map<Long,IoSession> |
sessions |
closeFuture, futureLock, state
log
DEFAULT_REUSE_ADDRESS
Modifier | Constructor and Description |
---|---|
protected |
Nio2Service(PropertyResolver propertyResolver,
IoHandler handler,
AsynchronousChannelGroup group,
ExecutorService resumeTasks) |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
protected AsynchronousChannelGroup |
getChannelGroup() |
protected ExecutorService |
getExecutorService() |
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,
Property<?> property,
SocketOption<T> option,
T defaultValue) |
protected <S extends NetworkChannel> |
setSocketOptions(S socket) |
protected void |
unmapSession(Long sessionId) |
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
public static final Map<Property<?>,AbstractMap.SimpleImmutableEntry<SocketOption<?>,Object>> CONFIGURABLE_OPTIONS
protected final AtomicBoolean disposing
protected final PropertyResolver propertyResolver
protected Nio2Service(PropertyResolver propertyResolver, IoHandler handler, AsynchronousChannelGroup group, ExecutorService resumeTasks)
public IoServiceEventListener getIoServiceEventListener()
getIoServiceEventListener
in interface IoServiceEventListenerManager
public void setIoServiceEventListener(IoServiceEventListener listener)
setIoServiceEventListener
in interface IoServiceEventListenerManager
protected AsynchronousChannelGroup getChannelGroup()
protected ExecutorService getExecutorService()
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, Property<?> property, SocketOption<T> option, T defaultValue) throws IOException
IOException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.