Package com.yahoo.statistics
Class Handle
- java.lang.Object
-
- com.yahoo.statistics.Handle
-
- Direct Known Subclasses:
Counter
,CounterGroup
,Value
,ValueGroup
public abstract class Handle extends java.lang.Object
Base class for the interface to the statistics framework.- Author:
- Steinar Knutsen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
cancel()
Cancel this Handle and remove it from internal state in Statistics.abstract boolean
equals(java.lang.Object o)
abstract int
hashCode()
boolean
isCancelled()
Returns whether this object has been cancelled or not.void
run()
Run the callback object first, then invoke runHandle().void
runCallback()
Run the callback object.abstract void
runHandle()
Invoke an action to be performed periodically for a statistics Handle.
-
-
-
Method Detail
-
runCallback
public final void runCallback()
Run the callback object. This will happen at the start of each invocation of a Handle's run() method. The callback is presumed to be exception safe. If no callback is set, this is a no-op. The callback will need to handle any necessary synchronization itself.
-
run
public final void run()
Run the callback object first, then invoke runHandle().
-
runHandle
public abstract void runHandle()
Invoke an action to be performed periodically for a statistics Handle.Synchronization has to be handled by the method itself.
-
cancel
public final boolean cancel()
Cancel this Handle and remove it from internal state in Statistics.- Returns:
- value of java.util.TimerTask.cancel()
-
isCancelled
public final boolean isCancelled()
Returns whether this object has been cancelled or not.- Returns:
- true if cancelled
-
equals
public abstract boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public abstract int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-