public final class SynchronizedCachePolicy extends Object implements CachePolicy
CachePolicy| Constructor and Description |
|---|
SynchronizedCachePolicy(CachePolicy delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
create() |
void |
destroy() |
void |
flush()
Flushes the cached objects from the cache.
|
Object |
get(Object key)
Returns the object paired with the specified key if it's
present in the cache, otherwise must return null.
|
void |
insert(Object key,
Object object)
Inserts the specified object into the cache following the
implemented policy.
|
Object |
peek(Object key)
Returns the object paired with the specified key if it's
present in the cache, otherwise must return null.
|
void |
remove(Object key)
Remove the cached object paired with the specified key.
|
int |
size() |
void |
start() |
void |
stop() |
public SynchronizedCachePolicy(CachePolicy delegate)
public Object get(Object key)
CachePolicyCachePolicy.peek(java.lang.Object) this method not only return whether
the object is present in the cache or not, but also
applies the implemented policy that will "refresh" the cached
object in the cache, because this cached object
was really requested.get in interface CachePolicykey - the key paired with the objectCachePolicy.peek(java.lang.Object)public Object peek(Object key)
CachePolicyCachePolicy.get(java.lang.Object).peek in interface CachePolicykey - the key paired with the objectCachePolicy.get(java.lang.Object)public void insert(Object key, Object object)
CachePolicyinsert in interface CachePolicykey - the key paired with the objectobject - the object to cacheCachePolicy.remove(java.lang.Object)public void remove(Object key)
CachePolicyremove in interface CachePolicykey - the key paired with the objectCachePolicy.insert(java.lang.Object, java.lang.Object)public void flush()
CachePolicyflush in interface CachePolicypublic int size()
size in interface CachePolicypublic void create()
throws Exception
create in interface CachePolicyExceptionpublic void start()
throws Exception
start in interface CachePolicyExceptionpublic void stop()
stop in interface CachePolicypublic void destroy()
destroy in interface CachePolicyCopyright © 2015 JBoss by Red Hat. All rights reserved.