public class CacheEhCacheImpl extends Object implements Cache
Ehcache is an open source, standards-based cache used to boost performance, offload the database and simplify scalability. Ehcache is robust, proven and full-featured and this has made it the most widely-used Java-based cache.
expiration is specified in seconds
Heavily inspired by excellent Play! 1.2.5 implementation.
Constructor and Description |
---|
CacheEhCacheImpl(org.slf4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
Object value,
int expiration) |
void |
clear() |
long |
decr(String key,
int by) |
void |
delete(String key) |
Object |
get(String key) |
Map<String,Object> |
get(String[] keys) |
long |
incr(String key,
int by) |
void |
replace(String key,
Object value,
int expiration) |
boolean |
safeAdd(String key,
Object value,
int expiration) |
boolean |
safeDelete(String key) |
boolean |
safeReplace(String key,
Object value,
int expiration) |
boolean |
safeSet(String key,
Object value,
int expiration) |
void |
set(String key,
Object value,
int expiration) |
void |
stop() |
public boolean safeDelete(String key)
safeDelete
in interface Cache
public boolean safeReplace(String key, Object value, int expiration)
safeReplace
in interface Cache
public void stop()
Copyright © 2015 ninjaframework. All Rights Reserved.