net.sourceforge.wurfl.core.cache
Class EhCacheProvider

java.lang.Object
  extended by net.sourceforge.wurfl.core.cache.EhCacheProvider
All Implemented Interfaces:
CacheProvider

public class EhCacheProvider
extends Object
implements CacheProvider

CacheProvider's EhCache implementation.

Add EhCache support to WURFL api. for more info visit the EHCache site

Version:
$Id: EhCacheProvider.java 432 2010-05-06 12:12:53Z filippo.deluca $
Author:
Fantayeneh Asres Gizaw, Filippo De Luca

Constructor Summary
EhCacheProvider()
          Default Constructor
EhCacheProvider(net.sf.ehcache.Cache cache)
          Constructor by EhCache cache
 
Method Summary
 void clear()
          Remove all items from cache.
 Object get(Object key)
          Returns the cached item.
 net.sf.ehcache.Cache getCache()
          Returns the held cache.
 void put(Object key, Object value)
          Put an item in cache associated to a key.
 void setCache(net.sf.ehcache.Cache cache)
          Set the underlying cache instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhCacheProvider

public EhCacheProvider()
Default Constructor


EhCacheProvider

public EhCacheProvider(net.sf.ehcache.Cache cache)
Constructor by EhCache cache

Parameters:
cache - Cache instance.
Method Detail

getCache

public net.sf.ehcache.Cache getCache()
Returns the held cache.

Returns:
Held Cache instance.

setCache

public void setCache(net.sf.ehcache.Cache cache)
Set the underlying cache instance.

Parameters:
cache - The EhCache Cache instance.

clear

public void clear()
Remove all items from cache.

Specified by:
clear in interface CacheProvider

get

public Object get(Object key)
Returns the cached item.

Specified by:
get in interface CacheProvider
Parameters:
key - The cached item key.
Returns:
Cached Object, null if this cache does not contain it.

put

public void put(Object key,
                Object value)
Put an item in cache associated to a key.

Specified by:
put in interface CacheProvider
Parameters:
key - The caching item key.
value - The caching item.


Copyright © 2008-2010 WURFL-Pro srl. All Rights Reserved.