Package org.apache.servicemix.common.packaging

Examples of org.apache.servicemix.common.packaging.Consumes


        return consumes;
    }

    private List<Consumes> generateConsumesFromTarget(ExchangeTarget target, List<Consumes> consumes) {
        if (target != null) {
            Consumes consume = new Consumes();
            consume.setEndpointName(target.getEndpoint());
            consume.setServiceName(target.getService());
            consume.setInterfaceName(target.getInterface());
            consumes.add(consume);
        }
        return consumes;
    }
View Full Code Here


        List consumes = new ArrayList();
        List provides = new ArrayList();

        QName serviceName = new QName("http://test.com/encoding", "abc���");

        Consumes newConsumes = new Consumes();
        newConsumes.setServiceName(serviceName);
        newConsumes.setEndpointName("consumer���");
        consumes.add(newConsumes);

        Provides newProvides = new Provides();
        newProvides.setServiceName(serviceName);
        newProvides.setEndpointName("provider���");
View Full Code Here

        assertEquals(doc.getXmlEncoding(), expectedXmlEncoding);

        Element serviceElement = getServicesElement(doc);

        List consumes = getConsumes(serviceElement);
        Consumes con = (Consumes) consumes.get(0);
        assertEquals(con.getServiceName().getLocalPart(), "abc���");
        assertEquals(con.getEndpointName(), "consumer���");

        List provides = getProvides(serviceElement);
        Provides prov = (Provides) provides.get(0);
        assertEquals(prov.getServiceName().getLocalPart(), "abc���");
        assertEquals(prov.getEndpointName(), "provider���");
View Full Code Here

        for (int i = 0; i < children.getLength(); i++) {
            if (children.item(i) instanceof Element) {
                Element childElement = (Element) children.item(i);
                if (XmlDescriptorHelper.isElement(childElement, JBI_NAMESPACE,
                        "consumes")) {
                    Consumes newConsumes = new Consumes();
                    newConsumes.setEndpointName(XmlDescriptorHelper
                            .getEndpointName(childElement));
                    newConsumes.setInterfaceName(XmlDescriptorHelper
                            .getInterfaceName(childElement));
                    newConsumes.setServiceName(XmlDescriptorHelper
                            .getServiceName(childElement));
                    consumes.add(newConsumes);
                }
            }
        }
View Full Code Here

public class JmsServiceUnitAnalyzer extends AbstractXBeanServiceUnitAnalyzer {

    protected List getConsumes(Endpoint endpoint) {
        List consumesList = new ArrayList();
        Consumes consumes;
        if (endpoint.getRole().equals(MessageExchange.Role.CONSUMER)) {
            consumes = new Consumes();
            JmsEndpoint httpEndpoint = (JmsEndpoint) endpoint;
            consumes.setEndpointName(httpEndpoint.getTargetEndpoint());
            consumes.setInterfaceName(httpEndpoint.getTargetInterfaceName());
            consumes.setServiceName(httpEndpoint.getTargetService());
            if (consumes.isValid()) {
                consumesList.add(consumes);
            } else {
                consumes = new Consumes();
                consumes.setEndpointName(endpoint.getEndpoint());
                consumes.setInterfaceName(endpoint.getInterfaceName());
                consumes.setServiceName(endpoint.getService());
                consumesList.add(consumes);
            }
        }

        return consumesList;
View Full Code Here

*/
public class HttpServiceUnitAnalyzer extends AbstractXBeanServiceUnitAnalyzer {

    protected List getConsumes(Endpoint endpoint) {
        List consumesList = new ArrayList();
        Consumes consumes;
        if (endpoint.getRole().equals(MessageExchange.Role.CONSUMER)) {
            consumes = new Consumes();
            HttpEndpoint httpEndpoint = (HttpEndpoint) endpoint;
            consumes.setEndpointName(httpEndpoint.getTargetEndpoint());
            consumes.setInterfaceName(httpEndpoint.getTargetInterfaceName());
            consumes.setServiceName(httpEndpoint.getTargetService());
            if (consumes.isValid()) {
                consumesList.add(consumes);
            } else {
                consumes = new Consumes();
                consumes.setEndpointName(endpoint.getEndpoint());
                consumes.setInterfaceName(endpoint.getInterfaceName());
                consumes.setServiceName(endpoint.getService());
                consumesList.add(consumes);
            }
        }

        return consumesList;
View Full Code Here

            namespaceCounter = resolveMapEntry(namespaceMap, providesEntry
                    .getServiceName(), namespaceCounter);
        }

        for (Iterator iterator = consumes.iterator(); iterator.hasNext();) {
            Consumes consumesEntry = (Consumes) iterator.next();
            namespaceCounter = resolveMapEntry(namespaceMap, consumesEntry
                    .getInterfaceName(), namespaceCounter);
            namespaceCounter = resolveMapEntry(namespaceMap, consumesEntry
                    .getServiceName(), namespaceCounter);
        }

        return namespaceMap;
    }
View Full Code Here

            writer.endElement();
        }

        // Put in the consumes
        for (Iterator iterator = consumes.iterator(); iterator.hasNext();) {
            Consumes consumesEntry = (Consumes) iterator.next();
            writer.startElement("consumes");
            addQNameAttribute(writer, "interface-name", consumesEntry
                    .getInterfaceName(), namespaceMap);
            addQNameAttribute(writer, "service-name", consumesEntry
                    .getServiceName(), namespaceMap);
            addStringAttribute(writer, "endpoint-name", consumesEntry
                    .getEndpointName());

            // TODO Handling of LinkType?

            writer.endElement();
View Full Code Here

                for (int i = 0; i < children.getLength(); i++) {
                    if (children.item(i) instanceof Element) {
                        Element childElement = (Element) children.item(i);
                        if (XmlDescriptorHelper.isElement(childElement,
                                JBI_NAMESPACE, "consumes")) {
                            Consumes newConsumes = new Consumes();
                            newConsumes.setEndpointName(XmlDescriptorHelper
                                    .getEndpointName(childElement));
                            newConsumes.setInterfaceName(XmlDescriptorHelper
                                    .getInterfaceName(childElement));
                            newConsumes.setServiceName(XmlDescriptorHelper
                                    .getServiceName(childElement));
                            consumes.add(newConsumes);
                        } else if (XmlDescriptorHelper.isElement(childElement,
                                JBI_NAMESPACE, "provides")) {
                            Provides newProvides = new Provides();
View Full Code Here

                        for (int x = 0; x < connectionChildren.getLength(); x++) {
                            if (connectionChildren.item(x) instanceof Element) {
                                Element childElement = (Element) connectionChildren.item(x);
                                if (XmlDescriptorHelper.isElement(
                                        childElement, JBI_NAMESPACE, "consumer")) {
                                    Consumes newConsumes = new Consumes();
                                    newConsumes.setEndpointName(XmlDescriptorHelper
                                                    .getEndpointName(childElement));
                                    newConsumes.setInterfaceName(XmlDescriptorHelper
                                                    .getInterfaceName(childElement));
                                    newConsumes.setServiceName(XmlDescriptorHelper
                                                    .getServiceName(childElement));
                                    connection.setConsumes(newConsumes);
                                } else if (XmlDescriptorHelper.isElement(
                                        childElement, JBI_NAMESPACE, "provider")) {
                                    Provides newProvides = new Provides();
View Full Code Here

TOP

Related Classes of org.apache.servicemix.common.packaging.Consumes

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.