Hi, Amindri.

Thanks for the patch. I have a few comments:

1) It seems that you are trying to add the "getView()" into the model such as 
Endpoint. This approach is a bit invasive. Can we achieve the same function 
using a different way?

* Define a ManagementProviderExtensionPoint which collects all management 
providers for given managed entities in Tuscany runtime.
* Define an ManagementProvider SPI like:

        package org.apache.tuscany.sca.management.jmx;

        public interface ManagementProvider<M> {
                Class<M> getModelType(); // The type of the model to be managed
                <V> V getView(M model); // The view of the given model
        }

* For managed entities in Tuscany runtime, create an implementation of 
ManagementProvider and register it using
META-INF/services/org.apache.tuscany.sca.management.jmx.ManagementProvider

2) Can the MXBeans be hierarchical in addition to the flat list? Typically in 
Tuscany, the managed entities are part of a tree. For example, 
ExtensionPointRegistry --> ExtensionPoint --> Extension, or SCA Domain --> 
Composite --> Component --> Services. Maybe the hierarchy can be represented 
using the ObjectName conventions.

3) To access the managed entities, take a look at 
org.apache.tuscany.sca.core.assembly.impl.CompositeActivatorImpl and 
org.apache.tuscany.sca.core.DefaultExtensionPointRegistry. We might need to 
expose some of the information to JMX.

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
[email protected]
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On May 27, 2011, at 11:55 PM, Amindri Udugala wrote:

> 
> 
> ---------- Forwarded message ----------
> From: Amindri Udugala <[email protected]>
> Date: 27 May 2011 09:32
> Subject: Adding JMX capabilities to Tuscany (patch)
> To: Raymond Feng <[email protected]>
> 
> 
> Hi Raymond,
> I have attached a zip file of the jmx module I created and the core-spi 
> module (in there I have created a package mgt : path 
> "modules/core-spi/src/main/java/org/apache/tuscany/sca/mgt"). 
> I have fully implemented the management class only for the EndpointReference 
> interface so I added a new method to it named "getView()", and have 
> implemented the method in "EndpointReferenceImpl".  I'm hoping to add similar 
> methods to other classes which needs to be monitored.. (hope that approach is 
> ok)
> 
> Also I have a problem in accessing all the runtime objects. Please have a 
> look at the "JmxModuleActivator" class in the jmx module. In 
> "getMBeanObjects()" method I need to access all objects which are created and 
> assign them to Maps. Can you please help me in doing this?
> 
> I'm using IntelliJIDEA as the editor, and when I open up certain classes , it 
> shows many dependency errors. Also when I imported certain classes, the 
> editor warned me of adding circular dependencies (I ignored these warnings)
> 
> Please have a look at this and let me know if I should change my 
> implementation design :)
> 
>  
> 
> -- 
> Thanks
> 
> Amindri Udugala
> University of Colombo School of Computing, 
> Sri Lanka.
> 
> 
> 
> 
> -- 
> Thanks
> 
> Amindri Udugala
> University of Colombo School of Computing, 
> Sri Lanka.
> 
> <modules.zip>

Reply via email to