001 package toolbus.atom;
002
003 import toolbus.TBTermFactory;
004 import toolbus.exceptions.ToolBusException;
005 import toolbus.parsercup.PositionInformation;
006 import toolbus.process.ProcessExpression;
007 import aterm.ATerm;
008
009 /**
010 * @author paulk, Jul 26, 2002
011 */
012 public class ShutDown extends Atom{
013 private final Ref arg;
014
015 public ShutDown(ATerm trm, TBTermFactory tbfactory, PositionInformation posInfo){
016 super(tbfactory, posInfo);
017 arg = new Ref(trm);
018 setAtomArgs(new Ref[]{arg});
019 }
020
021 public ProcessExpression copy(){
022 Atom a = new ShutDown(arg.value, tbfactory, getPosInfo());
023 a.copyAtomAttributes(this);
024 return a;
025 }
026
027 public boolean execute() throws ToolBusException{
028 if(isEnabled()){
029 getToolBus().shutdown(arg.value);
030 return true;
031 }
032
033 return false;
034 }
035 }