public class JCacheLoaderAdapter<K,V> extends Object implements CacheLoader
Constructor and Description |
---|
JCacheLoaderAdapter() |
Modifier and Type | Method and 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 |
load(Object key)
Fetches an entry from the storage.
|
void |
setCacheLoader(javax.cache.integration.CacheLoader<K,V> delegate) |
void |
setExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPolicy) |
void |
start() |
void |
stop() |
public void setExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPolicy)
public void init(InitializationContext ctx)
CacheLoader
PersistenceManager
when setting up cache loaders.init
in interface CacheLoader
public MarshalledEntry load(Object key) throws PersistenceException
CacheLoader
MarshalledEntry
needs to be created here, InitializationContext.getMarshalledEntryFactory()
and InitializationContext.getByteBufferFactory()
should be used.load
in interface CacheLoader
PersistenceException
- in case of an error, e.g. communicating with the external storagepublic void start() throws PersistenceException
start
in interface Lifecycle
PersistenceException
public void stop() throws PersistenceException
stop
in interface Lifecycle
PersistenceException
public boolean contains(Object key)
CacheLoader
contains
in interface CacheLoader
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.