public class ClosedMemcachedTCPSession extends Object implements MemcachedSession
Session.SessionStatus| Constructor and Description |
|---|
ClosedMemcachedTCPSession(InetSocketAddressWrapper inetSocketAddressWrapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAttributes()
Clear attributes
|
void |
close()
Close session
|
void |
destroy() |
void |
flush()
Flush the write queue,this method may be no effect if OP_WRITE is
running.
|
Object |
getAttribute(String key)
Return attribute associated with key
|
CodecFactory.Decoder |
getDecoder()
Return current decoder
|
CodecFactory.Encoder |
getEncoder()
Return current encoder
|
Handler |
getHandler() |
InetSocketAddressWrapper |
getInetSocketAddressWrapper() |
long |
getLastOperationTimeStamp()
Return last operation timestamp,operation include read,write,idle
|
InetAddress |
getLocalAddress() |
int |
getOrder() |
ByteOrder |
getReadBufferByteOrder()
Return the session read buffer's byte order,big end or little end.
|
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() |
int |
getWeight() |
boolean |
isAllowReconnect() |
boolean |
isAuthFailed() |
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 |
quit() |
void |
removeAttribute(String key)
Remove attribute
|
void |
setAllowReconnect(boolean allow) |
void |
setAttribute(String key,
Object value)
Set a attribute attched with this session
|
Object |
setAttributeIfAbsent(String key,
Object value) |
void |
setAuthFailed(boolean authFailed) |
void |
setBufferAllocator(BufferAllocator allocator) |
void |
setDecoder(CodecFactory.Decoder decoder) |
void |
setEncoder(CodecFactory.Encoder encoder)
Set encoder
|
void |
setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently) |
void |
setReadBufferByteOrder(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(Object packet)
Write a message,if you don't care when the message is written
|
public ClosedMemcachedTCPSession(InetSocketAddressWrapper inetSocketAddressWrapper)
public void destroy()
destroy in interface MemcachedSessionpublic InetSocketAddressWrapper getInetSocketAddressWrapper()
getInetSocketAddressWrapper in interface MemcachedSessionpublic int getOrder()
getOrder in interface MemcachedSessionpublic int getWeight()
getWeight in interface MemcachedSessionpublic boolean isAllowReconnect()
isAllowReconnect in interface MemcachedSessionpublic void quit()
quit in interface MemcachedSessionpublic void setAllowReconnect(boolean allow)
setAllowReconnect in interface MemcachedSessionpublic void setBufferAllocator(BufferAllocator allocator)
setBufferAllocator in interface MemcachedSessionpublic void clearAttributes()
SessionclearAttributes in interface Sessionpublic void close()
Sessionpublic void flush()
Sessionpublic Object getAttribute(String key)
SessiongetAttribute in interface Sessionpublic CodecFactory.Decoder getDecoder()
SessiongetDecoder in interface Sessionpublic CodecFactory.Encoder getEncoder()
SessiongetEncoder in interface Sessionpublic Handler getHandler()
getHandler in interface Sessionpublic long getLastOperationTimeStamp()
SessiongetLastOperationTimeStamp in interface Sessionpublic InetAddress getLocalAddress()
getLocalAddress in interface Sessionpublic ByteOrder getReadBufferByteOrder()
SessiongetReadBufferByteOrder in interface Sessionpublic InetSocketAddress getRemoteSocketAddress()
SessiongetRemoteSocketAddress in interface Sessionpublic long getScheduleWritenBytes()
SessiongetScheduleWritenBytes in interface Sessionpublic long getSessionIdleTimeout()
getSessionIdleTimeout in interface Sessionpublic long getSessionTimeout()
getSessionTimeout in interface Sessionpublic boolean isClosed()
Sessionpublic boolean isExpired()
Sessionpublic boolean isHandleReadWriteConcurrently()
SessionisHandleReadWriteConcurrently in interface Sessionpublic boolean isIdle()
Sessionpublic boolean isLoopbackConnection()
SessionisLoopbackConnection in interface Sessionpublic boolean isUseBlockingRead()
SessionisUseBlockingRead in interface Sessionpublic boolean isUseBlockingWrite()
SessionisUseBlockingWrite in interface Sessionpublic void removeAttribute(String key)
SessionremoveAttribute in interface Sessionpublic void setAttribute(String key, Object value)
SessionsetAttribute in interface Sessionpublic Object setAttributeIfAbsent(String key, Object value)
setAttributeIfAbsent in interface Sessionpublic void setDecoder(CodecFactory.Decoder decoder)
setDecoder in interface Sessionpublic void setEncoder(CodecFactory.Encoder encoder)
SessionsetEncoder in interface Sessionpublic void setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently)
setHandleReadWriteConcurrently in interface Sessionpublic void setReadBufferByteOrder(ByteOrder readBufferByteOrder)
setReadBufferByteOrder in interface Sessionpublic void setSessionIdleTimeout(long sessionIdleTimeout)
setSessionIdleTimeout in interface Sessionpublic void setSessionTimeout(long sessionTimeout)
setSessionTimeout in interface Sessionpublic void setUseBlockingRead(boolean useBlockingRead)
setUseBlockingRead in interface Sessionpublic boolean isAuthFailed()
isAuthFailed in interface MemcachedSessionpublic void setAuthFailed(boolean authFailed)
setAuthFailed in interface MemcachedSessionpublic void setUseBlockingWrite(boolean useBlockingWrite)
SessionsetUseBlockingWrite in interface Sessionpublic void start()
SessionCopyright © 2016. All rights reserved.