1 Reply Latest reply on Mar 1, 2013 7:30 AM by mazz

    How ResourceDiscoveryContext is being instructed

    arun2arunraj

      Hi Developers,

       

          I understand, DiscoveryComponent has been told to go hunt for resources by PluginContainer. Its been happened by the ResourceDiscoveryContext object. And Moreover, ResourceDiscovertContext contains all the information the DiscoveryComponent needs to perform.

          In this case my question is, How the PluginContainer instructing to the DiscoveryComponent by the help of PluginDescriptor. Please explain me with example, detailed explanations are appreciated. If I understand it properly, then I can easily create new resources by the help of ResourceDiscoveryContext object itself.

       

      Regards,

      ArunRaj

        • 1. Re: How ResourceDiscoveryContext is being instructed
          mazz

          Arun,

           

          You should not have to know the internals of the plugin container to be able to write your plugin code. That's the goal of the plugin API - you just write an implementation of the API and the plugin container will worry about when to call your plugin code, how to construct objects it passes to your plugin code, etc.

           

          In your plugin descriptor XML, you tell the plugin container what your discovery class is (that's the "discovery" attribute in the <server> or <service> tags).  Your resource component itself it declared in the "class" attribute. See the netservices plugin descriptor as an example:

           

          <service name="HTTPService"
             discovery="HTTPNetServiceDiscoveryComponent"
             class="HTTPNetServiceComponent"
             ...>

          See the plugin descriptor schemas here (the main one is rhq-plugin.xsd) : http://git.fedorahosted.org/cgit/rhq/rhq.git/tree/modules/core/client-api/src/main/resources