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).
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:
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:
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: