Sonic ESB API

com.sonicsw.esb.service.common.metrics
Class NoOpMetric

java.lang.Object
  extended by com.sonicsw.esb.service.common.metrics.NoOpMetric
All Implemented Interfaces:
SFCMetric

public class NoOpMetric
extends java.lang.Object
implements SFCMetric

Metric implementation that does nothing but hold a metric descriptor and write to the log.


Constructor Summary
NoOpMetric(MetricDescriptor descriptor)
           
 
Method Summary
 MetricDescriptor getMetricDescriptor()
          Returns the descriptor for this metric.
 long getRawValue()
          Gets the current value of this metric.
 void incrementValue()
          Increments the value for this metric by one.
 boolean isEnabled()
          Indicates whether this metric currently enabled.
 void resetValue()
          Resets the value of this metric to its initial value.
 void updateValue(long value)
          Updates the value for this metric.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpMetric

public NoOpMetric(MetricDescriptor descriptor)
Method Detail

getMetricDescriptor

public MetricDescriptor getMetricDescriptor()
Description copied from interface: SFCMetric
Returns the descriptor for this metric.

Specified by:
getMetricDescriptor in interface SFCMetric

getRawValue

public long getRawValue()
Description copied from interface: SFCMetric
Gets the current value of this metric.

Note that some metrics are computed by the metrics manager from a raw statistical value. This method returns the raw value rather than the computed result. For example: calling getCurrentMetricValue for an average will return the current total rather than the computed average.

Specified by:
getRawValue in interface SFCMetric
Returns:
the current value. The nature of this value depends on metric type and how its raw statistical value is tracked.

incrementValue

public void incrementValue()
Description copied from interface: SFCMetric
Increments the value for this metric by one. Assumes the metric is computing a total value. If the metric is not currently enabled, this method has no effect.

Specified by:
incrementValue in interface SFCMetric

isEnabled

public boolean isEnabled()
Description copied from interface: SFCMetric
Indicates whether this metric currently enabled. This can be used to conditionally call updateMetricValue if providing the value is expensive.

Specified by:
isEnabled in interface SFCMetric

resetValue

public void resetValue()
Description copied from interface: SFCMetric
Resets the value of this metric to its initial value. If the metric is not currently enabled, this method has no effect.

Specified by:
resetValue in interface SFCMetric

updateValue

public void updateValue(long value)
Description copied from interface: SFCMetric
Updates the value for this metric. The specific behavior (for example, whether this adds to a total value or replaces the current value) depends on the type of metric. If the metric is not currently enabled, this method has no effect.

Specified by:
updateValue in interface SFCMetric
Parameters:
value - the new value

Sonic ESB API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.