|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Callback
Callback processes various events of the Java Simon API and is used as an extension point of the API.
Callbacks can be registered with the Manager using its CompositeCallback
that can be obtained by calling Manager.callback(). After adding the callback
into the main composite callback (or anywhere lower into the callback tree) by calling
CompositeCallback.addCallback(Callback) all events are propagated to all Callbacks (unless filtered
using FilterCallback). Methods called on various events are named onEventXY with type of the source
clearly mentioned in the name (Manager, Simon, Stopwatch, Counter).
initialize() and cleanup().
Callback is initialized when it is attached to the manager (anywhere in the callback tree) and
deinitialized when the callback is removed from the callback tree.
| Nested Class Summary | |
|---|---|
static class |
Callback.Event
Enumeration of all supported callback actions. |
| Method Summary | |
|---|---|
void |
cleanup()
Lifecycle method called when the callback is removed from the manager. |
void |
initialize()
Lifecycle method called when the callback is added to a manager. |
void |
onCounterDecrease(Counter counter,
long dec,
CounterSample sample)
Counter decrease event. |
void |
onCounterIncrease(Counter counter,
long inc,
CounterSample sample)
Counter increase event. |
void |
onCounterSet(Counter counter,
long val,
CounterSample sample)
Counter set event. |
void |
onManagerClear()
Event called when the manager is cleared. |
void |
onManagerMessage(String message)
Message event is used to propagate arbitrary messages from the manager, or it can be used by the other Callback methods internally. |
void |
onManagerWarning(String warning,
Exception cause)
Warning event containing warning and/or cause. |
void |
onSimonCreated(Simon simon)
Simon created event is called when Simon is successfully created by the Manager. |
void |
onSimonDestroyed(Simon simon)
Simon destroyed event is called when Simon is successfully destroyed by the Manager. |
void |
onSimonReset(Simon simon)
Simon reset event. |
void |
onStopwatchAdd(Stopwatch stopwatch,
long ns,
StopwatchSample sample)
Stopwatch add time event. |
void |
onStopwatchAdd(Stopwatch stopwatch,
Split split,
StopwatchSample sample)
Stopwatch add split event. |
void |
onStopwatchStart(Split split)
Stopwatch start event. |
void |
onStopwatchStop(Split split,
StopwatchSample sample)
Stopwatch stop event. |
| Method Detail |
|---|
void initialize()
void cleanup()
void onStopwatchStart(Split split)
StopwatchSample valid for the moment after the start is provided because the callback
is executed out of synchronized block.
split - started Split
void onStopwatchStop(Split split,
StopwatchSample sample)
StopwatchSample valid for the moment after the stop is provided
because the callback is executed out of synchronized block.
split - stopped Splitsample - stopwatch sampled after the stopvoid onSimonReset(Simon simon)
simon - reset Simon
void onStopwatchAdd(Stopwatch stopwatch,
long ns,
StopwatchSample sample)
StopwatchSample valid for the moment after the add is provided
because the callback is executed out of synchronized block.
stopwatch - modified Stopwatchns - added split time in nssample - stopwatch sampled after the add
void onStopwatchAdd(Stopwatch stopwatch,
Split split,
StopwatchSample sample)
StopwatchSample valid for the moment after the add is provided
because the callback is executed out of synchronized block.
stopwatch - modified Stopwatchsplit - added split objectsample - stopwatch sampled after the add
void onCounterDecrease(Counter counter,
long dec,
CounterSample sample)
CounterSample valid for the moment after the operation is provided
because the callback is executed out of synchronized block.
counter - modified Counterdec - decrement amountsample - counter sampled after the operation
void onCounterIncrease(Counter counter,
long inc,
CounterSample sample)
CounterSample valid for the moment after the operation is provided
because the callback is executed out of synchronized block.
counter - modified Counterinc - increment amountsample - counter sampled after the operation
void onCounterSet(Counter counter,
long val,
CounterSample sample)
CounterSample valid for the moment after the operation is provided
because the callback is executed out of synchronized block.
counter - modified Counterval - new valuesample - counter sampled after the operationvoid onSimonCreated(Simon simon)
simon - created Simonvoid onSimonDestroyed(Simon simon)
simon - destroyed Simonvoid onManagerClear()
void onManagerMessage(String message)
message - message text
void onManagerWarning(String warning,
Exception cause)
warning - arbitrary warning message - can be null, unless concrete implementation states otherwisecause - exception causing this warning - can be null, unless concrete implementation states otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||