throws SoapFault
{
super.initialize();
WsResource resource = getWsResource();
ResourcePropertyCollection props = resource.getPropertyCollection();
MetadataDescriptor metadata = props.getMetadata();
//
// load all of the metric data from the RMD
//
Iterator i = metadata.getPropertyNames().iterator();
while (i.hasNext())
{
QName qname = (QName)i.next();
String capability = metadata.getExtendedMetadata(qname, MuwsConstants.CAPABILITY_QNAME);
//
// a property is a metric IF it defines a Capability element in
// its RMD definition with the Metrics capability URI
//
if (capability != null && capability.equals(MuwsConstants.METRICS_URI))
{
Metric metric = new SimpleMetric(qname, resource);
_metricsByQName.put(qname, metric);
//
// on demand? update metadata before reads
//
if (metric.isOnDemand())
props.addReadListener(new MetricOnDemandListener(metric));
//
// add metric attributes for all reads
//
props.addReadListener(new MetricDecorationProvider(metric));
//
// update metadata whenever changes occur
//
props.addChangeListener(new MetricUpdateListener(metric));
//
// special case: counters that run on an interval can be
// automated by starting a thread that increments the value
// every N seconds