You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Thorsten Möller <Th...@web.de> on 2006/02/06 15:15:30 UTC

ServiceMix 3.0 SNAPSHOT: custom JMX description, attributes, operations do not get exposed to JMX

Hello,

I have implemented a custom JBI component which extends 
org.apache.servicemix.components.util.ComponentSupport. The component 
contains additional attributes and operations which I want to expose 
for JMX management; furthermore, I want to re-define the textual 
description. As a consequence, I have overwritten getAttributeInfos(), 
getOperationInfos(), and getDescription() of BaseLifeCycle. The problem 
is that all of them do not get exposed to JXM, i.e., I can't see them 
in a JMX console like MC4J. Note that all other attributes and 
operations which are derived from BaseLifeCycle are visible. I tried to 
figure out the problem and realised that the methods even do not get 
called. After some debugging of ServiceMix it seems to me that at some 
point a custom component gets casted to a supertype of the component 
which finally leads to calling of the methods on BaseLifeCycle and 
not(!) the methods of the subtype, i.e., the custom component. It would 
be good if anybody could verify this and fix it.

Many thanks,
Thorsten


Re: ServiceMix 3.0 SNAPSHOT: custom JMX description, attributes, operations do not get exposed to JMX

Posted by Guillaume Nodet <gu...@worldonline.fr>.
Hi Thorsten  !

This is not really a bug.
You have been misleaded by the fact that lots of servicemix classes 
inherit the BaseLifeCycle,
but the object you see your jmx console is not the component itself.
It is an internal servicemix object which implements the 
javax.jbi.component.ComponentLifeCycle and
the component implementation is not exposed through jmx.
The ComponentContext.getMBeanNames has some helper methods to generate 
mbean names for a given
component and you can use the init / shutdown methods of the lifecycle 
to register / unregister any additional
mbeans you want.

Cheers,
Guillaume Nodet

Thorsten Möller wrote:

> Hello,
>
> I have implemented a custom JBI component which extends 
> org.apache.servicemix.components.util.ComponentSupport. The component 
> contains additional attributes and operations which I want to expose 
> for JMX management; furthermore, I want to re-define the textual 
> description. As a consequence, I have overwritten getAttributeInfos(), 
> getOperationInfos(), and getDescription() of BaseLifeCycle. The 
> problem is that all of them do not get exposed to JXM, i.e., I can't 
> see them in a JMX console like MC4J. Note that all other attributes 
> and operations which are derived from BaseLifeCycle are visible. I 
> tried to figure out the problem and realised that the methods even do 
> not get called. After some debugging of ServiceMix it seems to me that 
> at some point a custom component gets casted to a supertype of the 
> component which finally leads to calling of the methods on 
> BaseLifeCycle and not(!) the methods of the subtype, i.e., the custom 
> component. It would be good if anybody could verify this and fix it.
>
> Many thanks,
> Thorsten
>
>
>