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
ComputerLauncher
via inbound connections.- Author:
- Stephen Connolly, Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JNLPLauncher.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static String
CUSTOM_INBOUND_URL_PROPERTY
static Descriptor<ComputerLauncher>
DESCRIPTOR
Deprecated.as of 1.XXX UseJenkins.getDescriptor(Class)
String
tunnel
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.String
vmargs
Deprecated.No longer used.-
Fields inherited from class hudson.slaves.ComputerLauncher
LIST
-
-
Constructor Summary
Constructors Constructor Description JNLPLauncher()
JNLPLauncher(boolean enableWorkDir)
Deprecated.no useful properties, useJNLPLauncher()
JNLPLauncher(String tunnel)
Deprecated.no useful properties, useJNLPLauncher()
JNLPLauncher(String tunnel, String vmargs)
Deprecated.no useful properties, useJNLPLauncher()
JNLPLauncher(String tunnel, String vmargs, RemotingWorkDirSettings workDirSettings)
Deprecated.no useful properties, useJNLPLauncher()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getInboundAgentUrl()
Overrides the url that inbound TCP agents should connect to as advertised in the agent.jnlp file.String
getRemotingOptionsUnix(Computer computer)
String
getRemotingOptionsWindows(Computer computer)
String
getTunnel()
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.String
getWorkDirOptions(Computer computer)
Gets work directory options as a String.RemotingWorkDirSettings
getWorkDirSettings()
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.boolean
isConfigured()
boolean
isLaunchSupported()
Returns true if thisComputerLauncher
supports programmatic launch of the agent in the targetComputer
.boolean
isWebSocket()
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.void
launch(SlaveComputer computer, TaskListener listener)
Launches the agent for the givenComputer
.protected Object
readResolve()
void
setTunnel(String tunnel)
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.void
setWebSocket(boolean webSocket)
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.void
setWorkDirSettings(RemotingWorkDirSettings workDirSettings)
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.-
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 String tunnel
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
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.no useful properties, useJNLPLauncher()
-
JNLPLauncher
@Deprecated public JNLPLauncher(@CheckForNull String tunnel)
Deprecated.no useful properties, useJNLPLauncher()
-
JNLPLauncher
@Deprecated public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs)
Deprecated.no useful properties, useJNLPLauncher()
-
JNLPLauncher
@DataBoundConstructor public JNLPLauncher()
-
JNLPLauncher
@Deprecated public JNLPLauncher(boolean enableWorkDir)
Deprecated.no useful properties, useJNLPLauncher()
-
-
Method Detail
-
readResolve
protected Object readResolve()
-
getWorkDirSettings
public RemotingWorkDirSettings getWorkDirSettings()
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
setWorkDirSettings
@DataBoundSetter public final void setWorkDirSettings(@NonNull RemotingWorkDirSettings workDirSettings)
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
isLaunchSupported
public boolean isLaunchSupported()
Description copied from class:ComputerLauncher
Returns true if thisComputerLauncher
supports programmatic launch of the agent in the targetComputer
.- Overrides:
isLaunchSupported
in classComputerLauncher
-
isWebSocket
public boolean isWebSocket()
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
setWebSocket
@DataBoundSetter public void setWebSocket(boolean webSocket)
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
getTunnel
public String getTunnel()
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
setTunnel
@DataBoundSetter public void setTunnel(String tunnel)
Deprecated (only used with deprecated-jnlpUrl
mode), but cannot mark it as such without breaking CasC.
-
launch
public void launch(SlaveComputer computer, TaskListener listener)
Description copied from class:ComputerLauncher
Launches 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:
launch
in classComputerLauncher
listener
- The progress of the launch, as well as any error, should be sent to this listener.
-
getRemotingOptionsUnix
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getRemotingOptionsUnix(@NonNull Computer computer)
-
getRemotingOptionsWindows
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getRemotingOptionsWindows(@NonNull Computer computer)
-
isConfigured
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public boolean isConfigured()
-
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
-
-