Package net.sf.ehcache.terracotta
Interface ClusteredInstanceFactory
-
- All Known Implementing Classes:
ClusteredInstanceFactoryWrapper
public interface ClusteredInstanceFactoryFactory for creating clustered instances- Since:
- 1.7
- Author:
- Tim Eck, Geert Bevin
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CacheEventListenercreateEventReplicator(Ehcache cache)Create a replicator for the cache events of a given cacheManagementEventSinkcreateEventSink()Create a management event sinkTerracottaStorecreateNonStopStore(java.util.concurrent.Callable<TerracottaStore> store, Ehcache cache)Create a NonStopStoreWrapper for a terracottaStoreStorecreateStore(Ehcache cache)Create a Store instance for the given cacheTransactionIDFactorycreateTransactionIDFactory(java.lang.String uuid, java.lang.String cacheManagerName)Create a TransactionIDFactoryWriteBehindcreateWriteBehind(Ehcache cache)Create an WriteBehind instance for the given cachebooleandestroyCache(java.lang.String cacheManagerName, java.lang.String cacheName)Destroys the specified cachevoidenableNonStopForCurrentThread(boolean enable)Enable or disable NonStop for the current thread only.SoftLockManagergetOrCreateSoftLockManager(Ehcache cache)Create a SoftLockManager for a cacheCacheClustergetTopology()Get an api for looking at the clustered node topology.java.lang.StringgetUUID()Returns a universally unique identifiers for this factory.voidlinkClusteredCacheManager(java.lang.String cacheManagerName, Configuration configuration)Links this cache manager to the clustervoidshutdown()Cleans up any resources left behind after the shutdown of the associated CacheManagervoidunlinkCache(java.lang.String cacheName)Un-links the cache from its cluster entityvoidwaitForOrchestrator(java.lang.String cacheManagerName)Wait until the Orchestrator is running for the given CacheManager
-
-
-
Method Detail
-
createStore
Store createStore(Ehcache cache)
Create a Store instance for the given cache- Parameters:
cache- the cache will backed by the returned store- Returns:
- store instance
-
getTopology
CacheCluster getTopology()
Get an api for looking at the clustered node topology.
-
createWriteBehind
WriteBehind createWriteBehind(Ehcache cache)
Create an WriteBehind instance for the given cache- Parameters:
cache- the cache to which the write behind will be tied- Returns:
- write behind instance
-
createEventReplicator
CacheEventListener createEventReplicator(Ehcache cache)
Create a replicator for the cache events of a given cache- Parameters:
cache- the cache to which the replicator will be bound- Returns:
- cache event replicator
-
getUUID
java.lang.String getUUID()
Returns a universally unique identifiers for this factory.- Returns:
- the identifier as a string
-
enableNonStopForCurrentThread
void enableNonStopForCurrentThread(boolean enable)
Enable or disable NonStop for the current thread only.- Parameters:
enable- true to enable NonStop, false otherwise.
-
shutdown
void shutdown()
Cleans up any resources left behind after the shutdown of the associated CacheManager
-
createTransactionIDFactory
TransactionIDFactory createTransactionIDFactory(java.lang.String uuid, java.lang.String cacheManagerName)
Create a TransactionIDFactory- Parameters:
uuid- a UUID unique to the clustercacheManagerName- the name of the cache manager creating a TransactionIDFactory- Returns:
- a TransactionIDFactory
-
getOrCreateSoftLockManager
SoftLockManager getOrCreateSoftLockManager(Ehcache cache)
Create a SoftLockManager for a cache- Parameters:
cache- the cache for which to create a SoftLockManager- Returns:
- a SoftLockManager
-
createNonStopStore
TerracottaStore createNonStopStore(java.util.concurrent.Callable<TerracottaStore> store, Ehcache cache)
Create a NonStopStoreWrapper for a terracottaStore- Parameters:
store- the store for which to create a NonStopStore- Returns:
- a NonStopStore
-
destroyCache
boolean destroyCache(java.lang.String cacheManagerName, java.lang.String cacheName)Destroys the specified cache- Parameters:
cacheManagerName- name of the cache manager the cache belongs tocacheName- name of the cache- Returns:
- true if the cache existed before being destroyed
-
waitForOrchestrator
void waitForOrchestrator(java.lang.String cacheManagerName)
Wait until the Orchestrator is running for the given CacheManager- Parameters:
cacheManagerName- name of the CacheManager
-
linkClusteredCacheManager
void linkClusteredCacheManager(java.lang.String cacheManagerName, Configuration configuration)Links this cache manager to the cluster- Parameters:
cacheManagerName- the name of the cache managerconfiguration- the cache manager configuration
-
unlinkCache
void unlinkCache(java.lang.String cacheName)
Un-links the cache from its cluster entity- Parameters:
cacheName- the cache to unlink
-
createEventSink
ManagementEventSink createEventSink()
Create a management event sink- Returns:
- a management event sink
-
-