Package ucar.unidata.util
Class SerializedObjectStore
java.lang.Object
ucar.unidata.util.SerializedObjectStore
- All Implemented Interfaces:
PersistentStore
Implements the PersistentStore interface for metApps persistent objects.
This class stores serialized objects in a HashMap. All objects passed to it must
implement the Serializable interface.
- Version:
- $Revision: 1.16 $
- Author:
- caron
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
_more_protected boolean
_more_protected HashMap
_more_protected boolean
_more_protected boolean
_more_ -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
_more_SerializedObjectStore
(String systemName, String appName, String storeName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionget the value named by the keyboolean
Wrapper method that retrieves a boolean value form the store If the value does not exist this returns the dflt parameterprotected void
printHashMap
(HashMap hm) _more_void
_more_protected void
readConfigFile
(boolean isCore, String filename) _more_protected boolean
_more_void
save()
save the objects to diskprotected void
_more_
-
Field Details
-
debugShowHash
protected boolean debugShowHash_more_ -
showGet
protected boolean showGet_more_ -
showPut
protected boolean showPut_more_ -
debugWhichRead
protected boolean debugWhichRead_more_ -
hash
_more_
-
-
Constructor Details
-
SerializedObjectStore
protected SerializedObjectStore()_more_ -
SerializedObjectStore
Constructor. You can subclass to implement other strategies. In this default implementation, the following files are looked for (in sequence), and if found, are read into the HashMap. Thus, Objects in the later files override ones in the earlier files. If a file doesnt exist, it is skipped./data/config/<app>/<storeName>.ser CORE configuration files in jar file $METAPPS_HOME/config/<app>/<storeName>.ser SITE configuration files $USER_HOME/
<app>/<storeName>.ser USER configuration files where: $METAPPS_HOME: check for system property "metapps.home", if none, use current directory $USER_HOME: check for system property "user.home"; if none, use current directory Notes: Check for system property using System.getProperty("property") Set system property on command line: java -Dmetapps.home=$METAPPS_HOME An applet can read only from the jar file. - Parameters:
systemName
- system name.appName
- application name.storeName
- store name.
-
-
Method Details
-
get
get the value named by the key- Specified by:
get
in interfacePersistentStore
- Parameters:
key
-- Returns:
- _more_
-
get
Wrapper method that retrieves a boolean value form the store If the value does not exist this returns the dflt parameter- Parameters:
key
-dflt
-- Returns:
- _more_
-
put
_more_- Specified by:
put
in interfacePersistentStore
- Parameters:
key
-value
-
-
save
public void save()save the objects to disk- Specified by:
save
in interfacePersistentStore
-
readConfigFile
_more_- Parameters:
isCore
-filename
-
-
readObjectsFromStream
_more_- Parameters:
in
-- Returns:
- _more_
-
writeObjectsToStream
_more_- Parameters:
out
-
-
printHashMap
_more_- Parameters:
hm
-
-