public class ToolkitBackedClusteredCacheManager extends Object implements ClusteredCacheManager, ToolkitAwareEntity, LockingEntity, InternalRootEntity
| Constructor and Description |
|---|
ToolkitBackedClusteredCacheManager(String cacheManagerName,
ClusteredCacheManagerConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
ClusteredCache |
addCacheIfAbsent(String cacheName,
ClusteredCache clusteredCache)
Method for adding a
ClusteredCache to this ClusteredCacheManager. |
void |
addCacheMetaInfo(String cacheName,
org.terracotta.toolkit.ToolkitObjectType type,
String dsName) |
void |
addKeyRemoveInfo(String cacheName,
String toolkitMapName,
String keytoBeRemoved) |
void |
alive() |
void |
destroy() |
boolean |
destroyCache(ClusteredCache clusteredCache)
Method for destroying a cache entity
This method will follow these steps: Put cache entity in exclusive maintenance mode If this fails, throws IllegalStateException
Verify the cache entity passed in matches the current known cache entity
If this fails, throws IllegalArgumentException
Update the cache entity state to ClusteredEntityState.DESTROY_IN_PROGRESS and save it
If this fails, throws UnsupportedOperationException
Perform the destroy operation
|
ClusteredCache |
getCache(String cacheName) |
org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock |
getCacheLock(String cacheName) |
Map<String,ClusteredCache> |
getCaches() |
ClusteredCacheManagerConfiguration |
getConfiguration() |
org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock |
getEntityLock() |
ClusteredEntityState |
getState() |
boolean |
isCacheUsed(ClusteredCache clusteredCache) |
boolean |
isUsed() |
void |
markCacheInUse(ClusteredCache clusteredCache) |
void |
markDestroying() |
void |
markInUse() |
void |
releaseCacheUse(ClusteredCache clusteredCache) |
void |
releaseUse() |
void |
setEntityLockHandler(EntityLockHandler entityLockHandler) |
void |
setToolkit(org.terracotta.toolkit.Toolkit toolkit) |
public ToolkitBackedClusteredCacheManager(String cacheManagerName, ClusteredCacheManagerConfiguration configuration)
public ClusteredCacheManagerConfiguration getConfiguration()
getConfiguration in interface ClusteredEntity<ClusteredCacheManagerConfiguration>public ClusteredEntityState getState()
getState in interface ClusteredEntity<ClusteredCacheManagerConfiguration>public void setToolkit(org.terracotta.toolkit.Toolkit toolkit)
setToolkit in interface ToolkitAwareEntitypublic void setEntityLockHandler(EntityLockHandler entityLockHandler)
setEntityLockHandler in interface LockingEntitypublic Map<String,ClusteredCache> getCaches()
getCaches in interface ClusteredCacheManagerpublic ClusteredCache getCache(String cacheName)
getCache in interface ClusteredCacheManagerpublic ClusteredCache addCacheIfAbsent(String cacheName, ClusteredCache clusteredCache)
ClusteredCacheManagerClusteredCache to this ClusteredCacheManager.
ClusteredCache with that name is already known, it will be returned and
the clusteredCache passed in will not be added.addCacheIfAbsent in interface ClusteredCacheManagercacheName - the name of the cacheclusteredCache - the clustered cachenull otherwisepublic boolean destroyCache(ClusteredCache clusteredCache)
ClusteredCacheManagerIllegalStateExceptionIllegalArgumentExceptionClusteredEntityState.DESTROY_IN_PROGRESS and save it
If this fails, throws UnsupportedOperationExceptiondestroyCache in interface ClusteredCacheManagerclusteredCache - the cache entity to destroytrue if entity was effectively destroyed, false if entity does not existpublic void addCacheMetaInfo(String cacheName, org.terracotta.toolkit.ToolkitObjectType type, String dsName)
public void addKeyRemoveInfo(String cacheName, String toolkitMapName, String keytoBeRemoved)
public org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getCacheLock(String cacheName)
getCacheLock in interface ClusteredCacheManagerpublic org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getEntityLock()
getEntityLock in interface InternalRootEntitypublic void markInUse()
markInUse in interface ClusteredCacheManagerpublic void releaseUse()
releaseUse in interface ClusteredCacheManagerpublic boolean isUsed()
isUsed in interface ClusteredCacheManagerpublic void markCacheInUse(ClusteredCache clusteredCache)
markCacheInUse in interface ClusteredCacheManagerpublic void releaseCacheUse(ClusteredCache clusteredCache)
releaseCacheUse in interface ClusteredCacheManagerpublic boolean isCacheUsed(ClusteredCache clusteredCache)
isCacheUsed in interface ClusteredCacheManagerpublic void destroy()
destroy in interface InternalRootEntitypublic void markDestroying()
markDestroying in interface InternalRootEntitypublic void alive()
alive in interface InternalRootEntityCopyright © 2019 Terracotta, Inc.. All rights reserved.