Examples of ServiceContract


Examples of org.apache.tuscany.spi.model.ServiceContract

        throws ProcessingException {
        JavaMappedReference reference = new JavaMappedReference();
        reference.setName(name);
        reference.setMember(member);
        reference.setRequired(false);
        ServiceContract contract = null;
        try {
            contract = registry.introspect(paramType);
        } catch (InvalidServiceContractException e1) {
            throw new ProcessingException(e1);
        }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        }
        String name = toPropertyName(method.getName());
        JavaMappedService callbackService = null;
        Class<?> callbackClass = method.getParameterTypes()[0];
        for (JavaMappedService service : type.getServices().values()) {
            ServiceContract serviceContract = service.getServiceContract();
            if (serviceContract.getCallbackClass().equals(callbackClass)) {
                callbackService = service;
            }
        }
        if (callbackService == null) {
            throw new IllegalCallbackReferenceException("Callback type does not match a service callback interface");
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        }
        String name = field.getName();
        JavaMappedService callbacksService = null;
        Class<?> callbackClass = field.getType();
        for (JavaMappedService service : type.getServices().values()) {
            ServiceContract serviceContract = service.getServiceContract();
            if (serviceContract.getCallbackClass().equals(callbackClass)) {
                callbacksService = service;
            }
        }
        if (callbacksService == null) {
            throw new IllegalCallbackReferenceException("Callback type does not match a service callback interface");
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        JavaMappedReference reference = new JavaMappedReference();
        reference.setMember(method);
        reference.setAutowire(isAutowire);
        reference.setRequired(required);
        reference.setName(name);
        ServiceContract contract;
        try {
            contract = regsitry.introspect(method.getParameterTypes()[0]);
        } catch (InvalidServiceContractException e) {
            throw new ProcessingException(e);
        }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        JavaMappedReference reference = new JavaMappedReference();
        reference.setMember(field);
        reference.setRequired(required);
        reference.setAutowire(autowire);
        reference.setName(name);
        ServiceContract contract;
        try {
            contract = regsitry.introspect(field.getType());
        } catch (InvalidServiceContractException e) {
            throw new ProcessingException(e);
        }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

    @SuppressWarnings("unchecked")
    public void testCreateTargetInvoker() {
        // TODO: this doesn't really test anything yet
        RMIReference ref = new RMIReference(null, null, null, null, null, null, null, null);
        ServiceContract contract = new JavaServiceContract();
        contract.setInterfaceClass(String.class);
        List l = new ArrayList();
        l.add(new DataType(null, null));
        DataType in = new DataType(null, l);
        Operation operation = new Operation(null, in, null, null);
        try {
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

    public void testCreateConversationalService() throws Exception {
        JavaMappedService service = implService.createService(Foo.class);
        assertTrue(Foo.class.equals(service.getServiceContract().getInterfaceClass()));
        assertTrue(service.isRemotable());
        assertEquals(InteractionScope.CONVERSATIONAL, service.getServiceContract().getInteractionScope());
        ServiceContract serviceContract = service.getServiceContract();
        assertTrue(Bar.class.equals(serviceContract.getCallbackClass()));
        assertTrue("ImplementationProcessorServiceTestCase$Bar".equals(serviceContract.getCallbackName()));
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        ComponentType comonentType = introspector.introspectScript(scaConfig, rs.getClassLoader());
        assertNotNull(comonentType);
        Map services = comonentType.getServices();
        assertEquals(1, services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values().iterator().next();
        ServiceContract serviceContract = serviceDefinition.getServiceContract();
        assertTrue(serviceContract instanceof JavaServiceContract);
        JavaServiceContract javaServiceContract = (JavaServiceContract) serviceContract;
        assertEquals(HelloWorldService.class, javaServiceContract.getInterfaceClass());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        ComponentType comonentType = introspector.introspectScript(scaConfig, rs.getClassLoader());
        assertNotNull(comonentType);
        Map services = comonentType.getServices();
        assertEquals(1, services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values().iterator().next();
        ServiceContract serviceContract = serviceDefinition.getServiceContract();
        assertTrue(serviceContract instanceof WSDLServiceContract);
        WSDLServiceContract wsdlServiceContract = (WSDLServiceContract) serviceContract;
        assertEquals(new QName("http://helloworld", "HelloWorld"), wsdlServiceContract.getPortType().getQName());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceContract

        JavaMappedReference mappedReference = new JavaMappedReference();
        mappedReference.setName("ref");
        Method refMethod = FooImpl.class.getMethod("setRef", Foo.class);
        refMethod.setAccessible(true);
        mappedReference.setMember(refMethod);
        ServiceContract contract = new JavaServiceContract(Foo.class);
        mappedReference.setServiceContract(contract);
        type.add(mappedReference);
        ConstructorDefinition<FooImpl> ctorDef = new ConstructorDefinition<FooImpl>(FooImpl.class.getConstructor());
        type.setConstructorDefinition(ctorDef);
        SystemImplementation impl = new SystemImplementation();
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.