org.silverpeas.cache.service
Class EhCacheService

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

public final class EhCacheService
extends AbstractCacheService

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


Method Summary
 void clear()
          Clear the content of the cache.
 Object get(Object key)
          Gets an element from the cache.
 void put(Object key, Object value, int timeToLive, int timeToIdle)
          Puts a value for a given key.
 Object remove(Object key)
          Removes an element from the cache and return it.
<T> T
remove(Object key, Class<T> classType)
          Removes a typed element from the cache and return it.
 
Methods inherited from class org.silverpeas.cache.service.AbstractCacheService
add, add, put, put
 
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.SimpleCacheService
add, get
 

Method Detail

clear

public void clear()
Description copied from interface: SimpleCacheService
Clear the content of the cache.


get

public Object get(Object key)
Description copied from interface: SimpleCacheService
Gets an element from the cache.

Returns:

remove

public Object remove(Object key)
Description copied from interface: SimpleCacheService
Removes an element from the cache and return it.

Returns:

remove

public <T> T remove(Object key,
                    Class<T> classType)
Description copied from interface: SimpleCacheService
Removes a typed element from the cache and return it. Null is returned if an element exists for the given key but the object type doesn't correspond.

Returns:

put

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

timeToIdle - 0 = unlimited


Copyright © 2016 Silverpeas. All Rights Reserved.