metaglue
Class Icebox

java.lang.Object
  |
  +--metaglue.Icebox

public class Icebox
extends Object

A simple class for dealing with the database-backed icebox.


Constructor Summary
Icebox(Connection cnxn)
           
 
Method Summary
 Object defrost(String freezeName, String var)
          Defrosts an object to get its value from the icebox.
 Hashtable defrostAll(String freezeName)
          Gets the variables and values stored in the icebox.
 void freezeVar(String freezeName, String var, Object obj)
          `Freeze' an object into the icebox.
 Set getFrozenVariables(String freezeName)
          Gets the set of variables stored in the icebox.
 boolean removeFrozen(String freezeName, String var)
          Remove a frozen object from the icebox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Icebox

public Icebox(Connection cnxn)
Method Detail

freezeVar

public void freezeVar(String freezeName,
                      String var,
                      Object obj)
`Freeze' an object into the icebox. This will store the given object under the given name in some location, where it can later be `defrosted'. Anything serializable can be frozen--it will dump the serializable form of the object out using an ObjectOutputStream. The format for frozen objects is as defined in CrystalOutputStream.
Parameters:
freezeName - The agent name to store with the variable.
var - The variable name to save under.
obj - The object being saved. This must satisfy Serializable.
See Also:
defrost(String, String), CrystalOutputStream

removeFrozen

public boolean removeFrozen(String freezeName,
                            String var)
Remove a frozen object from the icebox.
Parameters:
freezeName - The agent name associated with the variable.
var - The variable name to remove.
See Also:
defrost(String, String), freezeVar(String, String, Object)

defrost

public Object defrost(String freezeName,
                      String var)
Defrosts an object to get its value from the icebox. Returns null if the object is not found.
Parameters:
freezeName - The agent name holding the variable.
var - The variable name to defrost.
Returns:
The object stored under the name.
See Also:
freezeVar(String, String, Object)

defrostAll

public Hashtable defrostAll(String freezeName)
Gets the variables and values stored in the icebox.
Returns:
A hashtable mapping variable names to values.
See Also:
freezeVar(String, String, Object), defrost(String, String)

getFrozenVariables

public Set getFrozenVariables(String freezeName)
Gets the set of variables stored in the icebox.
Returns:
A set of variable names.
See Also:
freezeVar(String, String, Object), defrost(String, String)