1 6 7 package SOFA.Connector.EEG.EEM.Actions; 8 9 import SOFA.Connector.EEG.EEM.ActionException; 10 import SOFA.Connector.EEG.EEM.ActionInterface; 11 12 17 public class IDL implements ActionInterface { 18 protected String include; 19 20 21 public IDL(java.util.HashMap props) { 22 include=(String )props.get("include"); 23 } 24 25 public String getName() { 26 return "idl"; 27 } 28 29 public void perform(SOFA.Connector.Property[] params, String sourceDir, String sourcePackage, String destDir, String destPackage) throws ActionException { 30 String source; 31 if ((source=SOFA.Connector.Property.findFirst(params,"source"))==null) { 32 throw new ActionException("source param not specified"); 33 } 34 35 int ret; 36 try { 37 Runtime runtime=Runtime.getRuntime(); 38 Process process=runtime.exec("idlj -td "+SOFA.Util.ConnGenPathInfo.getRMICOutDir()+" -fall "+(include!=null?"-i "+include+" ":"")+destDir+"/"+source); 39 ret=process.waitFor(); 40 } catch (Exception e) { 41 throw new ActionException("Can't create classes from idl file "+destPackage+"/"+source+".",e); 42 } 43 if (ret!=0) { 44 throw new ActionException("Creating classes from IDL 'idlj -fall "+(include!=null?"-i "+include+" ":"")+destDir+"/"+source+"' returned error ("+ret+")."); 45 } 46 } 47 48 } 49 | Popular Tags |