src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java
changeset 59226 a0f39cc47387
parent 58863 c16ac7a2eba4
child 59259 127ca611f19b
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java	Fri Nov 22 09:06:35 2019 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java	Fri Nov 22 17:20:43 2019 +0100
@@ -43,7 +43,6 @@
 
     static final long RESERVED_CLASS_ID_LIMIT = 400;
 
-    private volatile boolean recording;
     private volatile boolean nativeOK;
 
     private static native void registerNatives();
@@ -69,6 +68,15 @@
     }
 
     /**
+     * Marks current chunk as final
+     * <p>
+     * This allows streaming clients to read the chunk header and
+     * close the stream when no more data will be written into
+     * the current repository.
+     */
+    public native void markChunkFinal();
+
+    /**
      * Begin recording events
      *
      * Requires that JFR has been started with {@link #createNativeJFR()}
@@ -76,6 +84,19 @@
     public native void beginRecording();
 
     /**
+     * Return true if the JVM is recording
+     */
+    public native boolean isRecording();
+
+    /**
+     * End recording events, which includes flushing data in thread buffers
+     *
+     * Requires that JFR has been started with {@link #createNativeJFR()}
+     *
+     */
+    public native void endRecording();
+
+    /**
      * Return ticks
      *
      * @return the time, in ticks
@@ -97,13 +118,7 @@
      */
     public native boolean emitEvent(long eventTypeId, long timestamp, long when);
 
-    /**
-     * End recording events, which includes flushing data in thread buffers
-     *
-     * Requires that JFR has been started with {@link #createNativeJFR()}
-     *
-     */
-    public native void endRecording();
+
 
     /**
      * Return a list of all classes deriving from {@link jdk.internal.event.Event}
@@ -354,20 +369,6 @@
      */
     public native void storeMetadataDescriptor(byte[] bytes);
 
-    public void endRecording_() {
-        endRecording();
-        recording = false;
-    }
-
-    public void beginRecording_() {
-        beginRecording();
-        recording = true;
-    }
-
-    public boolean isRecording() {
-        return recording;
-    }
-
     /**
      * If the JVM supports JVM TI and retransformation has not been disabled this
      * method will return true. This flag can not change during the lifetime of
@@ -558,4 +559,5 @@
      *@return start time of the recording in nanos, -1 in case of in-memory
      */
     public native long getChunkStartNanos();
+
 }