hudson.plugins.labmanager
Class LabManagerVirtualMachineLauncher

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<hudson.slaves.ComputerLauncher>
      extended by hudson.slaves.ComputerLauncher
          extended by hudson.plugins.labmanager.LabManagerVirtualMachineLauncher
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.slaves.ComputerLauncher>

public class LabManagerVirtualMachineLauncher
extends hudson.slaves.ComputerLauncher

ComputerLauncher for Lab Manager that waits for the Virtual Machine to really come up before proceeding to the real user-specified ComputerLauncher.

Author:
Tom Rini

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.slaves.ComputerLauncher
LIST
 
Constructor Summary
LabManagerVirtualMachineLauncher(hudson.slaves.ComputerLauncher delegate, String lmDescription, String vmName, String idleOption, Boolean overrideLaunchSupported, String launchDelay)
           
 
Method Summary
 void afterDisconnect(hudson.slaves.SlaveComputer slaveComputer, hudson.model.TaskListener taskListener)
          Handle bringing down the Virtual Machine.
 void beforeDisconnect(hudson.slaves.SlaveComputer slaveComputer, hudson.model.TaskListener taskListener)
           
 LabManager findOurLmInstance()
          Determine what LabManager object controls this slave.
 hudson.slaves.ComputerLauncher getDelegate()
           
 hudson.model.Descriptor<hudson.slaves.ComputerLauncher> getDescriptor()
           
 String getLmDescription()
           
 Boolean getOverrideLaunchSupported()
           
 String getVmName()
           
 boolean isLaunchSupported()
           
 void launch(hudson.slaves.SlaveComputer slaveComputer, hudson.model.TaskListener taskListener)
          Do the real work of launching the machine via SOAP.
 void setOverrideLaunchSupported(Boolean overrideLaunchSupported)
           
 
Methods inherited from class hudson.slaves.ComputerLauncher
afterDisconnect, beforeDisconnect, launch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabManagerVirtualMachineLauncher

@DataBoundConstructor
public LabManagerVirtualMachineLauncher(hudson.slaves.ComputerLauncher delegate,
                                                             String lmDescription,
                                                             String vmName,
                                                             String idleOption,
                                                             Boolean overrideLaunchSupported,
                                                             String launchDelay)
Parameters:
delegate - The real ComputerLauncher we have been passed.
lmDescription - Human reable description of the Lab Manager instance.
vmName - The 'VM Name' field in the configuration in Lab Manager.
idleOption - The choice of action to take when the slave is deemed idle.
overrideLaunchSupported - Boolean to set of we force isLaunchSupported to always return True.
launchDelay - How long to wait between bringing up the VM and trying to connect to it as a slave.
Method Detail

findOurLmInstance

public LabManager findOurLmInstance()
                             throws RuntimeException
Determine what LabManager object controls this slave. Once we have that we can call and get the information out that we need to perform SOAP calls.

Throws:
RuntimeException

launch

public void launch(hudson.slaves.SlaveComputer slaveComputer,
                   hudson.model.TaskListener taskListener)
            throws IOException,
                   InterruptedException
Do the real work of launching the machine via SOAP.

Overrides:
launch in class hudson.slaves.ComputerLauncher
Throws:
IOException
InterruptedException

afterDisconnect

public void afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
                            hudson.model.TaskListener taskListener)
Handle bringing down the Virtual Machine.

Overrides:
afterDisconnect in class hudson.slaves.ComputerLauncher

getLmDescription

public String getLmDescription()

getVmName

public String getVmName()

getDelegate

public hudson.slaves.ComputerLauncher getDelegate()

getOverrideLaunchSupported

public Boolean getOverrideLaunchSupported()

setOverrideLaunchSupported

public void setOverrideLaunchSupported(Boolean overrideLaunchSupported)

isLaunchSupported

public boolean isLaunchSupported()
Overrides:
isLaunchSupported in class hudson.slaves.ComputerLauncher

beforeDisconnect

public void beforeDisconnect(hudson.slaves.SlaveComputer slaveComputer,
                             hudson.model.TaskListener taskListener)
Overrides:
beforeDisconnect in class hudson.slaves.ComputerLauncher

getDescriptor

public hudson.model.Descriptor<hudson.slaves.ComputerLauncher> getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.slaves.ComputerLauncher>
Overrides:
getDescriptor in class hudson.model.AbstractDescribableImpl<hudson.slaves.ComputerLauncher>


Copyright © 2004-2011. All Rights Reserved.