diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java index bd58fec696..2b7075a494 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/Async.java @@ -29,12 +29,18 @@ import java.lang.annotation.Target; * *
In terms of target method signatures, any parameter types are supported. * However, the return type is constrained to either {@code void} or - * {@link java.util.concurrent.Future}. In the latter case, the {@code Future} handle - * returned from the proxy will be an actual asynchronous {@code Future} that can be used - * to track the result of the asynchronous method execution. However, since the - * target method needs to implement the same signature, it will have to return - * a temporary {@code Future} handle that just passes the return value through: e.g. - * Spring's {@link AsyncResult} or EJB 3.1's {@link javax.ejb.AsyncResult}. + * {@link java.util.concurrent.Future}. In the latter case, you may declare the + * more specific {@link org.springframework.util.concurrent.ListenableFuture} or + * {@link java.util.concurrent.CompletableFuture} types which allow for richer + * interaction with the asynchronous task and for immediate composition with + * further processing steps. + * + *
A {@code Future} handle returned from the proxy will be an actual asynchronous
+ * {@code Future} that can be used to track the result of the asynchronous method
+ * execution. However, since the target method needs to implement the same signature,
+ * it will have to return a temporary {@code Future} handle that just passes a value
+ * through: e.g. Spring's {@link AsyncResult}, EJB 3.1's {@link javax.ejb.AsyncResult},
+ * or {@link java.util.concurrent.CompletableFuture#completedFuture(Object)}.
*
* @author Juergen Hoeller
* @author Chris Beams
diff --git a/src/asciidoc/integration.adoc b/src/asciidoc/integration.adoc
index 977f0a5ba7..58338ddfb4 100644
--- a/src/asciidoc/integration.adoc
+++ b/src/asciidoc/integration.adoc
@@ -866,6 +866,8 @@ proxy will take care of forwarding the call to the server-side object via JMS.
----
+
+
[[remoting-amqp]]
=== AMQP
Refer to the {doc-spring-amqp}/html/_reference.html#remoting[Spring AMQP Reference Document
@@ -1087,6 +1089,7 @@ Note that the `java.net` implementation for HTTP requests may raise an exception
accessing the status of a response that represents an error (e.g. 401). If this is an
issue, switch to `HttpComponentsClientHttpRequestFactory` instead.
====
+
The previous example using Apache HttpComponents `HttpClient` directly rewritten to use
the `RestTemplate` is shown below
@@ -1124,6 +1127,7 @@ construct a `HttpComponentsClientHttpRequestFactory` like so:
RestTemplate restTemplate = new RestTemplate(requestFactory);
----
====
+
The general callback interface is `RequestCallback` and is called when the execute
method is invoked.
@@ -2591,13 +2595,16 @@ what the <