// Allocate the Future<?> / Response<?> object - note: Response<?> is a subclass of Future<?>
AsyncInvocationFutureImpl future = AsyncInvocationFutureImpl.newInstance(returnType, getInterfaceClassloader());
try {
invokeAsync(proxy, method, args, future, asyncMethod);
} catch (Exception e) {
future.setWrappedFault(new AsyncFaultWrapper(e));
} catch (Throwable t) {
Exception e =
new ServiceRuntimeException("Received Throwable: " + t.getClass().getName()
+ " when invoking: "
+ asyncMethod.getName(), t);
future.setWrappedFault(new AsyncFaultWrapper(e));
} // end try
return future;
} // end method doInvokeAsyncPoll