package nxm.train.prim;

import nxm.sys.inc.*;
import nxm.sys.lib.*;

/** This primitive counts. */
public class echomessage extends Primitive {
  private boolean done;
  
  public int open() {
    done = false;
    return NORMAL;
  }
  
  public int process() {
     return (!done)? NOOP: FINISH;
  }

  public int close() {
    return NORMAL;
  }

  public int processMessage(Message msg) {
    M.info("COUNTER: Got message name="+msg.getName()+" info="+msg.getInfo()+" data="+msg.getData()+" from="+msg.getFrom());

    return super.processMessage(msg);
  }
}
