if( responseHandler == null )
throw new ServiceRuntimeException("JavaAsyncResponseInvoker - no Future matches the RELATES_TO id: " + relatesID);
// Invoke the response handler with the content of the message
// - in the case of a Java implementation, the response handler is a Future...
AsyncResponseHandler future = (AsyncResponseHandler) responseHandler;
Object payload = msg.getBody();
Object response;
if( payload == null ) {
System.out.println("Returned response message was null");
} else {
if (payload.getClass().isArray()) {
response = ((Object[])payload)[0];
} else {
response = payload;
} // end if
if( response.getClass().equals(AsyncFaultWrapper.class)) {
future.setWrappedFault((AsyncFaultWrapper) response );
} else if ( response instanceof Throwable ) {
future.setFault( (Throwable)response );
} else {
future.setResponse(response);
} // end if
} // end if
} // end method invokeAsyncResponse