|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.watch.WatchInjector
public class WatchInjector
The WatchInjector provides support for declarative Watch management, by
taking a WatchDescriptor and creating
SamplingWatch instances which are then registered for
an instantiated service.
If the watch already exists in the bean's
WatchRegistry, the watch will not be added.
The bean must declare a Java bean getter method that has as it's return type one of the following:
public class Foo {
...
public long getCount() {
return(value);
}
...
}
Finally, in the OperationalString, Watch declaration is accomplished using
the embedded the <Monitor> element, for example:
<SLA ID="backlog" Low="100" High="500">
<PolicyHandler type="scaling" max="10"
lowerDampener="3000" upperDampener="3000"/>
<Monitor name="entryCounter" property="count" period="10000"/>
</SLA>
This declaration creates a SamplingWatch with a name
of entryCounter, which adds the value returned from the
getCount() method every 10 seconds.
| Constructor Summary | |
|---|---|
WatchInjector(Object impl,
ServiceBeanContext context)
|
|
| Method Summary | |
|---|---|
protected Watch |
createWatch(WatchDescriptor wDesc,
Object bean,
Configuration config)
|
protected Watch |
createWatch(WatchDescriptor wDesc,
Object bean,
Method accessor,
Configuration config)
|
String[] |
getWatchNames()
Get all created Watch names |
Watch |
inject(WatchDescriptor wDesc)
Add a WatchDescriptor, creating the Watch |
Watch |
inject(WatchDescriptor wDesc,
Object bean,
Method accessor)
Add a WatchDescriptor, creating the Watch |
void |
modify(WatchDescriptor wDesc)
Modify an injected Watch |
void |
remove(String name)
Unregister and remove an injected Watch |
void |
remove(WatchDescriptor wDesc)
Unregister and remove an injected Watch |
void |
terminate()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WatchInjector(Object impl,
ServiceBeanContext context)
throws IntrospectionException
IntrospectionException| Method Detail |
|---|
public Watch inject(WatchDescriptor wDesc)
throws Exception
wDesc - The WatchDescriptor to add, must not be null
null if it could not be
created. If the watch already exists, the current Watch wil be returned
Exception - if there are problems getting the configuration from
the context
public Watch inject(WatchDescriptor wDesc,
Object bean,
Method accessor)
throws Exception
wDesc - The WatchDescriptor to add, must not be nullbean - The target bean to poll data fromaccessor - Method to get data from, must not be null
null if it could not be
created. If the watch already exists, the current Watch wil be returned
Exception - if there are problems getting the configuration from
the contextpublic void terminate()
protected Watch createWatch(WatchDescriptor wDesc,
Object bean,
Configuration config)
throws Exception
Exception
protected Watch createWatch(WatchDescriptor wDesc,
Object bean,
Method accessor,
Configuration config)
throws Exception
Exceptionpublic String[] getWatchNames()
public void modify(WatchDescriptor wDesc)
throws ConfigurationException
wDesc - The WatchDescriptor to modify, must not be null
ConfigurationException - if there are errors reading the
configurationpublic void remove(WatchDescriptor wDesc)
wDesc - The WatchDescriptor to remove, must not be nullpublic void remove(String name)
name - The Watch name (id) to remove, must not be null
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||