[jboss-cvs] JBossAS SVN: r84351 - projects/ejb3/trunk/async-impl/src/main/java/org/jboss/ejb3/async/impl/util/concurrent.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 17 23:57:25 EST 2009
Author: ALRubinger
Date: 2009-02-17 23:57:25 -0500 (Tue, 17 Feb 2009)
New Revision: 84351
Modified:
projects/ejb3/trunk/async-impl/src/main/java/org/jboss/ejb3/async/impl/util/concurrent/ResultUnwrappingFuture.java
Log:
[EJBTHREE-1721] Let a bean provider give any implementation of j.u.c.Future as a return value for @Asynchronous invocations, do not restrict to javax.ejb.AsyncResult
Modified: projects/ejb3/trunk/async-impl/src/main/java/org/jboss/ejb3/async/impl/util/concurrent/ResultUnwrappingFuture.java
===================================================================
--- projects/ejb3/trunk/async-impl/src/main/java/org/jboss/ejb3/async/impl/util/concurrent/ResultUnwrappingFuture.java 2009-02-18 04:53:02 UTC (rev 84350)
+++ projects/ejb3/trunk/async-impl/src/main/java/org/jboss/ejb3/async/impl/util/concurrent/ResultUnwrappingFuture.java 2009-02-18 04:57:25 UTC (rev 84351)
@@ -28,8 +28,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import javax.ejb.AsyncResult;
-
import org.jboss.logging.Logger;
/**
@@ -40,8 +38,8 @@
*
* <br /><br />
*
- * Required to unwrap the javax.ejb.AsyncResult<V> that has been given as a
- * return value by the bean provider
+ * Required to unwrap the javax.ejb.AsyncResult<V> (or any j.u.c.Future)
+ * that has been given as a return value by the bean provider
*
* @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
* @version $Revision: $
@@ -124,7 +122,7 @@
// --------------------------------------------------------------------------------||
/**
- * Unwraps the AsyncFuture result given by the bean provider
+ * Unwraps the AsyncFuture (or any j.u.c.Future) result given by the bean provider
* and returns the real return value
*/
@SuppressWarnings("unchecked")
@@ -137,14 +135,14 @@
}
// Ensure it's in expected form
- if (!(returnValueFromBeanProvider instanceof AsyncResult))
+ if (!(returnValueFromBeanProvider instanceof Future))
{
- throw new RuntimeException("Bean provider has not specified a return value of type "
- + AsyncResult.class.getName() + ", was instead: " + returnValueFromBeanProvider);
+ throw new RuntimeException("Bean provider has not specified a return value of type " + Future.class.getName()
+ + ", was instead: " + returnValueFromBeanProvider);
}
// Get the underlying result
- final AsyncResult<V> result = (AsyncResult<V>) returnValueFromBeanProvider;
+ final Future<V> result = (Future<V>) returnValueFromBeanProvider;
final V unwrappedReturnValue = result.get(); // Not blocking, as AsyncResult is not a blocking implementation
// Return
More information about the jboss-cvs-commits
mailing list