You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Matt Madhavan <ma...@gmail.com> on 2011/09/19 00:54:49 UTC

JMX/Aries Instrumentation Question

Hello,
I'm running my application in Karaf container and I see that the following
two bundles are active:

   1. org.apache.aries.jmx.blueprint
   2. org.apache.aries.jmx

I have my blueprint.xml as follows:

<reference id="persistenceService"
interface="itso.bank.api.persistence.PersistenceService">
</reference>
 <bean id="itsoBankBean" class="itso.bank.biz.ITSOBank">
<property name="persistenceService" ref="persistenceService"/>
<bptx:transaction value="Required" method="*" />
</bean>
 <service id="ItsoBankBeanService" interface="itso.bank.api.Bank"
ref="itsoBankBean">
   <service-properties>
      <entry key="osgi.jndi.service.name" value="biz/bankBizService"/>
      *<entry key="jmx.objectname" value="domain:name=bankBizService" />   *

    </service-properties>
</service>

I was expecting the JMX bundles are of type Extender Bundles. Like the Aries
JNDI extender bundle the Aries JMX extender bundle will automatically
instrument the itsoBankBean.

Do I need to do additional work than this?

Any help will be appreciated

Thanks in advance!

Matt

Fwd: JMX/Aries Instrumentation Question

Posted by Alasdair Nottingham <no...@apache.org>.
Hi,

The org.apache.aries.jmx bundle provides an implementation of the OSGi JMX
specification. This specification provides MBeans for interacting via JMX
with an OSGi framework. It doesn't provide a mechanism to register MBeans
with an OSGi bundle. So it won't do what you want it to do.

The Apache Aries project does contain a project that does specify how to
register MBeans. This is the jmx-whiteboard project. It allows you to
register a service using the jmx.objectname property in the service
registry. The MBean also needs to be either a DynamicMBean, or it needs to
follow the StandardMBean conventions.

Alasdair


On 18 September 2011 23:54, Matt Madhavan <ma...@gmail.com> wrote:

> Hello,
> I'm running my application in Karaf container and I see that the following
> two bundles are active:
>
>    1. org.apache.aries.jmx.blueprint
>    2. org.apache.aries.jmx
>
> I have my blueprint.xml as follows:
>
> <reference id="persistenceService"
> interface="itso.bank.api.persistence.PersistenceService">
>  </reference>
>  <bean id="itsoBankBean" class="itso.bank.biz.ITSOBank">
>  <property name="persistenceService" ref="persistenceService"/>
> <bptx:transaction value="Required" method="*" />
>  </bean>
>  <service id="ItsoBankBeanService" interface="itso.bank.api.Bank"
>  ref="itsoBankBean">
>    <service-properties>
>       <entry key="osgi.jndi.service.name" value="biz/bankBizService"/>
>       *<entry key="jmx.objectname" value="domain:name=bankBizService" />
> *
>     </service-properties>
> </service>
>
> I was expecting the JMX bundles are of type Extender Bundles. Like the
> Aries JNDI extender bundle the Aries JMX extender bundle will automatically
> instrument the itsoBankBean.
>
> Do I need to do additional work than this?
>
> Any help will be appreciated
>
> Thanks in advance!
>
> Matt
>



-- 
Alasdair Nottingham
not@apache.org



-- 
Alasdair Nottingham
not@apache.org

Re: JMX/Aries Instrumentation Question

Posted by Alasdair Nottingham <no...@apache.org>.
Hi,

Not quite. I was saying:

   1. You need the aries JMX whiteboard OSGi bundle, which you do not appear
   to have
   2. Your ITSOBank bean either needs to meet the standard Mbean design
   pattern (so in this case implement an ITSOBankMBean interface), or also
   implement DynamicMBean.


Alasdair

On 19 September 2011 18:31, Matt Madhavan <ma...@gmail.com> wrote:

> HI Alasdair,
> You mean to say that, in the above xml snippet I sent the mean *
> itso.bank.biz.ITSOBank* must implement the interface DynamicMBean? Like as
> follows:
>
> public class  *itso.bank.biz.ITSOBank *implements Bank, *DynamicMBean  {*
> * .......*
> *}*
>
> Could you please confirm with me?
>
> Thanks
> Matt
>
>
> Can you please confirm?
>
> Thanks
> Matt
>
> On Mon, Sep 19, 2011 at 4:36 AM, Alasdair Nottingham <no...@apache.org>wrote:
>
>> Hi,
>>
>> The org.apache.aries.jmx bundle provides an implementation of the OSGi JMX
>> specification. This specification provides MBeans for interacting via JMX
>> with an OSGi framework. It doesn't provide a mechanism to register MBeans
>> with an OSGi bundle. So it won't do what you want it to do.
>>
>> The Apache Aries project does contain a project that does specify how to
>> register MBeans. This is the jmx-whiteboard project. It allows you to
>> register a service using the jmx.objectname property in the service
>> registry. The MBean also needs to be either a DynamicMBean, or it needs to
>> follow the StandardMBean conventions.
>>
>> Alasdair
>>
>>
>> On 18 September 2011 23:54, Matt Madhavan <ma...@gmail.com> wrote:
>>
>>> Hello,
>>> I'm running my application in Karaf container and I see that the
>>> following two bundles are active:
>>>
>>>    1. org.apache.aries.jmx.blueprint
>>>    2. org.apache.aries.jmx
>>>
>>> I have my blueprint.xml as follows:
>>>
>>> <reference id="persistenceService"
>>> interface="itso.bank.api.persistence.PersistenceService">
>>>  </reference>
>>>  <bean id="itsoBankBean" class="itso.bank.biz.ITSOBank">
>>>  <property name="persistenceService" ref="persistenceService"/>
>>> <bptx:transaction value="Required" method="*" />
>>>  </bean>
>>>  <service id="ItsoBankBeanService" interface="itso.bank.api.Bank"
>>>  ref="itsoBankBean">
>>>    <service-properties>
>>>       <entry key="osgi.jndi.service.name" value="biz/bankBizService"/>
>>>       *<entry key="jmx.objectname" value="domain:name=bankBizService" />
>>>   *
>>>     </service-properties>
>>> </service>
>>>
>>> I was expecting the JMX bundles are of type Extender Bundles. Like the
>>> Aries JNDI extender bundle the Aries JMX extender bundle will automatically
>>> instrument the itsoBankBean.
>>>
>>> Do I need to do additional work than this?
>>>
>>> Any help will be appreciated
>>>
>>> Thanks in advance!
>>>
>>> Matt
>>>
>>
>>
>>
>> --
>> Alasdair Nottingham
>> not@apache.org
>>
>
>


-- 
Alasdair Nottingham
not@apache.org