You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2020/02/22 09:02:49 UTC

[maven-surefire] branch maven2surefire-jvm-communication updated: JavaDoc on new classes

This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch maven2surefire-jvm-communication
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/maven2surefire-jvm-communication by this push:
     new 1ae8671  JavaDoc on new classes
1ae8671 is described below

commit 1ae867118079ddb202016e8fd03b4597907166c9
Author: tibordigana <ti...@apache.org>
AuthorDate: Thu Feb 20 17:59:22 2020 +0100

    JavaDoc on new classes
---
 .../maven/plugin/surefire/extensions/LegacyForkChannel.java |  7 ++++++-
 .../plugin/surefire/extensions/LegacyForkNodeFactory.java   |  2 +-
 .../plugin/surefire/extensions/SurefireForkChannel.java     | 13 ++++++++++++-
 .../plugin/surefire/extensions/SurefireForkNodeFactory.java |  3 ++-
 .../org/apache/maven/surefire/extensions/ForkChannel.java   |  4 ++--
 .../apache/maven/surefire/extensions/ForkNodeFactory.java   |  2 ++
 6 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkChannel.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkChannel.java
index 17e4c1d..3dc4425 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkChannel.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkChannel.java
@@ -32,7 +32,12 @@ import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.WritableByteChannel;
 
 /**
- *
+ * The main purpose of this class is to bind the
+ * {@link #bindCommandReader(CommandReader, WritableByteChannel) command reader} reading the commands from
+ * {@link CommandReader}, serializing them and writing the stream to the
+ * {@link WritableByteChannel sub-process}. It binds the
+ * {@link #bindEventHandler(EventHandler, CountdownCloseable, ReadableByteChannel) event handler} deserializing
+ * a received event and sends the event object to the {@link EventHandler event handler}.
  */
 final class LegacyForkChannel extends ForkChannel
 {
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkNodeFactory.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkNodeFactory.java
index 836464e..3667407 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkNodeFactory.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/LegacyForkNodeFactory.java
@@ -26,7 +26,7 @@ import javax.annotation.Nonnegative;
 import javax.annotation.Nonnull;
 
 /**
- *
+ * The factory of {@link LegacyForkChannel}.
  */
 public class LegacyForkNodeFactory implements ForkNodeFactory
 {
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
index 616b965..fb2a1b1 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
@@ -45,7 +45,18 @@ import static java.net.StandardSocketOptions.TCP_NODELAY;
 import static java.nio.channels.ServerSocketChannel.open;
 
 /**
- *
+ * The TCP/IP server accepting only one client connection. The forked JVM connects to the server using the
+ * {@link #getForkNodeConnectionString() connection string}.
+ * The main purpose of this class is to {@link #connectToClient() conect with tthe client}, bind the
+ * {@link #bindCommandReader(CommandReader, WritableByteChannel) command reader} to the internal socket's
+ * {@link java.io.InputStream}, and bind the
+ * {@link #bindEventHandler(EventHandler, CountdownCloseable, ReadableByteChannel) event handler} writing the event
+ * objects to the {@link EventHandler event handler}.
+ * <br>
+ * The objects {@link WritableByteChannel} and {@link ReadableByteChannel} are forked process streams
+ * (standard input and output). Both are ignored in this implementation but they are used in {@link LegacyForkChannel}.
+ * <br>
+ * The channel is closed after the forked JVM has finished normally or the shutdown hook is executed in the plugin.
  */
 final class SurefireForkChannel extends ForkChannel
 {
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkNodeFactory.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkNodeFactory.java
index c076ba2..b3139d1 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkNodeFactory.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkNodeFactory.java
@@ -25,9 +25,10 @@ import org.apache.maven.surefire.extensions.ForkNodeFactory;
 import javax.annotation.Nonnegative;
 import javax.annotation.Nonnull;
 import java.io.IOException;
+import java.nio.channels.ReadableByteChannel;
 
 /**
- *
+ * The factory of {@link SurefireForkChannel}.
  */
 public class SurefireForkNodeFactory implements ForkNodeFactory
 {
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkChannel.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkChannel.java
index e23253e..f264647 100644
--- a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkChannel.java
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkChannel.java
@@ -32,8 +32,8 @@ import java.nio.channels.WritableByteChannel;
  * and dedicated forked JVM {@link #getForkChannelId()}. It represents a server.
  * <br>
  * <br>
- * It connects to a client {@link #connectToClient()} and provides a connection string
- * {@link #getForkNodeConnectionString()} needed by the client in the JVM and binds event and command handlers.
+ * It connects with a client {@link #connectToClient()}, provides a connection string
+ * {@link #getForkNodeConnectionString()} needed by the client in the JVM, binds event handler and command reader.
  *
  * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
  * @since 3.0.0-M5
diff --git a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkNodeFactory.java b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkNodeFactory.java
index db0e7b8..a460482 100644
--- a/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkNodeFactory.java
+++ b/surefire-extensions-api/src/main/java/org/apache/maven/surefire/extensions/ForkNodeFactory.java
@@ -24,6 +24,8 @@ import javax.annotation.Nonnull;
 import java.io.IOException;
 
 /**
+ * This is the plugin extension as a factory of {@link ForkChannel}.
+ *
  * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
  * @since 3.0.0-M5
  */