public interface RebindManager
| Modifier and Type | Interface and Description |
|---|---|
static class |
RebindManager.RebindFailureMode |
| Modifier and Type | Method and Description |
|---|---|
void |
forcePersistNow(boolean full,
PersistenceExceptionHandler exceptionHandler)
Forcibly performs persistence, in the foreground, either full (all entities) or incremental;
if no exception handler specified, the default one from the persister is used.
|
ChangeListener |
getChangeListener() |
java.util.Map<java.lang.String,java.lang.Object> |
getMetrics()
Metrics about rebind, last success, etc.
|
BrooklynMementoPersister |
getPersister() |
boolean |
hasPending() |
boolean |
isAwaitingInitialRebind()
Whether the management state has changed to a state where a rebind is needed
but we are still awaiting the first run;
ie state is master or hot, but list of apps is not yet accurate
|
boolean |
isRebindActive()
Whether rebind is currently executing.
|
java.util.List<Application> |
rebind(java.lang.ClassLoader classLoader,
RebindExceptionHandler exceptionHandler,
ManagementNodeState mode)
Causes this management context to rebind, loading data from the given backing store.
|
void |
reset()
Resets the effects of previously being read-only, ready to be used again (e.g.
|
BrooklynMementoRawData |
retrieveMementoRawData() |
void |
setPersister(BrooklynMementoPersister persister) |
void |
setPersister(BrooklynMementoPersister persister,
PersistenceExceptionHandler exceptionHandler) |
void |
start()
Starts the appropriate background processes,
startPersistence() if ManagementNodeState.MASTER,
#startReadOnly() if ManagementNodeState.HOT_STANDBY or ManagementNodeState.HOT_BACKUP |
void |
startPersistence()
Starts the background persisting of state
(if persister is set; otherwise will start persisting as soon as persister is set).
|
void |
startReadOnly(ManagementNodeState mode)
Perform an initial load of state read-only and starts a background process
reading (mirroring) state periodically.
|
void |
stop()
Stops the appropriate background processes,
stopPersistence() or stopReadOnly(),
waiting for activity there to cease (interrupting in the case of stopReadOnly()). |
void |
stopPersistence()
Stops the background persistence of state.
|
void |
stopReadOnly()
Stops the background reading (mirroring) of state.
|
void |
waitForPendingComplete(Duration duration,
boolean canTrigger) |
boolean isRebindActive()
void setPersister(BrooklynMementoPersister persister)
void setPersister(BrooklynMementoPersister persister, PersistenceExceptionHandler exceptionHandler)
BrooklynMementoPersister getPersister()
java.util.List<Application> rebind(java.lang.ClassLoader classLoader, RebindExceptionHandler exceptionHandler, ManagementNodeState mode)
ManagementNodeState.MASTER
or periodically for a node in ManagementNodeState.HOT_STANDBY or ManagementNodeState.HOT_BACKUP.BrooklynMementoRawData retrieveMementoRawData()
ChangeListener getChangeListener()
void startPersistence()
void stopPersistence()
void startReadOnly(ManagementNodeState mode)
void stopReadOnly()
void reset()
stopReadOnly() (thus long after setPersister(BrooklynMementoPersister),
and before rebind(ClassLoader, RebindExceptionHandler, ManagementNodeState) followed by start().void start()
startPersistence() if ManagementNodeState.MASTER,
#startReadOnly() if ManagementNodeState.HOT_STANDBY or ManagementNodeState.HOT_BACKUPvoid stop()
stopPersistence() or stopReadOnly(),
waiting for activity there to cease (interrupting in the case of stopReadOnly()).void waitForPendingComplete(Duration duration, boolean canTrigger) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
java.lang.InterruptedExceptionjava.util.concurrent.TimeoutExceptionboolean hasPending()
void forcePersistNow(boolean full,
@Nullable
PersistenceExceptionHandler exceptionHandler)
Note that full persistence does *not* delete items; incremental should normally be sufficient. (A clear then full persistence would have the same effect, but that is risky in a production setting if the process fails after the clear!)
boolean isAwaitingInitialRebind()
java.util.Map<java.lang.String,java.lang.Object> getMetrics()