Package org.apache.servicemix.common.packaging

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


  }

  protected List getProvides(Endpoint endpoint) {
    List providesList = new ArrayList();
    if (endpoint.getRole().equals(MessageExchange.Role.PROVIDER)) {
      Provides newProvide = new Provides();
      newProvide.setEndpointName(endpoint.getEndpoint());
      newProvide.setInterfaceName(endpoint.getInterfaceName());
      newProvide.setServiceName(endpoint.getService());
      providesList.add(newProvide);
    }

    return providesList;
  }
View Full Code Here


  }

  protected List getProvides(Endpoint endpoint) {
    List providesList = new ArrayList();
    if (endpoint.getRole().equals(MessageExchange.Role.PROVIDER)) {
      Provides newProvide = new Provides();
      newProvide.setEndpointName(endpoint.getEndpoint());
      newProvide.setInterfaceName(endpoint.getInterfaceName());
      newProvide.setServiceName(endpoint.getService());
      providesList.add(newProvide);
    }

    return providesList;
  }
View Full Code Here

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

    Provides newProvides = new Provides();
    newProvides.setServiceName(serviceName);
    newProvides.setEndpointName("provider���");
    provides.add(newProvides);

    JbiServiceUnitDescriptorWriter writer = new JbiServiceUnitDescriptorWriter(
        encoding);
    writer.write(descriptor, false, "name", "description", new ArrayList(), consumes,
View Full Code Here

    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,
            "provides")) {
          Provides newProvides = new Provides();
          newProvides.setEndpointName(XmlDescriptorHelper
              .getEndpointName(childElement));
          newProvides.setInterfaceName(XmlDescriptorHelper
              .getInterfaceName(childElement));
          newProvides.setServiceName(XmlDescriptorHelper
              .getServiceName(childElement));
          provides.add(newProvides);
        }
      }
    }
View Full Code Here

              newConsumes.setServiceName(XmlDescriptorHelper
                  .getServiceName(childElement));
              consumes.add(newConsumes);
            } else if (XmlDescriptorHelper.isElement(childElement,
                JBI_NAMESPACE, "provides")) {
              Provides newProvides = new Provides();
              newProvides.setEndpointName(XmlDescriptorHelper
                  .getEndpointName(childElement));
              newProvides.setInterfaceName(XmlDescriptorHelper
                  .getInterfaceName(childElement));
              newProvides.setServiceName(XmlDescriptorHelper
                  .getServiceName(childElement));
              provides.add(newProvides);
            }
          }
        }
View Full Code Here

                            .getServiceName(childElement));
                    connection.setConsumes(newConsumes);
                  } else if (XmlDescriptorHelper.isElement(childElement,
                      JBI_NAMESPACE,
                      "provider")) {
                    Provides newProvides = new Provides();
                    newProvides
                        .setEndpointName(XmlDescriptorHelper
                            .getEndpointName(childElement));
                    newProvides
                        .setInterfaceName(XmlDescriptorHelper
                            .getInterfaceName(childElement));
                    newProvides
                        .setServiceName(XmlDescriptorHelper
                            .getServiceName(childElement));
                    connection.setProvides(newProvides);
                  }
                }
View Full Code Here

  protected Map getNamespaceMap(List provides, List consumes) {
    Map namespaceMap = new HashMap();
    int namespaceCounter = 1;
    for (Iterator iterator = provides.iterator(); iterator.hasNext();) {
      Provides providesEntry = (Provides) iterator.next();
      namespaceCounter = resolveMapEntry(namespaceMap, providesEntry.getInterfaceName(),
          namespaceCounter);
      namespaceCounter = resolveMapEntry(namespaceMap, providesEntry.getServiceName(),
          namespaceCounter);
    }
 
    for (Iterator iterator = consumes.iterator(); iterator.hasNext();) {
      Consumes consumesEntry = (Consumes) iterator.next();
View Full Code Here

      writer.addAttribute(namespaceDecl.toString(), key);
    }

    // Put in the provides
    for (Iterator iterator = provides.iterator(); iterator.hasNext();) {
      Provides providesEntry = (Provides) iterator.next();
      writer.startElement("provides");
      addQNameAttribute(writer, "interface-name", providesEntry
          .getInterfaceName(), namespaceMap);
      addQNameAttribute(writer, "service-name", providesEntry
          .getServiceName(), namespaceMap);
      addStringAttribute(writer, "endpoint-name", providesEntry
          .getEndpointName());
      writer.endElement();
    }

    // Put in the consumes
View Full Code Here

TOP

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

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.