changeset 6046:6958ed0ddda5

RT-34951 Provide property to exit when when the screen is first rendered Reviewed-by: kcr
author Daniel Blaukopf <daniel.blaukopf@oracle.com>
date Tue, 07 Jan 2014 10:52:41 +0200
parents 881be4494731
children 0d5bcb3c0951
files modules/base/src/main/java/com/sun/javafx/logging/PulseLogger.java
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/base/src/main/java/com/sun/javafx/logging/PulseLogger.java	Tue Jan 07 00:12:43 2014 +0200
+++ b/modules/base/src/main/java/com/sun/javafx/logging/PulseLogger.java	Tue Jan 07 10:52:41 2014 +0200
@@ -79,6 +79,17 @@
             });
 
     /**
+     * Optionally exit after a given number of pulses
+     */
+    private static final int EXIT_ON_PULSE =
+            AccessController.doPrivileged(new PrivilegedAction<Integer>() {
+                @Override
+                public Integer run() {
+                    return Integer.getInteger("javafx.pulseLogger.exitOnPulse", 0);
+                }
+            });
+
+    /**
      * We have a simple counter that keeps track of the current pulse number.
      * INTER_PULSE_DATA is used to mark data that comes between pulses.
      */
@@ -442,6 +453,10 @@
             message.setLength(0);
             counters.clear();
             state = AVAILABLE;
+            if (EXIT_ON_PULSE > 0 && pulseCount >= EXIT_ON_PULSE) {
+                System.err.println("Exiting after pulse #" + pulseCount);
+                System.exit(0);
+            }
         }
     }
 }