public class ClosedMemcachedTCPSession extends Object implements ClosedMemcachedSession, 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 setBufferAllocator(BufferAllocator allocator)
setBufferAllocator
in interface MemcachedSession
public void destroy()
destroy
in interface MemcachedSession
public void quit()
quit
in interface MemcachedSession
public boolean isAuthFailed()
isAuthFailed
in interface MemcachedSession
public void setAuthFailed(boolean authFailed)
setAuthFailed
in interface MemcachedSession
public InetSocketAddressWrapper getInetSocketAddressWrapper()
getInetSocketAddressWrapper
in interface ClosedMemcachedSession
public int getOrder()
getOrder
in interface ClosedMemcachedSession
public int getWeight()
getWeight
in interface ClosedMemcachedSession
public boolean isAllowReconnect()
isAllowReconnect
in interface ClosedMemcachedSession
public void setAllowReconnect(boolean allow)
setAllowReconnect
in interface ClosedMemcachedSession
public void clearAttributes()
Session
clearAttributes
in interface Session
public void close()
Session
public void flush()
Session
public Object getAttribute(String key)
Session
getAttribute
in interface Session
public CodecFactory.Decoder getDecoder()
Session
getDecoder
in interface Session
public CodecFactory.Encoder getEncoder()
Session
getEncoder
in interface Session
public Handler getHandler()
getHandler
in interface Session
public long getLastOperationTimeStamp()
Session
getLastOperationTimeStamp
in interface Session
public InetAddress getLocalAddress()
getLocalAddress
in interface Session
public ByteOrder getReadBufferByteOrder()
Session
getReadBufferByteOrder
in interface Session
public InetSocketAddress getRemoteSocketAddress()
Session
getRemoteSocketAddress
in interface Session
public long getScheduleWritenBytes()
Session
getScheduleWritenBytes
in interface Session
public long getSessionIdleTimeout()
getSessionIdleTimeout
in interface Session
public long getSessionTimeout()
getSessionTimeout
in interface Session
public boolean isClosed()
Session
public boolean isExpired()
Session
public boolean isHandleReadWriteConcurrently()
Session
isHandleReadWriteConcurrently
in interface Session
public boolean isIdle()
Session
public boolean isLoopbackConnection()
Session
isLoopbackConnection
in interface Session
public boolean isUseBlockingRead()
Session
isUseBlockingRead
in interface Session
public boolean isUseBlockingWrite()
Session
isUseBlockingWrite
in interface Session
public void removeAttribute(String key)
Session
removeAttribute
in interface Session
public void setAttribute(String key, Object value)
Session
setAttribute
in interface Session
public Object setAttributeIfAbsent(String key, Object value)
setAttributeIfAbsent
in interface Session
public void setDecoder(CodecFactory.Decoder decoder)
setDecoder
in interface Session
public void setEncoder(CodecFactory.Encoder encoder)
Session
setEncoder
in interface Session
public void setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently)
setHandleReadWriteConcurrently
in interface Session
public void setReadBufferByteOrder(ByteOrder readBufferByteOrder)
setReadBufferByteOrder
in interface Session
public void setSessionIdleTimeout(long sessionIdleTimeout)
setSessionIdleTimeout
in interface Session
public void setSessionTimeout(long sessionTimeout)
setSessionTimeout
in interface Session
public void setUseBlockingRead(boolean useBlockingRead)
setUseBlockingRead
in interface Session
public void setUseBlockingWrite(boolean useBlockingWrite)
Session
setUseBlockingWrite
in interface Session
public void start()
Session
Copyright © 2021. All rights reserved.