This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-exec.git
The following commit(s) were added to refs/heads/master by this push:
new 4f5852c6 Javadoc
4f5852c6 is described below
commit 4f5852c6f3ef2963423796b19ab87e24a5d2bf48
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Dec 31 15:41:43 2023 -0500
Javadoc
---
.../java/org/apache/commons/exec/CommandLine.java | 8 +++++---
.../commons/exec/DefaultExecuteResultHandler.java | 4 ++--
.../org/apache/commons/exec/InputStreamPumper.java | 6 ++++++
src/main/java/org/apache/commons/exec/Watchdog.java | 19 +++++++++++++++++++
.../commons/exec/launcher/CommandLauncherProxy.java | 6 ++++++
.../commons/exec/launcher/OS2CommandLauncher.java | 5 +++++
.../commons/exec/launcher/WinNTCommandLauncher.java | 6 ++++++
7 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/exec/CommandLine.java
b/src/main/java/org/apache/commons/exec/CommandLine.java
index 06284ef2..97ed46d6 100644
--- a/src/main/java/org/apache/commons/exec/CommandLine.java
+++ b/src/main/java/org/apache/commons/exec/CommandLine.java
@@ -321,7 +321,7 @@ public class CommandLine {
}
/**
- * Returns the expanded and quoted command line arguments.
+ * Gets the expanded and quoted command line arguments.
*
* @return The quoted arguments.
*/
@@ -341,7 +341,7 @@ public class CommandLine {
}
/**
- * Returns the executable.
+ * Gets the executable.
*
* @return The executable.
*/
@@ -353,6 +353,8 @@ public class CommandLine {
}
/**
+ * Gets the substitution map.
+ *
* @return the substitution map.
*/
public Map<String, ?> getSubstitutionMap() {
@@ -405,7 +407,7 @@ public class CommandLine {
}
/**
- * Returns the command line as an array of strings.
+ * Converts the command line as an array of strings.
*
* @return The command line as an string array.
*/
diff --git
a/src/main/java/org/apache/commons/exec/DefaultExecuteResultHandler.java
b/src/main/java/org/apache/commons/exec/DefaultExecuteResultHandler.java
index 5a1f5905..34273b14 100644
--- a/src/main/java/org/apache/commons/exec/DefaultExecuteResultHandler.java
+++ b/src/main/java/org/apache/commons/exec/DefaultExecuteResultHandler.java
@@ -48,7 +48,7 @@ public class DefaultExecuteResultHandler implements
ExecuteResultHandler {
/**
* Gets the {@code exception} causing the process execution to fail.
*
- * @return Returns the exception.
+ * @return the exception.
* @throws IllegalStateException if the process has not exited yet.
*/
public ExecuteException getException() {
@@ -61,7 +61,7 @@ public class DefaultExecuteResultHandler implements
ExecuteResultHandler {
/**
* Gets the {@code exitValue} of the process.
*
- * @return Returns the exitValue.
+ * @return the exitValue.
* @throws IllegalStateException if the process has not exited yet.
*/
public int getExitValue() {
diff --git a/src/main/java/org/apache/commons/exec/InputStreamPumper.java
b/src/main/java/org/apache/commons/exec/InputStreamPumper.java
index 011924ce..94c94753 100644
--- a/src/main/java/org/apache/commons/exec/InputStreamPumper.java
+++ b/src/main/java/org/apache/commons/exec/InputStreamPumper.java
@@ -27,6 +27,9 @@ import org.apache.commons.exec.util.DebugUtils;
*/
public class InputStreamPumper implements Runnable {
+ /**
+ * Sleep time in milliseconds.
+ */
public static final int SLEEPING_TIME = 100;
/** The input stream to pump from. */
@@ -69,6 +72,9 @@ public class InputStreamPumper implements Runnable {
}
}
+ /**
+ * Requests processing to stop.
+ */
public void stopProcessing() {
stop = true;
}
diff --git a/src/main/java/org/apache/commons/exec/Watchdog.java
b/src/main/java/org/apache/commons/exec/Watchdog.java
index 9bd710b5..84b854f8 100644
--- a/src/main/java/org/apache/commons/exec/Watchdog.java
+++ b/src/main/java/org/apache/commons/exec/Watchdog.java
@@ -119,14 +119,27 @@ public class Watchdog implements Runnable {
this.threadFactory = threadFactory;
}
+ /**
+ * Adds a TimeoutObserver.
+ *
+ * @param to a TimeoutObserver to add.
+ */
public void addTimeoutObserver(final TimeoutObserver to) {
observers.addElement(to);
}
+ /**
+ * Fires a timeout occurred event for each observer.
+ */
protected final void fireTimeoutOccured() {
observers.forEach(o -> o.timeoutOccured(this));
}
+ /**
+ * Removes a TimeoutObserver.
+ *
+ * @param to a TimeoutObserver to remove.
+ */
public void removeTimeoutObserver(final TimeoutObserver to) {
observers.removeElement(to);
}
@@ -155,11 +168,17 @@ public class Watchdog implements Runnable {
}
}
+ /**
+ * Starts a new thread.
+ */
public synchronized void start() {
stopped = false;
ThreadUtil.newThread(threadFactory, this, "CommonsExecWatchdog-",
true).start();
}
+ /**
+ * Requests a thread stop.
+ */
public synchronized void stop() {
stopped = true;
notifyAll();
diff --git
a/src/main/java/org/apache/commons/exec/launcher/CommandLauncherProxy.java
b/src/main/java/org/apache/commons/exec/launcher/CommandLauncherProxy.java
index 92941de7..64bf0f07 100644
--- a/src/main/java/org/apache/commons/exec/launcher/CommandLauncherProxy.java
+++ b/src/main/java/org/apache/commons/exec/launcher/CommandLauncherProxy.java
@@ -27,8 +27,14 @@ import org.apache.commons.exec.CommandLine;
*/
public abstract class CommandLauncherProxy extends CommandLauncherImpl {
+ /** The command launcher to use. */
private final CommandLauncher launcher;
+ /**
+ * Constructs a new instance.
+ *
+ * @param launcher the command launcher to use.
+ */
public CommandLauncherProxy(final CommandLauncher launcher) {
this.launcher = launcher;
}
diff --git
a/src/main/java/org/apache/commons/exec/launcher/OS2CommandLauncher.java
b/src/main/java/org/apache/commons/exec/launcher/OS2CommandLauncher.java
index ee1c82ef..168195b2 100644
--- a/src/main/java/org/apache/commons/exec/launcher/OS2CommandLauncher.java
+++ b/src/main/java/org/apache/commons/exec/launcher/OS2CommandLauncher.java
@@ -34,6 +34,11 @@ import org.apache.commons.exec.CommandLine;
*/
public class OS2CommandLauncher extends CommandLauncherProxy {
+ /**
+ * Constructs a new instance.
+ *
+ * @param launcher the command launcher to use.
+ */
public OS2CommandLauncher(final CommandLauncher launcher) {
super(launcher);
}
diff --git
a/src/main/java/org/apache/commons/exec/launcher/WinNTCommandLauncher.java
b/src/main/java/org/apache/commons/exec/launcher/WinNTCommandLauncher.java
index 880ca54d..8e24b68a 100644
--- a/src/main/java/org/apache/commons/exec/launcher/WinNTCommandLauncher.java
+++ b/src/main/java/org/apache/commons/exec/launcher/WinNTCommandLauncher.java
@@ -27,6 +27,12 @@ import org.apache.commons.exec.CommandLine;
* A command launcher for Windows XP/2000/NT that uses 'cmd.exe' when
launching commands in directories other than the current working directory.
*/
public class WinNTCommandLauncher extends CommandLauncherProxy {
+
+ /**
+ * Constructs a new instance.
+ *
+ * @param launcher the command launcher to use.
+ */
public WinNTCommandLauncher(final CommandLauncher launcher) {
super(launcher);
}