com.jamonapi
Class FactoryDisabled

java.lang.Object
  extended by com.jamonapi.FactoryDisabled
All Implemented Interfaces:
MonitorFactoryInterface

public final class FactoryDisabled
extends java.lang.Object
implements MonitorFactoryInterface

Factory that returns null monitors when JAMon is disabled. Method are noops. Any methods that return Monitors return NullMonitors (noop monitors)


Constructor Summary
FactoryDisabled(MonitorFactoryInterface factoryEnabled)
          Creates a new instance of FactoryDisabled
 
Method Summary
 Monitor add(MonKey key, double value)
          Used when you want to create your own key for the monitor.
 Monitor add(java.lang.String label, java.lang.String units, double value)
          Return a monitor with the given label and units.
 void enableGlobalActive(boolean enable)
           
 boolean exists(MonKey key)
          Return true if the monitor associated with the passed in key exists
 boolean exists(java.lang.String label, java.lang.String units)
          Return true if the monitor associated with the passed in label and units exists
 MonitorComposite getComposite(java.lang.String units)
           
 Monitor getMonitor()
          Returns a non-TimeMonitor that won't update the jamon factory.
 Monitor getMonitor(MonKey key)
          Get the monitor associated with the passed in key.
 Monitor getMonitor(java.lang.String label, java.lang.String units)
          Get the monitor with the passed in label, and units.
 int getNumRows()
          Get the number of monitors in this factory
 java.lang.String[] getRangeHeader()
          Return the header associated with range names
 java.lang.Object[][] getRangeNames()
          Retun an array of range names.
 MonitorComposite getRootMonitor()
          Get the root composite monitor that contains all monitors in this factory
 Monitor getTimeMonitor(MonKey key)
          Get the time monitor associated with the passed in key.
 Monitor getTimeMonitor(java.lang.String label)
          Get the time monitor associated with the passed in label.
 java.lang.String getVersion()
          Get JAMon's version.
 boolean isGlobalActiveEnabled()
           
 java.util.Iterator iterator()
           
 void remove(MonKey key)
          Remove the monitor associated with the passed in key
 void remove(java.lang.String label, java.lang.String units)
          Remove the monitor associated with the passed in label and units
 void reset()
          Reset jamon stats for this factory.
 void setMap(java.util.Map map)
          Set the map that holds the monitors.
 void setRangeDefault(java.lang.String key, RangeHolder rangeHolder)
          Associate a Range mapping to any monitor that has a unit/key name that matches what is passed to key
 Monitor start()
          Returns a TimeMonitor that won't update the jamon factory.
 Monitor start(MonKey key)
          Start using the passed in key.
 Monitor start(java.lang.String label)
          Return a time monitor (the units are implied and are ms.
 Monitor startPrimary(MonKey key)
          Start a monitor with the specified key and mark it as primary
 Monitor startPrimary(java.lang.String label)
          Start a time monitor and mark it as primary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryDisabled

public FactoryDisabled(MonitorFactoryInterface factoryEnabled)
Creates a new instance of FactoryDisabled

Method Detail

add

public Monitor add(MonKey key,
                   double value)
Description copied from interface: MonitorFactoryInterface
Used when you want to create your own key for the monitor. This works similarly to a group by clause where the key is any columns used after the group by clause.

Specified by:
add in interface MonitorFactoryInterface

add

public Monitor add(java.lang.String label,
                   java.lang.String units,
                   double value)
Description copied from interface: MonitorFactoryInterface
Return a monitor with the given label and units. Note label has an effect on what range is used. If no range is associated with units then it will use the null range (i.e. no range) Sample Call: factory.add("com.fdsapi.MyException", "error", 1);

Specified by:
add in interface MonitorFactoryInterface

start

public Monitor start()
Description copied from interface: MonitorFactoryInterface
Returns a TimeMonitor that won't update the jamon factory.

Specified by:
start in interface MonitorFactoryInterface

start

public Monitor start(MonKey key)
Description copied from interface: MonitorFactoryInterface
Start using the passed in key. Note activity stats are incremented

Specified by:
start in interface MonitorFactoryInterface

start

public Monitor start(java.lang.String label)
Description copied from interface: MonitorFactoryInterface
Return a time monitor (the units are implied and are ms. Note activity stats are incremented

Specified by:
start in interface MonitorFactoryInterface

startPrimary

public Monitor startPrimary(MonKey key)
Description copied from interface: MonitorFactoryInterface
Start a monitor with the specified key and mark it as primary

Specified by:
startPrimary in interface MonitorFactoryInterface

startPrimary

public Monitor startPrimary(java.lang.String label)
Description copied from interface: MonitorFactoryInterface
Start a time monitor and mark it as primary

Specified by:
startPrimary in interface MonitorFactoryInterface

getMonitor

public Monitor getMonitor(MonKey key)
Description copied from interface: MonitorFactoryInterface
Get the monitor associated with the passed in key. It will be created if it doesn't exist

Specified by:
getMonitor in interface MonitorFactoryInterface

getMonitor

public Monitor getMonitor(java.lang.String label,
                          java.lang.String units)
Description copied from interface: MonitorFactoryInterface
Get the monitor with the passed in label, and units. It will be created if it doesn't exist

Specified by:
getMonitor in interface MonitorFactoryInterface

getTimeMonitor

public Monitor getTimeMonitor(MonKey key)
Description copied from interface: MonitorFactoryInterface
Get the time monitor associated with the passed in key. It will be created if it doesn't exist. The units are in ms.

Specified by:
getTimeMonitor in interface MonitorFactoryInterface

getTimeMonitor

public Monitor getTimeMonitor(java.lang.String label)
Description copied from interface: MonitorFactoryInterface
Get the time monitor associated with the passed in label. It will be created if it doesn't exist. The units are in ms.

Specified by:
getTimeMonitor in interface MonitorFactoryInterface

remove

public void remove(MonKey key)
Description copied from interface: MonitorFactoryInterface
Remove the monitor associated with the passed in key

Specified by:
remove in interface MonitorFactoryInterface

remove

public void remove(java.lang.String label,
                   java.lang.String units)
Description copied from interface: MonitorFactoryInterface
Remove the monitor associated with the passed in label and units

Specified by:
remove in interface MonitorFactoryInterface

exists

public boolean exists(MonKey key)
Description copied from interface: MonitorFactoryInterface
Return true if the monitor associated with the passed in key exists

Specified by:
exists in interface MonitorFactoryInterface

exists

public boolean exists(java.lang.String label,
                      java.lang.String units)
Description copied from interface: MonitorFactoryInterface
Return true if the monitor associated with the passed in label and units exists

Specified by:
exists in interface MonitorFactoryInterface

getComposite

public MonitorComposite getComposite(java.lang.String units)
Specified by:
getComposite in interface MonitorFactoryInterface

getRootMonitor

public MonitorComposite getRootMonitor()
Description copied from interface: MonitorFactoryInterface
Get the root composite monitor that contains all monitors in this factory

Specified by:
getRootMonitor in interface MonitorFactoryInterface

getNumRows

public int getNumRows()
Description copied from interface: MonitorFactoryInterface
Get the number of monitors in this factory

Specified by:
getNumRows in interface MonitorFactoryInterface

getRangeHeader

public java.lang.String[] getRangeHeader()
Description copied from interface: MonitorFactoryInterface
Return the header associated with range names

Specified by:
getRangeHeader in interface MonitorFactoryInterface

getRangeNames

public java.lang.Object[][] getRangeNames()
Description copied from interface: MonitorFactoryInterface
Retun an array of range names. This is dynamic based on what was passed to setRangeDefault

Specified by:
getRangeNames in interface MonitorFactoryInterface

getVersion

public java.lang.String getVersion()
Description copied from interface: MonitorFactoryInterface
Get JAMon's version. Example: 2.0

Specified by:
getVersion in interface MonitorFactoryInterface

setMap

public void setMap(java.util.Map map)
Description copied from interface: MonitorFactoryInterface
Set the map that holds the monitors. This could be used to aid jamon performance by passing in a high performance Thread safe map such as open source projects and jdk 1.5 have

Specified by:
setMap in interface MonitorFactoryInterface

setRangeDefault

public void setRangeDefault(java.lang.String key,
                            RangeHolder rangeHolder)
Description copied from interface: MonitorFactoryInterface
Associate a Range mapping to any monitor that has a unit/key name that matches what is passed to key

Specified by:
setRangeDefault in interface MonitorFactoryInterface

reset

public void reset()
Description copied from interface: MonitorFactoryInterface
Reset jamon stats for this factory. Like recreating the factory

Specified by:
reset in interface MonitorFactoryInterface

enableGlobalActive

public void enableGlobalActive(boolean enable)
Specified by:
enableGlobalActive in interface MonitorFactoryInterface

isGlobalActiveEnabled

public boolean isGlobalActiveEnabled()
Specified by:
isGlobalActiveEnabled in interface MonitorFactoryInterface

getMonitor

public Monitor getMonitor()
Description copied from interface: MonitorFactoryInterface
Returns a non-TimeMonitor that won't update the jamon factory.

Specified by:
getMonitor in interface MonitorFactoryInterface

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface MonitorFactoryInterface