KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyTesting > functionTests > harness > jdk13


1 /*
2
3    Derby - Class org.apache.derbyTesting.functionTests.harness.jdk13
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derbyTesting.functionTests.harness;
23
24 import java.util.Vector JavaDoc;
25 import java.util.StringTokenizer JavaDoc;
26
27 /**
28   <p>This class is for JDK1.3.
29
30   @author ames
31  */

32 public class jdk13 extends jvm {
33
34     public String JavaDoc getName(){return "jdk13";}
35     public jdk13(boolean noasyncgc, boolean verbosegc, boolean noclassgc,
36     long ss, long oss, long ms, long mx, String JavaDoc classpath, String JavaDoc prof,
37     boolean verify, boolean noverify, boolean nojit, Vector JavaDoc D) {
38         super(noasyncgc,verbosegc,noclassgc,ss,oss,ms,mx,classpath,prof,
39         verify,noverify,nojit,D);
40     }
41     // more typical use:
42
public jdk13(String JavaDoc classpath, Vector JavaDoc D) {
43         super(classpath,D);
44     }
45     // more typical use:
46
public jdk13(long ms, long mx, String JavaDoc classpath, Vector JavaDoc D) {
47         super(ms,mx,classpath,D);
48     }
49     // actual use
50
public jdk13() { }
51
52     // return the command line to invoke this VM. The caller then adds
53
// the class and program arguments.
54
public Vector JavaDoc getCommandLine()
55     {
56         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
57         Vector JavaDoc v = super.getCommandLine();
58         appendOtherFlags(sb);
59         String JavaDoc s = sb.toString();
60         StringTokenizer JavaDoc st = new StringTokenizer JavaDoc(s);
61         while (st.hasMoreTokens())
62         {
63             v.addElement(st.nextToken());
64         }
65         return v;
66     }
67
68     public void appendOtherFlags(StringBuffer JavaDoc sb)
69     {
70         if (noasyncgc) warn("jdk13 does not support noasyncgc");
71         if (verbosegc) sb.append(" -verbose:gc");
72         if (noclassgc) sb.append(" -Xnoclassgc");
73         if (ss>=0) warn("jdk13 does not support ss");
74         if (oss>=0) warn("jdk13 does not support oss");
75         if (ms>=0) {
76           sb.append(" -ms");
77           sb.append(ms);
78         }
79         if (mx>=0) {
80           sb.append(" -mx");
81           sb.append(mx);
82         }
83         if (classpath!=null) {
84           sb.append(" -classpath ");
85           sb.append(classpath);
86         }
87         if (prof!=null) warn("jdk13 does not support prof");
88         if (verify) warn("jdk13 does not support verify");
89         if (noverify) warn("jdk13 does not support noverify");
90         if (nojit) sb.append(" -Djava.compiler=NONE");
91         if (D != null)
92           for (int i=0; i<D.size();i++) {
93             sb.append(" -D");
94             sb.append((String JavaDoc)(D.elementAt(i)));
95           }
96     }
97     public String JavaDoc getDintro() { return "-D"; }
98 }
99
Popular Tags