Same problem in 2.9.2.

Check
org.apache.camel.management.MBeanInfoAssembler.getMBeanInfo(Object, Object,
String)

Use attributes from wrapper and from custom object too.

Solution could be a proxy on wrapper that forward custom method call to
custom object.

My workaround, but lost wrapper jmx attributes/operation.

    public ModelMBeanInfo getMBeanInfo(Object defaultManagedBean, Object
customManagedBean, String objectName)
        throws JMException
    {
        // maps and lists to contain information about attributes and
operations
        Map<String, ManagedAttributeInfo> attributes = new HashMap<String,
ManagedAttributeInfo>();
        Set<ManagedOperationInfo> operations = new
LinkedHashSet<ManagedOperationInfo>();
        Set<ModelMBeanAttributeInfo> mBeanAttributes = new
LinkedHashSet<ModelMBeanAttributeInfo>();
        Set<ModelMBeanOperationInfo> mBeanOperations = new
LinkedHashSet<ModelMBeanOperationInfo>();
        Set<ModelMBeanNotificationInfo> mBeanNotifications = new
LinkedHashSet<ModelMBeanNotificationInfo>();

        if (customManagedBean == null)
        {
            // extract details from default managed bean
            extractAttributesAndOperations(defaultManagedBean.getClass(),
attributes, operations);
            extractMbeanAttributes(defaultManagedBean, attributes,
mBeanAttributes, mBeanOperations);
            extractMbeanOperations(defaultManagedBean, operations,
mBeanOperations);
            extractMbeanNotifications(defaultManagedBean,
mBeanNotifications);

            // extract details from custom managed bean
        }
        else
        {
            attributes = new HashMap<String, ManagedAttributeInfo>();
            operations = new LinkedHashSet<ManagedOperationInfo>();
            extractAttributesAndOperations(customManagedBean.getClass(),
attributes, operations);
            extractMbeanAttributes(customManagedBean, attributes,
mBeanAttributes, mBeanOperations);
            extractMbeanOperations(customManagedBean, operations,
mBeanOperations);
            extractMbeanNotifications(customManagedBean,
mBeanNotifications);
        }





--
View this message in context: 
http://camel.465427.n5.nabble.com/exposing-custom-jmx-properties-tp5713375p5713514.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to