Package org.apache.tuscany.sca.invocation

Examples of org.apache.tuscany.sca.invocation.InvokerAsyncResponse


          RuntimeComponentReference theReference = (RuntimeComponentReference)this.getReference();
          RuntimeComponent theComponent = theReference.getComponent();
            ImplementationProvider implementationProvider = theComponent.getImplementationProvider();
            if (implementationProvider instanceof ImplementationAsyncProvider){
                for (InvocationChain chain : getInvocationChains()){
                    InvokerAsyncResponse asyncResponseInvoker = ((ImplementationAsyncProvider)implementationProvider).createAsyncResponseInvoker(chain.getSourceOperation());
                    if (chain.getHeadInvoker() instanceof InterceptorAsync){
                        ((InterceptorAsync)chain.getHeadInvoker()).setPrevious(asyncResponseInvoker);
                    } else {
                        //TODO - throw error once the old async code is removed
                    } // end if
View Full Code Here


            // fix up the operation chain response path to point back to the
            // binding provided async response handler
            ServiceBindingProvider serviceBindingProvider = getBindingProvider();
            if (serviceBindingProvider instanceof EndpointAsyncProvider){
                EndpointAsyncProvider asyncEndpointProvider = (EndpointAsyncProvider)serviceBindingProvider;
                InvokerAsyncResponse asyncResponseInvoker = asyncEndpointProvider.createAsyncResponseInvoker();
               
                for (InvocationChain chain : getInvocationChains()){
                    Invoker invoker = chain.getHeadInvoker();
                    if (invoker instanceof InterceptorAsync){
                        ((InterceptorAsync)invoker).setPrevious(asyncResponseInvoker);
View Full Code Here

            } // end for
           
            // fix up the binding chain response path to point back to the
            // binding provided async response handler
            EndpointAsyncProvider asyncEndpointProvider = (EndpointAsyncProvider)serviceBindingProvider;
            InvokerAsyncResponse asyncResponseInvoker = asyncEndpointProvider.createAsyncResponseInvoker();
            ((InterceptorAsync)bindingInvocationChain.getHeadInvoker()).setPrevious(asyncResponseInvoker);
        } // end if
       
        // Add the runtime invoker to the end of the binding chain.
        // It mediates between the binding chain and selects the
View Full Code Here

        if( isAsyncInvocation((RuntimeEndpointReference)source ) ) {
          isAsyncService = true;
          // Get hold of the JavaAsyncResponseHandler from the chain dealing with the async response
          Invoker theInvoker = chain.getHeadInvoker();
          if( theInvoker instanceof InterceptorAsync ) {
            InvokerAsyncResponse responseInvoker = ((InterceptorAsync)theInvoker).getPrevious();
            if( responseInvoker instanceof JDKAsyncResponseInvoker ) {
              // Register the future as the response object with its ID
              ((JDKAsyncResponseInvoker)responseInvoker).registerAsyncResponse(future.getUniqueID(), future);
            } // end if
          } // end if                 
View Full Code Here

            msg.setFrom(responseEPR);
            String msgID = respInvoker.getRelatesToMsgID();
            msg.getHeaders().put("RELATES_TO", msgID);
        } // end if

        InvokerAsyncResponse thePrevious = (InvokerAsyncResponse)getPrevious();
        if (thePrevious != null ) thePrevious.invokeAsyncResponse(msg);
    } // end method invokeAsyncResponse
View Full Code Here

         
          // Prevent the response being processed by the rest of the service chain
          return;
        } else {
          // Carry on processing the response by the rest of the service chain
            InvokerAsyncResponse thePrevious = (InvokerAsyncResponse)getPrevious();
            if (thePrevious != null ) thePrevious.invokeAsyncResponse(msg);
            return;
        } // end if

    } // end method invokeAsyncResponse
View Full Code Here

      } // end try
    } // end method invokeAsyncRequest
   
    public void invokeAsyncResponse(Message msg) {
        msg = processResponse(msg);
        InvokerAsyncResponse thePrevious = (InvokerAsyncResponse)getPrevious();
        if (thePrevious != null ) thePrevious.invokeAsyncResponse(msg);
    } // end method invokeAsyncResponse
View Full Code Here

          RuntimeComponentReference theReference = (RuntimeComponentReference)this.getReference();
          RuntimeComponent theComponent = theReference.getComponent();
            ImplementationProvider implementationProvider = theComponent.getImplementationProvider();
            if (implementationProvider instanceof ImplementationAsyncProvider){
                for (InvocationChain chain : getInvocationChains()){
                    InvokerAsyncResponse asyncResponseInvoker = ((ImplementationAsyncProvider)implementationProvider).createAsyncResponseInvoker(chain.getSourceOperation());
                    if (chain.getHeadInvoker() instanceof InterceptorAsync){
                        ((InterceptorAsync)chain.getHeadInvoker()).setPrevious(asyncResponseInvoker);
                    } else {
                        //TODO - throw error once the old async code is removed
                    } // end if
View Full Code Here

     */
    public InvokerAsyncResponse getAsyncResponseInvoker(Operation op) {
        InvocationChain chain = getInvocationChain(op);
        Invoker headInvoker = chain.getHeadInvoker();
        if( headInvoker instanceof InterceptorAsync ) {
            InvokerAsyncResponse responseInvoker = ((InterceptorAsync)headInvoker).getPrevious();
          return responseInvoker;
        }
        return null;
    }
View Full Code Here

    processRequest(msg);
  } // end method invokeAsyncRequest

  public void invokeAsyncResponse(Message msg) {
    msg = processResponse(msg);
        InvokerAsyncResponse thePrevious = (InvokerAsyncResponse)getPrevious();
        if (thePrevious != null ) thePrevious.invokeAsyncResponse(msg);
  } // end method invokeAsyncResponse
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.invocation.InvokerAsyncResponse

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.