jetbrains.buildServer.agent.runner
Class JavaRunnerUtil

java.lang.Object
  extended by jetbrains.buildServer.agent.runner.JavaRunnerUtil

public class JavaRunnerUtil
extends java.lang.Object

Author:
Sergey.Anchipolevsky Date: 18.04.2007

Method Summary
static java.util.Map<java.lang.String,java.lang.String> composeSystemProperties(AgentRunningBuild build, BuildRunnerContext runnerContext)
          Returns "default" set of system properties for the java process being launched
static java.util.List<java.lang.String> extractJvmArgs(java.util.Map<java.lang.String,java.lang.String> runParameters)
           
static java.util.List<java.lang.String> extractJvmArgs(java.lang.String userDefinedArgs)
           
static java.lang.String findJavaExecutable(java.lang.String explicitlyDefinedJavaHome, java.util.Map<java.lang.String,java.lang.String> propsAndVars, java.lang.String baseDir)
          Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir.
static java.io.File findJavaExecutablePath(java.lang.String explicitlyDefinedJavaHome, java.util.Map<java.lang.String,java.lang.String> propsAndVars, java.lang.String baseDir)
          Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir.
static java.lang.String findJavaHome(java.lang.String explicitlyDefinedJavaHome, java.util.Map<java.lang.String,java.lang.String> propsAndVars, java.lang.String baseDir)
          Finds Java home - path to a directory where Java is installed.
static java.util.List<java.lang.String> makeParamListFromProps(java.util.Map<java.lang.String,java.lang.String> allProps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeParamListFromProps

public static java.util.List<java.lang.String> makeParamListFromProps(java.util.Map<java.lang.String,java.lang.String> allProps)

composeSystemProperties

@NotNull
public static java.util.Map<java.lang.String,java.lang.String> composeSystemProperties(@NotNull
                                                                                               AgentRunningBuild build,
                                                                                               @NotNull
                                                                                               BuildRunnerContext runnerContext)
Returns "default" set of system properties for the java process being launched

Parameters:
runParameters - run parameters
buildParameters - build parameters
tempDirPath - path to the temp directory
Returns:
Map with the properties

findJavaExecutable

@Nullable
public static java.lang.String findJavaExecutable(@Nullable
                                                           java.lang.String explicitlyDefinedJavaHome,
                                                           @NotNull
                                                           java.util.Map<java.lang.String,java.lang.String> propsAndVars,
                                                           @Nullable
                                                           java.lang.String baseDir)
Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir.

Parameters:
explicitlyDefinedJavaHome -
propsAndVars -
baseDir -
Returns:
path to existing java executable or null

findJavaExecutablePath

@Nullable
public static java.io.File findJavaExecutablePath(@Nullable
                                                           java.lang.String explicitlyDefinedJavaHome,
                                                           @NotNull
                                                           java.util.Map<java.lang.String,java.lang.String> propsAndVars,
                                                           @Nullable
                                                           java.lang.String baseDir)
Finds Java executable (java.exe) using the specified parameters: - explicitly defined path - map of properties and environment variables (with corresponding prefixes) If found path is relative, it will be resolved against base dir. No file existence checks are performed. Path will end with 'java.exe' in windows and with 'java' on all other OSes.

Parameters:
explicitlyDefinedJavaHome -
propsAndVars -
baseDir -
Returns:
found and possible resolved absolute path to java executable, null is returned is no candidate paths are found at all

findJavaHome

@Nullable
public static java.lang.String findJavaHome(@Nullable
                                                     java.lang.String explicitlyDefinedJavaHome,
                                                     @NotNull
                                                     java.util.Map<java.lang.String,java.lang.String> propsAndVars,
                                                     @Nullable
                                                     java.lang.String baseDir)
Finds Java home - path to a directory where Java is installed.

Parameters:
explicitlyDefinedJavaHome -
propsAndVars -
baseDir -
Returns:

extractJvmArgs

@NotNull
public static java.util.List<java.lang.String> extractJvmArgs(@NotNull
                                                                      java.util.Map<java.lang.String,java.lang.String> runParameters)

extractJvmArgs

@NotNull
public static java.util.List<java.lang.String> extractJvmArgs(@NotNull
                                                                      java.lang.String userDefinedArgs)