package net.hyperic.hq.product.mx4j;

import java.util.Properties;

import net.hyperic.hq.product.MeasurementPlugin;
import net.hyperic.hq.product.Metric;
import net.hyperic.hq.product.MetricNotFoundException;
import net.hyperic.hq.product.MetricUnreachableException;
import net.hyperic.hq.product.MetricValue;
import net.hyperic.hq.product.PluginException;

public class MX4JMeasurementPlugin
    extends MeasurementPlugin {

    public MetricValue getValue(Metric metric)
        throws PluginException,
               MetricNotFoundException,
               MetricUnreachableException 
    {
        Object obj = MX4JUtil.getValue(metric);

        double val = Double.valueOf(obj.toString()).doubleValue();

        return new MetricValue(val);
    }
}
