Class ClusterLoader
- java.lang.Object
-
- org.infinispan.persistence.cluster.ClusterLoader
-
- All Implemented Interfaces:
Lifecycle,CacheLoader,LocalOnlyCacheLoader
public class ClusterLoader extends Object implements CacheLoader, LocalOnlyCacheLoader
Cache loader that consults other members in the cluster for values. AremoteCallTimeoutproperty is required, alongthat specifies in milliseconds how long to wait for results before returning a null.- Author:
- Mircea.Markus@jboss.com
-
-
Constructor Summary
Constructors Constructor Description ClusterLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Object key)Returns true if the storage contains an entry associated with the given key.voidinit(InitializationContext ctx)Used to initialize a cache loader.protected booleanisCacheReady()A test to check whether the cache is in its started state.MarshallableEntryloadEntry(Object key)Fetches an entry from the storage.voidstart()Invoked on component startvoidstop()Invoked on component stop-
Methods inherited from interface org.infinispan.persistence.spi.CacheLoader
isAvailable, load
-
-
-
-
Method Detail
-
init
public void init(InitializationContext ctx)
Description copied from interface:CacheLoaderUsed to initialize a cache loader. Typically invoked by thePersistenceManagerwhen setting up cache loaders.- Specified by:
initin interfaceCacheLoader
-
loadEntry
public MarshallableEntry loadEntry(Object key) throws PersistenceException
Description copied from interface:CacheLoaderFetches an entry from the storage. If aMarshallableEntryneeds to be created here,InitializationContext.getMarshallableEntryFactory()()} andInitializationContext.getByteBufferFactory()should be used.- Specified by:
loadEntryin interfaceCacheLoader- Returns:
- the entry, or null if the entry does not exist
- Throws:
PersistenceException- in case of an error, e.g. communicating with the external storage
-
contains
public boolean contains(Object key)
Description copied from interface:CacheLoaderReturns true if the storage contains an entry associated with the given key.- Specified by:
containsin interfaceCacheLoader
-
start
public void start()
Description copied from interface:LifecycleInvoked on component start
-
stop
public void stop()
Description copied from interface:LifecycleInvoked on component stop
-
isCacheReady
protected boolean isCacheReady()
A test to check whether the cache is in its started state. If not, calls should not be made as the channel may not have properly started, blocks due to state transfers may be in progress, etc.- Returns:
- true if the cache is in its STARTED state.
-
-