1 23 package org.enhydra.kelp.common.dods; 24 25 import org.enhydra.tool.ToolBoxInfo; 27 28 import org.enhydra.kelp.common.Constants; 30 import org.enhydra.kelp.common.PathUtil; 31 import org.enhydra.kelp.common.node.OtterProject; 32 33 import java.io.File ; 35 36 public class RunParameters { 38 private OtterProject project = null; 39 private boolean is3 = false; 40 41 public RunParameters(OtterProject p) { 43 project = p; 44 is3 = ToolBoxInfo.isEnhydra3(); 45 46 } 47 48 public String getAppParameters() { 49 StringBuffer buf = new StringBuffer (); 50 buf.append('\"'); 51 buf.append(project.getDeployBootstrapPath()); 52 buf.append('\"'); 53 return buf.toString(); 54 } 55 56 public String getClasspathArg() 57 { 58 if (is3) { 59 return ""; 60 } 61 else { 62 StringBuffer buf = new StringBuffer (); 63 String eRoot = new String (); 64 65 eRoot = ToolBoxInfo.getEnhydraRoot().replace('\\', '/'); 66 buf.setLength(0); 67 buf.append("-classpath "); 68 buf.append('\"'); 69 buf.append(eRoot); 70 buf.append("/lib/Boot.jar"); 71 buf.append(File.pathSeparatorChar); 72 buf.append(eRoot); 73 buf.append("/lib/EAAL.jar"); 74 buf.append('\"'); 75 return buf.toString(); 76 } 77 } 78 79 public String getBootArg() { 80 if (is3) { 81 return ""; 82 } else { 83 StringBuffer bootPath = new StringBuffer (); 84 85 bootPath.append("-Dorg.enhydra.boot.properties="); bootPath.append('\"'); 87 bootPath.append(project.getDeployRootPath()); 88 bootPath.append(File.separator); 89 bootPath.append("boot.properties"); 90 bootPath.append('\"'); 91 return bootPath.toString().replace('\\', '/'); 92 } 93 } 94 95 118 119 public String getTCcpArg() { 120 if (is3) { 121 return ""; 122 } else { 123 StringBuffer buf = new StringBuffer (); 124 String eRoot = ToolBoxInfo.getEnhydraRoot().replace('\\', '/'); 125 126 buf.append("-Dtc_path_add="); 127 buf.append('\"'); 128 buf.append(eRoot); 129 buf.append("/lib/WebService.jar"); 130 buf.append(File.pathSeparator); 131 buf.append(eRoot); 132 buf.append("/lib/SharedApiService.jar"); 133 buf.append('\"'); 134 return buf.toString(); 135 } 136 } 137 public String getVMParameters() { 138 StringBuffer buf = new StringBuffer (); 139 140 if (is3) { 141 142 } else { 144 buf.setLength(0); 145 buf.append(' '); 146 buf.append(getClasspathArg()); 147 buf.append(' '); 148 buf.append(getTCcpArg()); 149 buf.append(' '); 150 buf.append(' '); 152 buf.append(getBootArg()); 153 } 154 return buf.toString(); 155 } 156 157 } 158 | Popular Tags |