org.silverpeas.cache.service
Interface SimpleCacheService

All Known Subinterfaces:
CacheService
All Known Implementing Classes:
AbstractCacheService, AbstractSimpleCacheService, EhCacheService, InMemoryCacheService, ThreadCacheService

public interface SimpleCacheService

User: Yohann Chastagnier Date: 11/09/13


Method Summary
 String add(Object value)
          Adds a value and generate a unique key to retrieve later the value.
 void clear()
          Clear the content of the cache.
 Object get(Object key)
          Gets an element from the cache.
<T> T
get(Object key, Class<T> classType)
          Gets a typed element from the cache.
 void put(Object key, Object value)
          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.
 

Method Detail

clear

void clear()
Clear the content of the cache.


get

Object get(Object key)
Gets an element from the cache.

Parameters:
key -
Returns:

get

<T> T get(Object key,
          Class<T> classType)
Gets a typed element from the cache. Null is returned if an element exists for the given key but the object type doesn't correspond.

Type Parameters:
T -
Parameters:
key -
classType -
Returns:

remove

Object remove(Object key)
Removes an element from the cache and return it.

Parameters:
key -
Returns:

remove

<T> T remove(Object key,
             Class<T> classType)
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.

Type Parameters:
T -
Parameters:
key -
classType -
Returns:

add

String add(Object value)
Adds a value and generate a unique key to retrieve later the value. After 12 hours without be used the value is trashed.

Parameters:
value -
Returns:

put

void put(Object key,
         Object value)
Puts a value for a given key. After 12 hours without be used the value is trashed.

Parameters:
key -
value -


Copyright © 2016 Silverpeas. All Rights Reserved.