From 1abded4fce11629c9b48ab1594c2444927cd7757 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?=
* Execute the given {@link IProgressRunnable} (i.e. call
* {@link IProgressRunnable#run(IProgressMonitor)}. Will return a non-
- *
* Note that implementers may decide whether to invoke
@@ -53,27 +53,23 @@ public interface IExecutor {
* synchronously, but since IProgressRunnables are frequently going to be
* longer-running operations, implementers should proceed carefully before
* implementing with synchronous (blocking) invocation. Implementers should
- * typically implement via some non-blocking asynchronous invocation
- * mechanism, e.g. Threads, Jobs, ThreadPools etc.
+ * typically implement via some non-blocking asynchronous invocation mechanism,
+ * e.g. Threads, Jobs, ThreadPools etc.
* null
.
+ * @param progressMonitor any progress monitor to provide to the future upon
+ * construction. May be null
.
* @return the created future
*/
- protected abstract AbstractFuture> createFuture(
- IProgressMonitor progressMonitor);
+ protected abstract AbstractFuture> createFuture(IProgressMonitor progressMonitor);
}
diff --git a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractFuture.java b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractFuture.java
index f40fc9698fa..0130d17cd05 100644
--- a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractFuture.java
+++ b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractFuture.java
@@ -18,10 +18,10 @@
/**
* Abstract implementation of {@link IFuture} and {@link ISafeProgressRunner}.
+ *
* @since 1.1
*/
-public abstract class AbstractFuturetrue
if this future has been previously canceled,
diff --git a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractListenableFuture.java b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractListenableFuture.java
index eaadad3f6f8..43772882d37 100644
--- a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractListenableFuture.java
+++ b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/AbstractListenableFuture.java
@@ -17,10 +17,8 @@
* @since 1.1
*/
@SuppressWarnings("rawtypes")
-public abstract class AbstractListenableFuture extends AbstractFuture implements
- IListenableFuture {
+public abstract class AbstractListenableFuture extends AbstractFuture implements IListenableFuture {
- public abstract void addListener(IProgressRunnable progressRunnable,
- IExecutor executor);
+ public abstract void addListener(IProgressRunnable progressRunnable, IExecutor executor);
}
diff --git a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/FutureProgressMonitor.java b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/FutureProgressMonitor.java
index 6cda31690b6..c16bfaaf5f3 100644
--- a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/FutureProgressMonitor.java
+++ b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/FutureProgressMonitor.java
@@ -21,6 +21,7 @@
* wrapper for potentially two progress monitors: one provided by the
* {@link IFuture} client in a method call, the other (a child progress monitor)
* provided by the IExecutor that creates the future instance.
+ *
* @since 1.1
*
*/
@@ -30,12 +31,11 @@ public class FutureProgressMonitor extends ProgressMonitorWrapper {
private Object lock = new Object();
/**
- * Create a new progress monitor wrapping the given monitor. The nested
- * monitor is the one exposed to clients of futures.
+ * Create a new progress monitor wrapping the given monitor. The nested monitor
+ * is the one exposed to clients of futures.
*
- * @param progressMonitor
- * the client-facing monitor used with a future. May be
- * null
.
+ * @param progressMonitor the client-facing monitor used with a future. May be
+ * null
.
*
* @see #setChildProgressMonitor(IProgressMonitor)
*/
@@ -102,11 +102,10 @@ public void worked(int work) {
/**
* Set the client-facing progress monitor to the given value.
*
- * @param value
- * a second (child) monitor to report progress/take cancelation
- * from. If the parent progress monitor has been previously
- * canceled, the child progress monitor's setCanceled method will
- * be called.
+ * @param value a second (child) monitor to report progress/take cancelation
+ * from. If the parent progress monitor has been previously
+ * canceled, the child progress monitor's setCanceled method will
+ * be called.
*/
public void setChildProgressMonitor(IProgressMonitor value) {
synchronized (lock) {
diff --git a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IExecutor.java b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IExecutor.java
index b1a4573373d..d1d596da130 100644
--- a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IExecutor.java
+++ b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IExecutor.java
@@ -43,9 +43,9 @@ public interface IExecutor {
* null
instance of {@link IFuture} that allows clients to
- * inspect the state of the execution and retrieve any results via
- * {@link IFuture#get()} or {@link IFuture#get(long)}.
+ * null
instance of {@link IFuture} that allows clients to inspect
+ * the state of the execution and retrieve any results via {@link IFuture#get()}
+ * or {@link IFuture#get(long)}.
* null
.
- * @param monitor
- * any {@link IProgressMonitor} to be passed to the runnable. May
- * be null
.
+ * @param runnable the {@link IProgressRunnable} to invoke. Must not be
+ * null
.
+ * @param monitor any {@link IProgressMonitor} to be passed to the runnable.
+ * May be null
.
* @return {@link IFuture} to allow for inspection of the state of the
* computation by clients, as well as access to any return values of
* {@link IProgressRunnable#run(IProgressMonitor)}. Will not be
* null
.
- * @param
- * Get status for operation. Will return null
until at least
- * one operation(s) are complete.
+ * Get status for operation. Will return null
until at least one
+ * operation(s) are complete.
*
- * If {@link #hasValue()} returns true
, this method will return
- * a non-null
IStatus. If {@link #hasValue()} returns
+ * If {@link #hasValue()} returns true
, this method will return a
+ * non-null
IStatus. If {@link #hasValue()} returns
* false
, this method will return null
.
*
- * Note that the returned IStatus instance may be an IMultiStatus, meaning - * that multiple operations have completed or are pending completion. + * Note that the returned IStatus instance may be an IMultiStatus, meaning that + * multiple operations have completed or are pending completion. *
* * @return IStatus the status of completed operation(s). Will return - *null
if {@link #hasValue()} returns
- * false
.
+ * null
if {@link #hasValue()} returns false
.
*
* @see #hasValue()
*/
@@ -125,20 +120,18 @@ ResultType get(long waitTimeInMillis) throws InterruptedException,
/**
* - * Returns true if any underlying operation(s) have - * completed. + * Returns true if any underlying operation(s) have completed. *
*
- * If this future represents access to just one operation, then this method
- * and {@link #isDone()} will always return the same value. That is, when a
- * single operation has a value, it is then considered done/completed and
- * both {@link #isDone()} and this method will return true
.
+ * If this future represents access to just one operation, then this method and
+ * {@link #isDone()} will always return the same value. That is, when a single
+ * operation has a value, it is then considered done/completed and both
+ * {@link #isDone()} and this method will return true
.
*
- * If this future represents multiple operations, then this method will
- * return true
when any of the operations have
- * completed. Until the first operation is completed, it will return
- * false
.
+ * If this future represents multiple operations, then this method will return
+ * true
when any of the operations have completed. Until the
+ * first operation is completed, it will return false
.
*
- * If this future represents access to just one operation, then this method
- * and {@link #hasValue()} will always return the same value. That is, when
- * a single operation has a value, it is then considered done/completed and
- * both {@link #hasValue()} and #isDone will return true
.
+ * If this future represents access to just one operation, then this method and
+ * {@link #hasValue()} will always return the same value. That is, when a single
+ * operation has a value, it is then considered done/completed and both
+ * {@link #hasValue()} and #isDone will return true
.
*
* If this future represents multiple operations, then this method will only
- * return true
when all of the operations have
- * completed. Until all operations have completed, it will return
- * false
.
+ * return true
when all of the operations have completed.
+ * Until all operations have completed, it will return false
.
*
- * Completion can be due to normal operation completion, an exception, or - * user cancellation -- in all of these cases, this method will return - * true if all underlying operation(s) have been completed. + * Completion can be due to normal operation completion, an exception, or user + * cancellation -- in all of these cases, this method will return true + * if all underlying operation(s) have been completed. *
* * @return true if all operation(s) have completed in some manner. diff --git a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IListenableFuture.java b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IListenableFuture.java index 9d4bcc138b8..8953dfe17b5 100644 --- a/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IListenableFuture.java +++ b/bundles/org.eclipse.equinox.concurrent/src/org/eclipse/equinox/concurrent/future/IListenableFuture.java @@ -19,6 +19,7 @@ * * A future that allows for an {@link IProgressRunnable} (with optional * {@link IProgressMonitor}) to be executed via an {@link IExecutor}. + * * @since 1.1 * */ @@ -30,22 +31,21 @@ public interface IListenableFuturenull
and the {@link IExecutor} must also be non-
* null
. The given progressMonitor may be null
.
*
- * If the future has already completed by the time this method is called
- * (i.e. {@link #isDone()} returns true
, the progressRunnable
- * will be executed immediately by the given executor.
+ * If the future has already completed by the time this method is called (i.e.
+ * {@link #isDone()} returns true
, the progressRunnable will be
+ * executed immediately by the given executor.
*
- * @param executor
- * the {@link IExecutor} to use to execute the given
- * {@link IProgressRunnable}. Must not be null
.
- * @param progressRunnable
- * the {@link IProgressRunnable} that will be executed when this
- * future is complete. Must not be null
.
- * @param monitor
- * an optional progress monitor to be passed to the
- * progressRunnable when executed. May be null
.
+ * @param executor the {@link IExecutor} to use to execute the given
+ * {@link IProgressRunnable}. Must not be
+ * null
.
+ * @param progressRunnable the {@link IProgressRunnable} that will be executed
+ * when this future is complete. Must not be
+ * null
.
+ * @param monitor an optional progress monitor to be passed to the
+ * progressRunnable when executed. May be
+ * null
.
*/
- public void addListener(IExecutor executor,
- IProgressRunnable
* Subclasses may extend the behavior of this ThreadsExecutor. *
+ * * @since 1.1 */ public class ThreadsExecutor extends AbstractExecutor { @@ -47,15 +48,12 @@ protected String createThreadName(IProgressRunnable> runnable) { * Create a runnable given an {@link IProgressRunnable} and an * {@link ISafeProgressRunner} to run the runnable. * - * @param runner - * the safe progress runner to run the runnable - * @param progressRunnable - * the runnable to run. - * @return Runnable that when run will use the safe progress runner to run - * the progressRunnable + * @param runner the safe progress runner to run the runnable + * @param progressRunnable the runnable to run. + * @return Runnable that when run will use the safe progress runner to run the + * progressRunnable */ - protected Runnable createRunnable(final ISafeProgressRunner runner, - final IProgressRunnable> progressRunnable) { + protected Runnable createRunnable(final ISafeProgressRunner runner, final IProgressRunnable> progressRunnable) { return new Runnable() { public void run() { runner.runWithProgress(progressRunnable); @@ -64,12 +62,11 @@ public void run() { } /** - * Configure the given thread prior to starting it. Subclasses may override - * as appropriate to configure the given thread appropriately. The default + * Configure the given thread prior to starting it. Subclasses may override as + * appropriate to configure the given thread appropriately. The default * implementation calls {@link Thread#setDaemon(boolean)}. * - * @param thread - * the thread to configure + * @param thread the thread to configure */ protected void configureThreadForExecution(Thread thread) { // By default, we'll make the thread a daemon thread @@ -79,9 +76,8 @@ protected void configureThreadForExecution(Thread thread) { /** * Create an {@link AbstractFuture} with the given IProgressMonitor. * - * @param monitor - * a progress monitor to associate with the future. May be - *null
.
+ * @param monitor a progress monitor to associate with the future. May be
+ * null
.
*/
@SuppressWarnings("rawtypes")
protected AbstractFuture> createFuture(IProgressMonitor monitor) {
@@ -89,15 +85,13 @@ protected AbstractFuture> createFuture(IProgressMonitor monitor) {
}
@SuppressWarnings({ "rawtypes", "unchecked" })
- public synchronized