|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.util.SynchronizedCachePolicy
A synchronized cache policy wrapper.
CachePolicy
Constructor Summary | |
SynchronizedCachePolicy(CachePolicy delegate)
|
Method Summary | |
void |
create()
create the service, do expensive operations etc |
void |
destroy()
destroy the service, tear down |
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()
Get the size of the cache. |
void |
start()
start the service, create is already called |
void |
stop()
stop the service |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SynchronizedCachePolicy(CachePolicy delegate)
Method Detail |
public Object get(Object key)
CachePolicy
CachePolicy.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 CachePolicy
key
- the key paired with the objectCachePolicy.peek(java.lang.Object)
public Object peek(Object key)
CachePolicy
CachePolicy.get(java.lang.Object)
.
peek
in interface CachePolicy
key
- the key paired with the objectCachePolicy.get(java.lang.Object)
public void insert(Object key, Object object)
CachePolicy
insert
in interface CachePolicy
key
- the key paired with the objectobject
- the object to cacheCachePolicy.remove(java.lang.Object)
public void remove(Object key)
CachePolicy
remove
in interface CachePolicy
key
- the key paired with the objectCachePolicy.insert(java.lang.Object, java.lang.Object)
public void flush()
CachePolicy
flush
in interface CachePolicy
public int size()
CachePolicy
size
in interface CachePolicy
public void create() throws Exception
CachePolicy
create
in interface CachePolicy
Exception
public void start() throws Exception
CachePolicy
start
in interface CachePolicy
Exception
public void stop()
CachePolicy
stop
in interface CachePolicy
public void destroy()
CachePolicy
destroy
in interface CachePolicy
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |