|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.SwitchingManager
public final class SwitchingManager
Manager implementation that supports enable() and disable() and switches between
backing EnabledManager and DisabledManager accordingly.
| Field Summary | |
|---|---|
private Manager |
disabled
|
private Manager |
enabled
|
private Manager |
manager
|
| Fields inherited from interface org.javasimon.Manager |
|---|
HIERARCHY_DELIMITER, ROOT_SIMON_NAME |
| Constructor Summary | |
|---|---|
SwitchingManager()
|
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Manager enabled
private Manager disabled
private Manager manager
| Constructor Detail |
|---|
public SwitchingManager()
| Method Detail |
|---|
public Simon getRootSimon()
Manager
getRootSimon in interface Managerpublic Simon getSimon(String name)
Manager
getSimon in interface Managername - name of the Simon
public Counter getCounter(String name)
Manager
getCounter in interface Managername - name of the Counter
public Stopwatch getStopwatch(String name)
Manager
getStopwatch in interface Managername - name of the Stopwatch
public Collection<String> getSimonNames()
Manager
getSimonNames in interface Managerpublic Collection<Simon> getSimons(SimonPattern pattern)
Managernull).
Collection is unmodifiable if null pattern is provided and all Simons are returned,
otherwise new collection with matching Simons is returned.
getSimons in interface Managerpattern - Simon name pattern (see SimonPattern
to find out more about possible patternspublic void destroySimon(String name)
Manager
destroySimon in interface Managername - name of the Simonpublic void clear()
Manager
clear in interface Managerpublic CompositeCallback callback()
Manager
callback in interface Managerpublic ManagerConfiguration configuration()
Manager
configuration in interface Managerpublic void enable()
enable in interface Managerpublic void disable()
disable in interface Managerpublic boolean isEnabled()
isEnabled in interface Managerpublic void message(String message)
ManagerCallback. This allows user to report any
message if they implement Callback.onManagerMessage(String).
message in interface Managermessage - message text
public void warning(String warning,
Exception cause)
ManagerCallback. This allows user to report any
warning and/or exception if they implement Callback.onManagerWarning(String, Exception).
warning in interface Managerwarning - arbitrary warning messagecause - exception causing this warning
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||