hudson.slaves
Class Channels

java.lang.Object
  extended by hudson.slaves.Channels

public class Channels
extends Object

Various convenient subtype of Channels.

Author:
Kohsuke Kawaguchi

Constructor Summary
Channels()
           
 
Method Summary
static hudson.remoting.Channel forProcess(String name, ExecutorService execService, InputStream in, OutputStream out, OutputStream header, Proc proc)
          Creates a channel that wraps a remote process, so that when we shut down the connection we kill the process.
static hudson.remoting.Channel forProcess(String name, ExecutorService execService, InputStream in, OutputStream out, Proc proc)
          Deprecated. since 2009-04-13. Use forProcess(String, ExecutorService, InputStream, OutputStream, OutputStream, Proc)
static hudson.remoting.Channel forProcess(String name, ExecutorService execService, Process proc, OutputStream header)
           
static hudson.remoting.Channel newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String,String> systemProperties)
          Launches a new JVM with the given classpath and system properties, establish a communication channel, and return a Channel to it.
static hudson.remoting.Channel newJVM(String displayName, TaskListener listener, JVMBuilder vmb, FilePath workDir, ClasspathBuilder classpath)
          Launches a new JVM with the given classpath, establish a communication channel, and return a Channel to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Channels

public Channels()
Method Detail

forProcess

public static hudson.remoting.Channel forProcess(String name,
                                                 ExecutorService execService,
                                                 InputStream in,
                                                 OutputStream out,
                                                 Proc proc)
                                          throws IOException
Deprecated. since 2009-04-13. Use forProcess(String, ExecutorService, InputStream, OutputStream, OutputStream, Proc)

Throws:
IOException

forProcess

public static hudson.remoting.Channel forProcess(String name,
                                                 ExecutorService execService,
                                                 InputStream in,
                                                 OutputStream out,
                                                 OutputStream header,
                                                 Proc proc)
                                          throws IOException
Creates a channel that wraps a remote process, so that when we shut down the connection we kill the process.

Throws:
IOException

forProcess

public static hudson.remoting.Channel forProcess(String name,
                                                 ExecutorService execService,
                                                 Process proc,
                                                 OutputStream header)
                                          throws IOException
Throws:
IOException

newJVM

public static hudson.remoting.Channel newJVM(String displayName,
                                             TaskListener listener,
                                             FilePath workDir,
                                             ClasspathBuilder classpath,
                                             Map<String,String> systemProperties)
                                      throws IOException
Launches a new JVM with the given classpath and system properties, establish a communication channel, and return a Channel to it.

Parameters:
displayName - Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". This token is used for messages to listener.
listener - The progress of the launcher and the failure information will be sent here. Must not be null.
workDir - If non-null, the new JVM will have this directory as the working directory. This must be a local path.
classpath - The classpath of the new JVM. Can be null if you just need 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.
systemProperties - If the new JVM should have a certain system properties set. Can be null.
Returns:
never null
Throws:
IOException
Since:
1.300

newJVM

public static hudson.remoting.Channel newJVM(String displayName,
                                             TaskListener listener,
                                             JVMBuilder vmb,
                                             FilePath workDir,
                                             ClasspathBuilder classpath)
                                      throws IOException
Launches a new JVM with the given classpath, establish a communication channel, and return a Channel to it.

Parameters:
displayName - Human readable name of what this JVM represents. For example "Selenium grid" or "Hadoop". This token is used for messages to listener.
listener - The progress of the launcher and the failure information will be sent here. Must not be null.
workDir - If non-null, the new JVM will have this directory as the working directory. This must be a local path.
classpath - The classpath of the new JVM. Can be null if you just need 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.
vmb - A partially configured JVMBuilder that allows the caller to fine-tune the launch parameter.
Returns:
never null
Throws:
IOException
Since:
1.361


Copyright © 2004-2013. All Rights Reserved.