public class DummySession extends AbstractIoSession
IoSession for unit-testing or non-network-use of
the classes that depends on IoSession.
AbstractIoSession.close(), AbstractIoSession.write(Object)
are final and therefore cannot be
overridden, but you can always add your custom IoFilter to the
IoFilterChain to intercept any I/O events and requests.| 构造器和说明 |
|---|
DummySession()
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
IoSessionConfig |
getConfig() |
IoFilterChain |
getFilterChain() |
IoHandler |
getHandler() |
java.net.SocketAddress |
getLocalAddress() |
IoProcessor<IoSession> |
getProcessor() |
java.net.SocketAddress |
getRemoteAddress() |
IoService |
getService() |
TransportMetadata |
getTransportMetadata() |
void |
setConfig(IoSessionConfig config)
Sets the configuration of this session.
|
void |
setHandler(IoHandler handler)
Sets the
IoHandler which handles this session. |
void |
setLocalAddress(java.net.SocketAddress localAddress)
Sets the socket address of local machine which is associated with
this session.
|
void |
setRemoteAddress(java.net.SocketAddress remoteAddress)
Sets the socket address of remote peer.
|
void |
setScheduledWriteBytes(int byteCount)
Set the number of scheduled write bytes
|
void |
setScheduledWriteMessages(int messages)
Set the number of scheduled write messages
|
void |
setService(IoService service)
Sets the
IoService which provides I/O service to this session. |
void |
setTransportMetadata(TransportMetadata transportMetadata)
Sets the
TransportMetadata that this session runs on. |
void |
updateThroughput(boolean force)
Update all statistical properties related with throughput.
|
close, close, closeNow, closeOnFlush, containsAttribute, decreaseReadBufferSize, decreaseScheduledBytesAndMessages, equals, getAttachment, getAttribute, getAttribute, getAttributeKeys, getAttributeMap, getBothIdleCount, getCloseFuture, getCreationTime, getCurrentWriteMessage, getCurrentWriteRequest, getId, getIdleCount, getLastBothIdleTime, getLastIdleTime, getLastIoTime, getLastReaderIdleTime, getLastReadTime, getLastWriterIdleTime, getLastWriteTime, getReadBytes, getReadBytesThroughput, getReaderIdleCount, getReadMessages, getReadMessagesThroughput, getScheduledWriteBytes, getScheduledWriteMessages, getServiceAddress, getWriteRequestQueue, getWriterIdleCount, getWrittenBytes, getWrittenBytesThroughput, getWrittenMessages, getWrittenMessagesThroughput, hashCode, increaseIdleCount, increaseReadBufferSize, increaseReadBytes, increaseReadMessages, increaseScheduledWriteBytes, increaseScheduledWriteMessages, increaseWrittenBytes, increaseWrittenMessages, isActive, 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, setWriteRequestQueue, suspendRead, suspendWrite, toString, unscheduledForFlush, updateThroughput, write, writepublic IoSessionConfig getConfig()
getConfig 在接口中 IoSessiongetConfig 在类中 AbstractIoSessionpublic void setConfig(IoSessionConfig config)
config - the IoSessionConfig to setpublic IoFilterChain getFilterChain()
public IoHandler getHandler()
getHandler 在接口中 IoSessiongetHandler 在类中 AbstractIoSessionIoHandler which handles this session.public void setHandler(IoHandler handler)
IoHandler which handles this session.handler - the IoHandler to setpublic java.net.SocketAddress getLocalAddress()
public java.net.SocketAddress getRemoteAddress()
public void setLocalAddress(java.net.SocketAddress localAddress)
localAddress - The socket address to setpublic void setRemoteAddress(java.net.SocketAddress remoteAddress)
remoteAddress - The socket address to setpublic IoService getService()
getService 在接口中 IoSessiongetService 在类中 AbstractIoSessionIoService which provides I/O service to this session.public void setService(IoService service)
IoService which provides I/O service to this session.service - The IoService to setpublic final IoProcessor<IoSession> getProcessor()
getProcessor 在类中 AbstractIoSessionpublic TransportMetadata getTransportMetadata()
TransportMetadata that this session runs on.public void setTransportMetadata(TransportMetadata transportMetadata)
TransportMetadata that this session runs on.transportMetadata - The TransportMetadata to setpublic void setScheduledWriteBytes(int byteCount)
setScheduledWriteBytes 在类中 AbstractIoSessionbyteCount - The number of scheduled bytes for writepublic void setScheduledWriteMessages(int messages)
setScheduledWriteMessages 在类中 AbstractIoSessionmessages - The number of scheduled messages for writepublic void updateThroughput(boolean force)
calculation interval.
If, however, force is specified as true, this method
updates the throughput properties immediately.force - the flag that forces the update of properties immediately if true