Example #1
0
  /**
   * Helper method to construct children endpoints
   *
   * @param listEndpointElement OMElement representing the children endpoints
   * @param parent Parent endpoint
   * @param properties bag of properties to pass in any information to the factory
   * @return List of children endpoints
   */
  protected ArrayList<Endpoint> getEndpoints(
      OMElement listEndpointElement, Endpoint parent, Properties properties) {

    ArrayList<Endpoint> endpoints = new ArrayList<Endpoint>();
    ArrayList<String> keys = new ArrayList<String>();
    Iterator iter = listEndpointElement.getChildrenWithName(XMLConfigConstants.ENDPOINT_ELT);
    while (iter.hasNext()) {
      OMElement endptElem = (OMElement) iter.next();
      Endpoint endpoint = EndpointFactory.getEndpointFromElement(endptElem, true, properties);
      if (endpoint instanceof IndirectEndpoint) {
        String key = ((IndirectEndpoint) endpoint).getKey();
        if (!keys.contains(key)) {
          keys.add(key);
        } else {
          handleException("Same endpoint definition cannot be used with in the siblings");
        }
      }
      endpoint.setParentEndpoint(parent);
      endpoints.add(endpoint);
    }

    return endpoints;
  }