public abstract class GCUBERIFilePersistenceManager extends GCUBERIPersistenceManager
GCUBERIPersistenceManager for Running Instances that persist their state on the file system.GCUBERIPersistenceManager.StateChangeConsumer, GCUBERIPersistenceManager.StateNotFoundExceptionctxt, excludes, logger, profile| Constructor and Description |
|---|
GCUBERIFilePersistenceManager(GCUBEServiceContext ctxt,
GCUBERIPersistenceManagerProfile profile)
Creates a new instance for a given service and from a given configuration profile.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
commitState()
Invoked by
GCUBERIPersistenceManager.commit() to commit the state of the running instance. |
protected List<File> |
getState(File dir,
List<File>... files)
Used internally to enumerate the files that comprise the state to persist (i.e.
|
protected File |
getStateFile()
Returns the file in which state is to be packaged.
|
boolean |
isExclude(String name)
Used internally to check whether a given string matches at least one of the exclude directives.
|
protected abstract void |
loadState()
Loads the state of the running instance from persistent storage.
|
protected void |
packageState()
Packages the state of the running instance in a single file.
|
protected void |
recoverState()
Invoked by
GCUBERIPersistenceManager.recover() to recover the state of the running instance. |
protected abstract void |
storeState()
Stores the state of the running instance into persistent storage.
|
protected void |
unpackageState()
Unpackages the state of the running instances from a single file.
|
public GCUBERIFilePersistenceManager(GCUBEServiceContext ctxt, GCUBERIPersistenceManagerProfile profile)
ctxt - the context of the service.profile - the configuration profile.protected void commitState()
throws Exception
GCUBERIPersistenceManager.commit() to commit the state of the running instance.commitState in class GCUBERIPersistenceManagerException - if the state could not be committed.protected void recoverState()
throws GCUBERIPersistenceManager.StateNotFoundException,
Exception
GCUBERIPersistenceManager.recover() to recover the state of the running instance.recoverState in class GCUBERIPersistenceManagerException - if the state could not be recovered.GCUBERIPersistenceManager.StateNotFoundExceptionprotected List<File> getState(File dir, List<File>... files)
dir - the start directory.files - (optional) the list of files to persist accumulated during recursive invocations.public boolean isExclude(String name)
name - the name to match.true if the string matches, false otherwise.protected File getStateFile() throws IOException
IOExceptionprotected void packageState()
throws Exception
Exception - if the state could not be packaged.protected void unpackageState()
throws Exception
Exception - if the state could not be unpackaged.protected abstract void loadState()
throws GCUBERIPersistenceManager.StateNotFoundException,
Exception
Exception - if the state could not be loaded.GCUBERIPersistenceManager.StateNotFoundExceptionCopyright © 2015. All Rights Reserved.