CacheLoader
@ThreadSafe public class RestStore<K,V> extends Object implements AdvancedLoadWriteStore<K,V>
AdvancedCacheLoader.CacheLoaderTask<K,V>, AdvancedCacheLoader.TaskContext
AdvancedCacheWriter.PurgeListener<K>
Constructor and Description |
---|
RestStore()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Deprecated.
Removes all the data from the storage.
|
boolean |
contains(Object o)
Deprecated.
Returns true if the storage contains an entry associated with the given key.
|
boolean |
delete(Object key)
Deprecated.
|
void |
init(InitializationContext initializationContext)
Deprecated.
Used to initialize a cache loader.
|
boolean |
isAvailable()
Deprecated.
|
MarshalledEntry<K,V> |
load(Object key)
Deprecated.
Fetches an entry from the storage.
|
io.reactivex.Flowable<MarshalledEntry<K,V>> |
publishEntries(Predicate<? super K> filter,
boolean fetchValue,
boolean fetchMetadata)
Deprecated.
Publishes all entries from this store.
|
io.reactivex.Flowable<K> |
publishKeys(Predicate<? super K> filter)
Deprecated.
Publishes all the keys from this store.
|
void |
purge(Executor executor,
AdvancedCacheWriter.PurgeListener purgeListener)
Deprecated.
Using the thread in the pool, removed all the expired data from the persistence storage.
|
void |
setInternalCacheEntryFactory(InternalEntryFactory iceFactory)
Deprecated.
|
int |
size()
Deprecated.
Returns the number of elements in the store.
|
void |
start()
Deprecated.
Invoked on component start
|
void |
stop()
Deprecated.
Invoked on component stop
|
void |
write(MarshalledEntry entry)
Deprecated.
Persists the entry to the storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy
process
deleteBatch, writeBatch
public void init(InitializationContext initializationContext)
CacheLoader
PersistenceManager
when setting up cache loaders.init
in interface CacheLoader<K,V>
init
in interface CacheWriter<K,V>
public void start()
Lifecycle
public void stop()
Lifecycle
public boolean isAvailable()
isAvailable
in interface CacheLoader<K,V>
isAvailable
in interface CacheWriter<K,V>
isAvailable
in interface ExternalStore<K,V>
public void setInternalCacheEntryFactory(InternalEntryFactory iceFactory)
public void write(MarshalledEntry entry)
CacheWriter
write
in interface CacheWriter<K,V>
MarshalledEntry
public void clear()
AdvancedCacheWriter
clear
in interface AdvancedCacheWriter<K,V>
public boolean delete(Object key)
delete
in interface CacheWriter<K,V>
public MarshalledEntry<K,V> load(Object key)
CacheLoader
MarshalledEntry
needs to be created here, InitializationContext.getMarshalledEntryFactory()
and InitializationContext.getByteBufferFactory()
should be used.load
in interface CacheLoader<K,V>
public io.reactivex.Flowable<K> publishKeys(Predicate<? super K> filter)
AdvancedCacheLoader
Subscriber
s as desired. Keys are not retrieved until a given Subscriber requests
them from the Subscription
.
Stores will return only non expired keys
publishKeys
in interface AdvancedCacheLoader<K,V>
filter
- a filter - null is treated as allowing all entriespublic io.reactivex.Flowable<MarshalledEntry<K,V>> publishEntries(Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata)
AdvancedCacheLoader
Subscriber
s as desired. Entries are not retrieved until a given Subscriber requests
them from the Subscription
.
If fetchMetadata is true this store must guarantee to not return any expired entries.
publishEntries
in interface AdvancedCacheLoader<K,V>
filter
- a filter - null is treated as allowing all entriesfetchValue
- whether or not to fetch the value from the persistent store. E.g. if the iteration is
intended only over the key set, no point fetching the values from the persistent store as
wellfetchMetadata
- whether or not to fetch the metadata from the persistent store. E.g. if the iteration is
intended only ove the key set, then no point fetching the metadata from the persistent store
as wellpublic void purge(Executor executor, AdvancedCacheWriter.PurgeListener purgeListener)
AdvancedCacheWriter
When this method returns all entries will be purged and no tasks will be running due to this loader in the provided executor. If however an exception is thrown there could be tasks still pending or running in the executor.
purge
in interface AdvancedCacheWriter<K,V>
public int size()
AdvancedCacheLoader
size
in interface AdvancedCacheLoader<K,V>
public boolean contains(Object o)
CacheLoader
contains
in interface CacheLoader<K,V>
Copyright © 2019 JBoss, a division of Red Hat. All rights reserved.