Examples of TargetInvoker


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

            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");
View Full Code Here

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

public class Axis2ReferenceTestCase extends TestCase {

    public void testInvokeService() throws Exception {
        Axis2Reference axis2Reference = createAxis2Reference("testWebAppName", "testServiceName");
        Operation operation = new Operation<Type>("sayHi", null, null, null, false, null);
        TargetInvoker targetInvoker = axis2Reference.createTargetInvoker(null, operation);
        assertNotNull(targetInvoker);
    }
View Full Code Here

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

        EasyMock.expect(inboundWire.getServiceContract()).andReturn(contract).anyTimes();
        EasyMock.replay(inboundWire);

        axis2Reference.setInboundWire(inboundWire);
        Operation operation = new Operation<Type>("sayHi", null, null, null, true, null);
        TargetInvoker asyncTargetInvoker = axis2Reference.createAsyncTargetInvoker(null, operation);
        assertNotNull(asyncTargetInvoker);
    }
View Full Code Here

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

    }

    public void testTargetWireNonTargetInvokerOptimization() throws Exception {
        InboundWire wire = new InboundWireImpl();
        InboundInvocationChain chain = new InboundInvocationChainImpl(operation);
        TargetInvoker invoker = new StaticPojoTargetInvoker(m, new Object());
        invoker.setCacheable(false);
        chain.setTargetInvoker(invoker);
        wire.addInvocationChain(operation, chain);
        assertFalse(wire.isOptimizable());
    }
View Full Code Here

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

                                                                       null,
                                                                       null,
                                                                       serviceContract,
                                                                       null);
        Operation operation = new Operation<Type>("sayHi", null, null, null, false, null);
        TargetInvoker targetInvoker = compositeReference.createTargetInvoker(serviceContract, operation);
        assertNotNull(targetInvoker);
    }
View Full Code Here

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

                                                                       null,
                                                                       null,
                                                                       serviceContract,
                                                                       null);
        Operation operation = new Operation<Type>("sayHi", null, null, null, false, null);
        TargetInvoker targetInvoker = compositeReference.createCallbackTargetInvoker(serviceContract, operation);
        assertNotNull(targetInvoker);
    }
View Full Code Here

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

        JavaScriptComponent context =
            new JavaScriptComponent("source", implClass2, new HashMap<String, Object>(), services, null, scope,
                ArtifactFactory.createWireService(), null);
        scope.register(context);
        Operation<Type> operation = new Operation<Type>("greet", null, null, null, false, null);
        TargetInvoker invoker = context.createTargetInvoker(null, operation);
        assertEquals("foo", invoker.invokeTarget(new String[]{"foo"}));
        scope.stop();
    }
View Full Code Here

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

            for (OutboundInvocationChain chain : outboundWire.getInvocationChains().values()) {
                //FIXME should use target method, not outboundInvocationConfig.getMethod()
                Method[] methods = outboundWire.getServiceContract().getInterfaceClass().getMethods();
                Method m = JavaIDLUtils.findMethod(chain.getOperation(), methods);
                TargetInvoker invoker = new JavaTargetInvoker(m, targetContext);
                invoker.setCacheable(cacheable);
                chain.setTargetInvoker(invoker);
            }
        }
    }
View Full Code Here

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

    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);
        inboundChain.setTargetInvoker(invoker);
        inboundChain.prepare();
        inboundChain.getTargetInvoker().invokeTarget(val);
View Full Code Here

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

        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());
        connector.connect(inboundChain, outboundChain);
        inboundChain.setTargetInvoker(invoker);
        inboundChain.prepare();
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.