[jopr-dev] Service Resource Discovery
Ian Springer
ian.springer at redhat.com
Wed Sep 16 11:25:14 EDT 2009
By the way, the reason it works if you change it to a server, rather
than a service, is because, when parsing the plugin descriptor, if RHQ
encounters a server element at the top level with no runs-inside types
defined, it assumes the server is a platform server (a server who has
all the platform types as its parents). So:
<server name="Interdomain Service" ...>
...
</server>
is essentially equivalent to:
<server 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>
...
</server>
On 9/16/2009 11:14 AM, Ian Springer wrote:
> 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
More information about the jopr-dev
mailing list