Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derbyTesting.functionTests.harness
Class jvm  view jvm download jvm.java

java.lang.Object
  extended byorg.apache.derbyTesting.functionTests.harness.jvm
Direct Known Subclasses:
currentjvm, ibm13, ibm14, j9_13, j9_22, j9_foundation, jdk13, jdk14, jdk15

public abstract class jvm
extends java.lang.Object

This class provides the interface and mechanism for plugging VMs into the system. Typically you only need to add a new implementation if your supported attributes or command line building are different from those that exist.

this class has fields for all options that a JDK VM can take, that is the reference point for all others. Note some VMs (like jview) don't take all options and will ignore them (like -mx). Defining the system property "verbose" to 1 will give you warnings for ignored properties in a properly implemented subclass.

here is the canonical output from java -help for options we take:

    -noasyncgc        don't allow asynchronous garbage collection
    -verbosegc        print a message when garbage collection occurs
    -noclassgc        disable class garbage collection
    -ss       set the maximum native stack size for any thread
    -oss      set the maximum Java stack size for any thread
    -ms       set the initial Java heap size
    -mx       set the maximum Java heap size
    -classpath 
                      list directories in which to look for classes
    -prof[:]    output profiling data to .\java.prof or .\
    -verify           verify all classes when read in
    -noverify         do not verify any class
    -nojit            turn off the jit
    -Dprop=name       define property; can be specified more than once
  


Field Summary
 java.lang.String classpath
           
 java.util.Vector D
           
private static java.lang.String DEFAULT_CODEBASE
           
private static java.lang.String DEFAULT_POLICY
           
 java.lang.String flags
           
 int imajor
           
 int iminor
           
 java.lang.String javaCmd
           
 java.lang.String majorVersion
           
 java.lang.String minorVersion
           
 long ms
           
 long mx
           
 boolean noasyncgc
           
 boolean noclassgc
           
 boolean nojit
           
 boolean noverify
           
 long oss
           
 java.lang.String prof
           
 long ss
           
 boolean verbosegc
           
(package private)  int verboselevel
           
 boolean verify
           
 
Constructor Summary
jvm()
           
jvm(boolean noasyncgc, boolean verbosegc, boolean noclassgc, long ss, long oss, long ms, long mx, java.lang.String classpath, java.lang.String prof, boolean verify, boolean noverify, boolean nojit, java.util.Vector D)
           
jvm(long ms, long mx, java.lang.String classpath, java.util.Vector D)
           
jvm(java.lang.String classpath, java.util.Vector D)
           
 
Method Summary
private  java.lang.String baseName(java.lang.String resourceName)
          Get the base file name from a resource name string
protected static java.lang.String findCodeBase()
           
 java.util.Vector getCommandLine()
           
static jvm getCurrentJvm()
          Get the current JVM using the normal test harness rules for finding a JVM.
abstract  java.lang.String getDintro()
          return the property definition introducer, with a space if a separator is needed.
static jvm getJvm(java.lang.String jvmName)
          pass in class name for JVM.
 int getMajorVersion()
          Return the major version number
 int getMinorVersion()
          Return the major version number
abstract  java.lang.String getName()
           
protected static java.lang.String guessWSHome()
          Find $WS based on the assumption that JAVA_HOME is $WS/ or $WS//jre
 void setClasspath(java.lang.String classpath)
           
 void setD(java.util.Vector D)
           
 void setFlags(java.lang.String flags)
           
 void setJavaCmd(java.lang.String jcmd)
           
 void setMs(long ms)
           
 void setMx(long mx)
           
 void setNoasyncgc(boolean noasyncgc)
           
 void setNoclassgc(boolean noclassgc)
           
 void setNojit(boolean nojit)
           
 void setNoverify(boolean noverify)
           
 void setOss(long oss)
           
 void setProf(java.lang.String prof)
           
protected  void setSecurityProps()
          set up security properties for server command line.
 void setSs(long ss)
           
 void setVerbosegc(boolean verbosegc)
           
 void setVerify(boolean verify)
           
 void setVersion()
          Get the current JVM using the normal test harness rules for finding a JVM.
 void warn(java.lang.String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flags

public java.lang.String flags

noasyncgc

public boolean noasyncgc

verbosegc

public boolean verbosegc

noclassgc

public boolean noclassgc

ss

public long ss

oss

public long oss

ms

public long ms

mx

public long mx

classpath

public java.lang.String classpath

prof

public java.lang.String prof

verify

public boolean verify

noverify

public boolean noverify

nojit

public boolean nojit

D

public java.util.Vector D

javaCmd

public java.lang.String javaCmd

majorVersion

public java.lang.String majorVersion

minorVersion

public java.lang.String minorVersion

imajor

public int imajor

iminor

public int iminor

DEFAULT_POLICY

private static java.lang.String DEFAULT_POLICY

DEFAULT_CODEBASE

private static java.lang.String DEFAULT_CODEBASE

verboselevel

int verboselevel
Constructor Detail

jvm

public jvm()

jvm

public jvm(boolean noasyncgc,
           boolean verbosegc,
           boolean noclassgc,
           long ss,
           long oss,
           long ms,
           long mx,
           java.lang.String classpath,
           java.lang.String prof,
           boolean verify,
           boolean noverify,
           boolean nojit,
           java.util.Vector D)

jvm

public jvm(java.lang.String classpath,
           java.util.Vector D)

jvm

public jvm(long ms,
           long mx,
           java.lang.String classpath,
           java.util.Vector D)
Method Detail

getDintro

public abstract java.lang.String getDintro()
return the property definition introducer, with a space if a separator is needed.


getName

public abstract java.lang.String getName()

setNoasyncgc

public void setNoasyncgc(boolean noasyncgc)

setNoclassgc

public void setNoclassgc(boolean noclassgc)

setVerbosegc

public void setVerbosegc(boolean verbosegc)

setSs

public void setSs(long ss)

setOss

public void setOss(long oss)

setMs

public void setMs(long ms)

setMx

public void setMx(long mx)

setClasspath

public void setClasspath(java.lang.String classpath)

setProf

public void setProf(java.lang.String prof)

setVerify

public void setVerify(boolean verify)

setNoverify

public void setNoverify(boolean noverify)

setNojit

public void setNojit(boolean nojit)

setD

public void setD(java.util.Vector D)

setFlags

public void setFlags(java.lang.String flags)

setJavaCmd

public void setJavaCmd(java.lang.String jcmd)

getCommandLine

public java.util.Vector getCommandLine()

warn

public void warn(java.lang.String msg)

getJvm

public static jvm getJvm(java.lang.String jvmName)
                  throws java.lang.ClassNotFoundException,
                         java.lang.InstantiationException,
                         java.lang.IllegalAccessException
pass in class name for JVM. If we can't find it, try also org.apache.derbyTesting.functionTests.harness.


getCurrentJvm

public static jvm getCurrentJvm()
                         throws java.lang.Exception
Get the current JVM using the normal test harness rules for finding a JVM.
  1. If the sytem property 'jvm' use this name.
  2. else if the java version starts with 1.2 use "jdk12".
  3. else use "currentjvm".


getMajorVersion

public int getMajorVersion()
Return the major version number


getMinorVersion

public int getMinorVersion()
Return the major version number


setVersion

public void setVersion()
                throws java.lang.Exception
Get the current JVM using the normal test harness rules for finding a JVM.


guessWSHome

protected static java.lang.String guessWSHome()
Find $WS based on the assumption that JAVA_HOME is $WS/ or $WS//jre


findCodeBase

protected static java.lang.String findCodeBase()

setSecurityProps

protected void setSecurityProps()
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
set up security properties for server command line.


baseName

private java.lang.String baseName(java.lang.String resourceName)
Get the base file name from a resource name string