View Javadoc

1   package fr.in2p3.jsaga.impl.monitoring;
2   
3   /* ***************************************************
4   * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
5   * ***             http://cc.in2p3.fr/             ***
6   * ***************************************************
7   * File:   MetricFactoryImpl
8   * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
9   * Date:   25 oct. 2008
10  * ***************************************************
11  * Description:                                      */
12  /**
13   *
14   */
15  public class MetricFactoryImpl<E> {
16      private AbstractMonitorableImpl m_monitorable;
17  
18      public MetricFactoryImpl(AbstractMonitorableImpl monitorable) {
19          m_monitorable = monitorable;
20      }
21  
22      public MetricImpl<E> createAndRegister(String name, String desc, MetricMode mode, String unit, MetricType type, E initialValue) {
23          MetricImpl<E> metric = new MetricImpl<E>(m_monitorable, name, desc, mode, unit, type, initialValue);
24          m_monitorable._addMetric(name, metric);
25          return metric;
26      }
27  }