org.javasimon.jmx
Interface SimonSuperMXBean

All Known Subinterfaces:
CounterMXBean, StopwatchMXBean
All Known Implementing Classes:
AbstractSimonMXBeanImpl, CounterMXBeanImpl, StopwatchMXBeanImpl

public interface SimonSuperMXBean

Interface with common methods for JMX beans for a signle Simon that corresponds to AbstractSimon in the core package.

Author:
Richard "Virgo" Richter

Method Summary
 long getFirstUsage()
          Returns ms timestamp of the first usage of this Simon.
 String getFirstUsageAsString()
          Returns nicely formatted timestamp of the first usage of this Simon.
 List<String> getChildrenNames()
          Returns list of children names.
 long getLastUsage()
          Returns ms timestamp of the last usage of this Simon.
 String getLastUsageAsString()
          Returns nicely formatted timestamp of the last usage of this Simon.
 String getName()
          Returns Simon name.
 String getNote()
          Returns note for the Simon.
 String getParentName()
          Returns name of the parent Simon.
 String getState()
          Returns state of the Simon that can be ENABLED, DISABLED or INHERITED.
 String getType()
          Returns Simon type used as a property in the ObjectName.
 boolean isEnabled()
          Returns true, if the Simon is enabled or if the enabled state is inherited.
 void reset()
          Resets the Simon, its usages and stat processor - concrete values depend on the type and the implementation.
 Sample sample()
          Samples Simon values and returns them in a Java Bean derived from Sample interface.
 Sample sampleAndReset()
          Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon.
 void setNote(String note)
          Sets note for the Simon.
 void setState(String state, boolean overrule)
          Sets the state of the Simon.
 

Method Detail

getName

String getName()
Returns Simon name. While Simon names can be null for anonymous Simons, such Simons are never registered hence this method never returns null.

Returns:
name of the Simon

getParentName

String getParentName()
Returns name of the parent Simon.

Returns:
name of the parent Simon

getChildrenNames

List<String> getChildrenNames()
Returns list of children names.

Returns:
list of children names

getState

String getState()
Returns state of the Simon that can be ENABLED, DISABLED or INHERITED. State is returned as a String that matches values of the SimonState enumeration.

Returns:
state of the Simon as a String

setState

void setState(String state,
              boolean overrule)
Sets the state of the Simon. It must be specified whether to propagate the change and overrule states of all sub-simons which effectively sets the same state to the whole subtree. If subtree is not overruled, some Simons (with their subtrees) may not be affected by this change.

Parameters:
state - a new state as a valid String for SimonState.valueOf(String)
overrule - specifies whether this change is forced to the whole subtree.

isEnabled

boolean isEnabled()
Returns true, if the Simon is enabled or if the enabled state is inherited.

Returns:
true, if the Simon is effectively enabled

reset

void reset()
Resets the Simon, its usages and stat processor - concrete values depend on the type and the implementation.


getNote

String getNote()
Returns note for the Simon. Note enables Simon with an additional information in human readable form.

Returns:
note for the Simon.

setNote

void setNote(String note)
Sets note for the Simon. Note enables Simon with an additional information in human readable form.

Parameters:
note - note for the Simon.

getFirstUsage

long getFirstUsage()
Returns ms timestamp of the first usage of this Simon. First and last usage are updated when monitor performs the measuring (start/stop/count/etc). They are not updated when values are obtained from the monitor.

Returns:
ms timestamp of the first usage

getFirstUsageAsString

String getFirstUsageAsString()
Returns nicely formatted timestamp of the first usage of this Simon.

Returns:
formatted date and time of the first usage

getLastUsage

long getLastUsage()
Returns ms timestamp of the last usage of this Simon. First and last usage are updated when monitor performs the measuring (start/stop/count/etc). They are not updated when values are obtained from the monitor.

Returns:
ms timestamp of the last usage

getLastUsageAsString

String getLastUsageAsString()
Returns nicely formatted timestamp of the last usage of this Simon.

Returns:
formatted date and time of the last usage

sample

Sample sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface.

Returns:
sample containing all Simon values

sampleAndReset

Sample sampleAndReset()
Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon. Operation is synchronized to assure atomicity.

Returns:
sample containing all Simon values

getType

String getType()
Returns Simon type used as a property in the ObjectName.

Returns:
Simon type


Copyright © 2013. All Rights Reserved.