Author: awhite
Date: Tue Oct  3 17:26:45 2006
New Revision: 452683

URL: http://svn.apache.org/viewvc?view=rev&rev=452683
Log:
Move the Perf class that supports some of our concurrency utils on older JVMs
to lib, where it belongs.


Added:
    incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/
    incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/misc/
    incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/misc/Perf.java
Removed:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/sun/

Added: incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/misc/Perf.java
URL: 
http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/misc/Perf.java?view=auto&rev=452683
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/misc/Perf.java (added)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/sun/misc/Perf.java Tue 
Oct  3 17:26:45 2006
@@ -0,0 +1,29 @@
+package sun.misc;
+
+/**
+ * Compilation stub for pre-1.4.2 JREs. Thanks to it, the whole backport
+ * concurrency package compiles and works with 1.4.2 as well as wih earlier 
+ * JREs, and takes advantage of native Perf class when running on 1.4.2 while 
+ * seamlessly falling back to System.currentTimeMillis() on previous JREs. This
+ * class should NOT be included in the binary distribution of backport.
+ *
+ * @author Dawid Kurzyniec
+ * @version 1.0
+ * @nojavadoc
+ */
+public final class Perf {
+
+    private static final Perf perf = new Perf();
+
+    public static Perf getPerf() { return perf; }
+
+    private Perf() {}
+
+    public long highResCounter() {
+        return System.currentTimeMillis();
+    }
+
+    public long highResFrequency() {
+        return 1000L;
+    }
+}


Reply via email to