Package org.apache.tuscany.spi.model

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


    @SuppressWarnings("unchecked")
    private void introspectJavaInterface(ComponentType componentType, ClassLoader cl, String serviceClass)
        throws MissingResourceException, InvalidServiceContractException {
        if (serviceClass != null) {
            ServiceDefinition service = new ServiceDefinition();
            try {
                ServiceContract<?> sc = processorRegistry.introspect(Class.forName(serviceClass));
                service.setServiceContract(sc);
                componentType.add(service);
            } catch (ClassNotFoundException e) {
                throw new MissingResourceException("Interface not found", e);
            }
        }
View Full Code Here


            portType = readWSDLPortType(wsdlNamespace, wsdlPortType, wsdlLocation, portType);
        } else {
            portType = getPortType(wsdlNamespace, wsdlPortType);
        }

        ServiceDefinition service = new ServiceDefinition();
        WSDLServiceContract wsdlSC = new WSDLServiceContract();
        wsdlSC.setPortType(portType);
        service.setServiceContract(wsdlSC);
        componentType.add(service);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    private void introspectJavaInterface(ComponentType componentType, ClassLoader cl, String serviceClass)
        throws MissingResourceException, InvalidServiceContractException {
        if (serviceClass != null) {
            ServiceDefinition service = new ServiceDefinition();
            try {
                ServiceContract<?> sc = processorRegistry.introspect(Class.forName(serviceClass));
                service.setServiceContract(sc);
                componentType.add(service);
            } catch (ClassNotFoundException e) {
                throw new MissingResourceException("Interface not found", e);
            }
        }
View Full Code Here

            portType = readWSDLPortType(wsdlNamespace, wsdlPortType, wsdlLocation, portType);
        } else {
            portType = getPortType(wsdlNamespace, wsdlPortType);
        }

        ServiceDefinition service = new ServiceDefinition();
        WSDLServiceContract wsdlSC = new WSDLServiceContract();
        wsdlSC.setPortType(portType);
        service.setServiceContract(wsdlSC);
        componentType.add(service);
    }
View Full Code Here

                            }
                           
                            return new BindlessServiceDefinition(name, serviceContract, false, targetURI);
                        } else {
                            // FIXME need a way to specify "remotable" on a service
                            return new ServiceDefinition(name, serviceContract, false);
                        }
                    }
                    break;
            }
        }
View Full Code Here

                                                                   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

                                                                   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

            new JavaScriptIntrospector(null, new JavaInterfaceProcessorRegistryImpl());
        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

            new JavaScriptIntrospector(wsdlReg, new JavaInterfaceProcessorRegistryImpl());
        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

    public void testIntrospectUnannotatedClass() throws ProcessingException {
        CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class);
        SystemImplementation impl = new SystemImplementation(BasicInterfaceImpl.class);
        PojoComponentType<?, ?, ?> componentType = loader.loadByIntrospection(parent, impl, null);
        ServiceDefinition service = componentType.getServices().get("BasicInterface");
        assertEquals(BasicInterface.class, service.getServiceContract().getInterfaceClass());
        Property<?> property = componentType.getProperties().get("publicProperty");
        assertEquals(String.class, property.getJavaType());
        ReferenceDefinition referenceDefinition = componentType.getReferences().get("protectedReference");
        assertEquals(BasicInterface.class, referenceDefinition.getServiceContract().getInterfaceClass());
    }
View Full Code Here

TOP

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

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.