JBoss Community Archive (Read Only)

RHQ 4.9

Plugins - Plugin Validator

Overview

When a plugin is loaded by RHQ, it is first run through a plugin validation routine to ensure the integrity of the plugin. The following checks are made:

  • The plugin descriptor is validated against the descriptor schema.

  • For each resource type:

    • The class specified for the component class is accessible.

    • The component class implements the proper resource component interface (ResourceComponent)

    • For each subsystem specified, the corresponding facet interface is implemented. For instance, if operations are specified in the descriptor metadata, the component class is checked to ensure it implements the OperationFacet interface.

  • If a discovery class is specified, the validator ensures it is accessible and implements the resource discovery interface (ResourceDiscoveryComponent).

Maven Plugin

A maven plugin is provided that will run the plugin validator against a plugin. The pom.xml file for the skeleton plugin is already configured with the necessary plugin information. To run the validation, after building the plugin run:

mvn org.rhq:rhq-plugin-validator:rhq-plugin-validate

Note that the plugin must be built prior to validating it; the validation does not occur on the code but rather the packaged plugin. The maven plugin will generate the location of the RHQ plugin file on its own. It will look in the /target directory for a file with the following structure:

${artifactId}-${version}.jar

Where artifactId and version are taken out of the pom.xml.

For plugins that are not based off of the skeleton plugin, the following lines should be added to the pom.xml to enable access to the plugin validator:

...
<build>
   <plugins>
      <plugin>
         <groupId>org.rhq</groupId>
         <artifactId>rhq-core-plugin-validator</artifactId>
         <version>1.0.1-SNAPSHOT</version>
      </plugin>
   </plugins>
</build>
...
...
<pluginRepositories>
   <pluginRepository>
      <id>jboss</id>
      <name>JBoss Plugin Repository</name>
      <url>http://repository.jboss.org/maven2/</url>
      <snapshots>
         <enabled>false</enabled>
      </snapshots>
   </pluginRepository>
</pluginRepositories>
...
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 07:57:32 UTC, last content change 2013-09-18 19:42:10 UTC.