|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Monitor
A Monitor is used by an instrumented application to publish it's
state to jMonit internals. The application can publish numeric datas using
the add(double)
method.
As an interface, Monitor allow limited intrusion of jMonit API into the
application code. You can mock it using the
NullMonitor
for testing purpose, or any custom
implementation.
Method Summary | ||
---|---|---|
void |
add(long value)
Convenience method to add a primitive numeric data to the monitor. |
|
void |
clear()
Reset the monitor |
|
void |
fireMonitoringEvent(MonitoringEvent event)
Dispatches the given MonitoringEvent to all registred
listeners. |
|
|
getFeature(java.lang.Class<T> feature)
To acces internal optional features or plugable extensions, application asks the monitor for the extension plublic API class. |
|
java.util.Set<java.lang.Class> |
getFeatures()
|
|
java.lang.String |
getName()
|
|
java.util.Set<java.lang.String> |
getTags()
|
|
boolean |
hasFeatures(java.lang.Class[] features)
|
|
boolean |
isFeatureSupported(java.lang.Class clazz)
|
|
boolean |
isTagged(java.lang.String tag)
|
|
Monitor |
tag(java.lang.String tag)
Tag the monitor |
Method Detail |
---|
java.lang.String getName()
void add(long value)
value
- to be monitored#fireEvent(MonitoringEvent)
<T> T getFeature(java.lang.Class<T> feature)
The monitor is expected to "do its best" to return the expected feature,
including register new features on-demand. To check for a feature to be
supported, use isFeatureSupported(java.lang.Class)
.
java.util.Set<java.lang.Class> getFeatures()
boolean isFeatureSupported(java.lang.Class clazz)
boolean hasFeatures(java.lang.Class[] features)
features
- a set of requiered features
void clear()
Monitor tag(java.lang.String tag)
tag
- the tag
java.util.Set<java.lang.String> getTags()
boolean isTagged(java.lang.String tag)
tag
- tag to test
void fireMonitoringEvent(MonitoringEvent event)
MonitoringEvent
to all registred
listeners.
event
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |