Examples of OutboundInvocationChain


Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        outboundWire.setServiceContract(contract);
        outboundWire.setTargetName(new QualifiedName(targetName));
        outboundWire.setContainer(service);

        for (Operation<?> operation : contract.getOperations().values()) {
            OutboundInvocationChain outboundChain = createOutboundChain(operation);
            outboundWire.addInvocationChain(operation, outboundChain);
        }

        // Add target callback chain to outbound wire, applicable to both bound and bindless services
        if (contract.getCallbackName() != null) {
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        if (holder == null) {
            TargetException e = new TargetException("Operation not configured");
            e.setIdentifier(operation.getName());
            throw e;
        }
        OutboundInvocationChain chain = holder.chain;
        TargetInvoker invoker;

        if (holder.cachedInvoker == null) {
            assert chain != null;
            if (chain.getTargetInvoker() == null) {
                TargetException e = new TargetException("No target invoker configured for operation");
                e.setIdentifier(chain.getOperation().getName());
                throw e;
            }
            if (chain.getTargetInvoker().isCacheable()) {
                // clone and store the invoker locally
                holder.cachedInvoker = (TargetInvoker) chain.getTargetInvoker().clone();
                invoker = holder.cachedInvoker;
            } else {
                invoker = chain.getTargetInvoker();
            }
        } else {
            assert chain != null;
            invoker = chain.getTargetInvoker();
        }
        messageId = context.getCurrentMessageId();
        context.setCurrentMessageId(null);
        correlationId = context.getCurrentCorrelationId();
        context.setCurrentCorrelationId(null);
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

    public void foo() {
    }

    public void testSourceWireInterceptorOptimization() throws Exception {
        OutboundWire wire = new OutboundWireImpl();
        OutboundInvocationChain chain = new OutboundInvocationChainImpl(operation);
        chain.addInterceptor(new OptimizableInterceptor());
        wire.addInvocationChain(operation, chain);
        assertTrue(wire.isOptimizable());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        assertTrue(wire.isOptimizable());
    }

    public void testSourceWireNonInterceptorOptimization() throws Exception {
        OutboundWire wire = new OutboundWireImpl();
        OutboundInvocationChain chain = new OutboundInvocationChainImpl(operation);
        chain.addInterceptor(new NonOptimizableInterceptor());
        wire.addInvocationChain(operation, chain);
        assertFalse(wire.isOptimizable());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        Operation<Type> op1 = new Operation<Type>("test", inputType1, outputType1, null);
        ServiceContract<Type> outboundContract = new JavaServiceContract(null);
        outboundContract.setDataBinding(String.class.getName());
        op1.setServiceContract(outboundContract);

        OutboundInvocationChain outboundChain = createMock(OutboundInvocationChain.class);
        outboundChains.put(op1, outboundChain);
        expect(outboundWire.getInvocationChains()).andReturn(outboundChains);
        outboundChain.addInterceptor(EasyMock.anyInt(), (Interceptor)EasyMock.anyObject());

        Map<Operation<?>, InboundInvocationChain> inboundChains =
            new HashMap<Operation<?>, InboundInvocationChain>();
        DataType<Type> type2 = new DataType<Type>(Node.class, Node.class);
        List<DataType<Type>> types2 = new ArrayList<DataType<Type>>();
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        Operation<Type> op1 = new Operation<Type>("test", inputType1, outputType1, null);
        ServiceContract<Type> outboundContract = new JavaServiceContract(null);
        outboundContract.setDataBinding(String.class.getName());
        op1.setServiceContract(outboundContract);

        OutboundInvocationChain outboundChain = createMock(OutboundInvocationChain.class);
        outboundChains.put(op1, outboundChain);
        expect(outboundWire.getInvocationChains()).andReturn(outboundChains).anyTimes();
        outboundChain.addInterceptor(EasyMock.anyInt(), (Interceptor)EasyMock.anyObject());

        Map<Operation<?>, InboundInvocationChain> inboundChains =
            new HashMap<Operation<?>, InboundInvocationChain>();
        DataType<Type> type2 = new DataType<Type>(Node.class, Node.class);
        List<DataType<Type>> types2 = new ArrayList<DataType<Type>>();
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        Operation<Type> op1 = new Operation<Type>("test", inputType1, outputType1, null);
        ServiceContract<Type> outboundContract = new JavaServiceContract(null);
        outboundContract.setDataBinding(String.class.getName());
        op1.setServiceContract(outboundContract);

        OutboundInvocationChain outboundChain = createMock(OutboundInvocationChain.class);
        outboundChains.put(op1, outboundChain);
        expect(outboundWire.getInvocationChains()).andReturn(outboundChains).anyTimes();
        // outboundChain.addInterceptor(EasyMock.anyInt(), (Interceptor)
        // EasyMock.anyObject());
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

                                                                                   Interceptor interceptor)
        throws InvalidServiceContractException {
        Map<Operation<?>, OutboundInvocationChain> invocations = new HashMap<Operation<?>, OutboundInvocationChain>();
        ServiceContract<?> contract = REGISTRY.introspect(interfaze);
        for (Operation<?> operation : contract.getOperations().values()) {
            OutboundInvocationChain chain = new OutboundInvocationChainImpl(operation);
            if (interceptor != null) {
                chain.addInterceptor(interceptor);
            }
            invocations.put(operation, chain);
        }
        return invocations;
    }
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

    private Operation operation;

    public void testNoInterceptorsNoHandlers() throws Exception {
        ConnectorImpl connector = new ConnectorImpl();
        InboundInvocationChain inboundChain = setupInbound(null);
        OutboundInvocationChain outboundChain = setupOutbound(null);
        String[] val = new String[]{"foo"};
        TargetInvoker invoker = createNiceMock(TargetInvoker.class);
        expect(invoker.invokeTarget(EasyMock.eq(val))).andReturn(val);
        replay(invoker);
        connector.connect(inboundChain, outboundChain);
View Full Code Here

Examples of org.apache.tuscany.spi.wire.OutboundInvocationChain

        MockSyncInterceptor interceptor = new MockSyncInterceptor();
        List<Interceptor> interceptors = new ArrayList<Interceptor>();
        interceptors.add(interceptor);

        InboundInvocationChain inboundChain = setupInbound(interceptors);
        OutboundInvocationChain outboundChain = setupOutbound(null);
        Message msg = new MessageImpl();
        TargetInvoker invoker = createNiceMock(TargetInvoker.class);
        expect(invoker.invoke(EasyMock.eq(msg))).andReturn(msg);
        replay(invoker);
        assertEquals(0, interceptor.getCount());
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.