@NotThreadSafe public class Engine extends Thread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
boolean |
failIfWorkDirIsMissing
Fail the initialization if the workDir or internalDir are missing.
|
String |
internalDir
Specifies a directory within
workDir, which stores all the remoting-internal files. |
EngineListener |
listener
Deprecated.
Use
events. |
String |
slaveName |
Path |
workDir
Specifies a default working directory of the remoting instance.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Engine(EngineListener listener,
List<URL> hudsonUrls,
String secretKey,
String slaveName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCandidateCertificate(X509Certificate certificate) |
void |
addListener(EngineListener el) |
static Engine |
current()
|
URL |
getHudsonUrl()
Provides Jenkins URL if available.
|
boolean |
isKeepAlive()
Returns
true if and only if the socket to the master will have Socket.setKeepAlive(boolean) set. |
void |
removeListener(EngineListener el) |
void |
run() |
void |
setAgentLog(Path agentLog)
Sets the destination for agent logs.
|
void |
setCandidateCertificates(List<X509Certificate> candidateCertificates) |
void |
setCredentials(String creds) |
void |
setFailIfWorkDirIsMissing(boolean failIfWorkDirIsMissing)
Sets up behavior if the workDir or internalDir are missing during the startup.
|
void |
setInternalDir(String internalDir)
Specifies name of the internal data directory within
workDir. |
void |
setJarCache(JarCache jarCache)
Configures custom JAR Cache location.
|
void |
setKeepAlive(boolean keepAlive)
Sets the
Socket.setKeepAlive(boolean) to use for the connection to the master. |
void |
setLoggingConfigFile(Path filePath)
Sets path to the property file with JUL settings.
|
void |
setNoReconnect(boolean noReconnect) |
void |
setProxyCredentials(String proxyCredentials) |
void |
setTunnel(String tunnel) |
void |
setWorkDir(Path workDir)
Specified a path to the work directory.
|
void |
startEngine()
Starts the engine.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield@Deprecated public final EngineListener listener
events.public final String slaveName
@CheckForNull public Path workDir
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.
@Nonnull public String internalDir
workDir, 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.
@Nonnull public boolean failIfWorkDirIsMissing
public Engine(EngineListener listener, List<URL> hudsonUrls, String secretKey, String slaveName)
public void startEngine()
throws IOException
IOException - Initialization errorpublic void setJarCache(@Nonnull JarCache jarCache)
jarCache - JAR Cache to be usedpublic void setLoggingConfigFile(@Nonnull Path filePath)
filePath - JAR Cache to be used@CheckForNull public URL getHudsonUrl()
null if the connection is not established or if the URL cannot be determined
in the JnlpAgentEndpointResolver.public void setTunnel(String tunnel)
public void setCredentials(String creds)
public void setProxyCredentials(String proxyCredentials)
public void setNoReconnect(boolean noReconnect)
public void setAgentLog(@CheckForNull Path agentLog)
agentLog - Path to the agent log.
If null, the engine will pick the default behavior depending on the workDir valuepublic void setWorkDir(@CheckForNull Path workDir)
workDir - Path to the working directory of the remoting instance.
null Disables the working directory.public void setInternalDir(@Nonnull String internalDir)
workDir.internalDir - Directory namepublic void setFailIfWorkDirIsMissing(boolean failIfWorkDirIsMissing)
failIfWorkDirIsMissing - Flagpublic boolean isKeepAlive()
true if and only if the socket to the master will have Socket.setKeepAlive(boolean) set.true if and only if the socket to the master will have Socket.setKeepAlive(boolean) set.public void setKeepAlive(boolean keepAlive)
Socket.setKeepAlive(boolean) to use for the connection to the master.keepAlive - the Socket.setKeepAlive(boolean) to use for the connection to the master.public void setCandidateCertificates(List<X509Certificate> candidateCertificates)
public void addCandidateCertificate(X509Certificate certificate)
public void addListener(EngineListener el)
public void removeListener(EngineListener el)
public static Engine current()
Copyright © 2004–2017. All rights reserved.