ehcache

net.sf.ehcache.terracotta
Class ClusteredInstanceFactoryWrapper

java.lang.Object
  extended by net.sf.ehcache.terracotta.ClusteredInstanceFactoryWrapper
All Implemented Interfaces:
ClusteredInstanceFactory

public class ClusteredInstanceFactoryWrapper
extends Object
implements ClusteredInstanceFactory

A ClusteredInstanceFactory implementation that delegates all operations to an underlying delegate except for the following operations:

Author:
Abhishek Sanoujam

Constructor Summary
ClusteredInstanceFactoryWrapper(TerracottaClient client, ClusteredInstanceFactory delegate)
          Constructor accepting the TerracottaClient and the actual factory
 
Method Summary
 CacheEventListener createEventReplicator(Ehcache cache)
          Create a replicator for the cache events of a given cache
 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
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 shutdown()
          Cleans up any resources left behind after the shutdown of the associated CacheManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusteredInstanceFactoryWrapper

public ClusteredInstanceFactoryWrapper(TerracottaClient client,
                                       ClusteredInstanceFactory delegate)
Constructor accepting the TerracottaClient and the actual factory

Parameters:
client -
delegate -
Method Detail

getActualFactory

protected ClusteredInstanceFactory getActualFactory()
Returns the actual underlying factory

Returns:
the actual underlying factory

getTopology

public CacheCluster getTopology()
Get an api for looking at the clustered node topology.

Specified by:
getTopology in interface ClusteredInstanceFactory

getUUID

public String getUUID()
Returns a universally unique identifiers for this factory.

Specified by:
getUUID in interface ClusteredInstanceFactory
Returns:
the identifier as a string

createEventReplicator

public CacheEventListener createEventReplicator(Ehcache cache)
Create a replicator for the cache events of a given cache

Specified by:
createEventReplicator in interface ClusteredInstanceFactory
Parameters:
cache - the cache to which the replicator will be bound
Returns:
cache event replicator

createStore

public Store createStore(Ehcache cache)
Create a Store instance for the given cache

Specified by:
createStore in interface ClusteredInstanceFactory
Parameters:
cache - the cache will backed by the returned store
Returns:
store instance

createTransactionIDFactory

public TransactionIDFactory createTransactionIDFactory(String uuid,
                                                       String cacheManagerName)
Create a TransactionIDFactory

Specified by:
createTransactionIDFactory in interface ClusteredInstanceFactory
Parameters:
uuid - a UUID unique to the cluster
cacheManagerName - the name of the cache manager creating a TransactionIDFactory
Returns:
a TransactionIDFactory

createWriteBehind

public WriteBehind createWriteBehind(Ehcache cache)
Create an WriteBehind instance for the given cache

Specified by:
createWriteBehind in interface ClusteredInstanceFactory
Parameters:
cache - the cache to which the write behind will be tied
Returns:
write behind instance

getOrCreateSoftLockManager

public SoftLockManager getOrCreateSoftLockManager(Ehcache cache)
Create a SoftLockManager for a cache

Specified by:
getOrCreateSoftLockManager in interface ClusteredInstanceFactory
Parameters:
cache - the cache for which to create a SoftLockManager
Returns:
a SoftLockManager

shutdown

public void shutdown()
Cleans up any resources left behind after the shutdown of the associated CacheManager

Specified by:
shutdown in interface ClusteredInstanceFactory

ehcache

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