public interface ServerCache
This is used to cache beans or query results (bean collections).
There are 2 ServerCache's for each bean type. One is used as the 'bean cache' which holds beans of a given type. The other is the 'query cache' holding query results for a given type.
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all entries from the cache.
|
Object |
get(Object id)
Return the value given the key.
|
int |
getHitRatio()
Return the hit ratio the cache is currently getting.
|
ServerCacheStatistics |
getStatistics(boolean reset)
Return statistics for the cache.
|
Object |
put(Object id,
Object value)
Put the value in the cache with a given id.
|
Object |
remove(Object id)
Remove a entry from the cache given its id.
|
int |
size()
Return the number of entries in the cache.
|
void clear()
NOTE: Be careful using this method in that most of the time application
code should clear BOTH the bean and query caches at the same time. This can
be done via ServerCacheManager.clear(Class).
int size()
int getHitRatio()
ServerCacheStatistics getStatistics(boolean reset)
reset - if true the statistics are reset.Copyright © 2016. All rights reserved.