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() |
void |
stop() |
String |
toString() |
void |
write(MarshalledEntry entry)
Persists the entry to the storage.
|
init, undelegate
protected final ExecutorService executor
protected volatile boolean active
public SingletonCacheWriter(CacheWriter actual, SingletonStoreConfiguration singletonConfiguration)
public void start()
start
in interface Lifecycle
start
in class DelegatingCacheWriter
public void stop()
stop
in interface Lifecycle
stop
in class DelegatingCacheWriter
public void write(MarshalledEntry entry)
CacheWriter
write
in interface CacheWriter
write
in class DelegatingCacheWriter
MarshalledEntry
public boolean delete(Object key)
delete
in interface CacheWriter
delete
in class DelegatingCacheWriter
protected Callable<?> createPushStateTask()
protected void pushState(Cache cache) throws Exception
Exception
protected void awaitForPushToFinish(Future<?> future, long timeout, TimeUnit unit)
protected void activeStatusChanged(boolean newActiveState) throws SingletonCacheWriter.PushStateException
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.