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 boolean
private boolean
private InetSocketAddressWrapper
-
Constructor Summary
ConstructorsConstructorDescriptionClosedMemcachedTCPSession
(InetSocketAddressWrapper inetSocketAddressWrapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear attributesvoid
close()
Close sessionvoid
destroy()
void
flush()
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 encoderlong
Return last operation timestamp,operation include read,write,idleint
getOrder()
Return the session read buffer's byte order,big end or little end.Return the remote end's InetSocketAddresslong
Return the bytes in write queue,there bytes is in memory.Use this method to controll writing speed.long
long
int
boolean
boolean
boolean
isClosed()
Check if session is closedboolean
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
Return true if allow handling read and write concurrently,default is true.boolean
isIdle()
Check if session is idleboolean
return true if it is a loopback connectionboolean
Return true if using blocking readboolean
Return true if using blocking writevoid
quit()
void
removeAttribute
(String key) Remove attributevoid
setAllowReconnect
(boolean allow) void
setAttribute
(String key, Object value) Set a attribute attched with this sessionsetAttributeIfAbsent
(String key, Object value) void
setAuthFailed
(boolean authFailed) void
setBufferAllocator
(BufferAllocator allocator) void
setDecoder
(CodecFactory.Decoder decoder) void
setEncoder
(CodecFactory.Encoder encoder) Set encodervoid
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 writevoid
start()
Start sessionvoid
Write 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:
setBufferAllocator
in interfaceMemcachedSession
-
destroy
public void destroy()- Specified by:
destroy
in interfaceMemcachedSession
-
quit
public void quit()- Specified by:
quit
in interfaceMemcachedSession
-
isAuthFailed
public boolean isAuthFailed()- Specified by:
isAuthFailed
in interfaceMemcachedSession
-
setAuthFailed
public void setAuthFailed(boolean authFailed) - Specified by:
setAuthFailed
in interfaceMemcachedSession
-
getInetSocketAddressWrapper
- Specified by:
getInetSocketAddressWrapper
in interfaceClosedMemcachedSession
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceClosedMemcachedSession
-
getWeight
public int getWeight()- Specified by:
getWeight
in interfaceClosedMemcachedSession
-
isAllowReconnect
public boolean isAllowReconnect()- Specified by:
isAllowReconnect
in interfaceClosedMemcachedSession
-
setAllowReconnect
public void setAllowReconnect(boolean allow) - Specified by:
setAllowReconnect
in interfaceClosedMemcachedSession
-
clearAttributes
public void clearAttributes()Description copied from interface:Session
Clear attributes- Specified by:
clearAttributes
in interfaceSession
-
close
public void close()Description copied from interface:Session
Close session -
flush
public void flush()Description copied from interface:Session
Flush the write queue,this method may be no effect if OP_WRITE is running. -
getAttribute
Description copied from interface:Session
Return attribute associated with key- Specified by:
getAttribute
in interfaceSession
- Parameters:
key
-- Returns:
-
getDecoder
Description copied from interface:Session
Return current decoder- Specified by:
getDecoder
in interfaceSession
- Returns:
-
getEncoder
Description copied from interface:Session
Return current encoder- Specified by:
getEncoder
in interfaceSession
- Returns:
-
getHandler
- Specified by:
getHandler
in interfaceSession
-
getLastOperationTimeStamp
public long getLastOperationTimeStamp()Description copied from interface:Session
Return last operation timestamp,operation include read,write,idle- Specified by:
getLastOperationTimeStamp
in interfaceSession
- Returns:
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceSession
-
getReadBufferByteOrder
Description copied from interface:Session
Return the session read buffer's byte order,big end or little end.- Specified by:
getReadBufferByteOrder
in interfaceSession
- Returns:
-
getRemoteSocketAddress
Description copied from interface:Session
Return the remote end's InetSocketAddress- Specified by:
getRemoteSocketAddress
in interfaceSession
- Returns:
-
getScheduleWritenBytes
public long getScheduleWritenBytes()Description copied from interface:Session
Return the bytes in write queue,there bytes is in memory.Use this method to controll writing speed.- Specified by:
getScheduleWritenBytes
in interfaceSession
- Returns:
-
getSessionIdleTimeout
public long getSessionIdleTimeout()- Specified by:
getSessionIdleTimeout
in interfaceSession
-
getSessionTimeout
public long getSessionTimeout()- Specified by:
getSessionTimeout
in interfaceSession
-
isClosed
public boolean isClosed()Description copied from interface:Session
Check if session is closed -
isExpired
public boolean isExpired()Description copied from interface:Session
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. -
isHandleReadWriteConcurrently
public boolean isHandleReadWriteConcurrently()Description copied from interface:Session
Return true if allow handling read and write concurrently,default is true.- Specified by:
isHandleReadWriteConcurrently
in interfaceSession
- Returns:
-
isIdle
public boolean isIdle()Description copied from interface:Session
Check if session is idle -
isLoopbackConnection
public boolean isLoopbackConnection()Description copied from interface:Session
return true if it is a loopback connection- Specified by:
isLoopbackConnection
in interfaceSession
- Returns:
-
isUseBlockingRead
public boolean isUseBlockingRead()Description copied from interface:Session
Return true if using blocking read- Specified by:
isUseBlockingRead
in interfaceSession
- Returns:
-
isUseBlockingWrite
public boolean isUseBlockingWrite()Description copied from interface:Session
Return true if using blocking write- Specified by:
isUseBlockingWrite
in interfaceSession
- Returns:
-
removeAttribute
Description copied from interface:Session
Remove attribute- Specified by:
removeAttribute
in interfaceSession
- Parameters:
key
-
-
setAttribute
Description copied from interface:Session
Set a attribute attched with this session- Specified by:
setAttribute
in interfaceSession
- Parameters:
key
-value
-
-
setAttributeIfAbsent
- Specified by:
setAttributeIfAbsent
in interfaceSession
-
setDecoder
- Specified by:
setDecoder
in interfaceSession
-
setEncoder
Description copied from interface:Session
Set encoder- Specified by:
setEncoder
in interfaceSession
- Parameters:
encoder
-
-
setHandleReadWriteConcurrently
public void setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently) - Specified by:
setHandleReadWriteConcurrently
in interfaceSession
-
setReadBufferByteOrder
- Specified by:
setReadBufferByteOrder
in interfaceSession
-
setSessionIdleTimeout
public void setSessionIdleTimeout(long sessionIdleTimeout) - Specified by:
setSessionIdleTimeout
in interfaceSession
-
setSessionTimeout
public void setSessionTimeout(long sessionTimeout) - Specified by:
setSessionTimeout
in interfaceSession
-
setUseBlockingRead
public void setUseBlockingRead(boolean useBlockingRead) - Specified by:
setUseBlockingRead
in interfaceSession
-
setUseBlockingWrite
public void setUseBlockingWrite(boolean useBlockingWrite) Description copied from interface:Session
Set if using blocking write- Specified by:
setUseBlockingWrite
in interfaceSession
- Parameters:
useBlockingWrite
-
-
start
public void start()Description copied from interface:Session
Start session -
write
Description copied from interface:Session
Write a message,if you don't care when the message is written
-