Top Description Fields Constructors Methods
net.sf.ehcache.terracotta

public Class ClusteredInstanceFactoryWrapper

extends Object
implements ClusteredInstanceFactory
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.terracotta.ClusteredInstanceFactory
Imports
net.sf.ehcache.Ehcache, net.sf.ehcache.cluster.CacheCluster, net.sf.ehcache.config.Configuration, net.sf.ehcache.event.CacheEventListener, net.sf.ehcache.management.event.ManagementEventSink, net.sf.ehcache.store.Store, .TerracottaStore, net.sf.ehcache.transaction.SoftLockManager, .TransactionIDFactory, net.sf.ehcache.writer.writebehind.WriteBehind, java.util.concurrent.Callable

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

Field Summary

Modifier and TypeField and Description
private final TerracottaClient
private final ClusteredInstanceFactory

Constructor Summary

AccessConstructor and Description
public
ClusteredInstanceFactoryWrapper(TerracottaClient client, ClusteredInstanceFactory delegate)

Constructor accepting the TerracottaClient and the actual factory

Method Summary

Modifier and TypeMethod and Description
public CacheEventListener
createEventReplicator(Ehcache
the cache to which the replicator will be bound
cache
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createEventReplicator.

Create a replicator for the cache events of a given cache
public ManagementEventSink
public TerracottaStore
createNonStopStore(Callable<TerracottaStore>
the store for which to create a NonStopStore
store
,
Ehcache cache)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createNonStopStore.

Create a NonStopStoreWrapper for a terracottaStore
public Store
createStore(Ehcache
the cache will backed by the returned store
cache
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createStore.

Create a Store instance for the given cache
public TransactionIDFactory
createTransactionIDFactory(String
a UUID unique to the cluster
uuid
,
String
the name of the cache manager creating a TransactionIDFactory
cacheManagerName
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createTransactionIDFactory.

Create a TransactionIDFactory
public WriteBehind
createWriteBehind(Ehcache
the cache to which the write behind will be tied
cache
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createWriteBehind.

Create an WriteBehind instance for the given cache
public boolean
destroyCache(final String
name of the cache manager the cache belongs to
cacheManagerName
,
final String
name of the cache
cacheName
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.destroyCache.

Destroys the specified cache
public void
enableNonStopForCurrentThread(boolean
true to enable NonStop, false otherwise.
enable
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.enableNonStopForCurrentThread.

Enable or disable NonStop for the current thread only.
protected ClusteredInstanceFactory

Returns:

the actual underlying factory
getActualFactory
()

Returns the actual underlying factory

public SoftLockManager
getOrCreateSoftLockManager(Ehcache
the cache for which to create a SoftLockManager
cache
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.getOrCreateSoftLockManager.

Create a SoftLockManager for a cache
public CacheCluster
getTopology()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.getTopology.

Get an api for looking at the clustered node topology.
public String
getUUID()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.getUUID.

Returns a universally unique identifiers for this factory.
public void
linkClusteredCacheManager(String
the name of the cache manager
cacheManagerName
,
Configuration
the cache manager configuration
configuration
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.linkClusteredCacheManager.

Links this cache manager to the cluster
public void
shutdown()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.shutdown.

Cleans up any resources left behind after the shutdown of the associated CacheManager
public void
unlinkCache(String
the cache to unlink
cacheName
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.unlinkCache.

Un-links the cache from its cluster entity
public void
waitForOrchestrator(String
name of the CacheManager
cacheManagerName
)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.waitForOrchestrator.

Wait until the Orchestrator is running for the given CacheManager
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientback to summary
private final TerracottaClient client
delegateback to summary
private final ClusteredInstanceFactory delegate

Constructor Detail

ClusteredInstanceFactoryWrapperback to summary
public ClusteredInstanceFactoryWrapper(TerracottaClient client, ClusteredInstanceFactory delegate)

Constructor accepting the TerracottaClient and the actual factory

Method Detail

createEventReplicatorback to summary
public CacheEventListener createEventReplicator(Ehcache cache)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createEventReplicator.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.createEventReplicator.

Create a replicator for the cache events of a given cache

Parameters
cache:Ehcache

the cache to which the replicator will be bound

Returns:CacheEventListener

cache event replicator

createEventSinkback to summary
public ManagementEventSink createEventSink()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createEventSink.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.createEventSink.

Create a management event sink

Returns:ManagementEventSink

a management event sink

Annotations
@Override
createNonStopStoreback to summary
public TerracottaStore createNonStopStore(Callable<TerracottaStore> store, Ehcache cache)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createNonStopStore.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.createNonStopStore.

Create a NonStopStoreWrapper for a terracottaStore

Parameters
store:Callable<TerracottaStore>

the store for which to create a NonStopStore

Returns:TerracottaStore

a NonStopStore

Annotations
@Override
createStoreback to summary
public Store createStore(Ehcache cache)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createStore.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.createStore.

Create a Store instance for the given cache

Parameters
cache:Ehcache

the cache will backed by the returned store

Returns:Store

store instance

createTransactionIDFactoryback to summary
public TransactionIDFactory createTransactionIDFactory(String uuid, String cacheManagerName)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createTransactionIDFactory.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.createTransactionIDFactory.

Create a TransactionIDFactory

Parameters
uuid:String

a UUID unique to the cluster

cacheManagerName:String

the name of the cache manager creating a TransactionIDFactory

Returns:TransactionIDFactory

a TransactionIDFactory

createWriteBehindback to summary
public WriteBehind createWriteBehind(Ehcache cache)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.createWriteBehind.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.createWriteBehind.

Create an WriteBehind instance for the given cache

Parameters
cache:Ehcache

the cache to which the write behind will be tied

Returns:WriteBehind

write behind instance

destroyCacheback to summary
public boolean destroyCache(final String cacheManagerName, final String cacheName)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.destroyCache.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.destroyCache.

Destroys the specified cache

Parameters
cacheManagerName:String

name of the cache manager the cache belongs to

cacheName:String

name of the cache

Returns:boolean

true if the cache existed before being destroyed

Annotations
@Override
enableNonStopForCurrentThreadback to summary
public void enableNonStopForCurrentThread(boolean enable)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.enableNonStopForCurrentThread.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.enableNonStopForCurrentThread.

Enable or disable NonStop for the current thread only.

Parameters
enable:boolean

true to enable NonStop, false otherwise.

Annotations
@Override
getActualFactoryback to summary
protected ClusteredInstanceFactory getActualFactory()

Returns the actual underlying factory

Returns:ClusteredInstanceFactory

the actual underlying factory

getOrCreateSoftLockManagerback to summary
public SoftLockManager getOrCreateSoftLockManager(Ehcache cache)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.getOrCreateSoftLockManager.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.getOrCreateSoftLockManager.

Create a SoftLockManager for a cache

Parameters
cache:Ehcache

the cache for which to create a SoftLockManager

Returns:SoftLockManager

a SoftLockManager

getTopologyback to summary
public CacheCluster getTopology()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.getTopology.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.getTopology.

Get an api for looking at the clustered node topology.

getUUIDback to summary
public String getUUID()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.getUUID.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.getUUID.

Returns a universally unique identifiers for this factory.

Returns:String

the identifier as a string

linkClusteredCacheManagerback to summary
public void linkClusteredCacheManager(String cacheManagerName, Configuration configuration)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.linkClusteredCacheManager.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.linkClusteredCacheManager.

Links this cache manager to the cluster

Parameters
cacheManagerName:String

the name of the cache manager

configuration:Configuration

the cache manager configuration

Annotations
@Override
shutdownback to summary
public void shutdown()

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.shutdown.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.shutdown.

Cleans up any resources left behind after the shutdown of the associated CacheManager

unlinkCacheback to summary
public void unlinkCache(String cacheName)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.unlinkCache.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.unlinkCache.

Un-links the cache from its cluster entity

Parameters
cacheName:String

the cache to unlink

Annotations
@Override
waitForOrchestratorback to summary
public void waitForOrchestrator(String cacheManagerName)

Implements net.sf.ehcache.terracotta.ClusteredInstanceFactory.waitForOrchestrator.

Doc from net.sf.ehcache.terracotta.ClusteredInstanceFactory.waitForOrchestrator.

Wait until the Orchestrator is running for the given CacheManager

Parameters
cacheManagerName:String

name of the CacheManager