Package org.apache.tuscany.sca.core.invocation

Examples of org.apache.tuscany.sca.core.invocation.AsyncResponseHandler


    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
View Full Code Here


    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
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.invocation.AsyncResponseHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.