/** * Launches a new JVM with the given classpath and system properties, establish a communication channel, * and return a {@link Channel} to it. * * @param displayName * Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". * This token is used for messages to {@code listener}. * @param listener * The progress of the launcher and the failure information will be sent here. Must not be null. * @param workDir * If non-null, the new JVM will have this directory as the working directory. This must be a local path. * @param classpath * The classpath of the new JVM. Can be null if you just need {@code agent.jar} (and everything else * can be sent over the channel.) But if you have jars that are known to be necessary by the new JVM, * setting it here will improve the classloading performance (by avoiding remote class file transfer.) * Classes in this classpath will also take precedence over any other classes that's sent via the channel * later, so it's also useful for making sure you get the version of the classes you want. * @param systemProperties * If the new JVM should have a certain system properties set. Can be null. * * @return * never null * @since 1.300 */ public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(systemProperties); return newJVM(displayName,listener,vmb,workDir,classpath); }
/** * Launches a new JVM with the given classpath and system properties, establish a communication channel, * and return a {@link Channel} to it. * * @param displayName * Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". * This token is used for messages to {@code listener}. * @param listener * The progress of the launcher and the failure information will be sent here. Must not be null. * @param workDir * If non-null, the new JVM will have this directory as the working directory. This must be a local path. * @param classpath * The classpath of the new JVM. Can be null if you just need {@code slave.jar} (and everything else * can be sent over the channel.) But if you have jars that are known to be necessary by the new JVM, * setting it here will improve the classloading performance (by avoiding remote class file transfer.) * Classes in this classpath will also take precedence over any other classes that's sent via the channel * later, so it's also useful for making sure you get the version of the classes you want. * @param systemProperties * If the new JVM should have a certain system properties set. Can be null. * * @return * never null * @since 1.300 */ public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(systemProperties); return newJVM(displayName,listener,vmb,workDir,classpath); }
/** * Launches a new JVM with the given classpath and system properties, establish a communication channel, * and return a {@link Channel} to it. * * @param displayName * Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". * This token is used for messages to {@code listener}. * @param listener * The progress of the launcher and the failure information will be sent here. Must not be null. * @param workDir * If non-null, the new JVM will have this directory as the working directory. This must be a local path. * @param classpath * The classpath of the new JVM. Can be null if you just need {@code agent.jar} (and everything else * can be sent over the channel.) But if you have jars that are known to be necessary by the new JVM, * setting it here will improve the classloading performance (by avoiding remote class file transfer.) * Classes in this classpath will also take precedence over any other classes that's sent via the channel * later, so it's also useful for making sure you get the version of the classes you want. * @param systemProperties * If the new JVM should have a certain system properties set. Can be null. * * @return * never null * @since 1.300 */ public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(systemProperties); return newJVM(displayName,listener,vmb,workDir,classpath); }
/** * Launches a new JVM with the given classpath and system properties, establish a communication channel, * and return a {@link Channel} to it. * * @param displayName * Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". * This token is used for messages to {@code listener}. * @param listener * The progress of the launcher and the failure information will be sent here. Must not be null. * @param workDir * If non-null, the new JVM will have this directory as the working directory. This must be a local path. * @param classpath * The classpath of the new JVM. Can be null if you just need {@code slave.jar} (and everything else * can be sent over the channel.) But if you have jars that are known to be necessary by the new JVM, * setting it here will improve the classloading performance (by avoiding remote class file transfer.) * Classes in this classpath will also take precedence over any other classes that's sent via the channel * later, so it's also useful for making sure you get the version of the classes you want. * @param systemProperties * If the new JVM should have a certain system properties set. Can be null. * * @return * never null * @since 1.300 */ public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(systemProperties); return newJVM(displayName,listener,vmb,workDir,classpath); }
/** * Launches a new JVM with the given classpath and system properties, establish a communication channel, * and return a {@link Channel} to it. * * @param displayName * Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". * This token is used for messages to {@code listener}. * @param listener * The progress of the launcher and the failure information will be sent here. Must not be null. * @param workDir * If non-null, the new JVM will have this directory as the working directory. This must be a local path. * @param classpath * The classpath of the new JVM. Can be null if you just need {@code slave.jar} (and everything else * can be sent over the channel.) But if you have jars that are known to be necessary by the new JVM, * setting it here will improve the classloading performance (by avoiding remote class file transfer.) * Classes in this classpath will also take precedence over any other classes that's sent via the channel * later, so it's also useful for making sure you get the version of the classes you want. * @param systemProperties * If the new JVM should have a certain system properties set. Can be null. * * @return * never null * @since 1.300 */ public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(systemProperties); return newJVM(displayName,listener,vmb,workDir,classpath); }
/** * Launches a new JVM with the given classpath and system properties, * establish a communication channel, and return a {@link Channel} to it. * * @param displayName Human readable name of what this JVM represents. For * example "Selenium grid" or "Hadoop". This token is used for messages to * {@code listener}. * @param listener The progress of the launcher and the failure information * will be sent here. Must not be null. * @param workDir If non-null, the new JVM will have this directory as the * working directory. This must be a local path. * @param classpath The classpath of the new JVM. Can be null if you just * need {@code slave.jar} (and everything else can be sent over the * channel.) But if you have jars that are known to be necessary by the new * JVM, setting it here will improve the classloading performance (by * avoiding remote class file transfer.) Classes in this classpath will also * take precedence over any other classes that's sent via the channel later, * so it's also useful for making sure you get the version of the classes * you want. * @param systemProperties If the new JVM should have a certain system * properties set. Can be null. * * @return never null * @since 1.300 */ public static Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String, String> systemProperties) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(systemProperties); return newJVM(displayName, listener, vmb, workDir, classpath); }
/** * Launches Hub in a separate JVM. * */ public static Channel createSeleniumGridVM(TaskListener listener) throws IOException { JVMBuilder vmb = new JVMBuilder(); vmb.systemProperties(null); return Channels.newJVM("Selenium Grid", listener, vmb, new FilePath(Jenkins.getInstance().getRootDir()), new ClasspathBuilder().add(findStandAloneServerJar()).add(findHtmlUnitDriverJar())); }