Package org.apache.tuscany.sca.invocation

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


    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

        // add the policy interceptors to the service binding wire
        List<PolicyProvider> pps = getPolicyProviders();
        if (pps != null) {
            for (PolicyProvider p : pps) {
                Interceptor interceptor = p.createBindingInterceptor();
                if (interceptor != null) {
                    bindingInvocationChain.addInterceptor(interceptor);
                } // end if
            } // end for
        } // end if
View Full Code Here

     */
    private void addServiceBindingInterceptor(InvocationChain chain, Operation operation) {
        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

        }

        List<PolicyProvider> pps = ((RuntimeComponent)component).getPolicyProviders();
        if (pps != null) {
            for (PolicyProvider p : pps) {
                Interceptor interceptor = p.createInterceptor(operation);
                if (interceptor != null) {
                    chain.addInterceptor(interceptor);
                }
            }
        }
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

        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.replay(next);
        EasyMock.replay(msg);
        Interceptor interceptor = new NonBlockingInterceptor(scheduler, next);
        interceptor.invoke(msg);
        verify(context);
        verify(next);
        verify(msg);
    }
View Full Code Here

*/
public class CallbackInterfaceInterceptorTestCase extends TestCase {

    public void testHasCallbackObject() {
        CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor();
        Interceptor next = EasyMock.createMock(Interceptor.class);
        EasyMock.expect(next.invoke(EasyMock.isA(Message.class))).andReturn(null);
        EasyMock.replay(next);
        interceptor.setNext(next);
        Message msg = new MessageFactoryImpl().createMessage();
        msg.setFrom(new EndpointReferenceImpl("uri"));
        msg.getFrom().getReferenceParameters().setCallbackObjectID("ABC");
View Full Code Here

public class InvocationChainImplTestCase extends TestCase {

    public void testInsertAtEnd() throws Exception {
        Operation op = newOperation("foo");
        InvocationChain chain = new InvocationChainImpl(op, op, true);
        Interceptor inter2 = new MockInterceptor();
        Interceptor inter1 = new MockInterceptor();
        chain.addInterceptor(inter1);
        chain.addInterceptor(inter2);
        Interceptor head = (Interceptor)chain.getHeadInvoker();
        assertEquals(inter1, head);
        assertEquals(inter2, head.getNext());
        assertEquals(inter2, chain.getTailInvoker());

    }
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.