8 Replies Latest reply on Mar 30, 2013 1:13 AM by arun2arunraj

    Development Doubt

    arun2arunraj

      Hi Developers,

       

          I am sorry for asking development kind of doubt. But I am helpless , That is why I am asking to you.

       

          Can i get discovered parents( Any number of parents) name in my child resource. If it yes means, Please share me those methods.

       

      Regards,

      ArunRaj

        • 1. Re: Development Doubt
          lkrejci

          In ResourceComponent.start() method you are given the ResourceContext instance, which contains the getParentResourceComponent() method, which is the parent component of the component being started. You can save the ResourceContext instance in a private field of your ResourceComponent and use it at later point in time.

           

          For example, take a look at the code of the script plugin (doesn't really matter what that plugin does): http://git.fedorahosted.org/cgit/rhq/rhq.git/tree/modules/plugins/script/src/main/java/org/rhq/plugins/script/ScriptServerComponent.java#n96

           

          If you only need "metadata" about your parent (i.e. you don't need to interact with it, only to get some information about it) - you might try to use ResourceContext.getParentResourceContext() method (i.e. in your start(), call getParentResourceContext() on the instance of the ResourceContext you've been provided in the arguments of the start() method). You can access ancestors of your component that way.

          1 of 1 people found this helpful
          • 2. Re: Development Doubt
            arun2arunraj

            Hi Lukas,

             

                Thanks for your wonderful explanation.

             

                Is there any complete study material to get to know about RHQ Programming Aspect. If no, Please tell me How you guys are knowing these stuff. That would help me to prepare myself.

             

            Regards,

            ArunRaj

            • 3. Re: Development Doubt
              lkrejci

              The complete study material is the source code Especially the $RHQ_CHECKOUT/modules/core/plugin-api should of interest to you, since that is the API through which the plugins are implemented and which the plugins can use to "communicate" with the rest of the system.

              1 of 1 people found this helpful
              • 4. Re: Development Doubt
                arun2arunraj

                Hi Lukas,

                 

                    Thanks for your material. I will go through it..

                 

                Regards,

                ArunRaj

                • 5. Re: Development Doubt
                  arun2arunraj

                  Hi Developers,

                   

                      For you guys, It is really easy. Help me, if you can figure my doubts.

                   

                  1) Consider I am specifying 4 metrics in Plugin Descriptor. In my discovering component class, I am discovering 4 resources. Can I specify those 4 metrics as each to those 4 discovered component (each resource will have one metric). If yes, please suggest me any material. If No, please suggest me any material.

                   

                  2) What is the need of createResourceFacet? Because, As per my knowledge. RHQ monitors physically present hardware or sofware. Those are already there, So we dont have to create it again .Then why Should we have to use createResourceFacet ! ! ! Sorry If I am asking something wrong. Please share your knowledge with me and make me clear about RHQ.

                   

                  3) I have created One Server which will discover 5 static customers. again for that each customers I have created 2 services. It is working perfect. I have specified some metrics for SERVER and  SERVICES (2 services). But RHQ Aggregating those 2 services for a each customers. It is perfectly working when I have viewed the summary report.

                       How RHQ Aggregating each Servers corresponding to those two services ? ? ?

                   

                  Please clarify my all the doubts. Thanks in advance.

                   

                  Regards,

                  ArunRaj.

                  • 6. Re: Development Doubt
                    arun2arunraj

                    Hi Developers,

                     

                        Please respond my above post.

                      

                        Since, It is 2 days. I have not get any reply from anyone of you guys. Please help me to get one step ahead in RHQ.

                     

                    Regards,

                    ArunRaj

                    • 7. Re: Development Doubt
                      lkrejci

                      1) Consider I am specifying 4 metrics in Plugin Descriptor. In my discovering component class, I am discovering 4 resources. Can I specify those 4 metrics as each to those 4 discovered component (each resource will have one metric). If yes, please suggest me any material. If No, please suggest me any material.

                      You seem to be confusing resource type and resource. The difference between the two is the same as between the class and instance in Java. I.e. resource type is a "blueprint" for what "qualities" a resource should have. Each resource will have those qualiities and will "report". values of those qualities.

                      So if you discover 4 resources and each of them should have different metric defined, you need to have 4 distinct resource types. The "blueprints" for the resources need to be different, because you want each of the resources to "look" differently - i.e. have a different (set of) metric defined.

                       

                      2) What is the need of createResourceFacet? Because, As per my knowledge. RHQ monitors physically present hardware or sofware. Those are already there, So we dont have to create it again .Then why Should we have to use createResourceFacet ! ! ! Sorry If I am asking something wrong. Please share your knowledge with me and make me clear about RHQ.

                      Consider you'd want to deploy a new web application to your web server. The resource is not physically on the machine yet and you can use the CreateChildResourceFacet (implemented by the web server resource component in my example) to obtain the data and configuration for the web application to be deployed and actually deploy it physically to the web server. Afterwards such new web application can be discovered.

                       

                      3) I have created One Server which will discover 5 static customers. again for that each customers I have created 2 services. It is working perfect. I have specified some metrics for SERVER and  SERVICES (2 services). But RHQ Aggregating those 2 services for a each customers. It is perfectly working when I have viewed the summary report.

                      Could you please clarify what you are asking about?

                      • 8. Re: Development Doubt
                        arun2arunraj

                        Hi Lukas,

                         

                            Thank you so much for answering me, Again. I swear, I wont ask any unclarity questions in this community.

                         

                        1) WOW  Awesome ! ! !  I understood completly.

                         

                        2) WOW  Awesome ! ! !  I understood completly.

                         

                        3) Sorry for the foolish way of questioning ? ? ?

                         

                            Consider My Server resourceType is discovering 5 resources (Customers in my example).  For that Customers ( each Resources) Again, My Service resourceType is discovering 2 resources( Email Details , User Details ).

                            I have to get summary report for the each customers based on the email and user services ( This services is specific for each customer ). And also should get a summary report of my all customers.

                            FOR this scenario, Please guide me to study any plugin or give me any idea.

                         

                        Regards,

                        ArunRaj.