diff --git a/spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java b/spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java index 5166ce192ec..a218beae77c 100644 --- a/spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java +++ b/spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java @@ -15,6 +15,7 @@ */ package org.springframework.web.context.request.async; +import java.util.PriorityQueue; import java.util.concurrent.Callable; import org.apache.commons.logging.Log; @@ -28,10 +29,24 @@ import org.springframework.web.context.request.NativeWebRequest; * concurrently on behalf of the application, with a {@code DeferredResult} the * application can produce the result from a thread of its choice. * + *
Subclasses can extend this class to easily associate additional data or + * behavior with the {@link DeferredResult}. For example, one might want to + * associate the user used to create the {@link DeferredResult} by extending the + * class and adding an addition property for the user. In this way, the user + * could easily be accessed later without the need to use a data structure to do + * the mapping. + * + *
An example of associating additional behavior to this class might be
+ * realized by extending the class to implement an additional interface. For
+ * example, one might want to implement a {@link Comparable} so that when the
+ * {@link DeferredResult} is added to a {@link PriorityQueue} it is handled in
+ * the correct order.
+ *
* @author Rossen Stoyanchev
+ * @author Rob Winch
* @since 3.2
*/
-public final class DeferredResult