/** Get the Transport Metric for a specific Transport Type */
  public TransportMetric getTransportMetric(String protocol, EndpointAddress endpointAddress) {
    for (Iterator i = transportMetrics.iterator(); i.hasNext(); ) {
      TransportMetric transportMetric = (TransportMetric) i.next();
      if (protocol.equals(transportMetric.getProtocol())
          && endpointAddress.equals(transportMetric.getEndpointAddress())) return transportMetric;
    }

    return null;
  }
  /** {@inheritDoc} */
  public void serializeTo(Element element) throws DocumentSerializationException {
    for (Iterator i = transportMetrics.iterator(); i.hasNext(); ) {
      TransportMetric transportMetric = (TransportMetric) i.next();

      DocumentSerializableUtilities.addDocumentSerializable(
          element, "transportMetric", transportMetric);
    }
    if (moduleClassID != null) {
      DocumentSerializableUtilities.addString(element, "moduleClassID", moduleClassID.toString());
    }
  }
  /** {@inheritDoc} */
  public void initializeFrom(Element element) throws DocumentSerializationException {
    for (Enumeration e = element.getChildren(); e.hasMoreElements(); ) {
      Element childElement = (TextElement) e.nextElement();
      String tagName = (String) childElement.getKey();

      if (tagName.equals("transportMetric")) {
        TransportMetric transportMetric =
            (TransportMetric)
                DocumentSerializableUtilities.getDocumentSerializable(
                    childElement, TransportMetric.class);
        transportMetrics.add(transportMetric);
      }
      if (tagName.equals("moduleClassID")) {
        try {
          moduleClassID =
              (ModuleClassID)
                  IDFactory.fromURI(new URI(DocumentSerializableUtilities.getString(childElement)));
        } catch (URISyntaxException jex) {
          throw new DocumentSerializationException("Can't read moduleClassID", jex);
        }
      }
    }
  }
 /** Get all Transport Metrics */
 public Iterator getTransportMetrics() {
   return transportMetrics.iterator();
 }
 /** Append a Transport Metric */
 public void addTransportMetric(TransportMetric transportMetric) {
   transportMetrics.add(transportMetric);
 }