+ Simpler constructor for RequestProcessor. +
++ * class MyClass { + * private static final RequestProcessor RP = new RequestProcessor(MyClass.class); + * + * } + *+ * Behaves as
new RequestProcessor(MyClass.class.getName())
.
+ *
+ * @param forClass name of this class gives name for the processor threads
+ * @since 8.3
+ */
+ public RequestProcessor(Class> forClass) {
+ this(forClass.getName());
+ }
+
/** Creates a new named RequestProcessor with defined throughput.
* @param name the name to use for the request processor thread
* @param throughput the maximal count of requests allowed to run in parallel
diff -r 514c7d1a4263 openide.util/test/unit/src/org/openide/util/RequestProcessorTest.java
--- a/openide.util/test/unit/src/org/openide/util/RequestProcessorTest.java Tue Apr 06 09:51:23 2010 +0200
+++ b/openide.util/test/unit/src/org/openide/util/RequestProcessorTest.java Tue Apr 06 10:02:14 2010 +0200
@@ -233,6 +233,10 @@
}
+ static final class Priority {
+ static final RequestProcessor RP = new RequestProcessor(Priority.class);
+ }
+
/**
* A test that check that priorities are handled well.
*/
@@ -270,7 +274,7 @@
r[i] = new R(i);
}
- RequestProcessor rp = new RequestProcessor("PrioriyTest");
+ RequestProcessor rp = Priority.RP;
RequestProcessor.Task t[] = new RequestProcessor.Task[5];
synchronized (r[0]) {