Package org.apache.tuscany.spi.model

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


        throws XMLStreamException, LoaderException {
        assert SERVICE.equals(reader.getName());
        String name = reader.getAttributeValue(null, "name");
        String target = null;
        Binding binding = null;
        ServiceContract serviceContract = null;
        while (true) {
            int i = reader.next();
            switch (i) {
                case START_ELEMENT:
View Full Code Here


        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

        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

        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

        }
        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

        }
        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

        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

        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

    @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

    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

TOP

Related Classes of org.apache.tuscany.spi.model.ServiceContract

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.