src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java
branchJEP-349-branch
changeset 58129 7b751fe181a5
parent 58020 f082177c5023
child 58145 bc54ed8d908a
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java	Thu Sep 12 20:46:55 2019 -0700
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java	Fri Sep 13 18:46:07 2019 +0200
@@ -47,7 +47,7 @@
  * A recording stream produces events from the current JVM (Java Virtual
  * Machine).
  * <p>
- * The following example, shows how to record events using the default
+ * The following example shows how to record events using the default
  * configuration and print the Garbage Collection, CPU Load and JVM Information
  * event to standard out.
  *
@@ -110,7 +110,7 @@
      * </code>
      * </pre>
      *
-     * @param configuration configuration that contains the settings to be use,
+     * @param configuration configuration that contains the settings to use,
      *        not {@code null}
      *
      * @throws IllegalStateException if Flight Recorder can't be created (for
@@ -146,16 +146,17 @@
     }
 
     /**
-     * Replaces all settings for this recording stream
+     * Replaces all settings for this recording stream.
      * <p>
-     * The following example records 20 second using the "default" configuration
-     * and then changes to settings for the "profile" configuration.
+     * The following example records 20 seconds using the "default" configuration
+     * and then changes settings to the "profile" configuration.
      *
      * <pre>
      * <code>
-     *     var defaultConfiguration = Configuration.getConfiguration("default");
-     *     var profileConfiguration = Configuration.getConfiguration("profile");
-     *     try (var rs = new RecordingStream(defaultConfiguration) {
+     *     Configuration defaultConfiguration = Configuration.getConfiguration("default");
+     *     Configuration profileConfiguration = Configuration.getConfiguration("profile");
+     *     try (RecordingStream rs = new RecordingStream(defaultConfiguration) {
+     *        rs.onEvent(System.out::println);
      *        rs.startAsync();
      *        Thread.sleep(20_000);
      *        rs.setSettings(profileConfiguration.getSettings());
@@ -165,6 +166,8 @@
      * </pre>
      *
      * @param settings the settings to set, not {@code null}
+     *
+     * @see Recording#setSettings(Map)
      */
     public void setSettings(Map<String, String> settings) {
         recording.setSettings(settings);
@@ -217,8 +220,7 @@
     }
 
     /**
-     * Determines how far back data is kept for the stream, if the stream can't
-     * keep up.
+     * Determines how far back data is kept for the stream.
      * <p>
      * To control the amount of recording data stored on disk, the maximum
      * length of time to retain the data can be specified. Data stored on disk
@@ -241,8 +243,7 @@
     }
 
     /**
-     * Determines how much data is kept in the disk repository if the stream
-     * can't keep up.
+     * Determines how much data is kept for the stream.
      * <p>
      * To control the amount of recording data that is stored on disk, the
      * maximum amount of data to retain can be specified. When the maximum limit