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)
and
#setTrafficMask(TrafficMask)
) 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.Constructor and Description |
---|
DummySession()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
IoSessionConfig |
getConfig() |
IoFilterChain |
getFilterChain() |
IoHandler |
getHandler() |
java.net.SocketAddress |
getLocalAddress()
Returns the socket address of local machine which is associated with this
session.
|
IoProcessor<AbstractIoSession> |
getProcessor() |
java.net.SocketAddress |
getRemoteAddress()
Returns the socket address of remote peer.
|
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)
TODO Add method documentation
|
void |
setScheduledWriteMessages(int messages)
TODO Add method documentation
|
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, 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, isBothIdle, isClosing, isConnected, isIdle, isReaderIdle, isReadSuspended, isScheduledForFlush, 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, write
public IoSessionConfig getConfig()
AbstractIoSession
getConfig
in interface IoSession
getConfig
in class AbstractIoSession
public void setConfig(IoSessionConfig config)
public IoFilterChain getFilterChain()
public IoHandler getHandler()
AbstractIoSession
getHandler
in interface IoSession
getHandler
in class AbstractIoSession
IoHandler
which handles this session.public java.net.SocketAddress getLocalAddress()
IoSession
public java.net.SocketAddress getRemoteAddress()
IoSession
public void setLocalAddress(java.net.SocketAddress localAddress)
public void setRemoteAddress(java.net.SocketAddress remoteAddress)
public IoService getService()
AbstractIoSession
getService
in interface IoSession
getService
in class AbstractIoSession
IoService
which provides I/O service to this session.public void setService(IoService service)
IoService
which provides I/O service to this session.public final IoProcessor<AbstractIoSession> getProcessor()
getProcessor
in class AbstractIoSession
public TransportMetadata getTransportMetadata()
TransportMetadata
that this session runs on.public void setTransportMetadata(TransportMetadata transportMetadata)
TransportMetadata
that this session runs on.public void setScheduledWriteBytes(int byteCount)
AbstractIoSession
setScheduledWriteBytes
in class AbstractIoSession
public void setScheduledWriteMessages(int messages)
AbstractIoSession
setScheduledWriteMessages
in class AbstractIoSession
public void updateThroughput(boolean force)
calculation interval
.
If, however, force is specified as true, this method
updates the throughput properties immediately.Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.