Class MemcachedSessionDataMap

    • Field Detail

      • _client

        protected net.rubyeye.xmemcached.MemcachedClient _client
      • _expirySec

        protected int _expirySec
      • _heartbeats

        protected boolean _heartbeats
      • _builder

        protected net.rubyeye.xmemcached.XMemcachedClientBuilder _builder
    • Constructor Detail

      • MemcachedSessionDataMap

        public MemcachedSessionDataMap​(java.lang.String host,
                                       java.lang.String port)
        Parameters:
        host - address of memcache server
        port - address of memcache server
      • MemcachedSessionDataMap

        public MemcachedSessionDataMap​(java.util.List<java.net.InetSocketAddress> addresses)
      • MemcachedSessionDataMap

        public MemcachedSessionDataMap​(java.util.List<java.net.InetSocketAddress> addresses,
                                       int[] weights)
    • Method Detail

      • getBuilder

        public net.rubyeye.xmemcached.XMemcachedClientBuilder getBuilder()
        Returns:
        the builder
      • setExpirySec

        public void setExpirySec​(int sec)
        Parameters:
        sec - the expiry to use in seconds
      • getExpirySec

        @ManagedAttribute(value="memcached expiry time in sec",
                          readonly=true)
        public int getExpirySec()
        Expiry time for memached entries.
        Returns:
        memcached expiry time in sec
      • setHeartbeats

        public void setHeartbeats​(boolean heartbeats)
      • initialize

        public void initialize​(SessionContext context)
        Description copied from interface: SessionDataMap
        Initialize this data map for the given context. A SessionDataMap can only be used by one context(/session manager).
        Specified by:
        initialize in interface SessionDataMap
        Parameters:
        context - context associated
      • load

        public SessionData load​(java.lang.String id)
                         throws java.lang.Exception
        Description copied from interface: SessionDataMap
        Read in session data.
        Specified by:
        load in interface SessionDataMap
        Parameters:
        id - identity of session to load
        Returns:
        the SessionData matching the id
        Throws:
        java.lang.Exception - if unable to load session data
      • store

        public void store​(java.lang.String id,
                          SessionData data)
                   throws java.lang.Exception
        Description copied from interface: SessionDataMap
        Store the session data.
        Specified by:
        store in interface SessionDataMap
        Parameters:
        id - identity of session to store
        data - info of session to store
        Throws:
        java.lang.Exception - if unable to write session data
      • delete

        public boolean delete​(java.lang.String id)
                       throws java.lang.Exception
        Description copied from interface: SessionDataMap
        Delete session data
        Specified by:
        delete in interface SessionDataMap
        Parameters:
        id - identity of session to delete
        Returns:
        true if the session was deleted
        Throws:
        java.lang.Exception - if unable to delete session data
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Overrides:
        doStop in class AbstractLifeCycle
        Throws:
        java.lang.Exception