1 ) Parent getValues() method will be invoked before child getValues() method.
2 ) Parent thread will get highest priority than child.
I found these based on my knowledge.
1 of 1 people found this helpful
Parent and children resources metric collection schedules are completely independent.
If you don't have too many children one thing you could do is calling Child#getValues from Parent#getValues for each child resource and then aggregate results.
If you have too many children or child metric collection is too slow you'll have to stick with something asynchronous.
Thank you so much for guiding me again.
I am having minimum 5 resources. Could you please share me which asynchronous pattern is good in RHQ.
Asynchrounous : Concurrent Asynchronous API , JMS , Session Bean or something else.
Please put me in the perfect path.
When I said asynchronous, I was not talking about any technology like JMS. I was saying that parent and child metric collection happen at different times in distinct threads.
If you absolutely need to compute something at parent level with latest values from child level you can (just one possibility):
- extract metric collection logic from child components to reusable classes
- use these new classes in your parent component class and collect values for each child
You can use ResourceContext in start/stop method to register/deregister the child component to/from the parent component.
Thank you so much Thomas, for guiding me in the best path. I understood the extraction and registering/deregistering tips which is being used in all RHQ Plugins. Now I believe, I can make it.