|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.EnabledManager
public final class EnabledManager
Implements fully functional Manager in the enabled state. Does not support
enable()/disable() - for this use SwitchingManager.
| Field Summary | |
|---|---|
private Map<String,AbstractSimon> |
allSimons
|
private CompositeCallback |
callback
|
private ManagerConfiguration |
configuration
|
private UnknownSimon |
rootSimon
|
| Fields inherited from interface org.javasimon.Manager |
|---|
HIERARCHY_DELIMITER, ROOT_SIMON_NAME |
| Constructor Summary | |
|---|---|
EnabledManager()
Creates new enabled manager. |
|
| Method Summary | |
|---|---|
private void |
addToHierarchy(AbstractSimon simon,
String name)
|
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. |
private AbstractSimon |
createOrReplaceUnknownSimon(String name,
Class<? extends AbstractSimon> simonClass)
|
void |
destroySimon(String name)
Removes Simon from the Manager. |
void |
disable()
Throws UnsupportedOperationException. |
void |
enable()
Throws UnsupportedOperationException. |
Counter |
getCounter(String name)
Returns existing Counter or creates new if necessary. |
private Simon |
getOrCreateSimon(String name,
Class<? extends AbstractSimon> simonClass)
|
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. |
private AbstractSimon |
instantiateSimon(String name,
Class<? extends AbstractSimon> simonClass)
|
boolean |
isEnabled()
Returns true. |
void |
message(String message)
Method propagates message to manager's Callback. |
private AbstractSimon |
newSimon(String name,
Class<? extends AbstractSimon> simonClass)
|
private AbstractSimon |
replaceUnknownSimon(AbstractSimon simon,
Class<? extends AbstractSimon> simonClass)
|
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 final Map<String,AbstractSimon> allSimons
private UnknownSimon rootSimon
private CompositeCallback callback
private ManagerConfiguration configuration
| Constructor Detail |
|---|
public EnabledManager()
| Method Detail |
|---|
public Simon getSimon(String name)
Manager
getSimon in interface Managername - name of the Simon
public void destroySimon(String name)
Manager
destroySimon in interface Managername - name of the Simonpublic void clear()
Manager
clear in interface Managerpublic 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 Simon getRootSimon()
Manager
getRootSimon in interface Managerpublic 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 patterns
private Simon getOrCreateSimon(String name,
Class<? extends AbstractSimon> simonClass)
private AbstractSimon createOrReplaceUnknownSimon(String name,
Class<? extends AbstractSimon> simonClass)
private AbstractSimon replaceUnknownSimon(AbstractSimon simon,
Class<? extends AbstractSimon> simonClass)
private AbstractSimon newSimon(String name,
Class<? extends AbstractSimon> simonClass)
private AbstractSimon instantiateSimon(String name,
Class<? extends AbstractSimon> simonClass)
private void addToHierarchy(AbstractSimon simon,
String name)
public CompositeCallback callback()
Manager
callback in interface Managerpublic ManagerConfiguration configuration()
Manager
configuration in interface Managerpublic void enable()
UnsupportedOperationException.
enable in interface Managerpublic void disable()
UnsupportedOperationException.
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 | |||||||||