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
  • Field Details

    • inetSocketAddressWrapper

      private InetSocketAddressWrapper inetSocketAddressWrapper
    • allowReconnect

      private volatile boolean allowReconnect
    • authFailed

      private volatile boolean authFailed
  • Constructor Details

  • Method Details

    • setBufferAllocator

      public void setBufferAllocator(BufferAllocator allocator)
      Specified by:
      setBufferAllocator in interface MemcachedSession
    • destroy

      public void destroy()
      Specified by:
      destroy in interface MemcachedSession
    • quit

      public void quit()
      Specified by:
      quit in interface MemcachedSession
    • isAuthFailed

      public boolean isAuthFailed()
      Specified by:
      isAuthFailed in interface MemcachedSession
    • setAuthFailed

      public void setAuthFailed(boolean authFailed)
      Specified by:
      setAuthFailed in interface MemcachedSession
    • getInetSocketAddressWrapper

      public InetSocketAddressWrapper getInetSocketAddressWrapper()
      Specified by:
      getInetSocketAddressWrapper in interface ClosedMemcachedSession
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface ClosedMemcachedSession
    • getWeight

      public int getWeight()
      Specified by:
      getWeight in interface ClosedMemcachedSession
    • isAllowReconnect

      public boolean isAllowReconnect()
      Specified by:
      isAllowReconnect in interface ClosedMemcachedSession
    • setAllowReconnect

      public void setAllowReconnect(boolean allow)
      Specified by:
      setAllowReconnect in interface ClosedMemcachedSession
    • clearAttributes

      public void clearAttributes()
      Description copied from interface: Session
      Clear attributes
      Specified by:
      clearAttributes in interface Session
    • close

      public void close()
      Description copied from interface: Session
      Close session
      Specified by:
      close in interface 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.
      Specified by:
      flush in interface Session
    • getAttribute

      public Object getAttribute(String key)
      Description copied from interface: Session
      Return attribute associated with key
      Specified by:
      getAttribute in interface Session
      Parameters:
      key -
      Returns:
    • getDecoder

      public CodecFactory.Decoder getDecoder()
      Description copied from interface: Session
      Return current decoder
      Specified by:
      getDecoder in interface Session
      Returns:
    • getEncoder

      public CodecFactory.Encoder getEncoder()
      Description copied from interface: Session
      Return current encoder
      Specified by:
      getEncoder in interface Session
      Returns:
    • getHandler

      public Handler getHandler()
      Specified by:
      getHandler in interface Session
    • getLastOperationTimeStamp

      public long getLastOperationTimeStamp()
      Description copied from interface: Session
      Return last operation timestamp,operation include read,write,idle
      Specified by:
      getLastOperationTimeStamp in interface Session
      Returns:
    • getLocalAddress

      public InetAddress getLocalAddress()
      Specified by:
      getLocalAddress in interface Session
    • getReadBufferByteOrder

      public ByteOrder getReadBufferByteOrder()
      Description copied from interface: Session
      Return the session read buffer's byte order,big end or little end.
      Specified by:
      getReadBufferByteOrder in interface Session
      Returns:
    • getRemoteSocketAddress

      public InetSocketAddress getRemoteSocketAddress()
      Description copied from interface: Session
      Return the remote end's InetSocketAddress
      Specified by:
      getRemoteSocketAddress in interface Session
      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 interface Session
      Returns:
    • getSessionIdleTimeout

      public long getSessionIdleTimeout()
      Specified by:
      getSessionIdleTimeout in interface Session
    • getSessionTimeout

      public long getSessionTimeout()
      Specified by:
      getSessionTimeout in interface Session
    • isClosed

      public boolean isClosed()
      Description copied from interface: Session
      Check if session is closed
      Specified by:
      isClosed in interface Session
      Returns:
    • 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.
      Specified by:
      isExpired in interface Session
      Returns:
    • 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 interface Session
      Returns:
    • isIdle

      public boolean isIdle()
      Description copied from interface: Session
      Check if session is idle
      Specified by:
      isIdle in interface Session
      Returns:
    • isLoopbackConnection

      public boolean isLoopbackConnection()
      Description copied from interface: Session
      return true if it is a loopback connection
      Specified by:
      isLoopbackConnection in interface Session
      Returns:
    • isUseBlockingRead

      public boolean isUseBlockingRead()
      Description copied from interface: Session
      Return true if using blocking read
      Specified by:
      isUseBlockingRead in interface Session
      Returns:
    • isUseBlockingWrite

      public boolean isUseBlockingWrite()
      Description copied from interface: Session
      Return true if using blocking write
      Specified by:
      isUseBlockingWrite in interface Session
      Returns:
    • removeAttribute

      public void removeAttribute(String key)
      Description copied from interface: Session
      Remove attribute
      Specified by:
      removeAttribute in interface Session
      Parameters:
      key -
    • setAttribute

      public void setAttribute(String key, Object value)
      Description copied from interface: Session
      Set a attribute attched with this session
      Specified by:
      setAttribute in interface Session
      Parameters:
      key -
      value -
    • setAttributeIfAbsent

      public Object setAttributeIfAbsent(String key, Object value)
      Specified by:
      setAttributeIfAbsent in interface Session
    • setDecoder

      public void setDecoder(CodecFactory.Decoder decoder)
      Specified by:
      setDecoder in interface Session
    • setEncoder

      public void setEncoder(CodecFactory.Encoder encoder)
      Description copied from interface: Session
      Set encoder
      Specified by:
      setEncoder in interface Session
      Parameters:
      encoder -
    • setHandleReadWriteConcurrently

      public void setHandleReadWriteConcurrently(boolean handleReadWriteConcurrently)
      Specified by:
      setHandleReadWriteConcurrently in interface Session
    • setReadBufferByteOrder

      public void setReadBufferByteOrder(ByteOrder readBufferByteOrder)
      Specified by:
      setReadBufferByteOrder in interface Session
    • setSessionIdleTimeout

      public void setSessionIdleTimeout(long sessionIdleTimeout)
      Specified by:
      setSessionIdleTimeout in interface Session
    • setSessionTimeout

      public void setSessionTimeout(long sessionTimeout)
      Specified by:
      setSessionTimeout in interface Session
    • setUseBlockingRead

      public void setUseBlockingRead(boolean useBlockingRead)
      Specified by:
      setUseBlockingRead in interface Session
    • setUseBlockingWrite

      public void setUseBlockingWrite(boolean useBlockingWrite)
      Description copied from interface: Session
      Set if using blocking write
      Specified by:
      setUseBlockingWrite in interface Session
      Parameters:
      useBlockingWrite -
    • start

      public void start()
      Description copied from interface: Session
      Start session
      Specified by:
      start in interface Session
    • write

      public void write(Object packet)
      Description copied from interface: Session
      Write a message,if you don't care when the message is written
      Specified by:
      write in interface Session
      Parameters:
      packet -