public class JNLPLauncher extends ComputerLauncher
ComputerLauncher
via inbound connections.Modifier and Type | Class and Description |
---|---|
static class |
JNLPLauncher.DescriptorImpl |
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static String |
CUSTOM_INBOUND_URL_PROPERTY |
static Descriptor<ComputerLauncher> |
DESCRIPTOR
Deprecated.
as of 1.XXX
Use
Jenkins.getDescriptor(Class) |
String |
tunnel
If the agent needs to tunnel the connection to the master,
specify the "host:port" here.
|
String |
vmargs
Additional JVM arguments.
|
LIST
Constructor and Description |
---|
JNLPLauncher()
Deprecated.
This Launcher does not enable the work directory.
It is recommended to use
JNLPLauncher(boolean) |
JNLPLauncher(boolean enableWorkDir)
Constructor with default options.
|
JNLPLauncher(String tunnel,
String vmargs) |
JNLPLauncher(String tunnel,
String vmargs,
RemotingWorkDirSettings workDirSettings)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static String |
getInboundAgentUrl()
Overrides the url that inbound TCP agents should connect to
as advertised in the agent.jnlp file.
|
String |
getWorkDirOptions(Computer computer)
Gets work directory options as a String.
|
RemotingWorkDirSettings |
getWorkDirSettings()
Returns work directory settings.
|
boolean |
isJavaWebStartSupported()
Returns true if Java Web Start button should be displayed.
|
boolean |
isLaunchSupported()
Returns true if this
ComputerLauncher supports
programmatic launch of the agent in the target Computer . |
boolean |
isWebSocket() |
void |
launch(SlaveComputer computer,
TaskListener listener)
Launches the agent for the given
Computer . |
protected Object |
readResolve() |
void |
setWebSocket(boolean webSocket) |
void |
setWorkDirSettings(RemotingWorkDirSettings workDirSettings) |
afterDisconnect, afterDisconnect, beforeDisconnect, beforeDisconnect, checkJavaVersion, launch
getDescriptor
@CheckForNull public final String tunnel
Null if no tunneling is necessary.
@CheckForNull public final String vmargs
@NonNull @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final String CUSTOM_INBOUND_URL_PROPERTY
getInboundAgentUrl()
,
Constant Field Values@Deprecated public static Descriptor<ComputerLauncher> DESCRIPTOR
Jenkins.getDescriptor(Class)
@Deprecated public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs, @CheckForNull RemotingWorkDirSettings workDirSettings)
tunnel
- Tunnel settingsvmargs
- JVM argumentsworkDirSettings
- Settings for Work Directory management in Remoting.
If null
, RemotingWorkDirSettings.getEnabledDefaults()
will be used to enable work directories by default in new agents.@DataBoundConstructor public JNLPLauncher(@CheckForNull String tunnel, @CheckForNull String vmargs)
@Deprecated public JNLPLauncher()
JNLPLauncher(boolean)
public JNLPLauncher(boolean enableWorkDir)
enableWorkDir
- If true
, the work directory will be enabled with default settings.protected Object readResolve()
@NonNull public RemotingWorkDirSettings getWorkDirSettings()
@DataBoundSetter public final void setWorkDirSettings(@NonNull RemotingWorkDirSettings workDirSettings)
public boolean isLaunchSupported()
ComputerLauncher
ComputerLauncher
supports
programmatic launch of the agent in the target Computer
.isLaunchSupported
in class ComputerLauncher
public boolean isWebSocket()
@DataBoundSetter public void setWebSocket(boolean webSocket)
public void launch(SlaveComputer computer, TaskListener listener)
ComputerLauncher
Computer
.
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 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.
launch
in class ComputerLauncher
listener
- The progress of the launch, as well as any error, should be sent to this listener.@NonNull @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getWorkDirOptions(@NonNull Computer computer)
getWorkDirSettings().toCommandLineArgs(computer)
should be used insteadcomputer
- Computer@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isJavaWebStartSupported()
config.jelly
before displaying the
Java Web Start button.true
if Java Web Start button should be displayed.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static String getInboundAgentUrl()
Copyright © 2004–2021. All rights reserved.