summaryrefslogtreecommitdiff
path: root/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
diff options
context:
space:
mode:
authorrbuj <robert.buj@gmail.com>2014-07-23 18:51:20 +0200
committerMichael Stahl <mstahl@redhat.com>2014-07-24 13:11:41 +0200
commitb01358553082fd6f30781d0641c652f206c90c63 (patch)
tree24aa9acf9d1331ded2a12aef1cc230b267ea8e49 /jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
parentc8aa8226962db6ddbca6bfec8e415dfd5ecdda6f (diff)
jurt: Enhanced For-Loops, code formatting, javadoc & overrides
Signed-off-by: Michael Stahl <mstahl@redhat.com> Conflicts: jurt/com/sun/star/lib/uno/environments/remote/JobQueue.java Change-Id: I6d6324c5597fa472360a1b8bb4153dec647a36f0
Diffstat (limited to 'jurt/com/sun/star/lib/util/AsynchronousFinalizer.java')
-rw-r--r--jurt/com/sun/star/lib/util/AsynchronousFinalizer.java51
1 files changed, 26 insertions, 25 deletions
diff --git a/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java b/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
index 8839b1194255..1657ecfc3199 100644
--- a/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
+++ b/jurt/com/sun/star/lib/util/AsynchronousFinalizer.java
@@ -21,28 +21,28 @@ package com.sun.star.lib.util;
import java.util.LinkedList;
/**
- Helper class to asynchronously execute finalize methods.
-
- Current JVMs seem not to be robust against long-running finalize methods, in
- that such long-running finalize methods may lead to OutOfMemoryErrors. This
- class mitigates the problem by asynchronously shifting the bodies of
- potentially long-running finalize methods into an extra thread. Classes that
- make use of this in their finalize methods are the proxies used in the
- intra-process JNI UNO bridge and the inter-process Java URP UNO bridge (where
- in both cases finalizers lead to synchronous UNO release calls).
-
- If JVMs are getting more mature and should no longer have problems with
- long-running finalize mehtods, this class could be removed again.
-*/
+ * Helper class to asynchronously execute finalize methods.
+ *
+ * <p>Current JVMs seem not to be robust against long-running finalize methods,
+ * in that such long-running finalize methods may lead to OutOfMemoryErrors. This
+ * class mitigates the problem by asynchronously shifting the bodies of
+ * potentially long-running finalize methods into an extra thread. Classes that
+ * make use of this in their finalize methods are the proxies used in the
+ * intra-process JNI UNO bridge and the inter-process Java URP UNO bridge (where
+ * in both cases finalizers lead to synchronous UNO release calls).</p>
+ *
+ * <p>If JVMs are getting more mature and should no longer have problems with
+ * long-running finalize mehtods, this class could be removed again.</p>
+ */
public final class AsynchronousFinalizer {
/**
- Add a job to be executed asynchronously.
-
- The run method of the given job is called exactly once. If it terminates
- abnormally by throwing any Throwable, that is ignored.
-
- @param job represents the body of some finalize method; must not be null.
- */
+ * Add a job to be executed asynchronously.
+ *
+ * <p>The run method of the given job is called exactly once. If it terminates
+ * abnormally by throwing any Throwable, that is ignored.</p>
+ *
+ * @param job represents the body of some finalize method; must not be null.
+ */
public static void add(Job job) {
synchronized (queue) {
boolean first = queue.isEmpty();
@@ -54,11 +54,12 @@ public final class AsynchronousFinalizer {
}
/**
- An interface to represent bodies of finalize methods.
-
- Similar to Runnable, except that the run method may throw any Throwable
- (which is effectively ignored by AsynchronousFinalizer.add, similar to
- any Throwables raised by finalize being ignored).
+ * An interface to represent bodies of finalize methods.
+ *
+ * Similar to <code>Runnable</code>, except that the run method may throw any
+ * <code>Throwable</code> (which is effectively ignored by
+ * <code>AsynchronousFinalizer.add</code>, similar to any <code>Throwables</code>
+ * raised by finalize being ignored).
*/
public interface Job {
void run() throws Throwable;