Class NioSession
java.lang.Object
org.apache.mina.core.session.AbstractIoSession
org.apache.mina.transport.socket.nio.NioSession
- All Implemented Interfaces:
IoSession
- Direct Known Subclasses:
NioDatagramSession, NioSocketSession
An
IoSession which is managed by the NIO transport.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChannelThe communication channelprivate final IoFilterChainThe FilterChain created for this sessionprivate SelectionKeyThe SelectionKey used for this sessionprotected final IoProcessor<NioSession> The NioSession processorFields inherited from class AbstractIoSession
CLOSE_REQUEST, config, MESSAGE_SENT_REQUEST -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNioSession(IoProcessor<NioSession> processor, IoService service, Channel channel) Creates a new instance of NioSession, with its associated IoProcessor. -
Method Summary
Modifier and TypeMethodDescription(package private) abstract ByteChannel(package private) SelectionKeyfinal booleanisActive()(package private) voidSets theSelectionKeyfor thisIoSessionMethods inherited from class AbstractIoSession
close, close, closeNow, closeOnFlush, containsAttribute, decreaseReadBufferSize, decreaseScheduledBytesAndMessages, destroy, equals, getAttachment, getAttribute, getAttribute, getAttributeKeys, getAttributeMap, getBothIdleCount, getCloseFuture, getConfig, getCreationTime, getCurrentWriteMessage, getCurrentWriteRequest, getHandler, getId, getIdleCount, getLastBothIdleTime, getLastIdleTime, getLastIoTime, getLastReaderIdleTime, getLastReadTime, getLastWriterIdleTime, getLastWriteTime, getReadBytes, getReadBytesThroughput, getReaderIdleCount, getReadMessages, getReadMessagesThroughput, getScheduledWriteBytes, getScheduledWriteMessages, getService, getServiceAddress, getWriteRequestQueue, getWriterIdleCount, getWrittenBytes, getWrittenBytesThroughput, getWrittenMessages, getWrittenMessagesThroughput, hashCode, increaseIdleCount, increaseReadBufferSize, increaseReadBytes, increaseReadMessages, increaseScheduledWriteBytes, increaseScheduledWriteMessages, increaseWrittenBytes, increaseWrittenMessages, isBothIdle, isClosing, isConnected, isIdle, isReaderIdle, isReadSuspended, isScheduledForFlush, isSecured, isWriterIdle, isWriteSuspended, notifyIdleness, notifyIdleSession, offerClosedReadFuture, offerFailedReadFuture, offerReadFuture, read, removeAttribute, removeAttribute, replaceAttribute, resumeRead, resumeWrite, scheduledForFlush, setAttachment, setAttribute, setAttribute, setAttributeIfAbsent, setAttributeIfAbsent, setAttributeMap, setCurrentWriteRequest, setScheduledForFlush, setScheduledWriteBytes, setScheduledWriteMessages, setWriteRequestQueue, suspendRead, suspendWrite, toString, unscheduledForFlush, updateThroughput, write, writeMethods inherited from interface IoSession
getLocalAddress, getRemoteAddress, getTransportMetadata
-
Field Details
-
processor
The NioSession processor -
channel
The communication channel -
key
The SelectionKey used for this session -
filterChain
The FilterChain created for this session
-
-
Constructor Details
-
NioSession
Creates a new instance of NioSession, with its associated IoProcessor.
This method is only called by the inherited class.- Parameters:
processor- The associatedIoProcessorservice- The associatedIoServicechannel- The associatedChannel
-
-
Method Details
-
getChannel
- Returns:
- The ByteChannel associated with this
IoSession
-
getFilterChain
- Returns:
- the filter chain that only affects this session.
-
getSelectionKey
SelectionKey getSelectionKey()- Returns:
- The
SelectionKeyassociated with thisIoSession
-
setSelectionKey
Sets theSelectionKeyfor thisIoSession- Parameters:
key- The newSelectionKey
-
getProcessor
- Specified by:
getProcessorin classAbstractIoSession- Returns:
- The associated IoProcessor for this session
-
isActive
public final boolean isActive()- Specified by:
isActivein interfaceIoSession- Overrides:
isActivein classAbstractIoSession- Returns:
trueif this session is active.
-