[jopr-dev] Service Resource Discovery

John Mazzitelli mazz at redhat.com
Wed Sep 16 11:26:30 EDT 2009


Note that the need for the <runs-inside> with all the platforms listed is only necessary because this is a <service> (as opposed to a <server>).

If you are defining top-level <server> types in your plugin, you don't specify <runs-inside> for all the different platform types - its implied that your server is allowed to run on any platform. I believe if you want to restrict the platforms a <server> can run on, you can still put a runs-inside, but I'm not 100% sure if it will do what we think it'll do, probably just have to try it and see. But this is really unimportant to the question at hand because you are asking about <service> - which as Ian said should have the runs-inside tags. Take a look at the platform plugin descriptor for examples.

----- Original Message -----
From: "Ian Springer" <ian.springer at redhat.com>
To: jopr-dev at lists.jboss.org
Sent: Wednesday, September 16, 2009 11:14:58 AM GMT -05:00 US/Canada Eastern
Subject: Re: [jopr-dev] Service Resource Discovery

Hi Bruno,

You have to define the service's parent type(s), so RHQ knows where to 
stick it in the type hierarchy once it's discovered. There are a few 
ways to do this, depending on your needs.

If it's a platform service (i.e. a service whose parent is the platform 
itself), you'd do something like:

<service name="Interdomain Service" ...>

       <runs-inside>

<parent-resource-type name="Windows"  plugin="Platforms"/>
<parent-resource-type name="Linux"    plugin="Platforms"/>
<parent-resource-type name="Solaris"  plugin="Platforms"/>
<parent-resource-type name="HP-UX"    plugin="Platforms"/>
<parent-resource-type name="AIX"      plugin="Platforms"/>
<parent-resource-type name="FreeBSD"  plugin="Platforms"/>
<parent-resource-type name="Mac OS X" plugin="Platforms"/>
<parent-resource-type name="Java" plugin="Platforms"/> <!-- any OS that 
RHQ doesn't have native (i.e. SIGAR) support for -->
</runs-inside>
       ...
</service>

(If your service will only run on certain OS'es, you could remove the 
unsupported platform types from the list of parent types).

Or you could do something similar to say it can be the child of multiple 
server or service types, e.g.:

<service name="Interdomain Service" ...>       

<runs-inside>
<parent-resource-type name="JMX Server" plugin="JMX"/>
<parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
<parent-resource-type name="JBossAS Server" plugin="JBossAS5"/>
</runs-inside>
       ...
</service>

Finally, if you want it to be a child of a single server or service type 
defined in the same plugin, just nest it inside the parent server or 
service element, e.g.:

<server name="CoolServer">

    <service name="Interdomain Service" ...>
       ...

    </service>
    ...
</server>


Hopefully this helps.

--Ian

On 9/15/2009 5:55 AM, Bruno Wassermann wrote:
> Hello again,
>
> I have written a plugin which defines a single service like so:
> <service
>        name="Interdomain Service"
>        discovery="InterDomainResourceDiscoveryComponent"
>        class="InterDomainResourceComponent"
>        description="Dependency in different administrative domain"
>        supportsManualAdd="true">
> ...
>
> During auto-discovery, the resource discovery component does not get called.
> It only gets called, if I define the Interdomain Service to be a server.
> What am I missing here?
>
> Thanks,
>
> -- Bruno
>
>    
>
>
> _______________________________________________
> jopr-dev mailing list
> jopr-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jopr-dev
>    


-- 
Ian Springer
Sr. Software Developer
JBoss Operations Network
Red Hat
ian.springer at redhat.com

_______________________________________________
jopr-dev mailing list
jopr-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jopr-dev


More information about the jopr-dev mailing list