Examples of BoundServiceDefinition


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

        while (true) {
            switch (reader.next()) {
                case START_ELEMENT:
                    QName qname = reader.getName();
                    if (SERVICE_ELEMENT.equals(qname)) {
                        BoundServiceDefinition service =
                            (BoundServiceDefinition) registry.load(parent, reader, deploymentContext);
                        if (!type.isExposeAllBeans()) {
                            String name = service.getName();
                            if (!type.getServiceTypes().containsKey(name)) {
                                LoaderException e = new LoaderException("No service defined in Spring context for ");
                                e.setIdentifier(name);
                                throw e;
                            }
                        }
                        type.getDeclaredServices().put(service.getName(), service);
                    } else if (REFERENCE_ELEMENT.equals(qname)) {
                        BoundReferenceDefinition reference =
                            (BoundReferenceDefinition) registry.load(parent, reader, deploymentContext);
                        type.getDeclaredReferences().put(reference.getName(), reference);
                    }
View Full Code Here

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

        // check parse of <service>
        Map<String, ServiceDefinition> services = composite.getDeclaredServices();
        assertEquals(1, services.size()); // included doesn't count
        services = composite.getServices();
        assertEquals(2, services.size()); // included counts
        BoundServiceDefinition serviceDefinition = (BoundServiceDefinition) services.get("service");
        assertNotNull(serviceDefinition);
        assertEquals("service", serviceDefinition.getName());
        assertEquals(BasicInterface.class, serviceDefinition.getServiceContract().getInterfaceClass());
        assertTrue(serviceDefinition.getBinding() instanceof SystemBinding);

        // check parse of <component>
        Map<String, ComponentDefinition<? extends Implementation<?>>> components = composite.getDeclaredComponents();
        assertEquals(1, components.size()); // included doesn't count
        components = composite.getComponents();
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.