| |
|
| java.lang.Object com.jeta.swingbuilder.app.ApplicationStateStore
ApplicationStateStore | public class ApplicationStateStore implements ObjectStore(Code) | | This class implements the ObjectStore interface. It is used to manage
serialization of object properties. The idea is to decouple application
components from where we are serializing the data. We store the data in two
directories: home/data and home/data/work The work directory is used to
temporarily write out the store. If an error occurs, the user can still
recover from the old state. If the write is successful to the work area, then
we re-write to the data area.
author: Jeff Tassin |
PARENT_DIRECTORY | final public static String PARENT_DIRECTORY(Code) | | |
ApplicationStateStore | public ApplicationStateStore(String directory)(Code) | | ctor
|
delete | public synchronized void delete(String keyName) throws IOException(Code) | | Deletes the object from the store cache as well as on disk
|
flush | public synchronized void flush() throws IOException(Code) | | Saves the entire store to disk
|
getTargetDirectory | public String getTargetDirectory()(Code) | | the relative path to the directory where we store our objects |
getTargetDirectory | public String getTargetDirectory(boolean temp)(Code) | | the relative path to the directory where we store our objects |
isReadOnly | public boolean isReadOnly()(Code) | | true if the store is readonly. |
load | public Object load(String keyName, Object defaultValue) throws IOException(Code) | | loads the named object from the store. This object is also deserialized
at this point since the store only keeps track of serialized data
Parameters: keyName - the unique name of the lobject to retrieve Parameters: defaultValue - the value to return if the name is not found in the store the instantiated object from the store. The default value isreturned if the name is not found. throws: IOException - if an error occurs during deserialization |
save | public synchronized void save() throws IOException(Code) | | Writes out the data to disk
|
setReadOnly | public void setReadOnly(boolean readonly)(Code) | | Sets the flag that indicates if the store is readonly.
|
|
|
|