|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.mina.common.BaseSession
public abstract class BaseSession
Base implementation of Session.
| Constructor Summary | |
|---|---|
protected |
BaseSession()
|
| Method Summary | |
|---|---|
void |
close()
Closes this session immediately. |
java.lang.Object |
getAttachment()
Returns an attachment of this session. |
java.lang.Object |
getAttribute(java.lang.String key)
Returns the value of user-defined attribute of this session. |
java.util.Set |
getAttributeKeys()
Returns the set of keys of all user-defined attributes. |
long |
getCreationTime()
Returns the time in millis when this session is created. |
int |
getIdleCount(IdleStatus status)
Returns the number of the fired continuous sessionIdle events for the specified IdleStatus. |
long |
getLastIdleTime(IdleStatus status)
Returns the time in millis when the last sessionIdle event is fired for the specified IdleStatus. |
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. |
long |
getReadBytes()
Returns the total number of bytes which were read from 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. |
void |
increaseIdleCount(IdleStatus status)
|
void |
increaseReadBytes(int increment)
|
void |
increaseWrittenBytes(int increment)
|
void |
increaseWrittenWriteRequests()
|
boolean |
isIdle(IdleStatus status)
Returns true if this session is idle for the specified
IdleStatus. |
java.lang.Object |
removeAttribute(java.lang.String key)
Removes a user-defined attribute with the specified key. |
void |
resetIdleCount(IdleStatus status)
|
java.lang.Object |
setAttachment(java.lang.Object attachment)
Sets an attachment of this session. |
java.lang.Object |
setAttribute(java.lang.String key,
java.lang.Object value)
Sets a user-defined attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.mina.common.Session |
|---|
close, getConfig, getLocalAddress, getRemoteAddress, getScheduledWriteRequests, getTransportType, isConnected |
| Constructor Detail |
|---|
protected BaseSession()
| Method Detail |
|---|
public void close()
Session
close in interface Sessionpublic java.lang.Object getAttachment()
Session
getAttachment in interface Sessionpublic java.lang.Object setAttachment(java.lang.Object attachment)
Session
setAttachment in interface Sessionpublic java.lang.Object getAttribute(java.lang.String key)
Session
getAttribute in interface Sessionkey - the key of the attribute
public java.lang.Object setAttribute(java.lang.String key,
java.lang.Object value)
Session
setAttribute in interface Sessionkey - the key of the attributevalue - the value of the attribute
public java.lang.Object removeAttribute(java.lang.String key)
Session
removeAttribute in interface Sessionpublic java.util.Set getAttributeKeys()
Session
getAttributeKeys in interface Sessionpublic long getReadBytes()
Session
getReadBytes in interface Sessionpublic long getWrittenBytes()
Session
getWrittenBytes in interface Sessionpublic long getWrittenWriteRequests()
Session
getWrittenWriteRequests in interface Sessionpublic void increaseReadBytes(int increment)
public void increaseWrittenBytes(int increment)
public void increaseWrittenWriteRequests()
public long getCreationTime()
Session
getCreationTime in interface Sessionpublic long getLastIoTime()
Session
getLastIoTime in interface Sessionpublic long getLastReadTime()
Session
getLastReadTime in interface Sessionpublic long getLastWriteTime()
Session
getLastWriteTime in interface Sessionpublic boolean isIdle(IdleStatus status)
Sessiontrue if this session is idle for the specified
IdleStatus.
isIdle in interface Sessionpublic int getIdleCount(IdleStatus status)
SessionIdleStatus.
If sessionIdle event is fired first after some time after I/O, idleCount becomes 1. idleCount resets to 0 if any I/O occurs again, otherwise it increases to 2 and so on if sessionIdle event is fired again without any I/O between two (or more) sessionIdle events.
getIdleCount in interface Sessionpublic long getLastIdleTime(IdleStatus status)
SessionIdleStatus.
getLastIdleTime in interface Sessionpublic void increaseIdleCount(IdleStatus status)
public void resetIdleCount(IdleStatus status)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||