Issue 9: updated javadoc

git-svn-id: http://jclouds.googlecode.com/svn/trunk@1433 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-06-16 22:07:23 +00:00
parent f5135f3868
commit 7388293178
1 changed files with 84 additions and 84 deletions

View File

@ -27,7 +27,9 @@ import java.util.concurrent.*;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* // TODO: Adrian: Document this!
* Command that returns an asynchronous result. Generic type parameters associate the request (
* {@code Q}) with the response ({#code R}). When the response is parsed, it will return value (
* {@code T}).
*
* @author Adrian Cole
*/
@ -47,8 +49,8 @@ public class FutureCommand<Q, R, T> implements Future<T> {
public FutureCommand(Q request, ResponseCallable<R, T> responseCallable) {
this.request = checkNotNull(request, "request");
this.responseRunnableFuture = new ResponseRunnableFutureTask<R, T>(
checkNotNull(responseCallable, "responseCallable"));
this.responseRunnableFuture = new ResponseRunnableFutureTask<R, T>(checkNotNull(
responseCallable, "responseCallable"));
}
public Q getRequest() {
@ -79,8 +81,8 @@ public class FutureCommand<Q, R, T> implements Future<T> {
return responseRunnableFuture.get();
}
public T get(long l, TimeUnit timeUnit) throws InterruptedException,
ExecutionException, TimeoutException {
public T get(long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException,
TimeoutException {
return responseRunnableFuture.get(l, timeUnit);
}
@ -89,8 +91,8 @@ public class FutureCommand<Q, R, T> implements Future<T> {
*
* @author Adrian Cole
*/
public static class ResponseRunnableFutureTask<R, T> extends FutureTask<T>
implements ResponseRunnableFuture<R, T> {
public static class ResponseRunnableFutureTask<R, T> extends FutureTask<T> implements
ResponseRunnableFuture<R, T> {
private final ResponseCallable<R, T> callable;
public ResponseRunnableFutureTask(ResponseCallable<R, T> tCallable) {
@ -100,8 +102,7 @@ public class FutureCommand<Q, R, T> implements Future<T> {
@Override
public String toString() {
return getClass().getSimpleName() + "{" + "tCallable=" + callable
+ '}';
return getClass().getSimpleName() + "{" + "tCallable=" + callable + '}';
}
public R getResponse() {
@ -113,8 +114,8 @@ public class FutureCommand<Q, R, T> implements Future<T> {
}
/**
* opening this to public so that other errors can be associated with
* the request, for example i/o errors.
* opening this to public so that other errors can be associated with the request, for example
* i/o errors.
*
* @param throwable
*/
@ -125,8 +126,7 @@ public class FutureCommand<Q, R, T> implements Future<T> {
}
public interface ResponseRunnableFuture<R, T> extends Response<R>,
Runnable, Future<T> {
public interface ResponseRunnableFuture<R, T> extends Response<R>, Runnable, Future<T> {
public void setException(Throwable throwable);
}