You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Krzysztof Sobkowiak <kr...@gmail.com> on 2013/05/18 00:07:38 UTC
JMX
Hi
Can I find somewhere a documentation for Aries JMX? I can't find JXM in
the modules section of the Aries web page.
Best regards
Krzysztof
Re: JMX
Posted by David Bosschaert <da...@gmail.com>.
Hi Krzysztof,
Yeah, there is no specific JMX module section yet. Here are a few pointers
that might get you going...
The JMX component implements the OSGi R5 JMX specification [1]. To hook it
in with an MBean Server the relevant MBean Server needs to be registered in
the OSGi Service Registry (as defined by the spec).
The quickest way to get things to do something visibile is to use the
platform mbean server, and register that. For example create a simple
bundle that contains the following Bundle Activator:
import java.lang.management.ManagementFactory;
import javax.management.MBeanServer;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
context.registerService(MBeanServer.class.getName(), mbs, null);
}
public void stop(BundleContext context) throws Exception {}
}
Then install the Aries JMX bundle [2] and the Aries Util bundle [3] and
start everything:
g! lb
START LEVEL 1
ID|State |Level|Name
0|Active | 0|System Bundle (4.2.1)
1|Active | 1|Apache Felix Bundle Repository (1.6.6)
2|Active | 1|Apache Felix Gogo Command (0.12.0)
3|Active | 1|Apache Felix Gogo Runtime (0.10.0)
4|Active | 1|Apache Felix Gogo Shell (0.10.0)
5|Active | 1|My Glue Activator (1.0.0)
6|Active | 1|Apache Aries JMX Bundle (1.1.1)
7|Active | 1|Apache Aries Util (1.1.0)
At this point you can access the OSGi functionality through MBeans, for
example via jconsole (see screenshot):
[image: Inline images 1]
I'll to find some time to start an Aries JMX module page with some of this
info. Aries JMX also contains functionality relating to blueprint and it
contains a whiteboard feature. I'm not too familiar with those so it would
be great is someone else could chim in about those...
Hope this helps,
David
[1] Chapter 124 in the R5 Enterprise spec available from
www.osgi.org/Download/Release5
[2]
http://search.maven.org/remotecontent?filepath=org/apache/aries/jmx/org.apache.aries.jmx/1.1.1/org.apache.aries.jmx-1.1.1.jar
[3]
http://search.maven.org/remotecontent?filepath=org/apache/aries/org.apache.aries.util/1.1.0/org.apache.aries.util-1.1.0.jar
On 17 May 2013 23:07, Krzysztof Sobkowiak <kr...@gmail.com> wrote:
> Hi
>
> Can I find somewhere a documentation for Aries JMX? I can't find JXM in
> the modules section of the Aries web page.
>
> Best regards
> Krzysztof
>