Top Description Methods
net.sf.ehcache.terracotta

public Interface ClusteredInstanceFactory

Known Direct Implementers
net.sf.ehcache.terracotta.ClusteredInstanceFactoryWrapper
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

Factory for creating clustered instances
Authors
Tim Eck, Geert Bevin
Since
1.7

Method Summary

Modifier and TypeMethod and Description
public CacheEventListener

Returns:

cache event replicator
createEventReplicator
(Ehcache
the cache to which the replicator will be bound
cache
)

Create a replicator for the cache events of a given cache

public ManagementEventSink

Returns:

a management event sink
createEventSink
()

Create a management event sink

public TerracottaStore

Returns:

a NonStopStore
createNonStopStore
(Callable<TerracottaStore>
the store for which to create a NonStopStore
store
,
Ehcache cache)

Create a NonStopStoreWrapper for a terracottaStore

public Store

Returns:

store instance
createStore
(Ehcache
the cache will backed by the returned store
cache
)

Create a Store instance for the given cache

public TransactionIDFactory

Returns:

a TransactionIDFactory
createTransactionIDFactory
(String
a UUID unique to the cluster
uuid
,
String
the name of the cache manager creating a TransactionIDFactory
cacheManagerName
)

Create a TransactionIDFactory

public WriteBehind

Returns:

write behind instance
createWriteBehind
(Ehcache
the cache to which the write behind will be tied
cache
)

Create an WriteBehind instance for the given cache

public boolean

Returns:

true if the cache existed before being destroyed
destroyCache
(String
name of the cache manager the cache belongs to
cacheManagerName
,
String
name of the cache
cacheName
)

Destroys the specified cache

public void
enableNonStopForCurrentThread(boolean
true to enable NonStop, false otherwise.
enable
)

Enable or disable NonStop for the current thread only.

public SoftLockManager

Returns:

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

Create a SoftLockManager for a cache

public CacheCluster
getTopology()

Get an api for looking at the clustered node topology.

public String

Returns:

the identifier as a string
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
)

Links this cache manager to the cluster

public void
shutdown()

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

public void
unlinkCache(String
the cache to unlink
cacheName
)

Un-links the cache from its cluster entity

public void
waitForOrchestrator(String
name of the CacheManager
cacheManagerName
)

Wait until the Orchestrator is running for the given CacheManager

Method Detail

createEventReplicatorback to summary
public CacheEventListener createEventReplicator(Ehcache cache)

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()

Create a management event sink

Returns:ManagementEventSink

a management event sink

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

Create a NonStopStoreWrapper for a terracottaStore

Parameters
store:Callable<TerracottaStore>

the store for which to create a NonStopStore

Returns:TerracottaStore

a NonStopStore

createStoreback to summary
public Store createStore(Ehcache cache)

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)

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)

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(String cacheManagerName, String cacheName)

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

enableNonStopForCurrentThreadback to summary
public void enableNonStopForCurrentThread(boolean enable)

Enable or disable NonStop for the current thread only.

Parameters
enable:boolean

true to enable NonStop, false otherwise.

getOrCreateSoftLockManagerback to summary
public SoftLockManager getOrCreateSoftLockManager(Ehcache cache)

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()

Get an api for looking at the clustered node topology.

getUUIDback to summary
public String 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)

Links this cache manager to the cluster

Parameters
cacheManagerName:String

the name of the cache manager

configuration:Configuration

the cache manager configuration

shutdownback to summary
public void shutdown()

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

unlinkCacheback to summary
public void unlinkCache(String cacheName)

Un-links the cache from its cluster entity

Parameters
cacheName:String

the cache to unlink

waitForOrchestratorback to summary
public void waitForOrchestrator(String cacheManagerName)

Wait until the Orchestrator is running for the given CacheManager

Parameters
cacheManagerName:String

name of the CacheManager