Author: genspring
Date: Thu May 26 03:44:43 2011
New Revision: 1127778
URL: http://svn.apache.org/viewvc?rev=1127778&view=rev
Log:
OPENEJB-1558 EJB31 spec 3.4.8.1 , Asynchronous methods have a return type of
void or Future<V>, where V represents the result value
of the asynchronous invocation. we should return a null to avoid a classcast
exception from client side when the return type of aync method is void.
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java?rev=1127778&r1=1127777&r2=1127778&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbObjectProxyHandler.java
Thu May 26 03:44:43 2011
@@ -239,6 +239,9 @@ public abstract class EjbObjectProxyHand
AsynchronousCall asynchronousCall = new AsynchronousCall(interfce,
method, args, asynchronousCancelled);
try {
Future<Object> retValue =
beanContext.getModuleContext().getAppContext().submitTask(asynchronousCall);
+ if (method.getReturnType() == Void.TYPE) {
+ return null;
+ }
return new FutureAdapter<Object>(retValue, asynchronousCancelled,
beanContext.getModuleContext().getAppContext());
} catch (RejectedExecutionException e) {
throw new EJBException("fail to allocate internal resource to
execute the target task", e);