|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Session
Abstract connection
| Nested Class Summary | |
|---|---|
static class |
Session.SessionStatus
|
| Method Summary | |
|---|---|
void |
clearAttributes()
Clear attributes |
void |
close()
Close session |
void |
flush()
Flush the write queue,this method may be no effect if OP_WRITE is running. |
java.lang.Object |
getAttribute(java.lang.String key)
Return attribute associated with key |
CodecFactory.Decoder |
getDecoder()
Return current decoder |
CodecFactory.Encoder |
getEncoder()
Return current encoder |
Handler |
getHandler()
|
long |
getLastOperationTimeStamp()
Return last operation timestamp,operation include read,write,idle |
java.net.InetAddress |
getLocalAddress()
|
java.nio.ByteOrder |
getReadBufferByteOrder()
Return the session read buffer's byte order,big end or little end. |
java.net.InetSocketAddress |
getRemoteSocketAddress()
Return the remote end's InetSocketAddress |
long |
getScheduleWritenBytes()
Return the bytes in write queue,there bytes is in memory.Use this method to controll writing speed. |
long |
getSessionIdleTimeout()
|
long |
getSessionTimeout()
|
boolean |
isClosed()
Check if session is closed |
boolean |
isExpired()
Return true if session is expired,session is expired beacause you set the sessionTimeout,if since session's last operation form now is over this vlaue,isExpired return true,and Handler.onExpired() will be invoked. |
boolean |
isHandleReadWriteConcurrently()
Return true if allow handling read and write concurrently,default is true. |
boolean |
isIdle()
Check if session is idle |
boolean |
isLoopbackConnection()
return true if it is a loopback connection |
boolean |
isUseBlockingRead()
Return true if using blocking read |
boolean |
isUseBlockingWrite()
Return true if using blocking write |
void |
removeAttribute(java.lang.String key)
Remove attribute |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
Set a attribute attched with this session |
java.lang.Object |
setAttributeIfAbsent(java.lang.String key,
java.lang.Object value)
|
void |
setDecoder(CodecFactory.Decoder decoder)
|
void |
setEncoder(CodecFactory.Encoder encoder)
Set encoder |
void |
setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently)
|
void |
setReadBufferByteOrder(java.nio.ByteOrder readBufferByteOrder)
|
void |
setSessionIdleTimeout(long sessionIdleTimeout)
|
void |
setSessionTimeout(long sessionTimeout)
|
void |
setUseBlockingRead(boolean useBlockingRead)
|
void |
setUseBlockingWrite(boolean useBlockingWrite)
Set if using blocking write |
void |
start()
Start session |
void |
write(java.lang.Object packet)
Write a message,if you don't care when the message is written |
| Method Detail |
|---|
void start()
void write(java.lang.Object packet)
packet - boolean isClosed()
void close()
java.net.InetSocketAddress getRemoteSocketAddress()
java.net.InetAddress getLocalAddress()
boolean isUseBlockingWrite()
void setUseBlockingWrite(boolean useBlockingWrite)
useBlockingWrite - boolean isUseBlockingRead()
void setUseBlockingRead(boolean useBlockingRead)
void flush()
boolean isExpired()
boolean isIdle()
CodecFactory.Encoder getEncoder()
void setEncoder(CodecFactory.Encoder encoder)
encoder - CodecFactory.Decoder getDecoder()
void setDecoder(CodecFactory.Decoder decoder)
boolean isHandleReadWriteConcurrently()
void setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently)
java.nio.ByteOrder getReadBufferByteOrder()
void setReadBufferByteOrder(java.nio.ByteOrder readBufferByteOrder)
void setAttribute(java.lang.String key,
java.lang.Object value)
key - value - void removeAttribute(java.lang.String key)
key - java.lang.Object getAttribute(java.lang.String key)
key -
void clearAttributes()
long getScheduleWritenBytes()
long getLastOperationTimeStamp()
boolean isLoopbackConnection()
long getSessionIdleTimeout()
void setSessionIdleTimeout(long sessionIdleTimeout)
long getSessionTimeout()
void setSessionTimeout(long sessionTimeout)
java.lang.Object setAttributeIfAbsent(java.lang.String key,
java.lang.Object value)
Handler getHandler()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||