public class SingletonCacheWriter extends DelegatingCacheWriter
| Modifier and Type | Class and Description |
|---|---|
static class |
SingletonCacheWriter.PushStateException
Exception representing any issues that arise from pushing the in-memory state to the cache loader.
|
class |
SingletonCacheWriter.SingletonStoreListener
Cache listener that reacts to cluster topology changes to find out whether a new coordinator is elected.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active
Whether the the current cache is the coordinator and therefore SingletonStore is active.
|
protected ExecutorService |
executor
Executor service used to submit tasks to push in-memory state.
|
actual, ctx| Constructor and Description |
|---|
SingletonCacheWriter(CacheWriter actual,
SingletonStoreConfiguration singletonConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activeStatusChanged(boolean newActiveState)
Method called when the cache either becomes the coordinator or stops being the coordinator.
|
protected void |
awaitForPushToFinish(Future<?> future,
long timeout,
TimeUnit unit)
Method that waits for the in-memory to cache loader state to finish.
|
protected Callable<?> |
createPushStateTask() |
boolean |
delete(Object key) |
protected void |
pushState(Cache cache)
Pushes the state of a specific cache by reading the cache's data and putting in the cache store.
|
void |
start()
Invoked on component start
|
void |
stop()
Invoked on component stop
|
String |
toString() |
void |
write(MarshalledEntry entry)
Persists the entry to the storage.
|
init, undelegateprotected final ExecutorService executor
protected volatile boolean active
public SingletonCacheWriter(CacheWriter actual, SingletonStoreConfiguration singletonConfiguration)
public void start()
Lifecyclestart in interface Lifecyclestart in class DelegatingCacheWriterpublic void stop()
Lifecyclestop in interface Lifecyclestop in class DelegatingCacheWriterpublic void write(MarshalledEntry entry)
CacheWriterwrite in interface CacheWriterwrite in class DelegatingCacheWriterMarshalledEntrypublic boolean delete(Object key)
delete in interface CacheWriterdelete in class DelegatingCacheWriterprotected Callable<?> createPushStateTask()
protected void pushState(Cache cache) throws Exception
Exceptionprotected void awaitForPushToFinish(Future<?> future, long timeout, TimeUnit unit)
protected void activeStatusChanged(boolean newActiveState)
throws SingletonCacheWriter.PushStateException
Copyright © 2025 JBoss, a division of Red Hat. All rights reserved.