Examples of AsyncFaultWrapper


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

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

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

                Throwable e = s.getCause();
                if (e != null && e instanceof FaultException) {
                    if ("AsyncResponse".equals(e.getMessage())) {
                        // Do nothing...
                    } else {
                        future.setWrappedFault(new AsyncFaultWrapper(s));
                    } // end if
                } // end if
            } catch (AsyncResponseException ar) {
                // This exception is received in the case where the Binding does not support async invocation
              // natively - the initial invocation is effectively synchronous with this exception thrown to
              // indicate that the service received the request but will send the response separately - do nothing     
            } catch (Throwable t) {
                //System.out.println("Async invoke got exception: " + t.toString());
                future.setWrappedFault(new AsyncFaultWrapper(t));
            } // end try

        } // end method run
View Full Code Here

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

      throw new IllegalStateException("sendResponse() or sendFault() has been called previously");
    } // end if
    // Now dispatch the response to the callback...
    AsyncResponseHandler<T> handler = (AsyncResponseHandler<T>) callbackRef.getService();
    setResponseHeaders();
    handler.setFault(new AsyncFaultWrapper(e));
  } // end method sendFault
View Full Code Here

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

        // 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.setFault(new AsyncFaultWrapper(e));
        } catch (Throwable t) {
            Exception e =
                new ServiceRuntimeException("Received Throwable: " + t.getClass().getName()
                    + " when invoking: "
                    + asyncMethod.getName(), t);
            future.setFault(new AsyncFaultWrapper(e));
        } // end try
        return future;
    } // end method doInvokeAsyncPoll
View Full Code Here

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

                Throwable e = s.getCause();
                if (e != null && e instanceof FaultException) {
                    if ("AsyncResponse".equals(e.getMessage())) {
                        // Do nothing...
                    } else {
                        future.setFault(new AsyncFaultWrapper(s));
                    } // end if
                } // end if
            } catch (AsyncResponseException ar) {
                // do nothing     
            } catch (Throwable t) {
                System.out.println("Async invoke got exception: " + t.toString());
                future.setFault(new AsyncFaultWrapper(t));
            } // end try

        } // end method run
View Full Code Here

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

    } // end if
   
    // Now dispatch the response to the callback...
    AsyncResponseHandler<T> handler = (AsyncResponseHandler<T>) callbackRef.getService();
    setResponseHeaders();
    handler.setWrappedFault(new AsyncFaultWrapper(e));
  } // end method sendFault
View Full Code Here

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

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

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

                Throwable e = s.getCause();
                if (e != null && e instanceof FaultException) {
                    if ("AsyncResponse".equals(e.getMessage())) {
                        // Do nothing...
                    } else {
                        future.setWrappedFault(new AsyncFaultWrapper(s));
                    } // end if
                } // end if
            } catch (AsyncResponseException ar) {
                // This exception is received in the case where the Binding does not support async invocation
              // natively - the initial invocation is effectively synchronous with this exception thrown to
              // indicate that the service received the request but will send the response separately - do nothing     
            } catch (Throwable t) {
                //System.out.println("Async invoke got exception: " + t.toString());
                future.setWrappedFault(new AsyncFaultWrapper(t));
            } // end try

        } // end method run
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.