Package org.infinispan.persistence.async
Class AsyncCacheLoader<K,V>
- java.lang.Object
-
- org.infinispan.persistence.support.DelegatingCacheLoader<K,V>
-
- org.infinispan.persistence.async.AsyncCacheLoader<K,V>
-
- All Implemented Interfaces:
Lifecycle
,CacheLoader<K,V>
- Direct Known Subclasses:
AdvancedAsyncCacheLoader
public class AsyncCacheLoader<K,V> extends DelegatingCacheLoader<K,V>
- Since:
- 6.0
- Author:
- Mircea Markus
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicReference<State>
state
-
Fields inherited from class org.infinispan.persistence.support.DelegatingCacheLoader
actual, ctx
-
-
Constructor Summary
Constructors Constructor Description AsyncCacheLoader(CacheLoader actual, java.util.concurrent.atomic.AtomicReference<State> state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.Object key)
Returns true if the storage contains an entry associated with the given key.MarshallableEntry<K,V>
loadEntry(java.lang.Object key)
Fetches an entry from the storage.void
start()
Invoked on component startvoid
stop()
Invoked on component stop-
Methods inherited from class org.infinispan.persistence.support.DelegatingCacheLoader
init, 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, load
-
-
-
-
Field Detail
-
state
protected final java.util.concurrent.atomic.AtomicReference<State> state
-
-
Constructor Detail
-
AsyncCacheLoader
public AsyncCacheLoader(CacheLoader actual, java.util.concurrent.atomic.AtomicReference<State> state)
-
-
Method Detail
-
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
-
loadEntry
public MarshallableEntry<K,V> loadEntry(java.lang.Object key)
Description copied from interface:CacheLoader
Fetches an entry from the storage. If aMarshallableEntry
needs to be created here,InitializationContext.getMarshallableEntryFactory()
()} andInitializationContext.getByteBufferFactory()
should be used.- Specified by:
loadEntry
in interfaceCacheLoader<K,V>
- Overrides:
loadEntry
in classDelegatingCacheLoader<K,V>
- Returns:
- the entry, or null if the entry does not exist
-
contains
public boolean contains(java.lang.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>
- Overrides:
contains
in classDelegatingCacheLoader<K,V>
-
-