|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Monitor
The interface for Monitor Plugins.
Monitor Plugins utilize the MonitorEnvironment
to retrieve measure
subscriptions and store measurements.
Method Summary | |
---|---|
Status |
execute(MonitorEnvironment env)
Executes the Monitor Plugin to retrieve subscribed measures and store measurements. |
Status |
setup(MonitorEnvironment env)
Initializes the Plugin. |
void |
teardown(MonitorEnvironment env)
Shuts the Plugin down and frees resources. |
Method Detail |
---|
Status setup(MonitorEnvironment env) throws java.lang.Exception
If the returned status is null or the status code is a
non-success code then teardown(MonitorEnvironment)
will be called
next.
Resources like sockets or files can be opened in this method.
env
- the configured MonitorEnvironment for this Plugin;
contains subscribed measures, but measurements will be
discarded
java.lang.Exception
teardown(MonitorEnvironment)
Status execute(MonitorEnvironment env) throws java.lang.Exception
This method is called at the scheduled intervals. If the Plugin execution
takes longer than the schedule interval, subsequent calls to
execute(MonitorEnvironment)
will be skipped until this method
returns. After the execution duration exceeds the schedule timeout,
PluginEnvironment.isStopped()
will return true. In this
case execution should be stopped as soon as possible. If the Plugin
ignores PluginEnvironment.isStopped()
or fails to stop execution in
a reasonable timeframe, the execution thread will be stopped ungracefully
which might lead to resource leaks!
env
- a MonitorEnvironment object that contains the
Plugin configuration and subscribed measures. These
MonitorMeasures can be used to store measurements.
java.lang.Exception
void teardown(MonitorEnvironment env) throws java.lang.Exception
The Plugin methods setup, execute and teardown may be called on different threads, but they are called sequentially. This means that the execution of these methods does not overlap, they are executed one after the other.
Examples:
All by the Plugin allocated resources should be freed in this method. Examples are opened sockets or files.
java.lang.Exception
setup(MonitorEnvironment)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |