public class ClusteredInstanceFactoryWrapper extends Object implements ClusteredInstanceFactory
ClusteredInstanceFactory
implementation that delegates all operations to an underlying delegate except for the following
operations:
getTopology()
: Delegates to the TerracottaClient.getCacheCluster()
Constructor and Description |
---|
ClusteredInstanceFactoryWrapper(TerracottaClient client,
ClusteredInstanceFactory delegate)
Constructor accepting the TerracottaClient and the actual factory
|
Modifier and Type | Method and Description |
---|---|
CacheEventListener |
createEventReplicator(Ehcache cache)
Create a replicator for the cache events of a given cache
|
ManagementEventSink |
createEventSink()
Create a management event sink
|
TerracottaStore |
createNonStopStore(Callable<TerracottaStore> store,
Ehcache cache)
Create a NonStopStoreWrapper for a terracottaStore
|
Store |
createStore(Ehcache cache)
Create a Store instance for the given cache
|
TransactionIDFactory |
createTransactionIDFactory(String uuid,
String cacheManagerName)
Create a TransactionIDFactory
|
WriteBehind |
createWriteBehind(Ehcache cache)
Create an WriteBehind instance for the given cache
|
boolean |
destroyCache(String cacheManagerName,
String cacheName)
Destroys the specified cache
|
void |
enableNonStopForCurrentThread(boolean enable)
Enable or disable NonStop for the current thread only.
|
protected ClusteredInstanceFactory |
getActualFactory()
Returns the actual underlying factory
|
SoftLockManager |
getOrCreateSoftLockManager(Ehcache cache)
Create a SoftLockManager for a cache
|
CacheCluster |
getTopology()
Get an api for looking at the clustered node topology.
|
String |
getUUID()
Returns a universally unique identifiers for this factory.
|
void |
linkClusteredCacheManager(String cacheManagerName,
Configuration configuration)
Links this cache manager to the cluster
|
void |
shutdown()
Cleans up any resources left behind after the shutdown of the associated CacheManager
|
void |
unlinkCache(String cacheName)
Un-links the cache from its cluster entity
|
void |
waitForOrchestrator(String cacheManagerName)
Wait until the Orchestrator is running for the given CacheManager
|
public ClusteredInstanceFactoryWrapper(TerracottaClient client, ClusteredInstanceFactory delegate)
client
- delegate
- protected ClusteredInstanceFactory getActualFactory()
public CacheCluster getTopology()
getTopology
in interface ClusteredInstanceFactory
public String getUUID()
getUUID
in interface ClusteredInstanceFactory
public void enableNonStopForCurrentThread(boolean enable)
enableNonStopForCurrentThread
in interface ClusteredInstanceFactory
enable
- true to enable NonStop, false otherwise.public CacheEventListener createEventReplicator(Ehcache cache)
createEventReplicator
in interface ClusteredInstanceFactory
cache
- the cache to which the replicator will be boundpublic Store createStore(Ehcache cache)
createStore
in interface ClusteredInstanceFactory
cache
- the cache will backed by the returned storepublic TransactionIDFactory createTransactionIDFactory(String uuid, String cacheManagerName)
createTransactionIDFactory
in interface ClusteredInstanceFactory
uuid
- a UUID unique to the clustercacheManagerName
- the name of the cache manager creating a TransactionIDFactorypublic WriteBehind createWriteBehind(Ehcache cache)
createWriteBehind
in interface ClusteredInstanceFactory
cache
- the cache to which the write behind will be tiedpublic SoftLockManager getOrCreateSoftLockManager(Ehcache cache)
getOrCreateSoftLockManager
in interface ClusteredInstanceFactory
cache
- the cache for which to create a SoftLockManagerpublic void shutdown()
shutdown
in interface ClusteredInstanceFactory
public TerracottaStore createNonStopStore(Callable<TerracottaStore> store, Ehcache cache)
ClusteredInstanceFactory
createNonStopStore
in interface ClusteredInstanceFactory
store
- the store for which to create a NonStopStorepublic boolean destroyCache(String cacheManagerName, String cacheName)
ClusteredInstanceFactory
destroyCache
in interface ClusteredInstanceFactory
cacheManagerName
- name of the cache manager the cache belongs tocacheName
- name of the cachepublic void linkClusteredCacheManager(String cacheManagerName, Configuration configuration)
ClusteredInstanceFactory
linkClusteredCacheManager
in interface ClusteredInstanceFactory
cacheManagerName
- the name of the cache managerconfiguration
- the cache manager configurationpublic void unlinkCache(String cacheName)
ClusteredInstanceFactory
unlinkCache
in interface ClusteredInstanceFactory
cacheName
- the cache to unlinkpublic ManagementEventSink createEventSink()
ClusteredInstanceFactory
createEventSink
in interface ClusteredInstanceFactory
public void waitForOrchestrator(String cacheManagerName)
waitForOrchestrator
in interface ClusteredInstanceFactory
cacheManagerName
- name of the CacheManagerCopyright © 2003–2016 Terracotta, Inc.. All rights reserved.