|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.jmx.AbstractSimonMXBeanImpl
org.javasimon.jmx.CounterMXBeanImpl
public class CounterMXBeanImpl
MX Bean representing a particular Counter. It is not created
by default when JMX is activated - it must be created explicitely.
JmxRegisterCallback can be used to automate this.
counter is declared protected for this reason.
| Field Summary | |
|---|---|
protected Counter |
counter
Wrapped Counter instance - protected for subclasses. |
| Constructor Summary | |
|---|---|
CounterMXBeanImpl(Counter counter)
Creates the MX bean for the provided Counter. |
|
| Method Summary | |
|---|---|
void |
decrease()
Decrements the counter by one. |
void |
decrease(long dec)
Increments the counter by the specified value. |
long |
getCounter()
Returns the current value of the counter. |
long |
getDecrementSum()
Returns the sum of all decremented values (as a positive number). |
long |
getIncrementSum()
Returns the sum of all incremented values. |
long |
getMax()
Returns maximal value of counter. |
long |
getMaxTimestamp()
Returns ms timestamp when the max value was reached. |
long |
getMin()
Returns minimal value of counter. |
long |
getMinTimestamp()
Returns ms timestamp when the min value was reached. |
String |
getType()
Returns Simon type used as a property in the ObjectName. |
void |
increase()
Increments the counter by one. |
void |
increase(long inc)
Increments the counter by the specified value. |
CounterSample |
sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface. |
CounterSample |
sampleAndReset()
Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon. |
void |
set(long val)
Sets the value of the counter to specified value. |
protected Simon |
simon()
Returns the wrapped Simon. |
| Methods inherited from class org.javasimon.jmx.AbstractSimonMXBeanImpl |
|---|
getFirstUsage, getFirstUsageAsString, getChildrenNames, getLastUsage, getLastUsageAsString, getName, getNote, getParentName, getState, isEnabled, reset, setNote, setState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.javasimon.jmx.SimonSuperMXBean |
|---|
getFirstUsage, getFirstUsageAsString, getChildrenNames, getLastUsage, getLastUsageAsString, getName, getNote, getParentName, getState, isEnabled, reset, setNote, setState |
| Field Detail |
|---|
protected Counter counter
Counter instance - protected for subclasses.
| Constructor Detail |
|---|
public CounterMXBeanImpl(Counter counter)
counter - wrapped Counter| Method Detail |
|---|
public final void increase()
CounterMXBean
increase in interface CounterMXBeanCounter.increase()public final void decrease()
CounterMXBean
decrease in interface CounterMXBeanCounter.decrease()public final void increase(long inc)
CounterMXBean
increase in interface CounterMXBeaninc - added valueCounter.increase(long)public final void decrease(long dec)
CounterMXBean
decrease in interface CounterMXBeandec - subtracted valueCounter.decrease(long)public long getMaxTimestamp()
CounterMXBean
getMaxTimestamp in interface CounterMXBeanCounter.getMaxTimestamp()public long getMax()
CounterMXBean
getMax in interface CounterMXBeanCounter.getMax()public long getMinTimestamp()
CounterMXBean
getMinTimestamp in interface CounterMXBeanCounter.getMinTimestamp()public long getMin()
CounterMXBean
getMin in interface CounterMXBeanCounter.getMin()public long getCounter()
CounterMXBean
getCounter in interface CounterMXBeanCounter.getCounter()public final void set(long val)
CounterMXBean
set in interface CounterMXBeanval - new counter valueCounter.set(long)public long getIncrementSum()
CounterMXBean
getIncrementSum in interface CounterMXBeanCounter.getIncrementSum()public long getDecrementSum()
CounterMXBean
getDecrementSum in interface CounterMXBeanCounter.getDecrementSum()public final CounterSample sample()
SimonSuperMXBean
sample in interface CounterMXBeansample in interface SimonSuperMXBeanpublic final CounterSample sampleAndReset()
SimonSuperMXBean
sampleAndReset in interface CounterMXBeansampleAndReset in interface SimonSuperMXBeanpublic final String getType()
SimonSuperMXBeanObjectName.
getType in interface SimonSuperMXBeanprotected final Simon simon()
AbstractSimonMXBeanImpl
simon in class AbstractSimonMXBeanImpl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||