Package org.apache.tuscany.spi.idl.java

Examples of org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorRegistry


     * @param interfaze   the interface associated with the wire
     */
    public static <T> InboundWire createInboundWire(String serviceName, Class<T> interfaze)
        throws InvalidServiceContractException {
        InboundWire wire = new InboundWireImpl();
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(interfaze);
        wire.setServiceContract(contract);
        wire.setServiceName(serviceName);
        wire.addInvocationChains(createInboundChains(interfaze));
        return wire;
    }
View Full Code Here


    public static <T> OutboundWire createOutboundWire(String refName, Class<T> interfaze)
        throws InvalidServiceContractException {
        OutboundWire wire = new OutboundWireImpl();
        wire.setReferenceName(refName);
        wire.addInvocationChains(createOutboundChains(interfaze));
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(interfaze);
        wire.setServiceContract(contract);
        return wire;
    }
View Full Code Here

    }

    private static Map<Operation<?>, OutboundInvocationChain> createOutboundChains(Class<?> interfaze)
        throws InvalidServiceContractException {
        Map<Operation<?>, OutboundInvocationChain> invocations = new HashMap<Operation<?>, OutboundInvocationChain>();
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(interfaze);
        for (Operation operation : contract.getOperations().values()) {
            OutboundInvocationChain chain = new OutboundInvocationChainImpl(operation);
            invocations.put(operation, chain);
        }
        return invocations;
View Full Code Here

    }

    private static Map<Operation<?>, InboundInvocationChain> createInboundChains(Class<?> interfaze)
        throws InvalidServiceContractException {
        Map<Operation<?>, InboundInvocationChain> invocations = new HashMap<Operation<?>, InboundInvocationChain>();
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(interfaze);
        for (Operation<?> operation : contract.getOperations().values()) {
            InboundInvocationChain chain = new InboundInvocationChainImpl(operation);
            // add tail interceptor
            //chain.addInterceptor(new InvokerInterceptor());
            invocations.put(operation, chain);
View Full Code Here

        super(arg0);
    }

    public void setUp() throws Exception {
        super.setUp();
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        contract = registry.introspect(SimpleTarget.class);
        hello = SimpleTarget.class.getMethod("hello", String.class);
    }
View Full Code Here

public class BasicReferenceInvocationHandlerTestCase extends TestCase {

    private Method echo;

    public void testInterceptorInvoke() throws Throwable {
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(SimpleTarget.class);
        Operation<?> operation = contract.getOperations().get("echo");
        MockStaticInvoker invoker = new MockStaticInvoker(echo, new SimpleTargetImpl());
        OutboundInvocationChain chain = new OutboundInvocationChainImpl(operation);
        MockSyncInterceptor interceptor = new MockSyncInterceptor();
        chain.addInterceptor(interceptor);
View Full Code Here

        super(arg0);
    }

    public void setUp() throws Exception {
        super.setUp();
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        contract = registry.introspect(SimpleTarget.class);
        hello = SimpleTarget.class.getMethod("hello", String.class);
    }
View Full Code Here

            TestBean.class.getDeclaredMethod("checkedException", (Class[]) null);
        runtimeMethod =
            TestBean.class.getDeclaredMethod("runtimeException", (Class[]) null);
        assertNotNull(checkedMethod);
        assertNotNull(runtimeMethod);
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract;
        try {
            contract = registry.introspect(TestBean.class);
        } catch (InvalidServiceContractException e) {
            throw new AssertionError();
        }

        checkedOperation = contract.getOperations().get("checkedException");
View Full Code Here

        super(arg0);
    }

    public void setUp() throws Exception {
        super.setUp();
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract;
        try {
            contract = registry.introspect(SimpleTarget.class);
        } catch (InvalidServiceContractException e) {
            throw new AssertionError();
        }

        operation = contract.getOperations().get("echo");
View Full Code Here

        return wire;
    }

    public static Map<Operation<?>, InboundInvocationChain> createInboundChains(Class<?> interfaze)
        throws InvalidServiceContractException {
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        Map<Operation<?>, InboundInvocationChain> invocations = new HashMap<Operation<?>, InboundInvocationChain>();
        ServiceContract<?> contract = registry.introspect(interfaze);

        for (Operation<?> operation : contract.getOperations().values()) {
            InboundInvocationChain chain = new InboundInvocationChainImpl(operation);
            // add tail interceptor
            chain.addInterceptor(new InvokerInterceptor());
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorRegistry

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.