001: /*
002: * Enhydra Java Application Server Project
003: *
004: * The contents of this file are subject to the Enhydra Public License
005: * Version 1.1 (the "License"); you may not use this file except in
006: * compliance with the License. You may obtain a copy of the License on
007: * the Enhydra web site ( http://www.enhydra.org/ ).
008: *
009: * Software distributed under the License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011: * the License for the specific terms governing rights and limitations
012: * under the License.
013: *
014: * The Initial Developer of the Enhydra Application Server is Lutris
015: * Technologies, Inc. The Enhydra Application Server and portions created
016: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017: * All Rights Reserved.
018: *
019: * Contributor(s):
020: * Paul Mahar
021: *
022: */
023: package org.enhydra.kelp.common.dods;
024:
025: // ToolBox
026: import org.enhydra.tool.ToolBoxInfo;
027:
028: // AddinCore
029: import org.enhydra.kelp.common.Constants;
030: import org.enhydra.kelp.common.PathUtil;
031: import org.enhydra.kelp.common.node.OtterProject;
032:
033: // JDK
034: import java.io.File;
035:
036: //
037: public class RunParameters {
038: private OtterProject project = null;
039:
040: //
041: public RunParameters(OtterProject p) {
042: project = p;
043:
044: }
045:
046: public String getAppParameters() {
047: StringBuffer buf = new StringBuffer();
048: buf.append('\"');
049: buf.append(project.getDeployBootstrapPath());
050: buf.append('\"');
051: return buf.toString();
052: }
053:
054: public String getClasspathArg() {
055: StringBuffer buf = new StringBuffer();
056: String eRoot = new String();
057:
058: eRoot = ToolBoxInfo.getEnhydraRoot().replace('\\', '/');
059: buf.setLength(0);
060: buf.append("-classpath ");
061: buf.append('\"');
062: buf.append(eRoot);
063: buf.append("/lib/Boot.jar");
064: buf.append(File.pathSeparatorChar);
065: buf.append(eRoot);
066: buf.append("/lib/EAAL.jar");
067: buf.append('\"');
068: return buf.toString();
069: }
070:
071: public String getBootArg() {
072: StringBuffer bootPath = new StringBuffer();
073:
074: bootPath.append("-Dorg.enhydra.boot.properties="); // nores
075: bootPath.append('\"');
076: bootPath.append(project.getDeployRootPath());
077: bootPath.append(File.separator);
078: bootPath.append("boot.properties");
079: bootPath.append('\"');
080: return bootPath.toString().replace('\\', '/');
081: }
082:
083: public String getTCcpArg() {
084: StringBuffer buf = new StringBuffer();
085: String eRoot = ToolBoxInfo.getEnhydraRoot().replace('\\', '/');
086:
087: buf.append("-Dtc_path_add=");
088: buf.append('\"');
089: buf.append(eRoot);
090: buf.append("/lib/WebService.jar");
091: buf.append(File.pathSeparator);
092: buf.append(eRoot);
093: buf.append("/lib/SharedApiService.jar");
094: buf.append('\"');
095: return buf.toString();
096: }
097:
098: public String getVMParameters() {
099: StringBuffer buf = new StringBuffer();
100: buf.setLength(0);
101: buf.append(' ');
102: buf.append(getClasspathArg());
103: buf.append(' ');
104: buf.append(getTCcpArg());
105: buf.append(' ');
106: // buf.append(getPolicyArg());
107: buf.append(' ');
108: buf.append(getBootArg());
109: return buf.toString();
110: }
111:
112: }
|