//
// FlowContext.java - State passed during flow execution
//
// A flow context is a message and a set of variables
//

package nyangau.jmsadapter;

import java.util.Map;
import java.util.HashMap;

public class FlowContext
  {
  protected FlowProcessor fp;
  protected JmsaMessage m;
  protected Map<String,Object> vars; // named variables
  public FlowContext(FlowProcessor flowproc, JmsaMessage message)
    {
    fp = flowproc;
    m = message;
    vars = new HashMap<String,Object>();
    }
  public FlowProcessor getFlowProcessor() { return fp; }
  public JmsaMessage getMessage() { return m; }
  public void setMessage(JmsaMessage message) { m = message; }
  public Object getVar(String name) { return vars.get(name); }
  public Map<String,Object> getVars() { return vars; }
  public void setVar(String name, Object value) { vars.put(name, value); }
  public void delVar(String name) { vars.remove(name); }
  }
