de.esprit.appsuite.task.vm

## Class JavaCommand

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.TransferableObject
    - - de.esprit.appsuite.task.vm.JavaCommand

- All Implemented Interfaces:
    DeepCloneable, Dumpable, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    JavaVmLaunchCommand, StartClientCommand, StartServerCommand

      public class JavaCommand
      extends TransferableObject

  A `JavaCommand` is supposed to start a java program within a foreign VM. It encapsulates all information needed to create the platform specific command line for launching. The startup of the foreign command is actually done via a special `JavaCommandLauncher` class which is packed into a temporary JAR file and made known to the foreign VM.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `JAVA_LAUNCH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaCommand(java.io.File javaHomeDir, java.io.File installationRootDir, java.lang.String mainClassName)`
    `JavaCommand(JavaVersion javaVersion, java.io.File installationRootDir, java.lang.String mainClassName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addClassPathEntry(java.io.File dir)`
    `void` | `addClassPathEntry(java.io.File baseDir, java.lang.String jarEntry)`
    `void` | `addClassPathEntry(java.lang.String jarEntry)`
    `void` | `addCommandArg(java.lang.String cmdArg)`
    `void` | `addCommandArg(java.lang.String option, java.lang.String cmdArg)`
    `void` | `addNativeLibraryPath(java.lang.String libPath)`
    `void` | `addSystemPathProperty(java.io.File baseDir, java.lang.String key, java.lang.String relativeFilePath)`
    `void` | `addSystemPathProperty(java.lang.String key, java.lang.String relativeFilePath)`
    `void` | `addSystemProperty(java.lang.String key, java.lang.String value)`
    `void` | `addVmArg(java.lang.String vmArg)`
    `java.lang.String[]` | `createCommandLine()`
    `java.util.Map` | `fillEnv(java.util.Map<java.lang.String,java.lang.String> envMap)`
    `java.util.List<java.lang.String>` | `getClassPathList()`
    `java.lang.String[]` | `getCommandLineArgs()`
    `java.lang.String` | `getDescription()`
    `java.io.File` | `getInstallationRootDir()`
    `JavaVersion` | `getJavaVersion()`
    `protected java.lang.Class` | `getLauncherClass()`
    `java.lang.String` | `getName()`
    `java.lang.String` | `getVersion()`
    `de.esprit.appsuite.task.vm.JavaVmArgs` | `getVmArgs()`
    `java.io.File` | `getWorkingDir()`
    `void` | `publishLauncherClass()`
    `void` | `putEnv(java.lang.String key, java.lang.String value)`
    `void` | `setDescription(java.lang.String cmdDescription)`
    `void` | `setJavaExecutable(java.io.File javaExecutable)`
    `void` | `setName(java.lang.String cmdName)`
    `void` | `setVersion(java.lang.String cmdVersion)`
    `void` | `setWorkingDir(java.io.File workingDir)`
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.

    - ### Methods inherited from class de.esprit.common.util.TransferableObject

      `clone, deepClone`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### JAVA_LAUNCH

          public static final java.lang.String JAVA_LAUNCH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JavaCommand

          public JavaCommand(JavaVersion javaVersion,
                     java.io.File installationRootDir,
                     java.lang.String mainClassName)

      Parameters:
        `javaVersion` - is the `JavaVersion` read by the `AbstractJavaVersionScanner`.
        `installationRootDir` - is the homeDir of the foreign software to run.
        `mainClassName` - is the className of the main-class to be executed.

    - #### JavaCommand

          public JavaCommand(java.io.File javaHomeDir,
                     java.io.File installationRootDir,
                     java.lang.String mainClassName)

      Parameters:
        `javaHomeDir` - is the homeDir of the java VM that should run the software.
        `installationRootDir` - is the homeDir of the foreign software to run.
        `mainClassName` - is the className of the main-class to be executed.

  - ### Method Detail

    - #### getJavaVersion

          public JavaVersion getJavaVersion()

    - #### setJavaExecutable

          public void setJavaExecutable(java.io.File javaExecutable)

    - #### getName

          public java.lang.String getName()

    - #### getVmArgs

          public de.esprit.appsuite.task.vm.JavaVmArgs getVmArgs()

    - #### setName

          public void setName(java.lang.String cmdName)

    - #### getVersion

          public java.lang.String getVersion()

    - #### setVersion

          public void setVersion(java.lang.String cmdVersion)

    - #### getDescription

          public java.lang.String getDescription()

    - #### setDescription

          public void setDescription(java.lang.String cmdDescription)

    - #### getWorkingDir

          public java.io.File getWorkingDir()

    - #### setWorkingDir

          public void setWorkingDir(java.io.File workingDir)

    - #### getInstallationRootDir

          public java.io.File getInstallationRootDir()

    - #### addSystemPathProperty

          public void addSystemPathProperty(java.lang.String key,
                                   java.lang.String relativeFilePath)

    - #### addSystemPathProperty

          public void addSystemPathProperty(java.io.File baseDir,
                                   java.lang.String key,
                                   java.lang.String relativeFilePath)

    - #### addSystemProperty

          public void addSystemProperty(java.lang.String key,
                               java.lang.String value)

    - #### addVmArg

          public void addVmArg(java.lang.String vmArg)

    - #### addClassPathEntry

          public void addClassPathEntry(java.io.File dir)

    - #### addClassPathEntry

          public void addClassPathEntry(java.io.File baseDir,
                               java.lang.String jarEntry)

    - #### getClassPathList

          public java.util.List<java.lang.String> getClassPathList()

    - #### addClassPathEntry

          public void addClassPathEntry(java.lang.String jarEntry)

    - #### addCommandArg

          public void addCommandArg(java.lang.String cmdArg)

    - #### addCommandArg

          public void addCommandArg(java.lang.String option,
                           java.lang.String cmdArg)

    - #### putEnv

          public void putEnv(java.lang.String key,
                    java.lang.String value)

    - #### addNativeLibraryPath

          public void addNativeLibraryPath(java.lang.String libPath)

    - #### fillEnv

          public java.util.Map fillEnv(java.util.Map<java.lang.String,java.lang.String> envMap)

    - #### createCommandLine

          public java.lang.String[] createCommandLine()

    - #### publishLauncherClass

          public void publishLauncherClass()
                                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getLauncherClass

          protected java.lang.Class getLauncherClass()

    - #### getCommandLineArgs

          public java.lang.String[] getCommandLineArgs()

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.