custom plugin configuration

Bala Nair bnairtm at comcast.net
Mon Apr 25 15:52:11 UTC 2011


I am trying to add log files as event sources to one of my plugins and I 
want to be able to pre-define the file names in the plugin xml.  I have 
seen how the rhq agent plugin does this by adding files to the 
logEventSources property list as part of the discoverResources method.  
I'd like to do the same thing in my plugin but have the name and 
location of the files to use be defined in the plugin xml itself, rather 
than hard coded in the code.  So I added the following to my plugin 
configuration section:

<plugin-configuration>
<c:simple-property name="objectName" 
default="tv.seachange.adrenalin.Quoteserver:type=QuoteMXBean" 
readOnly="true"/>
<c:simple-property name="nameTemplate" default="Stock Quote Service"/>

<c:group name="logs" displayName="Log Files">
<c:simple-property name="logFilePathRoot" default="/seachange/logs"/>
<c:list-property name="logFiles" description="Log files to track for 
events">
<c:map-property name="logFiles">
<c:simple-property name="quoteserver" default="Quoteserver.log"/>
<c:simple-property name="framework" default="Framework.log"/>
</c:map-property>
</c:list-property>
</c:group>
</plugin-configuration>

The service is discovered correctly and the simple properties show up.  
However, I can't see any of the children of the property list when I run 
my plugin in the standalone container.  Here's the output from the pc 
command for this resource:

[
   PropertySimple[id=0, name=logFilePathRoot, value=/seachange/logs, 
override=null],
   PropertySimple[id=0, name=objectName, 
value=tv.seachange.adrenalin.Quoteserver:type=QuoteMXBean, override=null],
   PropertySimple[id=0, name=nameTemplate, value=Stock Quote Service, 
override=null],
   PropertyList[id=0, name=logFiles, list=[]]
]

The plugin validates correctly using the plugin validator and I have run 
the plugin xml through xmlspy to validate it against the plugin and 
configuration schemas and xmlspy reports that the xml is valid.  I have 
turned up the log level for org.rhq.core.pc.plugin and everything in the 
log appears ok.  I have tried various combinations of configuration 
properties and nothing seems to get me a property list of multiple 
objects.  Any idea what I'm doing wrong?

Bala Nair
SeaChange International




More information about the rhq-devel mailing list