Apache

MOSGi enables the remote management of OSGi-compatible service gateways, using JMX. The framework is a reference architecture for end-to-end gateway management. It provides the following features:

Very fast QuickStart Guide

Go into $FELIX_HOME/trunk/mosgi.doc and read Readme.txt.

General architecture

The overall architecture is presented in the following picture :

How it works

Managed OSGi gateways can install JMX probes from various repositories. A JMX probe is a standard OSGi bundle that registers an MBean component in the managed gateway's JMX agent.

The management console (running in a standard OSGi framework) is connected to each gateway through the JMX remoting protocol. When it connects for the first time to a managed gateway, it asks for probes that are installed (i.e. all MBeans registered in the TabUI JMX domain). Then, for each MBean found, the management console asks for its graphical representation through a call to our standard API (component getUI() call). This call redirects to a bundle in the GUI probe repository that is installed by the management console. So the management console discovers at run-time the user interface it should use to
supervise a specific remote gateway.

Here is a description of different bundles that should be installed on both parts of the infrastructure (managed OSGi gateway and Management console).

A managed OSGi gateway must host the following bundles :

A JMX Console is an OSGi framework also (for simplicity) which should host two bundles :

OSGi/JMX MBean registration

MOSGi installs JMX-MX4J agent at the gateways level. Any one can register an MBean to the JMX agent. The registration can be made in two ways. The direct code and the white board pattern.

Example:

org.osgi.framework.ServiceReference sr = context.getServiceReference(javax.management.MBeanServer.class.getName());
javax.management.MBeanServer mbs=(javax.management.MBeanServer)context.getService(sr);
mbs.registerMBean(new MBeanImpl(), new ObjectName("Foo:FooName");

Exemple of such code is uses in mosgi.managedelements.bundlesprobes code in felix repository

Example:

java.util.Properties prop=new java.util.Properties();
prop.add( org.apache.felix.mosgi.jmx.agent.Constants.OBJECTNAME, "Foo:FooName");
context.registerService(test.FooMBean.class.getName(), new test.Foo(), prop);

Management Console

The management console is a ad-hoc jmx compatible console. Its aim is not to be a concurrent to general purpose consoles like MX4J or JConsole but provides an ad-hoc user interface depending on the managed gateway. The console is based on a plugin framework. Each time the consol connects to a gateway it gets the list of available MBean. Then for each registered MBean it asks for specific local bundles for managing it. Each graphical bundle is integrated as a graphical tab in the management console.

In the next screenshot, the gateway user has deployed 4 probes on the remote gateway : Remote Obr, Remote Bundle List, GNU/Linux and OSGi Plateform.

In order to get these tabs, the gateway manager deploys the 4 probe bundles on the remote gateway and GUI tabs are automatically made available to the remote console. These bundles are :

These plugin are developed as simple examples and are available in felix repository. A ProbeGuide that describes plugin integration is available. Plugin are dynamically removed and reinstalled each time you change your selected gateway.

MBean Definition

An MBean is a Management Component for the JMX framework. It is made of an MBean interface and an implementation of it. The MBean interface is used to make remote management with the implementation. 

Last modified by heavy@ungoverned.org on 2006-11-20 01:54:44.0
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.