...
Managed OSGi gateways can install JMX probes from various repositories. A JMX probe is a standard OSGi bundle that registers an test #MBean component in the managed gateway's JMX agent.
...
- In the direct code, one can register an MBean to the agent through the standard service interface : javax.management.MBeanServer
For instance Example:
Code Block |
---|
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"); |
...
- In the whiteboard pattern, one can register an MBean through registering its interface to the framework as a service. If the interface name ends with MBean or if the interface is javax.management.DynamicMBean, the agent will automatically register the implementation as a standard MBean. The objectName of the MBean can either be defined at registration time with the org.apache.felix.mosgi.jmx.agent.Constants.OBJECTNAME property name or automatically build through introspection.
For instance Example:
Code Block |
---|
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()); |
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 :
- ObrProbe : a probe that enables interaction with obr for bundle deployment
- BundleProbe : a probe that enables the bundle life-cycle management
- GNU-Linux : a probe that gets status from running host operating system
- OSGi Platform : a probe that gets information from current running gateway
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.
Anchor | ||||
---|---|---|---|---|
|
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.