//
// FlowStepThrow.java - Throw an exception
//

package nyangau.jmsadapter;

//...simports:0:
import javax.jms.JMSException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
//...e

public class FlowStepThrow extends FlowStep
  {
  protected String cause;
//...sFlowStepThrow:2:
public FlowStepThrow(Node eStep)
  throws FlowProcessorException
  {
  super(eStep);
  NamedNodeMap nnmStep = eStep.getAttributes();
  Node aCause = nnmStep.getNamedItem("cause");
  if ( aCause == null )
    throw new FlowProcessorException("unexpected missing cause in step"+name+", bad jmsadapter.xsd?");
  cause = aCause.getNodeValue();
  }
//...e
//...sprocess:2:
public void process(FlowContext c)
  throws FlowProcessorException, JMSException
  {
  throw new FlowProcessorException("user defined exception in step "+name+": "+cause);
  }
//...e
  }
