|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Manager
Manager provides access to Simons and manages them in a tree structure. Any number of Managers
can be created. There is also one special Manager (called "default manager") that is accessible
via convenient static utility class SimonManager.
EnabledManager represents fully functional manager in the enabled state;DisabledManager is manager implementation in the disabled state;SwitchingManager is manager implementation with both enabled and disabled manager in the background,
only this implementation supports enable() and disable() method.
| Field Summary | |
|---|---|
static String |
HIERARCHY_DELIMITER
Hierarchy delimiter in Simon name. |
static String |
ROOT_SIMON_NAME
Name of the root Simon. |
| Method Summary | |
|---|---|
CompositeCallback |
callback()
Accesses default composite callback of this manager. |
void |
clear()
Clears the whole manager and starts again with a single newly created Root Simon. |
ManagerConfiguration |
configuration()
Accesses configuration of this manager. |
void |
destroySimon(String name)
Removes Simon from the Manager. |
void |
disable()
Disables the Simon Manager. |
void |
enable()
Enables the Simon Manager. |
Counter |
getCounter(String name)
Returns existing Counter or creates new if necessary. |
Simon |
getRootSimon()
Returns root Simon. |
Simon |
getSimon(String name)
Returns Simon by its name if it exists. |
Collection<String> |
getSimonNames()
Returns unmodifiable collection containing names of all existing Simons. |
Collection<Simon> |
getSimons(SimonPattern pattern)
Returns collection containing all existing Simons matching the pattern (can be null). |
Stopwatch |
getStopwatch(String name)
Returns existing Stopwatch or creates new if necessary. |
boolean |
isEnabled()
Returns true if the Java Simon API is enabled. |
void |
message(String message)
Method propagates message to manager's Callback. |
void |
warning(String warning,
Exception cause)
Method propagates warning to manager's Callback. |
| Field Detail |
|---|
static final String ROOT_SIMON_NAME
static final String HIERARCHY_DELIMITER
| Method Detail |
|---|
Simon getRootSimon()
Simon getSimon(String name)
name - name of the Simon
Counter getCounter(String name)
name - name of the Counter
Stopwatch getStopwatch(String name)
name - name of the Stopwatch
Collection<String> getSimonNames()
Collection<Simon> getSimons(SimonPattern pattern)
null).
Collection is unmodifiable if null pattern is provided and all Simons are returned,
otherwise new collection with matching Simons is returned.
pattern - Simon name pattern (see SimonPattern
to find out more about possible patternsvoid destroySimon(String name)
name - name of the Simonvoid clear()
CompositeCallback callback()
ManagerConfiguration configuration()
void enable()
SwitchingManager supports this operation.
void disable()
SwitchingManager supports this operation.
boolean isEnabled()
void message(String message)
Callback. This allows user to report any
message if they implement Callback.onManagerMessage(String).
message - message text
void warning(String warning,
Exception cause)
Callback. This allows user to report any
warning and/or exception if they implement Callback.onManagerWarning(String, Exception).
warning - arbitrary warning messagecause - exception causing this warning
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||