hudson.os.windows
Class ManagedWindowsServiceLauncher

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<ComputerLauncher>
      extended by hudson.slaves.ComputerLauncher
          extended by hudson.os.windows.ManagedWindowsServiceLauncher
All Implemented Interfaces:
ExtensionPoint, Describable<ComputerLauncher>

public class ManagedWindowsServiceLauncher
extends ComputerLauncher

Windows slave installed/managed as a service entirely remotely

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class ManagedWindowsServiceLauncher.AccountInfo
           
static class ManagedWindowsServiceLauncher.DescriptorImpl
           
static class ManagedWindowsServiceLauncher.LogOnOption
           
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 String host
          Host name to connect to.
 String javaPath
           
 ManagedWindowsServiceLauncher.AccountInfo logOn
          Deprecated. Use account
 Secret password
           
 String userName
          "[DOMAIN\\]USERNAME" to follow the Windows convention.
 String vmargs
           
 
Fields inherited from class hudson.slaves.ComputerLauncher
LIST
 
Constructor Summary
ManagedWindowsServiceLauncher(String userName, String password)
           
ManagedWindowsServiceLauncher(String userName, String password, String host)
           
ManagedWindowsServiceLauncher(String userName, String password, String host, ManagedWindowsServiceAccount account, String vmargs)
           
ManagedWindowsServiceLauncher(String userName, String password, String host, ManagedWindowsServiceAccount account, String vmargs, String javaPath)
           
ManagedWindowsServiceLauncher(String userName, String password, String host, ManagedWindowsServiceLauncher.AccountInfo account)
           
 
Method Summary
 void afterDisconnect(SlaveComputer computer, TaskListener listener)
          Allows the ComputerLauncher to tidy-up after a disconnect.
protected  String determineHost(Computer c)
          Determines the host name (or the IP address) to connect to.
 ManagedWindowsServiceAccount getAccount()
           
 void launch(SlaveComputer computer, TaskListener listener)
          Launches the slave agent for the given Computer.
 Object readResolve()
           
 
Methods inherited from class hudson.slaves.ComputerLauncher
afterDisconnect, beforeDisconnect, beforeDisconnect, checkJavaVersion, isLaunchSupported, launch
 
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userName

public final String userName
"[DOMAIN\\]USERNAME" to follow the Windows convention.


password

public final Secret password

vmargs

public final String vmargs

javaPath

public final String javaPath

logOn

public final transient ManagedWindowsServiceLauncher.AccountInfo logOn
Deprecated. Use account

host

public final String host
Host name to connect to. For compatibility reasons, null if the same with the slave name.

Since:
1.419
Constructor Detail

ManagedWindowsServiceLauncher

public ManagedWindowsServiceLauncher(String userName,
                                     String password)

ManagedWindowsServiceLauncher

public ManagedWindowsServiceLauncher(String userName,
                                     String password,
                                     String host)

ManagedWindowsServiceLauncher

public ManagedWindowsServiceLauncher(String userName,
                                     String password,
                                     String host,
                                     ManagedWindowsServiceLauncher.AccountInfo account)

ManagedWindowsServiceLauncher

public ManagedWindowsServiceLauncher(String userName,
                                     String password,
                                     String host,
                                     ManagedWindowsServiceAccount account,
                                     String vmargs)

ManagedWindowsServiceLauncher

@DataBoundConstructor
public ManagedWindowsServiceLauncher(String userName,
                                                          String password,
                                                          String host,
                                                          ManagedWindowsServiceAccount account,
                                                          String vmargs,
                                                          String javaPath)
Method Detail

readResolve

public Object readResolve()

getAccount

public ManagedWindowsServiceAccount getAccount()

launch

public void launch(SlaveComputer computer,
                   TaskListener listener)
            throws IOException,
                   InterruptedException
Description copied from class: ComputerLauncher
Launches the slave agent for the given Computer.

If the slave agent is launched successfully, SlaveComputer.setChannel(InputStream, OutputStream, TaskListener, 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.) Also note that the normal return of this method call does not necessarily signify a successful launch. If someone programmatically calls this method and wants to find out if the launch was a success, use Computer.isOnline() at the end.

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

Overrides:
launch in class ComputerLauncher
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

determineHost

protected String determineHost(Computer c)
Determines the host name (or the IP address) to connect to.


afterDisconnect

public void afterDisconnect(SlaveComputer computer,
                            TaskListener listener)
Description copied from class: ComputerLauncher
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.

Overrides:
afterDisconnect in class ComputerLauncher


Copyright © 2004-2013. All Rights Reserved.