Class DelegatingCacheLoader<K,V>
- java.lang.Object
-
- org.infinispan.persistence.support.DelegatingCacheLoader<K,V>
-
- All Implemented Interfaces:
Lifecycle
,CacheLoader<K,V>
- Direct Known Subclasses:
AsyncCacheLoader
public abstract class DelegatingCacheLoader<K,V> extends Object implements CacheLoader<K,V>
- Since:
- 6.0
- Author:
- Mircea Markus
-
-
Field Summary
Fields Modifier and Type Field Description protected CacheLoader
actual
protected InitializationContext
ctx
-
Constructor Summary
Constructors Modifier Constructor Description protected
DelegatingCacheLoader(CacheLoader actual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Object key)
Returns true if the storage contains an entry associated with the given key.void
init(InitializationContext ctx)
Used to initialize a cache loader.MarshalledEntry<K,V>
load(Object key)
Fetches an entry from the storage.void
start()
Invoked on component startvoid
stop()
Invoked on component stopCacheLoader
undelegate()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.persistence.spi.CacheLoader
isAvailable
-
-
-
-
Field Detail
-
actual
protected CacheLoader actual
-
ctx
protected InitializationContext ctx
-
-
Constructor Detail
-
DelegatingCacheLoader
protected DelegatingCacheLoader(CacheLoader actual)
-
-
Method Detail
-
init
public void init(InitializationContext ctx)
Description copied from interface:CacheLoader
Used to initialize a cache loader. Typically invoked by thePersistenceManager
when setting up cache loaders.- Specified by:
init
in interfaceCacheLoader<K,V>
-
start
public void start()
Description copied from interface:Lifecycle
Invoked on component start
-
stop
public void stop()
Description copied from interface:Lifecycle
Invoked on component stop
-
contains
public boolean contains(Object key)
Description copied from interface:CacheLoader
Returns true if the storage contains an entry associated with the given key.- Specified by:
contains
in interfaceCacheLoader<K,V>
-
load
public MarshalledEntry<K,V> load(Object key)
Description copied from interface:CacheLoader
Fetches an entry from the storage. If aMarshalledEntry
needs to be created here,InitializationContext.getMarshalledEntryFactory()
andInitializationContext.getByteBufferFactory()
should be used.- Specified by:
load
in interfaceCacheLoader<K,V>
- Returns:
- the entry, or null if the entry does not exist
-
undelegate
public CacheLoader undelegate()
-
-