org.silverpeas.cache.service
Class AbstractCacheService

java.lang.Object
  extended by org.silverpeas.cache.service.AbstractSimpleCacheService
      extended by org.silverpeas.cache.service.AbstractCacheService
All Implemented Interfaces:
CacheService, SimpleCacheService
Direct Known Subclasses:
EhCacheService

public abstract class AbstractCacheService
extends AbstractSimpleCacheService
implements CacheService

Implementation of the CacheService that uses EhCache API. User: Yohann Chastagnier Date: 11/09/13


Constructor Summary
AbstractCacheService()
           
 
Method Summary
 String add(Object value, int timeToLive)
          Adds a value and generate a unique key to retrieve later the value.
 String add(Object value, int timeToLive, int timeToIdle)
          Adds a value and generate a unique key to retrieve later the value.
 void put(Object key, Object value)
          Puts a value for a given key.
 void put(Object key, Object value, int timeToLive)
          Puts a value for a given key.
 
Methods inherited from class org.silverpeas.cache.service.AbstractSimpleCacheService
add, get
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.silverpeas.cache.service.CacheService
put
 
Methods inherited from interface org.silverpeas.cache.service.SimpleCacheService
add, clear, get, get, remove, remove
 

Constructor Detail

AbstractCacheService

public AbstractCacheService()
Method Detail

add

public String add(Object value,
                  int timeToLive)
Description copied from interface: CacheService
Adds a value and generate a unique key to retrieve later the value. After the given time, the value is trashed.

Specified by:
add in interface CacheService
timeToLive - 0 = unlimited
Returns:

add

public String add(Object value,
                  int timeToLive,
                  int timeToIdle)
Description copied from interface: CacheService
Adds a value and generate a unique key to retrieve later the value. After the given live time, the value is trashed. After the given idle time, the value is trashed.

Specified by:
add in interface CacheService
timeToLive - 0 = unlimited
timeToIdle - 0 = unlimited
Returns:

put

public void put(Object key,
                Object value)
Description copied from interface: SimpleCacheService
Puts a value for a given key. After 12 hours without be used the value is trashed.

Specified by:
put in interface SimpleCacheService

put

public void put(Object key,
                Object value,
                int timeToLive)
Description copied from interface: CacheService
Puts a value for a given key. After the given time, the value is trashed.

Specified by:
put in interface CacheService
timeToLive - 0 = unlimited


Copyright © 2016 Silverpeas. All Rights Reserved.