com.jamonapi
Class Monitor

java.lang.Object
  extended by com.jamonapi.Monitor
Direct Known Subclasses:
MonitorComposite, NullMonitor

public abstract class Monitor
extends java.lang.Object


Field Summary
static java.lang.String MAX
           
static java.lang.String MAXACTIVE
           
static java.lang.String MIN
           
static java.lang.String VALUE
          Used in call to addListener(...).
 
Method Summary
 Monitor add(double value)
          This method adds a value to the monitor (and aggegates statistics on it)
 void disable()
          Disable the monitor.
 void enable()
          enable the monitor.
 double getActive()
           
 double getAvg()
           
 double getAvgActive()
           
 double getAvgGlobalActive()
           
 double getAvgPrimaryActive()
           
 java.util.Date getFirstAccess()
           
 double getHits()
           
 JAMonDetailValue getJAMonDetailRow()
           
 java.lang.String getLabel()
          Returns the label for the monitor
 java.util.Date getLastAccess()
           
 double getLastValue()
           
 ListenerType getListenerType(java.lang.String listenerType)
          Add a listener that receives notification every time this monitors add method is called.
 double getMax()
           
 double getMaxActive()
           
 double getMin()
           
 MonKey getMonKey()
          Return the label associated with this monitor.
 Range getRange()
          Return the Range object associated with this monitor.
 double getStdDev()
           
 double getTotal()
           
 java.lang.String getUnits()
          Returns the units for the monitor
 boolean hasListeners()
           
 boolean isActivityTracking()
           
 boolean isEnabled()
          Is the monitor enabled.
 boolean isPrimary()
           
 void reset()
          reset all values in the monitor to their defaults
 void setAccessStats(long now)
           
 void setActive(double value)
           
 void setActivityTracking(boolean trackActivity)
          FROM frequencydistimp
 void setFirstAccess(java.util.Date date)
           
 void setHits(double value)
           
 void setLastAccess(java.util.Date date)
           
 void setLastValue(double value)
           
 void setMax(double value)
           
 void setMaxActive(double value)
           
 void setMin(double value)
           
 void setPrimary(boolean isPrimary)
          Indicate that this a primary Monitor.
 void setTotal(double value)
           
 void setTotalActive(double value)
          Neeed to reset this to 0.0 to remove avg active numbers
 Monitor start()
          Start a monitor.
 Monitor stop()
          Stop a monitor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE

public static final java.lang.String VALUE
Used in call to addListener(...). i.e. addListener(Monitor.MAX, ...)

See Also:
Constant Field Values

MAX

public static final java.lang.String MAX
See Also:
Constant Field Values

MIN

public static final java.lang.String MIN
See Also:
Constant Field Values

MAXACTIVE

public static final java.lang.String MAXACTIVE
See Also:
Constant Field Values
Method Detail

getMonKey

public MonKey getMonKey()
Return the label associated with this monitor.


getLabel

public java.lang.String getLabel()
Returns the label for the monitor


getUnits

public java.lang.String getUnits()
Returns the units for the monitor


setAccessStats

public void setAccessStats(long now)

reset

public void reset()
reset all values in the monitor to their defaults


getTotal

public double getTotal()

setTotal

public void setTotal(double value)

getAvg

public double getAvg()

getMin

public double getMin()

setMin

public void setMin(double value)

getMax

public double getMax()

setMax

public void setMax(double value)

getHits

public double getHits()

setHits

public void setHits(double value)

getStdDev

public double getStdDev()

setFirstAccess

public void setFirstAccess(java.util.Date date)

getFirstAccess

public java.util.Date getFirstAccess()

setLastAccess

public void setLastAccess(java.util.Date date)

getLastAccess

public java.util.Date getLastAccess()

getLastValue

public double getLastValue()

setLastValue

public void setLastValue(double value)

disable

public void disable()
Disable the monitor. If a monitor is disabled all other calls to the monitor are noops.


enable

public void enable()
enable the monitor. If the monitor is enabled all other calls to the monitor have an action


isEnabled

public boolean isEnabled()
Is the monitor enabled.


getListenerType

public ListenerType getListenerType(java.lang.String listenerType)
Add a listener that receives notification every time this monitors add method is called. If null is passed all associated Listeners will be detached.


start

public Monitor start()
Start a monitor. This increments the active counter by one. Calling start is not required. If it is called stop should be called too.


stop

public Monitor stop()
Stop a monitor. The decrements the active counter by one. Calling stop is required if start is called.


add

public Monitor add(double value)
This method adds a value to the monitor (and aggegates statistics on it)


getRange

public Range getRange()
Return the Range object associated with this monitor. The range object is a compromise between saving all data or none


getActive

public double getActive()

setActive

public void setActive(double value)

getMaxActive

public double getMaxActive()

setMaxActive

public void setMaxActive(double value)

setTotalActive

public void setTotalActive(double value)
Neeed to reset this to 0.0 to remove avg active numbers


isPrimary

public boolean isPrimary()

setPrimary

public void setPrimary(boolean isPrimary)
Indicate that this a primary Monitor. See www.jamonapi.com for an explanation of primary monitors


hasListeners

public boolean hasListeners()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setActivityTracking

public void setActivityTracking(boolean trackActivity)
FROM frequencydistimp


isActivityTracking

public boolean isActivityTracking()

getAvgActive

public double getAvgActive()

getAvgGlobalActive

public double getAvgGlobalActive()

getAvgPrimaryActive

public double getAvgPrimaryActive()

getJAMonDetailRow

public JAMonDetailValue getJAMonDetailRow()