hudson.slaves
Class ComputerLauncher

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<ComputerLauncher>
      extended by hudson.slaves.ComputerLauncher
All Implemented Interfaces:
ExtensionPoint, Describable<ComputerLauncher>
Direct Known Subclasses:
CommandLauncher, ComputerLauncherFilter, DelegatingComputerLauncher, JNLPLauncher

public abstract class ComputerLauncher
extends AbstractDescribableImpl<ComputerLauncher>
implements ExtensionPoint

Extension point to allow control over how Computers are "launched", meaning how they get connected to their slave agent program.

Associated View

main.jelly
This page will be rendered into the top page of the computer (/computer/NAME/) Useful for showing launch related commands and status reports.

Since:
24-Apr-2008 22:12:35
Author:
Stephen Connolly
See Also:
ComputerConnector

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
static DescriptorList<ComputerLauncher> LIST
          Deprecated. as of 1.281 Use Extension for registration, and use Hudson.getDescriptorList(Class) for read access.
 
Constructor Summary
ComputerLauncher()
           
 
Method Summary
 void afterDisconnect(SlaveComputer computer, StreamTaskListener listener)
          Deprecated. as of 1.304 Use afterDisconnect(SlaveComputer, TaskListener)
 void afterDisconnect(SlaveComputer computer, TaskListener listener)
          Allows the ComputerLauncher to tidy-up after a disconnect.
 void beforeDisconnect(SlaveComputer computer, StreamTaskListener listener)
          Deprecated. as of 1.304 Use beforeDisconnect(SlaveComputer, TaskListener)
 void beforeDisconnect(SlaveComputer computer, TaskListener listener)
          Allows the ComputerLauncher to prepare for a disconnect.
 boolean isLaunchSupported()
          Returns true if this ComputerLauncher supports programatic launch of the slave agent in the target Computer.
 void launch(SlaveComputer computer, StreamTaskListener listener)
          Deprecated. as of 1.304 Use launch(SlaveComputer, TaskListener)
 void launch(SlaveComputer computer, TaskListener listener)
          Launches the slave agent for the given Computer.
 
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST

public static final DescriptorList<ComputerLauncher> LIST
Deprecated. as of 1.281 Use Extension for registration, and use Hudson.getDescriptorList(Class) for read access.
All registered ComputerLauncher implementations.

Constructor Detail

ComputerLauncher

public ComputerLauncher()
Method Detail

isLaunchSupported

public boolean isLaunchSupported()
Returns true if this ComputerLauncher supports programatic launch of the slave agent in the target Computer.


launch

public void launch(SlaveComputer computer,
                   TaskListener listener)
            throws IOException,
                   InterruptedException
Launches the slave agent for the given Computer.

If the slave agent is launched successfully, SlaveComputer.setChannel(java.io.InputStream, java.io.OutputStream, TaskListener, hudson.remoting.Channel.Listener) should be invoked in the end to notify Hudson of the established connection. The operation could also fail, in which case there's no need to make any callback notification, (except to notify the user of the failure through StreamTaskListener.)

This method must operate synchronously. Asynchrony is provided by Computer.connect(boolean) and its correct operation depends on this.

Parameters:
listener - The progress of the launch, as well as any error, should be sent to this listener.
Throws:
IOException - if the method throws an IOException or InterruptedException, the launch was considered a failure and the stack trace is reported into the listener. This handling is just so that the implementation of this method doesn't have to dilligently catch those exceptions.
InterruptedException

launch

public void launch(SlaveComputer computer,
                   StreamTaskListener listener)
            throws IOException,
                   InterruptedException
Deprecated. as of 1.304 Use launch(SlaveComputer, TaskListener)

Throws:
IOException
InterruptedException

afterDisconnect

public void afterDisconnect(SlaveComputer computer,
                            TaskListener listener)
Allows the ComputerLauncher to tidy-up after a disconnect.

This method is invoked after the Channel to this computer is terminated.

Disconnect operation is performed asynchronously, so there's no guarantee that the corresponding SlaveComputer exists for the duration of the operation.


afterDisconnect

public void afterDisconnect(SlaveComputer computer,
                            StreamTaskListener listener)
Deprecated. as of 1.304 Use afterDisconnect(SlaveComputer, TaskListener)


beforeDisconnect

public void beforeDisconnect(SlaveComputer computer,
                             TaskListener listener)
Allows the ComputerLauncher to prepare for a disconnect.

This method is invoked before the Channel to this computer is terminated, thus the channel is still accessible from SlaveComputer.getChannel(). If the channel is terminated unexpectedly, this method will not be invoked, as the channel is already gone.

Disconnect operation is performed asynchronously, so there's no guarantee that the corresponding SlaveComputer exists for the duration of the operation.


beforeDisconnect

public void beforeDisconnect(SlaveComputer computer,
                             StreamTaskListener listener)
Deprecated. as of 1.304 Use beforeDisconnect(SlaveComputer, TaskListener)



Copyright © 2004-2013 Hudson. All Rights Reserved.