public class SynchronousStateManager extends StateManager
activeObjArray, activeObjListenersArray, baseStateDir, logger, scratchDir, stateBufferFileName, stateBufferObjArray, stateDirObjArray| Constructor and Description |
|---|
SynchronousStateManager(LoggerIfc logger,
java.io.File scratchDir)
Creates the default StateManager
|
SynchronousStateManager(LoggerIfc logger,
java.io.File scratchDir,
java.lang.String stateBufferFileName)
Creates the StateManager with a buffer file.
|
| Modifier and Type | Method and Description |
|---|---|
StateManagementType |
getType()
Returns this type of StateManager.
|
void |
manageState(StateBufferSaveable state)
Adds a single StateBufferSaveable object to be managed.
|
void |
manageState(StateDirectorySaveable state)
Adds a single StateDirectorySaveable object to be managed.
|
void |
manageStates(StateBufferSaveable[] states)
Adds an array of StateBufferSaveable objects for managing.
|
void |
manageStates(StateDirectorySaveable[] states)
Adds an array of StateDirectorySaveable objects for managing.
|
void |
restoreState()
This method causes the state to be restored immediately.
|
void |
saveState()
This method causes the state to be saved immediately.
|
void |
saveState(Callback callback)
This method causes the state to be saved immediately.
|
void |
setMergeThreshold(int threshold)
Sets the number of state saves allowed before a merge occurs.
|
void |
setStateBufferFileName(java.lang.String stateBufferFileName)
Sets the current state buffer file.
|
void |
shutdown()
Shuts down the StateManager, and cleans up any remaining
state-related files.
|
manageActiveObjectpublic SynchronousStateManager(LoggerIfc logger, java.io.File scratchDir)
logger - Activity loggerscratchDir - Directory which to store state datapublic SynchronousStateManager(LoggerIfc logger, java.io.File scratchDir, java.lang.String stateBufferFileName)
logger - Activity loggerscratchDir - Directory which to store state data.stateBufferFileName - Buffer File namepublic void shutdown()
shutdown in class StateManagerpublic void setStateBufferFileName(java.lang.String stateBufferFileName)
setStateBufferFileName in class StateManagerstateBufferFileName - Buffer file, containing the states.public void manageState(StateBufferSaveable state)
manageState in class StateManagerstateDirObj - State object to managepublic void manageState(StateDirectorySaveable state)
manageState in class StateManagerstateDirObj - State object to managepublic void manageStates(StateBufferSaveable[] states)
manageStates in class StateManagerstates - Array of state objectspublic void manageStates(StateDirectorySaveable[] states)
manageStates in class StateManagerstates - Array of state objectspublic void setMergeThreshold(int threshold)
public void saveState()
throws StateException
saveState in class StateManagerStateExceptionpublic void saveState(Callback callback) throws StateException
saveState in class StateManagerStateExceptionpublic void restoreState()
throws StateException
restoreState in class StateManagerStateExceptionpublic StateManagementType getType()
StateManagergetType in class StateManager