Class JNLPLauncher
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<ComputerLauncher>
-
- hudson.slaves.ComputerLauncher
-
- hudson.slaves.JNLPLauncher
-
- All Implemented Interfaces:
ExtensionPoint,Describable<ComputerLauncher>
public class JNLPLauncher extends ComputerLauncher
ComputerLaunchervia inbound connections.- Author:
- Stephen Connolly, Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJNLPLauncher.DescriptorImpl-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static StringCUSTOM_INBOUND_URL_PROPERTYstatic Descriptor<ComputerLauncher>DESCRIPTORDeprecated.as of 1.XXX UseJenkins.getDescriptor(Class)StringtunnelIf the agent needs to tunnel the connection to the controller, specify the "host:port" here.StringvmargsDeprecated.No longer used.-
Fields inherited from class hudson.slaves.ComputerLauncher
LIST
-
-
Constructor Summary
Constructors Constructor Description JNLPLauncher()Deprecated.This Launcher does not enable the work directory.JNLPLauncher(boolean enableWorkDir)Constructor with default options.JNLPLauncher(String tunnel)JNLPLauncher(String tunnel, String vmargs)Deprecated.JNLPLauncher(String tunnel, String vmargs, RemotingWorkDirSettings workDirSettings)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetInboundAgentUrl()Overrides the url that inbound TCP agents should connect to as advertised in the agent.jnlp file.StringgetWorkDirOptions(Computer computer)Gets work directory options as a String.RemotingWorkDirSettingsgetWorkDirSettings()Returns work directory settings.booleanisLaunchSupported()Returns true if thisComputerLaunchersupports programmatic launch of the agent in the targetComputer.booleanisWebSocket()voidlaunch(SlaveComputer computer, TaskListener listener)Launches the agent for the givenComputer.protected ObjectreadResolve()voidsetWebSocket(boolean webSocket)voidsetWorkDirSettings(RemotingWorkDirSettings workDirSettings)-
Methods inherited from class hudson.slaves.ComputerLauncher
afterDisconnect, afterDisconnect, beforeDisconnect, beforeDisconnect, checkJavaVersion, launch
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Field Detail
-
tunnel
@CheckForNull public final String tunnel
If the agent needs to tunnel the connection to the controller, specify the "host:port" here. This can include the special syntax "host:" and ":port" to indicate the default host/port shall be used.Null if no tunneling is necessary.
- Since:
- 1.250
-
vmargs
@Deprecated public final transient String vmargs
Deprecated.No longer used.
-
CUSTOM_INBOUND_URL_PROPERTY
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final String CUSTOM_INBOUND_URL_PROPERTY
- See Also:
getInboundAgentUrl(), Constant Field Values
-
DESCRIPTOR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Descriptor<ComputerLauncher> DESCRIPTOR
Deprecated.as of 1.XXX UseJenkins.getDescriptor(Class)
-
-
Constructor Detail
-
JNLPLauncher
@Deprecated public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs, @CheckForNull RemotingWorkDirSettings workDirSettings)
Deprecated.Constructor.- Parameters:
tunnel- Tunnel settingsvmargs- JVM argumentsworkDirSettings- Settings for Work Directory management in Remoting. Ifnull,RemotingWorkDirSettings.getEnabledDefaults()will be used to enable work directories by default in new agents.- Since:
- 2.68
-
JNLPLauncher
@DataBoundConstructor public JNLPLauncher(@CheckForNull String tunnel)
-
JNLPLauncher
@Deprecated public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs)
Deprecated.
-
JNLPLauncher
@Deprecated public JNLPLauncher()
Deprecated.This Launcher does not enable the work directory. It is recommended to useJNLPLauncher(boolean)
-
JNLPLauncher
public JNLPLauncher(boolean enableWorkDir)
Constructor with default options.- Parameters:
enableWorkDir- Iftrue, the work directory will be enabled with default settings.
-
-
Method Detail
-
readResolve
protected Object readResolve()
-
getWorkDirSettings
@NonNull public RemotingWorkDirSettings getWorkDirSettings()
Returns work directory settings.- Since:
- 2.72
-
setWorkDirSettings
@DataBoundSetter public final void setWorkDirSettings(@NonNull RemotingWorkDirSettings workDirSettings)
-
isLaunchSupported
public boolean isLaunchSupported()
Description copied from class:ComputerLauncherReturns true if thisComputerLaunchersupports programmatic launch of the agent in the targetComputer.- Overrides:
isLaunchSupportedin classComputerLauncher
-
isWebSocket
public boolean isWebSocket()
- Since:
- 2.216
-
setWebSocket
@DataBoundSetter public void setWebSocket(boolean webSocket)
- Since:
- 2.216
-
launch
public void launch(SlaveComputer computer, TaskListener listener)
Description copied from class:ComputerLauncherLaunches the agent for the givenComputer.If the 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 throughStreamTaskListener.) 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, useComputer.isOnline()at the end.This method must operate synchronously. Asynchrony is provided by
Computer.connect(boolean)and its correct operation depends on this.- Overrides:
launchin classComputerLauncherlistener- The progress of the launch, as well as any error, should be sent to this listener.
-
getWorkDirOptions
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getWorkDirOptions(@NonNull Computer computer)
Gets work directory options as a String. In public APIgetWorkDirSettings().toCommandLineArgs(computer)should be used instead- Parameters:
computer- Computer- Returns:
- Command line options for launching with the WorkDir
-
getInboundAgentUrl
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static String getInboundAgentUrl()
Overrides the url that inbound TCP agents should connect to as advertised in the agent.jnlp file. If not set, the default behavior is unchanged and returns the root URL. This enables using a private address for inbound tcp agents, separate from Jenkins root URL.- See Also:
- JENKINS-63222
-
-