|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.mina.protocol.io.IoProtocolSession
public class IoProtocolSession
A ProtocolSession
that is backed by IoSession
.
Method Summary | |
---|---|
void |
close()
Closes this session immediately. |
void |
close(boolean wait)
Closes this session immediately. |
Object |
getAttachment()
Returns an attachment of this session. |
Object |
getAttribute(String key)
Returns the value of user-defined attribute of this session. |
Set |
getAttributeKeys()
Returns the set of keys of all user-defined attributes. |
SessionConfig |
getConfig()
Returns the configuration of this session. |
ProtocolDecoder |
getDecoder()
Returns the ProtocolDecoder for this session. |
ProtocolEncoder |
getEncoder()
Returns the ProtocolEncoder for this session. |
ProtocolFilterChain |
getFilterChain()
Returns the filter chain that only affects this session. |
ProtocolHandler |
getHandler()
Returns the ProtocolHandler which handles this session. |
IoSession |
getIoSession()
Returns the IoSession this session is backed by. |
long |
getLastIoTime()
Returns the time in millis when I/O occurred lastly. |
long |
getLastReadTime()
Returns the time in millis when read operation occurred lastly. |
long |
getLastWriteTime()
Returns the time in millis when write operation occurred lastly. |
SocketAddress |
getLocalAddress()
Returns the socket address of local machine which is associated with this session. |
long |
getReadBytes()
Returns the total number of bytes which were read from this session. |
SocketAddress |
getRemoteAddress()
Returns the socket address of remote peer. |
int |
getScheduledWriteRequests()
Returns the number of write requests which are scheduled to be written to this session. |
TransportType |
getTransportType()
Returns transport type of this session. |
long |
getWrittenBytes()
Returns the total number of bytes which were written to this session. |
long |
getWrittenWriteRequests()
Returns the total number of write requests which were written to this session. |
boolean |
isConnected()
Returns true if this session is connected with remote peer. |
boolean |
isIdle(IdleStatus status)
Returns true if this session is idle for the specified
IdleStatus . |
Object |
removeAttribute(String key)
Removes a user-defined attribute with the specified key. |
Object |
setAttachment(Object attachment)
Sets an attachment of this session. |
Object |
setAttribute(String key,
Object value)
Sets a user-defined attribute. |
void |
write(Object message)
Writes the specified message to remote peer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public IoSession getIoSession()
IoSession
this session is backed by.
public ProtocolFilterChain getFilterChain()
ProtocolSession
getFilterChain
in interface ProtocolSession
public ProtocolHandler getHandler()
ProtocolSession
ProtocolHandler
which handles this session.
getHandler
in interface ProtocolSession
public ProtocolEncoder getEncoder()
ProtocolSession
ProtocolEncoder
for this session.
getEncoder
in interface ProtocolSession
public ProtocolDecoder getDecoder()
ProtocolSession
ProtocolDecoder
for this session.
getDecoder
in interface ProtocolSession
public void close()
Session
close
in interface Session
public void close(boolean wait)
Session
close
in interface Session
wait
- true if you want to wait until closing process is
complete.public Object getAttachment()
Session
getAttachment
in interface Session
public Object setAttachment(Object attachment)
Session
setAttachment
in interface Session
public Object getAttribute(String key)
Session
getAttribute
in interface Session
key
- the key of the attribute
public Object setAttribute(String key, Object value)
Session
setAttribute
in interface Session
key
- the key of the attributevalue
- the value of the attribute
public Object removeAttribute(String key)
Session
removeAttribute
in interface Session
public Set getAttributeKeys()
Session
getAttributeKeys
in interface Session
public void write(Object message)
ProtocolSession
message
to remote peer. This operation
is asynchronous; ProtocolHandler.messageSent(ProtocolSession, Object)
will be invoked when the message is actually sent to remote peer.
write
in interface ProtocolSession
public long getWrittenWriteRequests()
Session
getWrittenWriteRequests
in interface Session
public int getScheduledWriteRequests()
Session
getScheduledWriteRequests
in interface Session
public TransportType getTransportType()
Session
getTransportType
in interface Session
public boolean isConnected()
Session
true
if this session is connected with remote peer.
isConnected
in interface Session
public SessionConfig getConfig()
Session
getConfig
in interface Session
public SocketAddress getRemoteAddress()
Session
getRemoteAddress
in interface Session
public SocketAddress getLocalAddress()
Session
getLocalAddress
in interface Session
public long getReadBytes()
Session
getReadBytes
in interface Session
public long getWrittenBytes()
Session
getWrittenBytes
in interface Session
public long getLastIoTime()
Session
getLastIoTime
in interface Session
public long getLastReadTime()
Session
getLastReadTime
in interface Session
public long getLastWriteTime()
Session
getLastWriteTime
in interface Session
public boolean isIdle(IdleStatus status)
Session
true
if this session is idle for the specified
IdleStatus
.
isIdle
in interface Session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |