public class DefaultPersistentMetadataCacheManager extends Object implements MetadataCacheManager, org.mule.runtime.api.lifecycle.Startable
MetadataCacheManager. This implementation provides a way of managing persistent
MetadataCaches that are stored at container-level using the ObjectStore as handler for the persistence.
Cache's are never evicted, and will be cleared only when an explicit disposal is invoked.| Modifier and Type | Field and Description |
|---|---|
static String |
MULE_METADATA_CACHE_ENTRY_TTL |
static String |
MULE_METADATA_CACHE_EXPIRATION_INTERVAL |
static String |
PERSISTENT_METADATA_SERVICE_CACHE |
METADATA_CACHE_MANAGER_KEY| Constructor and Description |
|---|
DefaultPersistentMetadataCacheManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose(String keyHash)
If the given
id references exactly one MetadataCache then that cache will be disposed. |
org.mule.runtime.api.metadata.MetadataCache |
getOrCreateCache(String id)
Returns the
MetadataCache with the given id if one has already been defined. |
void |
setLockFactory(org.mule.runtime.api.lock.LockFactory lockFactory) |
void |
setObjectStoreManager(org.mule.runtime.api.store.ObjectStoreManager objectStoreManager) |
void |
start() |
void |
updateCache(String id,
org.mule.runtime.api.metadata.MetadataCache cache)
Replaces the old binding of the given
id with the new cache element. |
public static final String PERSISTENT_METADATA_SERVICE_CACHE
public static final String MULE_METADATA_CACHE_ENTRY_TTL
public static final String MULE_METADATA_CACHE_EXPIRATION_INTERVAL
public DefaultPersistentMetadataCacheManager()
public void setLockFactory(org.mule.runtime.api.lock.LockFactory lockFactory)
public void setObjectStoreManager(org.mule.runtime.api.store.ObjectStoreManager objectStoreManager)
public void start()
start in interface org.mule.runtime.api.lifecycle.Startablepublic org.mule.runtime.api.metadata.MetadataCache getOrCreateCache(String id)
MetadataCacheManagerMetadataCache with the given id if one has already been defined. Otherwise, a new instance of
MetadataCache will be created, bound to the given id and then returned.getOrCreateCache in interface MetadataCacheManagerid - the cache identifier hash stringMetadataCache bound to the given id, or a new cache of none existed.public void updateCache(String id, org.mule.runtime.api.metadata.MetadataCache cache)
MetadataCacheManagerid with the new cache element.updateCache in interface MetadataCacheManagerid - the cache identifier hash stringcache - the new MetadataCache value bound to the given idpublic void dispose(String keyHash)
MetadataCacheManagerid references exactly one MetadataCache then that cache will be disposed. Otherwise, all the
caches that have an id starting with the given value will be disposed, based on the pre-condition that id's are
formed in a hierarchical way.dispose in interface MetadataCacheManagerkeyHash - the given identifier hash string of the level at which the disposal should be performedCopyright © 2003–2022 MuleSoft, Inc.. All rights reserved.