
public final class PersistencyService extends Object implements ServiceLifecycle, HasLifecycle
Persist and to write them into a
local file at subsystem shutdown or at regular time intervals.| Modifier and Type | Method and Description |
|---|---|
boolean |
isLocalPersistenceFilePresent()
Tells whether a local persistence file exists on the local filesystem for
that agent.
|
boolean |
load()
Reads the persisted data local file and applies the contained value to
the
Persist annotated fields. |
boolean |
persistNow()
Persists the annotated fields values in a local file.
|
void |
preInit() |
void |
preStart()
Called from the enclosing
Subsystem when
org.lsst.ccs.Subsystem#start() has been called. |
void |
setAutomatic(boolean loadAtStartup,
boolean persistAtShutdown)
Customize the behavior of the local persistence service.
|
void |
shutdown()
Called from the enclosing
Subsystem when
org.lsst.ccs.Subsystem#shutdown() has been called. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpreBuild, preShutdownbuild, init, postBuild, postInit, postShutdown, postStart, startpublic void preInit()
preInit in interface ServiceLifecyclepublic void preStart()
ServiceLifecycleSubsystem when
org.lsst.ccs.Subsystem#start() has been called.
The preceding lifecycle step is HasLifecycle.postInit()
The following lifecycle step is HasLifecycle.start()
At the time it is called :
PhaseState is
INITIALIZING
connection with the messaging layer is effective, the enclosing
subsystem has started StatusHeartBeat
publication
preStart in interface ServiceLifecyclepublic void shutdown()
HasLifecycleSubsystem when
org.lsst.ccs.Subsystem#shutdown() has been called. At the time it
is called :
PhaseState is CLOSING.
HardwareController.checkStopped() has
been called
shutdown in interface HasLifecyclepublic void setAutomatic(boolean loadAtStartup,
boolean persistAtShutdown)
loadAtStartup - true if the persistence file should be loaded
automatically at startuppersistAtShutdown - true if the persistence file should be written
autmatically at shutdown@Command(description="writes persistent data in local file") public boolean persistNow()
@Command(description="loads persistent data from local file") public boolean load()
Persist annotated fields.
Inconsistent data are silently ignored@Command(description="returns true if a local persistence file is present, false otherwise.") public boolean isLocalPersistenceFilePresent()
Copyright © 2018 LSST. All rights reserved.