Package org.apache.tuscany.core.idl.java

Examples of org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl.introspect()


     */
    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


        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

    }

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

    /**
     * Tests basic wiring of a source to a target, including handlers and interceptors
View Full Code Here

    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

    }

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

    public void testBasicInvoke() throws Throwable {
        OutboundWire wire = new OutboundWireImpl();
View Full Code Here

        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

            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        type.setConstructorDefinition(ctorDef);
        type.setImplementationScope(Scope.MODULE);
        Method method = FooImpl.class.getMethod("setCallback", FooCallback.class);
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(Foo.class);
        contract.setCallbackClass(FooCallback.class);
        contract.setCallbackName("callback");
        JavaMappedService mappedService = new JavaMappedService("Foo", contract, false, "callback", method);
        type.getServices().put("Foo", mappedService);
View Full Code Here

            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        type.setConstructorDefinition(ctorDef);
        type.setImplementationScope(Scope.MODULE);
        Method method = FooClient.class.getMethod("setFoo", Foo.class);
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract = registry.introspect(Foo.class);
        contract.setCallbackClass(FooCallback.class);
        contract.setCallbackName("callback");
        JavaMappedReference mappedReference = new JavaMappedReference("foo", contract, method);
        type.getReferences().put("foo", mappedReference);
        ReferenceTarget refTarget = new ReferenceTarget();
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.