|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.SerializedObjectStore
public class SerializedObjectStore
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.
| Field Summary | |
|---|---|
protected boolean |
debugShowHash
_more_ |
protected boolean |
debugWhichRead
_more_ |
protected HashMap |
hash
_more_ |
protected boolean |
showGet
_more_ |
protected boolean |
showPut
_more_ |
| Constructor Summary | |
|---|---|
protected |
SerializedObjectStore()
_more_ |
|
SerializedObjectStore(String systemName,
String appName,
String storeName)
Constructor. |
| Method Summary | |
|---|---|
Object |
get(Object key)
get the value named by the key |
boolean |
get(Object key,
boolean dflt)
Wrapper method that retrieves a boolean value form the store If the value does not exist this returns the dflt parameter |
protected void |
printHashMap(HashMap hm)
_more_ |
void |
put(Object key,
Object value)
_more_ |
protected void |
readConfigFile(boolean isCore,
String filename)
_more_ |
protected boolean |
readObjectsFromStream(ObjectInputStream in)
_more_ |
void |
save()
save the objects to disk |
protected void |
writeObjectsToStream(ObjectOutputStream out)
_more_ |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean debugShowHash
protected boolean showGet
protected boolean showPut
protected boolean debugWhichRead
protected HashMap hash
| Constructor Detail |
|---|
protected SerializedObjectStore()
public SerializedObjectStore(String systemName,
String appName,
String storeName)
/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.
systemName - system name.appName - application name.storeName - store name.| Method Detail |
|---|
public Object get(Object key)
get in interface PersistentStorekey -
public boolean get(Object key,
boolean dflt)
key - dflt -
public void put(Object key,
Object value)
put in interface PersistentStorekey - value - public void save()
save in interface PersistentStore
protected void readConfigFile(boolean isCore,
String filename)
isCore - filename - protected boolean readObjectsFromStream(ObjectInputStream in)
in -
protected void writeObjectsToStream(ObjectOutputStream out)
out - protected void printHashMap(HashMap hm)
hm -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||