Package org.apache.tuscany.spi.wire

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


        configuration.setServices(services);
        configuration.setScopeContainer(scopeContainer);
        configuration.setWireService(createWireService());
        GroovyAtomicComponent component = new GroovyAtomicComponent(configuration, null);
        Operation<Type> operation = new Operation<Type>("greet", null, null, null, false, null);
        TargetInvoker invoker = component.createTargetInvoker(null, operation);
        assertEquals("foo", invoker.invokeTarget(new String[]{"foo"}));
    }
View Full Code Here


            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

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

        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

    }

    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

                                                                       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

                                                                       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

        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

            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

    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

TOP

Related Classes of org.apache.tuscany.spi.wire.TargetInvoker

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.