Ejemplo n.º 1
0
  /** 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;
  }
Ejemplo n.º 2
0
  public void mergeMetrics(
      ServiceMetric serviceMetric, TransportServiceMonitorFilter transportServiceMonitorFilter) {
    TransportServiceMetric otherTransportServiceMetric = (TransportServiceMetric) serviceMetric;

    for (Iterator i = otherTransportServiceMetric.getTransportMetrics(); i.hasNext(); ) {
      TransportMetric otherTransportMetric = (TransportMetric) i.next();
      String protocol = otherTransportMetric.getProtocol();

      if ((transportServiceMonitorFilter == null)
          || transportServiceMonitorFilter.hasTransport(protocol)) {
        TransportMetric transportMetric =
            getTransportMetric(
                otherTransportMetric.getProtocol(), otherTransportMetric.getEndpointAddress());

        if (transportMetric == null) {
          transportMetric = new TransportMetric(otherTransportMetric);
          addTransportMetric(transportMetric);
        }

        transportMetric.mergeMetrics(otherTransportMetric);
      }
    }
  }
Ejemplo n.º 3
0
 /**
  * Get the Transport Metric for a specific Transport Type
  *
  * @param prototype a similar Transport metric object (ie same protocol/endpointAddress)
  * @see getTransportMetric(String, EndpointAddress)
  */
 public TransportMetric getTransportMetric(TransportMetric prototype) {
   return getTransportMetric(prototype.getProtocol(), prototype.getEndpointAddress());
 }