Package hudson.remoting
Class Launcher
java.lang.Object
hudson.remoting.Launcher
- Direct Known Subclasses:
Main
Entry point for running a
Channel
. This is the main method of the agent JVM.
This class also defines several methods for starting a channel on a fresh JVM.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.Specifies a destination for error logs.Deprecated.Deprecated.removed without replacementConnect directly to the TCP port specified, skipping the HTTP(S) connection parameter download.boolean
Fail the initialization if the workDir or internalDir are missing.boolean
Deprecated.removed without replacementThe controller's instance identity.Specifies a directory withinworkDir
, which stores all the remoting-internal files.Specified location of the property file with JUL settings.boolean
Disables HTTPs Certificate validation of the server when usingJnlpAgentEndpointResolver
.boolean
boolean
boolean
Deprecated.removed without replacementWheninstanceIdentity
is set, the agent skips connecting via http(s) where it normally obtains the configured protocols.boolean
Shows help message and then exitsboolean
Shows version information and then exitsDeprecated.removed without replacementstatic final String
Version number of Hudson this agent.jar is from.boolean
Specifies a default working directory of the remoting instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Get the name of the communication protocol used in the Launcher.static boolean
static void
main
(InputStream is, OutputStream os) static void
main
(InputStream is, OutputStream os, Channel.Mode mode) static void
main
(InputStream is, OutputStream os, Channel.Mode mode, boolean performPing) Deprecated.static void
main
(InputStream is, OutputStream os, Channel.Mode mode, boolean performPing, JarCache cache) static void
void
run()
void
Deprecated.void
setConnectTo
(String target) Deprecated.removed without replacementvoid
setHeadlessMode
(boolean headlessMode) Deprecated.removed without replacementvoid
setPing
(boolean ping) Deprecated.removed without replacementvoid
setTcpPortFile
(File tcpPortFile) Deprecated.removed without replacementvoid
setTextMode
(boolean b)
-
Field Details
-
mode
-
ping
Deprecated.removed without replacement -
agentLog
Specifies a destination for error logs. If specified, this option overrides the default destination withinworkDir
. If both this options andworkDir
is not set, the log will not be generated.- Since:
- 3.8
-
agentJnlpURL
Deprecated.usesecret
,name
,urls
,webSocket
,tunnel
,workDir
,internalDir
, and/orfailIfWorkDirIsMissing
directly. -
agentJnlpCredentials
-
secret
-
name
-
proxyCredentials
-
tcpPortFile
Deprecated.removed without replacement -
auth
Deprecated. -
jarCache
- Since:
- 2.24
-
loggingConfigFilePath
Specified location of the property file with JUL settings.- Since:
- 3.8
-
candidateCertificates
-
noCertificateCheck
public boolean noCertificateCheckDisables HTTPs Certificate validation of the server when usingJnlpAgentEndpointResolver
. This option is managed by the-noCertificateCheck
option. -
connectionTarget
Deprecated.removed without replacement -
noReconnect
public boolean noReconnect -
noReconnectAfter
-
noKeepAlive
public boolean noKeepAlive -
workDir
Specifies a default working directory of the remoting instance. If specified, this directory will be used to store logs, JAR cache, etc.In order to retain compatibility, the option is disabled by default.
Jenkins specifics: This working directory is expected to be equal to the agent root specified in Jenkins configuration.
- Since:
- 3.8
-
internalDir
Specifies a directory withinworkDir
, which stores all the remoting-internal files.This option is not expected to be used frequently, but it allows remoting users to specify a custom storage directory if the default
remoting
directory is consumed by other stuff.- Since:
- 3.8
-
failIfWorkDirIsMissing
public boolean failIfWorkDirIsMissingFail the initialization if the workDir or internalDir are missing. This option presumes that the workspace structure gets initialized previously in order to ensure that we do not start up with a borked instance (e.g. if a filesystem mount gets disconnected).- Since:
- 3.8
-
tunnel
-
headlessMode
Deprecated.removed without replacement -
urls
-
webSocket
public boolean webSocket -
webSocketHeaders
-
directConnection
Connect directly to the TCP port specified, skipping the HTTP(S) connection parameter download.- Since:
- 3.34
-
instanceIdentity
The controller's instance identity.- Since:
- 3.34
- See Also:
-
protocols
WheninstanceIdentity
is set, the agent skips connecting via http(s) where it normally obtains the configured protocols. When no protocols are given the agent tries all protocols it knows. Use this to limit the protocol list.- Since:
- 3.34
-
showHelp
public boolean showHelpShows help message and then exits- Since:
- 3.36
-
showVersion
public boolean showVersionShows version information and then exits- Since:
- 3.36
-
args
The original calling convention takes two positional arguments: secret key and agent name. -
VERSION
Version number of Hudson this agent.jar is from.
-
-
Constructor Details
-
Launcher
public Launcher()
-
-
Method Details
-
setTextMode
public void setTextMode(boolean b) -
setPing
Deprecated.removed without replacement -
setTcpPortFile
Deprecated.removed without replacement -
setAuth
Deprecated. -
setConnectTo
Deprecated.removed without replacement -
setHeadlessMode
Deprecated.removed without replacement -
main
- Throws:
IOException
InterruptedException
-
run
- Throws:
org.kohsuke.args4j.CmdLineException
IOException
InterruptedException
-
main
- Throws:
IOException
InterruptedException
-
main
public static void main(InputStream is, OutputStream os, Channel.Mode mode) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
main
@Deprecated public static void main(InputStream is, OutputStream os, Channel.Mode mode, boolean performPing) throws IOException, InterruptedException Deprecated.- Throws:
IOException
InterruptedException
-
main
public static void main(InputStream is, OutputStream os, Channel.Mode mode, boolean performPing, @CheckForNull JarCache cache) throws IOException, InterruptedException - Parameters:
cache
- JAR cache to be used. Ifnull
, a default value will be used.- Throws:
IOException
InterruptedException
- Since:
- 2.24
-
isWindows
public static boolean isWindows() -
getCommunicationProtocolName
Get the name of the communication protocol used in the Launcher. When the channel is established by an Engine instance (that is, using JNLP), useEngine.getProtocolName()
instead.- Returns:
- the communication protocol name.
- Since:
- 4.8
-
secret
,name
,urls
,webSocket
,tunnel
,workDir
,internalDir
, and/orfailIfWorkDirIsMissing
directly.