Package org.apache.tuscany.sca.invocation

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


        EasyMock.replay(context);
        ThreadMessageContext.setMessageContext(context);
        Message msg = createMock(Message.class);
        //TODO port to the new way of dealing with conversation IDs later
        //msg.setConversationID(convID);
        Interceptor next = EasyMock.createMock(Interceptor.class);
        EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
        EasyMock.expect(msg.isFault()).andReturn(false);
        EasyMock.replay(next);
        EasyMock.replay(msg);
        Interceptor interceptor = new NonBlockingInterceptor(scheduler, next);
        interceptor.invoke(msg);
        verify(context);
        verify(next);
        verify(msg);
    }
View Full Code Here


        // find out which policies are active
        List<PolicyProvider> pps = ((RuntimeComponentReference)reference).getPolicyProviders(referenceBinding);
        if (pps != null) {
            for (PolicyProvider p : pps) {
                if (p.getPhase().equals(Phase.REFERENCE_BINDING_POLICY)) {
                    Interceptor interceptor = p.createInterceptor(null);
                    if (interceptor != null) {
                        bindingInvocationChain.addInterceptor(Phase.REFERENCE_BINDING_POLICY, interceptor);
                    }
                }
            }
View Full Code Here

        // add the policy interceptors to the service binding wire
        List<PolicyProvider> pps = ((RuntimeComponentService)service).getPolicyProviders(serviceBinding);
        if (pps != null) {
            for (PolicyProvider p : pps) {
                if (p.getPhase().equals(Phase.SERVICE_BINDING_POLICY)) {
                    Interceptor interceptor = p.createInterceptor(null);
                    if (interceptor != null) {
                        bindingInvocationChain.addInterceptor(Phase.SERVICE_BINDING_POLICY, interceptor);
                    }
                }
            }
View Full Code Here

            }
        }
        List<PolicyProvider> pps = ((RuntimeComponentReference)reference).getPolicyProviders(binding);
        if (pps != null) {
            for (PolicyProvider p : pps) {
                Interceptor interceptor = p.createInterceptor(operation);
                if (interceptor != null) {
                    chain.addInterceptor(p.getPhase(), p.createInterceptor(operation));
                }
            }
        }
View Full Code Here

                                              InvocationChain chain,
                                              Operation operation) {
        List<PolicyProvider> pps = ((RuntimeComponentService)service).getPolicyProviders(binding);
        if (pps != null) {
            for (PolicyProvider p : pps) {
                Interceptor interceptor = p.createInterceptor(operation);
                if (interceptor != null) {
                    chain.addInterceptor(p.getPhase(), p.createInterceptor(operation));
                }
            }
        }
View Full Code Here

            chain.addInvoker(invoker);
        }
        List<PolicyProvider> pps = ((RuntimeComponent)component).getPolicyProviders();
        if (pps != null) {
            for (PolicyProvider p : pps) {
                Interceptor interceptor = p.createInterceptor(operation);
                if (interceptor != null) {
                    chain.addInterceptor(p.getPhase(), p.createInterceptor(operation));
                }
            }
        }
View Full Code Here

        List<InvocationChain> chains = wire.getInvocationChains();
        for (InvocationChain chain : chains) {
            Operation sourceOperation = chain.getSourceOperation();
            Operation targetOperation = chain.getTargetOperation();

            Interceptor interceptor = null;
            if (isTransformationRequired(sourceContract, sourceOperation, targetContract, targetOperation)) {
                // Add the interceptor to the source side because multiple
                // references can be wired to the same service
                interceptor =
                    new DataTransformationInterceptor(wire, sourceOperation, targetOperation, mediator);
View Full Code Here

    public void configure() {

        InvocationChain bindingChain = endpoint.getBindingInvocationChain();

        if (wfProvider != null) {
            Interceptor interceptor = wfProvider.createInterceptor();
            if (interceptor != null) {
                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
            }
        }

        if (wfResponseProvider != null) {
            Interceptor interceptor = wfResponseProvider.createInterceptor();
            if (interceptor != null) {
                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
            }

        }

        if (osProvider != null) {
            Interceptor interceptor = osProvider.createInterceptor();
            if (interceptor != null) {
                bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR, interceptor);
            }
        }
View Full Code Here

        }

        // add the policy interceptors to the service binding wire
        // find out which policies are active
        for (PolicyProvider p : getPolicyProviders()) {
           Interceptor interceptor = p.createBindingInterceptor();
            if (interceptor != null) {
                bindingInvocationChain.addInterceptor(interceptor);
            }
        }
    }
View Full Code Here

            }
        }
        List<PolicyProvider> pps = getPolicyProviders();
        if (pps != null) {
            for (PolicyProvider p : pps) {
                Interceptor interceptor = p.createInterceptor(operation);
                if (interceptor != null) {
                    chain.addInterceptor(interceptor);
                }
            }
        }
View Full Code Here

TOP

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

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.