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

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


        CompositeComponentType<ServiceDefinition, ReferenceDefinition, JavaMappedProperty<?>> innerType =
            new CompositeComponentType<ServiceDefinition, ReferenceDefinition, JavaMappedProperty<?>>();
        innerType.add(createInnerSourceComponentDef());
        ReferenceDefinition reference = new ReferenceDefinition();
        reference.setName("TargetComponentRef");
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        JavaServiceContract targetContract = registry.introspect(Target.class);
        reference.setServiceContract(targetContract);
        innerType.add(reference);
        BindlessServiceDefinition service = new BindlessServiceDefinition();
        service.setName("InnerSourceService");
        JavaServiceContract sourceContract = registry.introspect(Source.class);
        service.setServiceContract(sourceContract);
        service.setTarget(new URI("InnerSourceComponent"));
        innerType.add(service);

        CompositeImplementation innerImpl = new CompositeImplementation();
View Full Code Here


        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> sourceType =
            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        sourceType.setImplementationScope(Scope.MODULE);
        JavaMappedReference reference = new JavaMappedReference();
        reference.setName("targetReference");
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> targetContract = registry.introspect(Target.class);
        targetContract.setCallbackClass(OtherTarget.class);
        targetContract.setCallbackName("OtherTarget");
        reference.setServiceContract(targetContract);
        reference.setMember(SourceImpl.class.getMethod("setTarget", Target.class));
        sourceType.add(reference);

        ServiceContract<?> sourceContract = registry.introspect(Source.class);

        JavaMappedService sourceServiceDefinition = new JavaMappedService();
        sourceServiceDefinition.setName("Source");
        sourceServiceDefinition.setServiceContract(sourceContract);
View Full Code Here

        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> targetType =
            new PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>>();
        targetType.setImplementationScope(Scope.MODULE);

        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> targetContract = registry.introspect(Target.class);
        targetContract.setCallbackClass(OtherTarget.class);
        targetContract.setCallbackName("OtherTarget");

        JavaMappedService serviceDefinition = new JavaMappedService();
        serviceDefinition.setName("Target");
View Full Code Here

        return chain;
    }

    protected 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

        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
            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

        PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type =
            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

        verify(invoker);
    }


    public InboundInvocationChain setupTarget(List<Interceptor> interceptors) {
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract;
        try {
            contract = registry.introspect(SimpleTarget.class);
        } catch (InvalidServiceContractException e) {
            throw new AssertionError();
        }
        Operation operation = contract.getOperations().get("echo");
        InboundInvocationChainImpl chain = new InboundInvocationChainImpl(operation);
View Full Code Here

        chain.addInterceptor(new InvokerInterceptor()); // add tail interceptor
        return chain;
    }

    public OutboundInvocationChain setupSource(List<Interceptor> interceptors) {
        JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl();
        ServiceContract<?> contract;
        try {
            contract = registry.introspect(SimpleTarget.class);
        } catch (InvalidServiceContractException e) {
            throw new AssertionError();
        }
        Operation operation = contract.getOperations().get("echo");
        OutboundInvocationChainImpl chain = new OutboundInvocationChainImpl(operation);
View Full Code Here

        assertNotNull(foo.hashCode());
    }

    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");
        echo = SimpleTarget.class.getMethod("echo", String.class);
View Full Code Here

    }

    private static Map<Operation<?>, OutboundInvocationChain> createInvocationChains(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

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.