Skip to content

Commit

Permalink
[JENKINS-48686] Switch to calling the agent 'agent' (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref authored and oleg-nenashev committed Dec 26, 2017
1 parent 6a528dd commit 3ce2e98
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/main/java/hudson/remoting/Engine.java
Expand Up @@ -76,7 +76,7 @@
import org.jenkinsci.remoting.util.KeyUtils;

/**
* Slave agent engine that proactively connects to Jenkins master.
* Agent engine that proactively connects to Jenkins master.
*
* @author Kohsuke Kawaguchi
*/
Expand Down Expand Up @@ -122,7 +122,7 @@ public void run() {
private List<X509Certificate> candidateCertificates;

/**
* URL that points to Jenkins's tcp slave agent listener, like <tt>http://myhost/hudson/</tt>
* URL that points to Jenkins's tcp agent listener, like <tt>http://myhost/hudson/</tt>
*
* <p>
* This value is determined from {@link #candidateUrls} after a successful connection.
Expand Down Expand Up @@ -672,7 +672,7 @@ private void onConnectionRejected(String greeting) throws InterruptedException {
}

/**
* Connects to TCP slave host:port, with a few retries.
* Connects to TCP agent host:port, with a few retries.
* @param endpoint Connection endpoint
* @throws IOException Connection failure or invalid parameter specification
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/remoting/InitializeJarCacheMain.java
Expand Up @@ -34,7 +34,7 @@ public boolean accept(File dir, String name) {
public static void main(String[] argv) throws Exception {
if (argv.length != 2) {
throw new IllegalArgumentException(
"Usage: java -cp slave.jar hudson.remoting.InitializeJarCacheMain " +
"Usage: java -cp agent.jar hudson.remoting.InitializeJarCacheMain " +
"<source jar dir> <jar cache dir>");
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/hudson/remoting/Launcher.java
Expand Up @@ -128,7 +128,7 @@ public class Launcher {
public File slaveLog = null;

@Option(name="-text",usage="encode communication with the master with base64. " +
"Useful for running slave over 8-bit unsafe protocol like telnet")
"Useful for running agent over 8-bit unsafe protocol like telnet")
public void setTextMode(boolean b) {
mode = b?Mode.TEXT:Mode.BINARY;
System.out.println("Running in "+mode.name().toLowerCase(Locale.ENGLISH)+" mode");
Expand All @@ -142,7 +142,7 @@ public void setTextMode(boolean b) {
@Option(name="-jnlpCredentials",metaVar="USER:PASSWORD",usage="HTTP BASIC AUTH header to pass in for making HTTP requests.")
public String slaveJnlpCredentials = null;

@Option(name="-secret", metaVar="HEX_SECRET", usage="Slave connection secret to use instead of -jnlpCredentials.")
@Option(name="-secret", metaVar="HEX_SECRET", usage="Agent connection secret to use instead of -jnlpCredentials.")
public String secret;

@Option(name="-proxyCredentials",metaVar="USER:PASSWORD",usage="HTTP BASIC AUTH header to pass in for making HTTP authenticated proxy requests.")
Expand Down Expand Up @@ -283,7 +283,7 @@ public static void main(String... args) throws Exception {
launcher.run();
} catch (CmdLineException e) {
System.err.println(e.getMessage());
System.err.println("java -jar slave.jar [options...]");
System.err.println("java -jar agent.jar [options...]");
parser.printUsage(System.err);
System.err.println();
}
Expand Down Expand Up @@ -585,9 +585,9 @@ private static byte[] fromHexString(String data) {
return r;
}

private static Document loadDom(URL slaveJnlpURL, InputStream is) throws ParserConfigurationException, SAXException, IOException {
private static Document loadDom(URL agentJnlpURL, InputStream is) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return db.parse(is, slaveJnlpURL.toExternalForm());
return db.parse(is, agentJnlpURL.toExternalForm());
}

/**
Expand Down Expand Up @@ -701,9 +701,9 @@ private static void ttyCheck() {
// we seem to be running from interactive console. issue a warning.
// but since this diagnosis could be wrong, go on and do what we normally do anyway. Don't exit.
System.out.println(
"WARNING: Are you running slave agent from an interactive console?\n" +
"WARNING: Are you running agent from an interactive console?\n" +
"If so, you are probably using it incorrectly.\n" +
"See http://wiki.jenkins-ci.org/display/JENKINS/Launching+slave.jar+from+from+console");
"See https://wiki.jenkins.io/display/JENKINS/Launching+agent+from+console");
}
}

Expand Down Expand Up @@ -801,7 +801,7 @@ private static void closeWithLogOnly(Closeable stream, String name) {
}

/**
* Version number of Hudson this slave.jar is from.
* Version number of Hudson this agent.jar is from.
*/
public static final String VERSION = computeVersion();

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/hudson/remoting/jnlp/Main.java
Expand Up @@ -58,7 +58,7 @@
import javax.annotation.Nonnull;

/**
* Entry point to JNLP slave agent.
* Entry point to JNLP agent.
*
* <p>
* See also <tt>slave-agent.jnlp.jelly</tt> in the core.
Expand Down Expand Up @@ -179,7 +179,7 @@ public class Main {

/**
* 4 mandatory parameters.
* Host name (deprecated), Jenkins URL, secret key, and slave name.
* Host name (deprecated), Jenkins URL, secret key, and agent name.
*/
@Argument
public final List<String> args = new ArrayList<String>();
Expand All @@ -189,7 +189,7 @@ public static void main(String[] args) throws IOException, InterruptedException
_main(args);
} catch (CmdLineException e) {
System.err.println(e.getMessage());
System.err.println("java -jar slave.jar [options...] <secret key> <slave name>");
System.err.println("java -jar agent.jar [options...] <secret key> <agent name>");
new CmdLineParser(new Main()).printUsage(System.err);
}
}
Expand Down Expand Up @@ -238,11 +238,11 @@ public void main() throws IOException, InterruptedException {
}

public Engine createEngine() {
String slaveName = args.get(1);
LOGGER.log(INFO, "Setting up slave: {0}", slaveName);
String agentName = args.get(1);
LOGGER.log(INFO, "Setting up agent: {0}", agentName);
Engine engine = new Engine(
headlessMode ? new CuiListener() : new GuiListener(),
urls, args.get(0), slaveName);
urls, args.get(0), agentName);
if(tunnel!=null)
engine.setTunnel(tunnel);
if(credentials!=null)
Expand All @@ -260,7 +260,7 @@ public Engine createEngine() {
engine.setDisableHttpsCertValidation(disableHttpsCertValidation);


// TODO: ideally logging should be initialized before the "Setting up slave" entry
// TODO: ideally logging should be initialized before the "Setting up agent" entry
if (agentLog != null) {
try {
engine.setAgentLog(PathUtils.fileToPath(agentLog));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/hudson/remoting/jnlp/MainDialog.java
Expand Up @@ -31,7 +31,7 @@
import javax.annotation.CheckForNull;

/**
* Main window for JNLP slave agent.
* Main window for JNLP agent.
*
* @author Kohsuke Kawaguchi
*/
Expand All @@ -43,7 +43,7 @@ public class MainDialog extends JFrame {
@SuppressFBWarnings(value = "UI_INHERITANCE_UNSAFE_GETRESOURCE",
justification = "We allow overriding this resource. Just in case")
public MainDialog() throws HeadlessException {
super("Jenkins slave agent");
super("Jenkins agent");

ImageIcon background = new ImageIcon(getClass().getResource("title.png"));

Expand Down Expand Up @@ -93,7 +93,7 @@ public void status(String msg) {
}

/**
* If the current JVM runs a {@link MainDialog} as a JNLP slave agent,
* If the current JVM runs a {@link MainDialog} as a JNLP agent,
* return its reference, otherwise {@code null}.
*/
@CheckForNull
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/remoting/package-info.java
Expand Up @@ -25,7 +25,7 @@
* Remoting infrastructure for Hudson.
*
* <p>
* Code in this package is used for running a part of a program in slaves.
* Code in this package is used for running a part of a program in agents.
* If you are new to this package, start from {@link hudson.remoting.Channel}.
*/
package hudson.remoting;

0 comments on commit 3ce2e98

Please sign in to comment.