org.jbpm.pvm.impl
Class VariableMap

java.lang.Object
  extended by org.jbpm.pvm.impl.VariableMap
All Implemented Interfaces:
java.io.Serializable, VariableScope

public class VariableMap
extends java.lang.Object
implements VariableScope, java.io.Serializable

maintains a map of named objects. Internally, the objects are wrapped and stored as Variable-objects so that this map can be persisted with hibernate in the database.

See Also:
Serialized Form

Field Summary
protected  long dbid
           
protected  int dbversion
           
protected  ExecutionImpl execution
           
protected  ExecutionImpl processInstance
           
protected  java.util.Map<java.lang.String,Variable> variables
           
 
Constructor Summary
VariableMap()
           
VariableMap(ExecutionImpl execution)
           
 
Method Summary
protected  Variable createVariable(java.lang.String key, java.lang.Object value)
           
 java.lang.Object get(java.lang.String key)
          retrieve an object from this scope
 java.util.Map<java.lang.String,java.lang.Object> getAll()
          all the variables.
 Variable getVariable(java.lang.String key)
           
 boolean has(java.lang.String key)
          check for presence of a key in this scope
 boolean isEmpty()
          checks if this scope is empty
 java.util.Set<java.lang.String> keys()
          all the keys that are present in this scope
 boolean remove(java.lang.String key)
          remove the entry for the given key from this scope
protected  boolean removeVariable(java.lang.String key)
           
 void set(java.lang.String key, java.lang.Object value)
          set an object in this scope
protected  void setVariable(Variable variable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbid

protected long dbid

dbversion

protected int dbversion

variables

protected java.util.Map<java.lang.String,Variable> variables

execution

protected ExecutionImpl execution

processInstance

protected ExecutionImpl processInstance
Constructor Detail

VariableMap

public VariableMap()

VariableMap

public VariableMap(ExecutionImpl execution)
Method Detail

isEmpty

public boolean isEmpty()
Description copied from interface: VariableScope
checks if this scope is empty

Specified by:
isEmpty in interface VariableScope

has

public boolean has(java.lang.String key)
Description copied from interface: VariableScope
check for presence of a key in this scope

Specified by:
has in interface VariableScope

keys

public java.util.Set<java.lang.String> keys()
Description copied from interface: VariableScope
all the keys that are present in this scope

Specified by:
keys in interface VariableScope

getAll

public java.util.Map<java.lang.String,java.lang.Object> getAll()
all the variables. A new HashMap is created for each invocation.

Specified by:
getAll in interface VariableScope
Returns:
a Map of variables or null if there are no variables.

get

public java.lang.Object get(java.lang.String key)
Description copied from interface: VariableScope
retrieve an object from this scope

Specified by:
get in interface VariableScope

remove

public boolean remove(java.lang.String key)
Description copied from interface: VariableScope
remove the entry for the given key from this scope

Specified by:
remove in interface VariableScope

set

public void set(java.lang.String key,
                java.lang.Object value)
Description copied from interface: VariableScope
set an object in this scope

Specified by:
set in interface VariableScope

createVariable

protected Variable createVariable(java.lang.String key,
                                  java.lang.Object value)

getVariable

public Variable getVariable(java.lang.String key)

removeVariable

protected boolean removeVariable(java.lang.String key)
Returns:
true if a variable was actually deleted.

setVariable

protected void setVariable(Variable variable)