Return-Path: X-Original-To: apmail-karaf-user-archive@minotaur.apache.org Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 973F4D5A8 for ; Wed, 3 Oct 2012 16:12:47 +0000 (UTC) Received: (qmail 70331 invoked by uid 500); 3 Oct 2012 16:12:47 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 70311 invoked by uid 500); 3 Oct 2012 16:12:47 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 70303 invoked by uid 99); 3 Oct 2012 16:12:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 16:12:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ch007m@gmail.com designates 209.85.212.48 as permitted sender) Received: from [209.85.212.48] (HELO mail-vb0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 16:12:40 +0000 Received: by vbme21 with SMTP id e21so10566309vbm.21 for ; Wed, 03 Oct 2012 09:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Ez1XIKPf8Ol8tWBjOXrf3s0XsvttSEHRDb2VYcUX2Xg=; b=ez8ekawq6zPetxgngqMuKzBNzEuhwmDBr/eM18oUrUbpnTmvlZ7UoEwYnkLCnrq3Ej 8oEigK3v4rILF3JhMycdwI6RTG+a7lFvKKE/XVE/NxPBzX74EKWlG54gJZXMXwJn5zSd Mte567qyIRcMuEwzEsEiCi3aH92qSyLFLJ0W3dimL0EJCby1ZHmkG1FLaNBynC9nAJ0I p9lgxcaYdJm/YfoQ1MY4hTVmkYL/WmaFXjJoEuW4Zz2bpRNVeo++YZbzcYdaJL6iIWXs zik7L+CfYIFe+9uNqJNavL5orWvDcq0kji7GcV76cbDri5FbIoppLvbqsTYjSOK3GLB/ gtSA== MIME-Version: 1.0 Received: by 10.58.189.40 with SMTP id gf8mr1480410vec.24.1349280739377; Wed, 03 Oct 2012 09:12:19 -0700 (PDT) Received: by 10.58.6.197 with HTTP; Wed, 3 Oct 2012 09:12:19 -0700 (PDT) Date: Wed, 3 Oct 2012 18:12:19 +0200 Message-ID: Subject: Register a bean as a MBean (JMX) From: Charles Moulliard To: user@karaf.apache.org, user@aries.apache.org Content-Type: multipart/alternative; boundary=047d7b5d24522c3ffc04cb29e753 --047d7b5d24522c3ffc04cb29e753 Content-Type: text/plain; charset=ISO-8859-1 Hi, I have developed a small project to register a bean as a JMX Mbean. The code looks the same as org.apache.karaf.web.management.internal.Web of Karaf 1. Interface package com.fusesource.poc.service; public interface ServiceMBean { String sayHello(); } 2. Impl package com.fusesource.poc.service.impl; import com.fusesource.poc.service.ServiceMBean; import javax.management.NotCompliantMBeanException; import javax.management.StandardMBean; public class MyService extends StandardMBean implements ServiceMBean { public MyService() throws NotCompliantMBeanException { super(ServiceMBean.class); } @Override public String sayHello() { return ">> Good morning from Weather Team"; } } 3. Blueprint Remark : no error is reported in the console of karaf Unfortunately, when my bundle is started, I cannot see it registered in MBean server - JConsole. Is there something that I missed ? Regards -- Charles Moulliard Apache Committer / Sr. Enterprise Architect (RedHat) Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com --047d7b5d24522c3ffc04cb29e753 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I have developed a small project to register a bean = as a JMX Mbean. The code looks the same as=A0org.apache.karaf.web.managemen= t.internal.Web of Karaf=A0

1. Interface
=
package com.fusesource.poc.service;

public interface ServiceMBean {

=A0 =A0 String s= ayHello();

}

2. Imp= l

package com.fusesource.poc.service.impl;

import com.fusesource.poc.service.ServiceMBean;
<= br>
import javax.management.NotCompliantMBeanException;
import javax.management.StandardMBean;

public= class MyService extends StandardMBean implements ServiceMBean {
=
=A0 =A0 public MyService() throws NotCompliantMBeanException= {
=A0 =A0 =A0 =A0 super(ServiceMBean.class);
=A0 =A0 }

=A0 =A0 @Override
=A0 =A0 public String sayHell= o() {
=A0 =A0 =A0 =A0 return ">> Good morning from Wea= ther Team";
=A0 =A0 }
}

3. Blueprint

=A0 =A0 =A0 =A0 =A0 =A0xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"= ;
=A0 =A0 =A0 =A0 =A0 =A0xsi:schemaLocation=3D"

=A0 =A0 <bean id=3D"= ;service" class=3D"com.fusesource.poc.service.impl.MyService"= ;/>

=A0 =A0 <service ref=3D"service" auto-expo= rt=3D"interfaces">
=A0 =A0 =A0 =A0 <service-prope= rties>
=A0 =A0 =A0 =A0 =A0 =A0 <entry key=3D"jmx.objec= tname" value=3D"com.fusesource.poc.service:type=3Dservice,name=3D= feedback" />
=A0 =A0 =A0 =A0 </service-properties>
=A0 =A0 </ser= vice>

</blueprint>

Remark : no error is reported in the console of karaf
Unfortunately, when my bundle is started, I cannot see it registered i= n MBean server - JConsole. Is there something that I missed ?
Regards

--
Charles Mou= lliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter= : @cmoulliard |=A0Blog : http://cmoulliard.blogspot.com


--047d7b5d24522c3ffc04cb29e753--