Examples of Invoker


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

    }

    public void addInterceptor(int index, Interceptor interceptor) {
        invokers.add(index, interceptor);
        if (index - 1 >= 0) {
            Invoker before = invokers.get(index - 1);
            if (before instanceof Interceptor) {
                ((Interceptor)before).setNext(interceptor);
            }
        }
        if (index + 1 < invokers.size()) {
            Invoker after = invokers.get(index + 1);
            interceptor.setNext(after);
        }
    }

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

        } else {
            msg.setFrom(epFrom);
        }
        msg.setTo(wire.getTarget());

        Invoker headInvoker = chain.getHeadInvoker();
        Operation operation = chain.getTargetOperation();
        msg.setOperation(operation);

        Message msgContext = ThreadMessageContext.getMessageContext();
        Object currentConversationID = msgContext.getFrom().getReferenceParameters().getConversationID();

        ThreadMessageContext.setMessageContext(msg);
        try {
            conversationPreinvoke(msg);
            // handleCallback(msg, currentConversationID);
            // dispatch the wire down the chain and get the response
            Message resp = headInvoker.invoke(msg);
            Object body = resp.getBody();
            if (resp.isFault()) {
                throw new InvocationTargetException((Throwable)body);
            }
            return body;

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

                            }
                        }
                       
                        if ( !applicablePolicyHandlers.isEmpty() ) {
                            int index = 0;
                            Invoker invoker = chain.getHeadInvoker();
                            while ( invoker != chain.getTailInvoker()) {
                                if ( invoker instanceof Interceptor ) {
                                    invoker = ((Interceptor)invoker).getNext();
                                    ++index;
                                }

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

   
    public void invokeAsyncResponse(Message msg){
      // If there is a Binding Chain, invoke it first...
        InvocationChain chain = this.getBindingInvocationChain();
        if( chain != null ) {
          Invoker tailInvoker = chain.getTailInvoker();
          if (tailInvoker != null) {
            ((InvokerAsyncResponse)tailInvoker).invokeAsyncResponse(msg);
      } // end if
        } // end if
       
        chain = this.getInvocationChain(msg.getOperation());
        Invoker tailInvoker = chain.getTailInvoker();
        ((InvokerAsyncResponse)tailInvoker).invokeAsyncResponse(msg);  
    } // end method invokeAsyncResponse    

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

     * @param operation
     */
    private void addReferenceBindingInterceptor(InvocationChain chain, Operation operation) {
        ReferenceBindingProvider provider = getBindingProvider();
        if (provider != null) {
            Invoker invoker = provider.createInvoker(operation);
            if (invoker != null) {
                chain.addInvoker(invoker);
            }
        }
        List<PolicyProvider> pps = getPolicyProviders();

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

            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);
                    } else {
                        //TODO - throw error once the old async code is removed
                    } // end if

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

            ((EndpointAsyncProvider)serviceBindingProvider).supportsNativeAsync()){
            // fix up the invocation chains to point back to the
            // binding chain so that async response messages
            // are processed correctly
            for (InvocationChain chain : getInvocationChains()){
                Invoker invoker = chain.getHeadInvoker();
                ((InterceptorAsync)invoker).setPrevious((InvokerAsyncResponse)bindingInvocationChain.getTailInvoker());
            } // end for
           
            // fix up the binding chain response path to point back to the
            // binding provided async response handler

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

        }

        ImplementationProvider provider = ((RuntimeComponent)component).getImplementationProvider();

        if (provider != null) {
            Invoker invoker = null;
            RuntimeComponentService runtimeService = (RuntimeComponentService)service;
            if (runtimeService.getName().endsWith("_asyncCallback")){
                if (provider instanceof ImplementationAsyncProvider){
                    invoker = (Invoker)((ImplementationAsyncProvider)provider).createAsyncResponseInvoker(operation);
                } else {

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

        Servlet servlet = null;
        for (InvocationChain invocationChain : wire.getInvocationChains()) {
            Operation operation = invocationChain.getTargetOperation();
            String operationName = operation.getName();
            if (operationName.equals("get")) {
                Invoker getInvoker = invocationChain.getHeadInvoker();
                servlet = new HTTPGetListenerServlet(getInvoker, messageFactory);
                break;
            } else if (operationName.equals("service")) {
                Invoker serviceInvoker = invocationChain.getHeadInvoker();
                servlet = new HTTPServiceListenerServlet(serviceInvoker, messageFactory);
                break;
            }
        }
        if (servlet == null) {

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

        if (target != null) {
            msg.setTo(target);
        } else {
            msg.setTo(wire.getTarget());
        }
        Invoker headInvoker = chain.getHeadInvoker();
        Operation operation = chain.getTargetOperation();
        msg.setOperation(operation);
        msg.setBody(args);

        Message msgContext = ThreadMessageContext.getMessageContext();
        Object currentConversationID = msgContext.getFrom().getReferenceParameters().getConversationID();

        conversationPreinvoke(msg, wire);
        handleCallback(msg, wire, currentConversationID);
        ThreadMessageContext.setMessageContext(msg);
        try {
            // dispatch the wire down the chain and get the response
            Message resp = headInvoker.invoke(msg);
            Object body = resp.getBody();
            if (resp.isFault()) {
                throw (Throwable)body;
            }
            return body;
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.