Class ConcurrentFIFOExoCache<K extends Serializable,​V>

    • Constructor Detail

      • ConcurrentFIFOExoCache

        public ConcurrentFIFOExoCache()
      • ConcurrentFIFOExoCache

        public ConcurrentFIFOExoCache​(org.exoplatform.services.log.Log log)
      • ConcurrentFIFOExoCache

        public ConcurrentFIFOExoCache​(int maxSize)
      • ConcurrentFIFOExoCache

        public ConcurrentFIFOExoCache​(int maxSize,
                                      org.exoplatform.services.log.Log log)
      • ConcurrentFIFOExoCache

        public ConcurrentFIFOExoCache​(String name,
                                      int maxSize)
      • ConcurrentFIFOExoCache

        public ConcurrentFIFOExoCache​(String name,
                                      int maxSize,
                                      org.exoplatform.services.log.Log log)
    • Method Detail

      • assertConsistent

        public void assertConsistent()
      • setName

        public void setName​(String s)
        Description copied from interface: ExoCache
        Sets the cache name.
        Specified by:
        setName in interface ExoCache<K extends Serializable,​V>
        Parameters:
        s - the cache name
      • setLabel

        public void setLabel​(String name)
        Description copied from interface: ExoCache
        Sets the cache label
        Specified by:
        setLabel in interface ExoCache<K extends Serializable,​V>
        Parameters:
        name - the cache label
      • getLiveTime

        public long getLiveTime()
        Description copied from interface: ExoCache
        Returns the maximum life time of an entry in the cache. The life time is a value in seconds, a negative value means that the life time is infinite.
        Specified by:
        getLiveTime in interface ExoCache<K extends Serializable,​V>
        Returns:
        the live time
      • setLiveTime

        public void setLiveTime​(long period)
        Description copied from interface: ExoCache
        Sets the maximum life time of an entry in the cache.
        Specified by:
        setLiveTime in interface ExoCache<K extends Serializable,​V>
        Parameters:
        period - the live time
      • getLiveTimeMillis

        public long getLiveTimeMillis()
      • setLiveTimeMillis

        public void setLiveTimeMillis​(long liveTimeMillis)
      • getMaxSize

        public int getMaxSize()
        Description copied from interface: ExoCache
        Returns the maximum capacity of the cache.
        Specified by:
        getMaxSize in interface ExoCache<K extends Serializable,​V>
        Returns:
        the maximum capacity
      • setMaxSize

        public void setMaxSize​(int max)
        Description copied from interface: ExoCache
        Sets the maximum capacity of the cache.
        Specified by:
        setMaxSize in interface ExoCache<K extends Serializable,​V>
        Parameters:
        max - the maximum capacity
      • get

        public V get​(Serializable name)
        Description copied from interface: ExoCache
        Performs a lookup operation.
        Specified by:
        get in interface ExoCache<K extends Serializable,​V>
        Parameters:
        name - the cache key
        Returns:
        the cached value which may be evaluated to null
      • put

        public void put​(K name,
                        V obj)
        Description copied from interface: ExoCache
        Performs a put in the cache.
        Specified by:
        put in interface ExoCache<K extends Serializable,​V>
        Parameters:
        name - the cache key
        obj - the cached value
      • putLocal

        public void putLocal​(K name,
                             V obj)
        Description copied from interface: ExoCache
        Performs a put in the cache local mode (avoid replication).
        Specified by:
        putLocal in interface ExoCache<K extends Serializable,​V>
        Parameters:
        name - the cache key
        obj - the cached value
      • putMap

        public void putMap​(Map<? extends K,​? extends V> objs)
        Description copied from interface: ExoCache
        Performs a put of all the entries provided by the map argument.
        Specified by:
        putMap in interface ExoCache<K extends Serializable,​V>
        Parameters:
        objs - the objects to put
      • remove

        public V remove​(Serializable name)
        Description copied from interface: ExoCache
        Removes an entry from the cache.
        Specified by:
        remove in interface ExoCache<K extends Serializable,​V>
        Parameters:
        name - the cache key
        Returns:
        the previously cached value or null if no entry existed or that entry value was evaluated to null
      • getCachedObjects

        public List<? extends V> getCachedObjects()
        Description copied from interface: ExoCache
        Returns a list of cached object that are considered as valid when the method is called. Any non valid object will not be returned.
        Specified by:
        getCachedObjects in interface ExoCache<K extends Serializable,​V>
        Returns:
        the list of cached objects
      • removeCachedObjects

        public List<? extends V> removeCachedObjects()
        Description copied from interface: ExoCache
        Clears the cache and returns the list of cached object that are considered as valid when the method is called. Any non valid object will not be returned.
        Specified by:
        removeCachedObjects in interface ExoCache<K extends Serializable,​V>
        Returns:
        the list of cached objects
      • getCacheSize

        public int getCacheSize()
        Description copied from interface: ExoCache
        Returns the number of entries in the cache.
        Specified by:
        getCacheSize in interface ExoCache<K extends Serializable,​V>
        Returns:
        the size of the cache
      • getCacheHit

        public int getCacheHit()
        Description copied from interface: ExoCache
        Returns the number of time the cache was queried and a valid entry was returned.
        Specified by:
        getCacheHit in interface ExoCache<K extends Serializable,​V>
        Returns:
        the cache hits
      • getCacheMiss

        public int getCacheMiss()
        Description copied from interface: ExoCache
        Returns the number of time the cache was queried and no entry was returned.
        Specified by:
        getCacheMiss in interface ExoCache<K extends Serializable,​V>
        Returns:
        the cache misses
      • onExpire

        public void onExpire​(K key,
                             V obj)
        Description copied from interface: ExoCache
        On expire entry event
        Specified by:
        onExpire in interface ExoCache<K extends Serializable,​V>
        Parameters:
        key - entry key
        obj - value
      • onRemove

        public void onRemove​(K key,
                             V obj)
        Description copied from interface: ExoCache
        On remove entry event
        Specified by:
        onRemove in interface ExoCache<K extends Serializable,​V>
        Parameters:
        key - entry key
        obj - value
      • onPut

        public void onPut​(K key,
                          V obj)
        Description copied from interface: ExoCache
        On put entry event
        Specified by:
        onPut in interface ExoCache<K extends Serializable,​V>
        Parameters:
        key - entry key
        obj - value
      • onPutLocal

        public void onPutLocal​(K key,
                               V obj)
        Description copied from interface: ExoCache
        On put entry event
        Specified by:
        onPutLocal in interface ExoCache<K extends Serializable,​V>
        Parameters:
        key - entry key
        obj - value
      • onGet

        public void onGet​(K key,
                          V obj)
        Description copied from interface: ExoCache
        On get entry event
        Specified by:
        onGet in interface ExoCache<K extends Serializable,​V>
        Parameters:
        key - entry key
        obj - value