Package net.rubyeye.xmemcached.impl
Class ClosedMemcachedTCPSession
java.lang.Object
net.rubyeye.xmemcached.impl.ClosedMemcachedTCPSession
- All Implemented Interfaces:
Session,ClosedMemcachedSession,MemcachedSession
public class ClosedMemcachedTCPSession
extends Object
implements ClosedMemcachedSession, MemcachedSession
Closed session
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.code.yanf4j.core.Session
Session.SessionStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate InetSocketAddressWrapper -
Constructor Summary
ConstructorsConstructorDescriptionClosedMemcachedTCPSession(InetSocketAddressWrapper inetSocketAddressWrapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidClear attributesvoidclose()Close sessionvoiddestroy()voidflush()Flush the write queue,this method may be no effect if OP_WRITE is running.getAttribute(String key) Return attribute associated with keyReturn current decoderReturn current encoderlongReturn last operation timestamp,operation include read,write,idleintgetOrder()Return the session read buffer's byte order,big end or little end.Return the remote end's InetSocketAddresslongReturn the bytes in write queue,there bytes is in memory.Use this method to controll writing speed.longlongintbooleanbooleanbooleanisClosed()Check if session is closedbooleanReturn 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.booleanReturn true if allow handling read and write concurrently,default is true.booleanisIdle()Check if session is idlebooleanreturn true if it is a loopback connectionbooleanReturn true if using blocking readbooleanReturn true if using blocking writevoidquit()voidremoveAttribute(String key) Remove attributevoidsetAllowReconnect(boolean allow) voidsetAttribute(String key, Object value) Set a attribute attched with this sessionsetAttributeIfAbsent(String key, Object value) voidsetAuthFailed(boolean authFailed) voidsetBufferAllocator(BufferAllocator allocator) voidsetDecoder(CodecFactory.Decoder decoder) voidsetEncoder(CodecFactory.Encoder encoder) Set encodervoidsetHandleReadWriteConcurrently(boolean handleReadWriteConcurrently) voidsetReadBufferByteOrder(ByteOrder readBufferByteOrder) voidsetSessionIdleTimeout(long sessionIdleTimeout) voidsetSessionTimeout(long sessionTimeout) voidsetUseBlockingRead(boolean useBlockingRead) voidsetUseBlockingWrite(boolean useBlockingWrite) Set if using blocking writevoidstart()Start sessionvoidWrite a message,if you don't care when the message is written
-
Field Details
-
inetSocketAddressWrapper
-
allowReconnect
private volatile boolean allowReconnect -
authFailed
private volatile boolean authFailed
-
-
Constructor Details
-
ClosedMemcachedTCPSession
-
-
Method Details
-
setBufferAllocator
- Specified by:
setBufferAllocatorin interfaceMemcachedSession
-
destroy
public void destroy()- Specified by:
destroyin interfaceMemcachedSession
-
quit
public void quit()- Specified by:
quitin interfaceMemcachedSession
-
isAuthFailed
public boolean isAuthFailed()- Specified by:
isAuthFailedin interfaceMemcachedSession
-
setAuthFailed
public void setAuthFailed(boolean authFailed) - Specified by:
setAuthFailedin interfaceMemcachedSession
-
getInetSocketAddressWrapper
- Specified by:
getInetSocketAddressWrapperin interfaceClosedMemcachedSession
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceClosedMemcachedSession
-
getWeight
public int getWeight()- Specified by:
getWeightin interfaceClosedMemcachedSession
-
isAllowReconnect
public boolean isAllowReconnect()- Specified by:
isAllowReconnectin interfaceClosedMemcachedSession
-
setAllowReconnect
public void setAllowReconnect(boolean allow) - Specified by:
setAllowReconnectin interfaceClosedMemcachedSession
-
clearAttributes
public void clearAttributes()Description copied from interface:SessionClear attributes- Specified by:
clearAttributesin interfaceSession
-
close
public void close()Description copied from interface:SessionClose session -
flush
public void flush()Description copied from interface:SessionFlush the write queue,this method may be no effect if OP_WRITE is running. -
getAttribute
Description copied from interface:SessionReturn attribute associated with key- Specified by:
getAttributein interfaceSession- Parameters:
key-- Returns:
-
getDecoder
Description copied from interface:SessionReturn current decoder- Specified by:
getDecoderin interfaceSession- Returns:
-
getEncoder
Description copied from interface:SessionReturn current encoder- Specified by:
getEncoderin interfaceSession- Returns:
-
getHandler
- Specified by:
getHandlerin interfaceSession
-
getLastOperationTimeStamp
public long getLastOperationTimeStamp()Description copied from interface:SessionReturn last operation timestamp,operation include read,write,idle- Specified by:
getLastOperationTimeStampin interfaceSession- Returns:
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceSession
-
getReadBufferByteOrder
Description copied from interface:SessionReturn the session read buffer's byte order,big end or little end.- Specified by:
getReadBufferByteOrderin interfaceSession- Returns:
-
getRemoteSocketAddress
Description copied from interface:SessionReturn the remote end's InetSocketAddress- Specified by:
getRemoteSocketAddressin interfaceSession- Returns:
-
getScheduleWritenBytes
public long getScheduleWritenBytes()Description copied from interface:SessionReturn the bytes in write queue,there bytes is in memory.Use this method to controll writing speed.- Specified by:
getScheduleWritenBytesin interfaceSession- Returns:
-
getSessionIdleTimeout
public long getSessionIdleTimeout()- Specified by:
getSessionIdleTimeoutin interfaceSession
-
getSessionTimeout
public long getSessionTimeout()- Specified by:
getSessionTimeoutin interfaceSession
-
isClosed
public boolean isClosed()Description copied from interface:SessionCheck if session is closed -
isExpired
public boolean isExpired()Description copied from interface:SessionReturn 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. -
isHandleReadWriteConcurrently
public boolean isHandleReadWriteConcurrently()Description copied from interface:SessionReturn true if allow handling read and write concurrently,default is true.- Specified by:
isHandleReadWriteConcurrentlyin interfaceSession- Returns:
-
isIdle
public boolean isIdle()Description copied from interface:SessionCheck if session is idle -
isLoopbackConnection
public boolean isLoopbackConnection()Description copied from interface:Sessionreturn true if it is a loopback connection- Specified by:
isLoopbackConnectionin interfaceSession- Returns:
-
isUseBlockingRead
public boolean isUseBlockingRead()Description copied from interface:SessionReturn true if using blocking read- Specified by:
isUseBlockingReadin interfaceSession- Returns:
-
isUseBlockingWrite
public boolean isUseBlockingWrite()Description copied from interface:SessionReturn true if using blocking write- Specified by:
isUseBlockingWritein interfaceSession- Returns:
-
removeAttribute
Description copied from interface:SessionRemove attribute- Specified by:
removeAttributein interfaceSession- Parameters:
key-
-
setAttribute
Description copied from interface:SessionSet a attribute attched with this session- Specified by:
setAttributein interfaceSession- Parameters:
key-value-
-
setAttributeIfAbsent
- Specified by:
setAttributeIfAbsentin interfaceSession
-
setDecoder
- Specified by:
setDecoderin interfaceSession
-
setEncoder
Description copied from interface:SessionSet encoder- Specified by:
setEncoderin interfaceSession- Parameters:
encoder-
-
setHandleReadWriteConcurrently
public void setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently) - Specified by:
setHandleReadWriteConcurrentlyin interfaceSession
-
setReadBufferByteOrder
- Specified by:
setReadBufferByteOrderin interfaceSession
-
setSessionIdleTimeout
public void setSessionIdleTimeout(long sessionIdleTimeout) - Specified by:
setSessionIdleTimeoutin interfaceSession
-
setSessionTimeout
public void setSessionTimeout(long sessionTimeout) - Specified by:
setSessionTimeoutin interfaceSession
-
setUseBlockingRead
public void setUseBlockingRead(boolean useBlockingRead) - Specified by:
setUseBlockingReadin interfaceSession
-
setUseBlockingWrite
public void setUseBlockingWrite(boolean useBlockingWrite) Description copied from interface:SessionSet if using blocking write- Specified by:
setUseBlockingWritein interfaceSession- Parameters:
useBlockingWrite-
-
start
public void start()Description copied from interface:SessionStart session -
write
Description copied from interface:SessionWrite a message,if you don't care when the message is written
-