|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.SimonManager
public final class SimonManager
SimonManager is static utility class providing so called "default Manager.
It is possible to create separate Manager, but it cannot be accessed via this convenient
utility-like class. This option may be useful in Java EE environmant when it's required to
separate Simon trees accross different applications. For majority of Java SE applications this
class is recommended.
-Djavasimon.config.file=some-path/simon.config.xmlTo configure the SimonManager via resource that can be found on classpath:
-Djavasimon.config.resource=org/javasimon/example/wannabe-config.xml
| Field Summary | |
|---|---|
private static Manager |
manager
|
static String |
PROPERTY_CONFIG_FILE_NAME
Property name for the Simon configuration file is "javasimon.config.file". |
static String |
PROPERTY_CONFIG_RESOURCE_NAME
Property name for the Simon configuration resource is "javasimon.config.resource". |
| Constructor Summary | |
|---|---|
private |
SimonManager()
|
| Method Summary | |
|---|---|
static CompositeCallback |
callback()
Accesses Simon callback. |
static void |
clear()
Clears the SimonManager (ignored if manager is disabled). |
static ManagerConfiguration |
configuration()
Accesses configuration of this manager. |
static void |
destroySimon(String name)
Destroys Simon or replaces it with UnknownSimon if it's necessary to preserve the hierarchy. |
static void |
disable()
Disables the Simon Manager. |
static void |
enable()
Enables the Simon Manager. |
static Counter |
getCounter(String name)
Returns existing Counter or creates new if necessary. |
static Simon |
getRootSimon()
Returns root Simon. |
static Simon |
getSimon(String name)
Returns Simon by its name if it exists. |
static Collection<String> |
getSimonNames()
Returns unmodifiable collection containing names of all existing Simons. |
static Collection<Simon> |
getSimons(SimonPattern pattern)
Returns collection containing all existing Simons matching the pattern (can be null). |
static Stopwatch |
getStopwatch(String name)
Returns existing Stopwatch or creates new if necessary. |
(package private) static void |
init()
Initilizes the configuration facility for the default Simon Manager. |
static boolean |
isEnabled()
Returns true if the Simon Manager is enabled. |
static Manager |
manager()
Accesses default Simon Manager which is the switching manager. |
static void |
message(String message)
Method propagates message to manager's Callback. |
static 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 |
|---|
public static final String PROPERTY_CONFIG_FILE_NAME
public static final String PROPERTY_CONFIG_RESOURCE_NAME
private static Manager manager
| Constructor Detail |
|---|
private SimonManager()
| Method Detail |
|---|
static void init()
public static Simon getSimon(String name)
name - name of the Simon
public static void destroySimon(String name)
name - name of the Simonpublic static Counter getCounter(String name)
name - name of the Counter
public static Stopwatch getStopwatch(String name)
name - name of the Stopwatch
public static void enable()
public static void disable()
public static boolean isEnabled()
public static Simon getRootSimon()
public static Collection<String> getSimonNames()
public static 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 patternspublic static void clear()
public static CompositeCallback callback()
public static ManagerConfiguration configuration()
public static Manager manager()
public static void message(String message)
Callback. This allows user to report any
message if they implement Callback.onManagerMessage(String).
message - message text
public static 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 | |||||||||