How to get the plugin configuration in parent resource ?
Lin Gao
lgao at redhat.com
Wed Dec 22 01:28:12 UTC 2010
Hi, gurus:
I am fresher on RHQ plug-ins, I am writing a RHQ plug-in, and have a question on the plugin configuration:
My rhq-plugins.xml:
<plugin name="HttpCheck" displayName="Http Server Checker" ...>
<server name="Http Server Checker" discovery="HttpCheckServerDiscoveryComponent" class="HttpCheckResourceComponent">
<server name="HttpServer-Host" supportsManualAdd="true" discovery="HttpHostDiscoveryComponent" class="HttpHostResourceComponent">
<plugin-configuration>
<c:simple-property name="host" ... />
<c:simple-property name="port" type="integer" ... />
</plugin-configuration>
<service name="HttpServer-Path" supportsManualAdd="true" discovery="HttpPathDiscoveryComponent" class="HttpPathResourceComponent">
<plugin-configuration>
<c:simple-property name="path" ... />
</plugin-configuration>
</service>
</server>
</server>
</plugin>
The idea of this plugin is to check the specified path of one http server whether it is available.
In the
HttpPathResourceComponent.start(ResourceContext _context){
Configuration config = context.getPluginConfiguration();
String path = config.getSimpleValue("path", "/"); // Here get the path configuration
//TODO: How to get the host and port here ??
//TODO: What is the best practice to get the plugin configuration in parent resource ??
}
--
Best Regards
Lin Gao
More information about the rhq-devel
mailing list