org.terracotta.modules.ehcache
Class ToolkitInstanceFactoryImpl

java.lang.Object
  extended by org.terracotta.modules.ehcache.ToolkitInstanceFactoryImpl
All Implemented Interfaces:
ToolkitInstanceFactory

public class ToolkitInstanceFactoryImpl
extends Object
implements ToolkitInstanceFactory


Field Summary
static String DELIMITER
           
protected  org.terracotta.toolkit.Toolkit toolkit
           
 
Constructor Summary
ToolkitInstanceFactoryImpl(TerracottaClientConfiguration terracottaClientConfiguration)
           
 
Method Summary
 boolean destroy(String cacheManagerName, String cacheName)
          Destorys any clustered state associated with the given cache.
 String getFullyQualifiedCacheName(Ehcache cache)
          Returns a fully qualified name for the cache
static String getFullyQualifiedCacheName(String cacheMgrName, String cacheName)
           
 org.terracotta.toolkit.concurrent.locks.ToolkitLock getLockForCache(Ehcache cache, String lockName)
           
 SerializedToolkitCache<ClusteredSoftLockIDKey,SerializedReadCommittedClusteredSoftLock> getOrCreateAllSoftLockMap(String cacheManagerName, String cacheName)
           
 org.terracotta.toolkit.collections.ToolkitMap<String,AsyncConfig> getOrCreateAsyncConfigMap()
           
 org.terracotta.toolkit.collections.ToolkitMap<String,Set<String>> getOrCreateAsyncListNamesMap(String fullAsyncName)
           
 org.terracotta.toolkit.events.ToolkitNotifier<CacheDisposalNotification> getOrCreateCacheDisposalNotifier(Ehcache cache)
           
 org.terracotta.toolkit.events.ToolkitNotifier<CacheEventNotificationMsg> getOrCreateCacheEventNotifier(Ehcache cache)
          Returns a ToolkitNotifier for the cachse to notify CacheEventNotificationMsg across the cluster
 org.terracotta.toolkit.collections.ToolkitMap<String,Serializable> getOrCreateClusteredStoreConfigMap(String cacheManagerName, String cacheName)
           
 org.terracotta.toolkit.events.ToolkitNotifier<CacheConfigChangeNotificationMsg> getOrCreateConfigChangeNotifier(Ehcache cache)
          Returns a ToolkitNotifier for the cache for notifying CacheConfigChangeNotificationMsg across the cluster
 org.terracotta.toolkit.collections.ToolkitMap<String,AttributeExtractor> getOrCreateExtractorsMap(Ehcache cache)
          Returns a ToolkitCache for storing serialized extractors for the cache
 org.terracotta.toolkit.collections.ToolkitMap<SerializedReadCommittedClusteredSoftLock,Integer> getOrCreateNewSoftLocksSet(String cacheManagerName, String cacheName)
           
 org.terracotta.toolkit.concurrent.locks.ToolkitLock getOrCreateStoreLock(Ehcache cache)
          Returns a ToolkitReadWriteLock for protecting the cache's store cluster wide
 org.terracotta.toolkit.internal.cache.ToolkitCacheInternal<String,Serializable> getOrCreateToolkitCache(Ehcache cache)
          Returns the backend ToolkitCacheInternal to be used for the cache
 SerializedToolkitCache<TransactionID,Decision> getOrCreateTransactionCommitStateMap(String cacheManagerName)
          Return the map used for storing commit state of ehcache transactions
 org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getSoftLockFreezeLock(String cacheManagerName, String cacheName, TransactionID transactionID, Object key)
           
 org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getSoftLockNotifierLock(String cacheManagerName, String cacheName, TransactionID transactionID, Object key)
           
 org.terracotta.toolkit.concurrent.locks.ToolkitLock getSoftLockWriteLock(String cacheManagerName, String cacheName, TransactionID transactionID, Object key)
           
 org.terracotta.toolkit.Toolkit getToolkit()
          Returns the toolkit associated with this factory
 void removeNonStopConfigforCache(Ehcache cache)
           
 void shutdown()
          Shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER

public static final String DELIMITER
See Also:
Constant Field Values

toolkit

protected final org.terracotta.toolkit.Toolkit toolkit
Constructor Detail

ToolkitInstanceFactoryImpl

public ToolkitInstanceFactoryImpl(TerracottaClientConfiguration terracottaClientConfiguration)
Method Detail

getToolkit

public org.terracotta.toolkit.Toolkit getToolkit()
Description copied from interface: ToolkitInstanceFactory
Returns the toolkit associated with this factory

Specified by:
getToolkit in interface ToolkitInstanceFactory

getOrCreateToolkitCache

public org.terracotta.toolkit.internal.cache.ToolkitCacheInternal<String,Serializable> getOrCreateToolkitCache(Ehcache cache)
Description copied from interface: ToolkitInstanceFactory
Returns the backend ToolkitCacheInternal to be used for the cache

Specified by:
getOrCreateToolkitCache in interface ToolkitInstanceFactory

getOrCreateConfigChangeNotifier

public org.terracotta.toolkit.events.ToolkitNotifier<CacheConfigChangeNotificationMsg> getOrCreateConfigChangeNotifier(Ehcache cache)
Description copied from interface: ToolkitInstanceFactory
Returns a ToolkitNotifier for the cache for notifying CacheConfigChangeNotificationMsg across the cluster

Specified by:
getOrCreateConfigChangeNotifier in interface ToolkitInstanceFactory

getOrCreateCacheEventNotifier

public org.terracotta.toolkit.events.ToolkitNotifier<CacheEventNotificationMsg> getOrCreateCacheEventNotifier(Ehcache cache)
Description copied from interface: ToolkitInstanceFactory
Returns a ToolkitNotifier for the cachse to notify CacheEventNotificationMsg across the cluster

Specified by:
getOrCreateCacheEventNotifier in interface ToolkitInstanceFactory

getOrCreateCacheDisposalNotifier

public org.terracotta.toolkit.events.ToolkitNotifier<CacheDisposalNotification> getOrCreateCacheDisposalNotifier(Ehcache cache)
Specified by:
getOrCreateCacheDisposalNotifier in interface ToolkitInstanceFactory

getFullyQualifiedCacheName

public String getFullyQualifiedCacheName(Ehcache cache)
Description copied from interface: ToolkitInstanceFactory
Returns a fully qualified name for the cache

Specified by:
getFullyQualifiedCacheName in interface ToolkitInstanceFactory

getFullyQualifiedCacheName

public static String getFullyQualifiedCacheName(String cacheMgrName,
                                                String cacheName)

getOrCreateStoreLock

public org.terracotta.toolkit.concurrent.locks.ToolkitLock getOrCreateStoreLock(Ehcache cache)
Description copied from interface: ToolkitInstanceFactory
Returns a ToolkitReadWriteLock for protecting the cache's store cluster wide

Specified by:
getOrCreateStoreLock in interface ToolkitInstanceFactory

getOrCreateExtractorsMap

public org.terracotta.toolkit.collections.ToolkitMap<String,AttributeExtractor> getOrCreateExtractorsMap(Ehcache cache)
Description copied from interface: ToolkitInstanceFactory
Returns a ToolkitCache for storing serialized extractors for the cache

Specified by:
getOrCreateExtractorsMap in interface ToolkitInstanceFactory

shutdown

public void shutdown()
Description copied from interface: ToolkitInstanceFactory
Shutdown

Specified by:
shutdown in interface ToolkitInstanceFactory

getOrCreateAllSoftLockMap

public SerializedToolkitCache<ClusteredSoftLockIDKey,SerializedReadCommittedClusteredSoftLock> getOrCreateAllSoftLockMap(String cacheManagerName,
                                                                                                                         String cacheName)
Specified by:
getOrCreateAllSoftLockMap in interface ToolkitInstanceFactory

getOrCreateNewSoftLocksSet

public org.terracotta.toolkit.collections.ToolkitMap<SerializedReadCommittedClusteredSoftLock,Integer> getOrCreateNewSoftLocksSet(String cacheManagerName,
                                                                                                                                  String cacheName)
Specified by:
getOrCreateNewSoftLocksSet in interface ToolkitInstanceFactory

getOrCreateAsyncConfigMap

public org.terracotta.toolkit.collections.ToolkitMap<String,AsyncConfig> getOrCreateAsyncConfigMap()
Specified by:
getOrCreateAsyncConfigMap in interface ToolkitInstanceFactory

getOrCreateAsyncListNamesMap

public org.terracotta.toolkit.collections.ToolkitMap<String,Set<String>> getOrCreateAsyncListNamesMap(String fullAsyncName)
Specified by:
getOrCreateAsyncListNamesMap in interface ToolkitInstanceFactory

getOrCreateClusteredStoreConfigMap

public org.terracotta.toolkit.collections.ToolkitMap<String,Serializable> getOrCreateClusteredStoreConfigMap(String cacheManagerName,
                                                                                                             String cacheName)
Specified by:
getOrCreateClusteredStoreConfigMap in interface ToolkitInstanceFactory

getOrCreateTransactionCommitStateMap

public SerializedToolkitCache<TransactionID,Decision> getOrCreateTransactionCommitStateMap(String cacheManagerName)
Description copied from interface: ToolkitInstanceFactory
Return the map used for storing commit state of ehcache transactions

Specified by:
getOrCreateTransactionCommitStateMap in interface ToolkitInstanceFactory

getSoftLockWriteLock

public org.terracotta.toolkit.concurrent.locks.ToolkitLock getSoftLockWriteLock(String cacheManagerName,
                                                                                String cacheName,
                                                                                TransactionID transactionID,
                                                                                Object key)
Specified by:
getSoftLockWriteLock in interface ToolkitInstanceFactory

getLockForCache

public org.terracotta.toolkit.concurrent.locks.ToolkitLock getLockForCache(Ehcache cache,
                                                                           String lockName)
Specified by:
getLockForCache in interface ToolkitInstanceFactory

getSoftLockFreezeLock

public org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getSoftLockFreezeLock(String cacheManagerName,
                                                                                          String cacheName,
                                                                                          TransactionID transactionID,
                                                                                          Object key)
Specified by:
getSoftLockFreezeLock in interface ToolkitInstanceFactory

getSoftLockNotifierLock

public org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getSoftLockNotifierLock(String cacheManagerName,
                                                                                            String cacheName,
                                                                                            TransactionID transactionID,
                                                                                            Object key)
Specified by:
getSoftLockNotifierLock in interface ToolkitInstanceFactory

destroy

public boolean destroy(String cacheManagerName,
                       String cacheName)
Description copied from interface: ToolkitInstanceFactory
Destorys any clustered state associated with the given cache.

Specified by:
destroy in interface ToolkitInstanceFactory

removeNonStopConfigforCache

public void removeNonStopConfigforCache(Ehcache cache)
Specified by:
removeNonStopConfigforCache in interface ToolkitInstanceFactory


Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.