The component itself is not exposed as an MBean.  The way to do that is to
register the mbean yourself.  JBI defines some methods to help doing
that, mainly
you should create the mbean name using
   getContext().getMBeanNames().createCustomComponentMBeanName("Configuration");
and return this name in the
    public ObjectName getExtensionMBeanName()
method of your component.

Note that you still have to register / unregister it yourself when the
component is initialized / shutdown.

Cheers,
Guillaume Nodet


On 4/11/06, pgodot <[EMAIL PROTECTED]> wrote:
>
> Hi SM men,
>
> I wrote a component and I try to expose a new attribute to JMX. Is it
> possible ?
>
> My component extends from ComponentSupprot and I implemented :
> A getter :
> public int getStackSize() {
>                 return stackSize;
>         }
>
>
>  public MBeanAttributeInfo[] getAttributeInfos() throws JMException {
>         AttributeInfoHelper helper = new AttributeInfoHelper();
>         helper.addAttribute(getObjectToManage(), "stackSize", "internal size
> queue");
>  return AttributeInfoHelper.join(super.getAttributeInfos(),
> helper.getAttributeInfos());
>     }
>
> and implements myClassMBean interface where I defined interface of my
> getter.
>
> I didn't see my attribute in JMX console. What's going worng ?
>
> Thanks a lot,
> Phil
> --
> View this message in context: 
> http://www.nabble.com/extend-JMX-attribute-from-pojosupport-t1429769.html#a3856243
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Reply via email to