public class RebindManagerImpl extends java.lang.Object implements RebindManager
Lifecycle is to create an instance of this, set it up (e.g. setPeriodicPersistPeriod(Duration)
,
setPersister(BrooklynMementoPersister)
; however noting that persist period must be set before the persister).
Usually done for you by the conveniences (such as the launcher).
Modifier and Type | Class and Description |
---|---|
static class |
RebindManagerImpl.RebindTracker
For tracking if rebinding, for
AbstractBrooklynObject.isRebinding() etc. |
RebindManager.RebindFailureMode
Modifier and Type | Field and Description |
---|---|
static ConfigKey<RebindManager.RebindFailureMode> |
ADD_POLICY_FAILURE_MODE |
static ConfigKey<RebindManager.RebindFailureMode> |
DANGLING_REFERENCE_FAILURE_MODE |
static ConfigKey<RebindManager.RebindFailureMode> |
LOAD_POLICY_FAILURE_MODE |
static org.slf4j.Logger |
LOG |
static ConfigKey<RebindManager.RebindFailureMode> |
REBIND_FAILURE_MODE |
Constructor and Description |
---|
RebindManagerImpl(ManagementContextInternal managementContext) |
Modifier and Type | Method and Description |
---|---|
void |
forcePersistNow()
Forcibly performs persistence, in the foreground
|
ChangeListener |
getChangeListener() |
BrooklynMementoPersister |
getPersister() |
boolean |
isPersistenceRunning() |
boolean |
isReadOnlyRunning() |
java.util.List<Application> |
rebind() |
java.util.List<Application> |
rebind(java.lang.ClassLoader classLoader) |
java.util.List<Application> |
rebind(java.lang.ClassLoader classLoader,
RebindExceptionHandler exceptionHandler) |
java.util.List<Application> |
rebind(java.lang.ClassLoader classLoaderO,
RebindExceptionHandler exceptionHandlerO,
ManagementNodeState modeO)
Causes this management context to rebind, loading data from the given backing store.
|
BrooklynMementoRawData |
retrieveMementoRawData() |
void |
setPeriodicPersistPeriod(Duration period)
Must be called before setPerister()
|
void |
setPeriodicPersistPeriod(long periodMillis)
Deprecated.
since 0.7.0; use
setPeriodicPersistPeriod(Duration) |
void |
setPersister(BrooklynMementoPersister val) |
void |
setPersister(BrooklynMementoPersister val,
PersistenceExceptionHandler exceptionHandler) |
void |
start()
Starts the appropriate background processes,
RebindManager.startPersistence() if ManagementNodeState.MASTER ,
RebindManager.startReadOnly() if ManagementNodeState.HOT_STANDBY |
void |
startPersistence()
Starts the background persisting of state
(if persister is set; otherwise will start persisting as soon as persister is set).
|
void |
startReadOnly()
Perform an initial load of state read-only and starts a background process
reading (mirroring) state periodically.
|
void |
stop()
Stops the appropriate background processes,
RebindManager.stopPersistence() or RebindManager.stopReadOnly() ,
waiting for activity there to cease (interrupting in the case of RebindManager.stopReadOnly() ). |
void |
stopPersistence()
Stops the background persistence of state.
|
void |
stopReadOnly()
Stops the background reading (mirroring) of state.
|
java.lang.String |
toString() |
void |
waitForPendingComplete(Duration timeout)
waits for any needed or pending writes to complete
|
void |
waitForPendingComplete(long timeout,
java.util.concurrent.TimeUnit unit)
Deprecated.
|
public static final ConfigKey<RebindManager.RebindFailureMode> DANGLING_REFERENCE_FAILURE_MODE
public static final ConfigKey<RebindManager.RebindFailureMode> REBIND_FAILURE_MODE
public static final ConfigKey<RebindManager.RebindFailureMode> ADD_POLICY_FAILURE_MODE
public static final ConfigKey<RebindManager.RebindFailureMode> LOAD_POLICY_FAILURE_MODE
public static final org.slf4j.Logger LOG
public RebindManagerImpl(ManagementContextInternal managementContext)
public void setPeriodicPersistPeriod(Duration period)
public void setPeriodicPersistPeriod(long periodMillis)
setPeriodicPersistPeriod(Duration)
public boolean isPersistenceRunning()
public boolean isReadOnlyRunning()
public void setPersister(BrooklynMementoPersister val)
setPersister
in interface RebindManager
public void setPersister(BrooklynMementoPersister val, PersistenceExceptionHandler exceptionHandler)
setPersister
in interface RebindManager
public BrooklynMementoPersister getPersister()
getPersister
in interface RebindManager
public void startPersistence()
RebindManager
startPersistence
in interface RebindManager
public void stopPersistence()
RebindManager
stopPersistence
in interface RebindManager
public void startReadOnly()
RebindManager
startReadOnly
in interface RebindManager
public void stopReadOnly()
RebindManager
stopReadOnly
in interface RebindManager
public void start()
RebindManager
RebindManager.startPersistence()
if ManagementNodeState.MASTER
,
RebindManager.startReadOnly()
if ManagementNodeState.HOT_STANDBY
start
in interface RebindManager
public void stop()
RebindManager
RebindManager.stopPersistence()
or RebindManager.stopReadOnly()
,
waiting for activity there to cease (interrupting in the case of RebindManager.stopReadOnly()
).stop
in interface RebindManager
@Deprecated public void waitForPendingComplete(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
waitForPendingComplete
in interface RebindManager
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public void waitForPendingComplete(Duration timeout) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
RebindManager
waitForPendingComplete
in interface RebindManager
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public void forcePersistNow()
RebindManager
forcePersistNow
in interface RebindManager
public ChangeListener getChangeListener()
getChangeListener
in interface RebindManager
public java.util.List<Application> rebind()
rebind
in interface RebindManager
public java.util.List<Application> rebind(java.lang.ClassLoader classLoader)
rebind
in interface RebindManager
public java.util.List<Application> rebind(java.lang.ClassLoader classLoader, RebindExceptionHandler exceptionHandler)
rebind
in interface RebindManager
public java.util.List<Application> rebind(java.lang.ClassLoader classLoaderO, RebindExceptionHandler exceptionHandlerO, ManagementNodeState modeO)
RebindManager
ManagementNodeState.MASTER
or periodically for a node in ManagementNodeState.HOT_STANDBY
.rebind
in interface RebindManager
public BrooklynMementoRawData retrieveMementoRawData() throws java.io.IOException
retrieveMementoRawData
in interface RebindManager
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object