public class EhcacheCachingManager extends java.lang.Object implements CachingManager, Initializable
CachingManager.CACHE_ATTACHMENTS, CACHE_ATTACHMENTS_COLLECTION, CACHE_ATTACHMENTS_DYNAMIC, CACHE_DOCUMENTS, CACHE_PAGES, CACHE_PAGES_HISTORY, CACHE_PAGES_TEXT, PROP_CACHE_CONF_FILE, PROP_CACHE_ENABLE, PROP_USECACHE_DEPRECATED| Constructor and Description |
|---|
EhcacheCachingManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
enabled(java.lang.String cacheName)
Checks if the requested cache is enabled or not.
|
<T,E extends java.lang.Exception> |
get(java.lang.String cacheName,
java.io.Serializable key,
CheckedSupplier<T,E> supplier)
Returns an item from a cache.
|
CacheInfo |
info(java.lang.String cacheName)
Retrieves cache usage information.
|
void |
initialize(Engine engine,
java.util.Properties props) |
java.util.List<java.lang.String> |
keys(java.lang.String cacheName)
Returns the list of keys from elements present in a cache.
|
void |
put(java.lang.String cacheName,
java.io.Serializable key,
java.lang.Object val)
Puts an item on a cache.
|
void |
remove(java.lang.String cacheName,
java.io.Serializable key)
Removes an item from a cache.
|
void |
shutdown()
Shuts down the underlying cache manager
|
public EhcacheCachingManager()
public void shutdown()
shutdown in interface CachingManagerpublic void initialize(Engine engine, java.util.Properties props) throws WikiException
initialize in interface InitializableWikiExceptionpublic boolean enabled(java.lang.String cacheName)
enabled in interface CachingManagercacheName - The cache to be queried.true if the cache is enabled, false otherwise.public CacheInfo info(java.lang.String cacheName)
info in interface CachingManagercacheName - The cache to be queried.null if the requested cache is not enabled.public java.util.List<java.lang.String> keys(java.lang.String cacheName)
keys in interface CachingManagercacheName - The cache to be queried.public <T,E extends java.lang.Exception> T get(java.lang.String cacheName, java.io.Serializable key, CheckedSupplier<T,E> supplier) throws E extends java.lang.Exception
null.get in interface CachingManagercacheName - The cache in which the item lives.key - item's identifier.supplier - if the element is not cached, try to retrieve from the cached system.null if either the cache is not enabled or the item is not present on the cache / cached service.E - the supplier may throw a checked exception, which is propagated upwards.E extends java.lang.Exceptionpublic void put(java.lang.String cacheName, java.io.Serializable key, java.lang.Object val)
put in interface CachingManagercacheName - The cache in which the item will live.key - item's identifier.val - item to insert in the cache.public void remove(java.lang.String cacheName, java.io.Serializable key)
remove in interface CachingManagercacheName - The cache in which the item to be removed lives.key - item's identifier.Copyright (c) 2001-2021 The Apache Software Foundation. All rights reserved.