This would go into the code, add stuff into the plugin descriptor, make sure your code implements correct interfaces and maybe even stub out the impl of the metric collection for you.
But that is completely different from what I originally had in mind.
My idea was that the users would be able to define a complete plugin by ONLY annotating their Pojos with RHQ-specific annotations. Our annotation processor would then - at compile time - generate necessary glue code and plugin descriptor to turn that bunch of POJOs into a fully functional plugin.