blob: 974697356b62999f79860f8a7abbc66d5f807e52 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<title>Apache Felix - MOSGi Managed OSGi framework</title>
<link rel="icon" href="/res/favicon.ico">
<link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
<link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
<div class="title">
<div class="logo">
<a href="https://felix.apache.org/">
<img border="0" alt="Apache Felix" src="/res/logo.png">
</a>
</div>
<div class="header">
<a href="https://www.apache.org/">
<img border="0" alt="Apache" src="/res/apache.png">
</a>
</div>
</div>
<div class="menu">
<style type="text/css">
/* The following code is added by mdx_elementid.py
It was originally lifted from http://subversion.apache.org/style/site.css */
/*
* Hide class="elementid-permalink", except when an enclosing heading
* has the :hover property.
*/
.headerlink, .elementid-permalink {
visibility: hidden;
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
<p><a href="/news.html">News</a> <br />
<a href="/license.html">License</a> <br />
<a href="/downloads.cgi">Downloads</a> <br />
<a href="/documentation.html">Documentation</a> <br />
<a href="/documentation/community/project-info.html">Project Info</a> <br />
<a href="/documentation/community/contributing.html">Contributing</a> <br />
<a href="/sitemap.html">Site Map</a> <br />
<a href="https://www.apache.org/">ASF</a> <br />
<a href="https://www.apache.org/security/">Security</a> <br />
<a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a> <br />
<a href="https://www.apache.org/foundation/thanks.html">Sponsors</a> </p>
<iframe
src="https://www.apache.org/ads/button.html"
style="border-width:0; float: left"
frameborder="0"
scrolling="no"
width="135"
height="135">
</iframe>
</div>
<div class="main">
<div class="breadcrump" style="font-size: 80%;">
<a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>
</div>
<h1>MOSGi Managed OSGi framework</h1>
<style type="text/css">
/* The following code is added by mdx_elementid.py
It was originally lifted from http://subversion.apache.org/style/site.css */
/*
* Hide class="elementid-permalink", except when an enclosing heading
* has the :hover property.
*/
.headerlink, .elementid-permalink {
visibility: hidden;
}
h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
<p>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:
<em> relies on JMX management infrastructure (IP-based management),
</em> provides two JMX agents: the standard Java 1.5 agent and a specific Java 1.4 lightweight embedded agent (MX4J agent deviation),
<em> provides a way to deploy various probes on remote gateways,
</em> provides a management console,
* the graphical part of a probe (management console part) can be dynamically plugged in the management console and is dynamically downloaded.</p>
<h1 id="very-fast-quickstart-guide">Very fast QuickStart Guide<a class="headerlink" href="#very-fast-quickstart-guide" title="Permanent link">&para;</a></h1>
<p>Go into $FELIX_HOME/trunk/mosgi.doc and read Readme.txt.</p>
<h1 id="general-architecture">General architecture<a class="headerlink" href="#general-architecture" title="Permanent link">&para;</a></h1>
<p>The overall architecture is presented in the following picture :</p>
<p>!MOSGiArchitecture.png!</p>
<h1 id="how-it-works">How it works<a class="headerlink" href="#how-it-works" title="Permanent link">&para;</a></h1>
<p>Managed OSGi gateways can install JMX probes from various repositories. A JMX probe is a standard OSGi bundle that registers an <a href="">#MBean</a> component in the managed gateway's JMX agent.</p>
<p>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.</p>
<p>Here is a description of different bundles that should be installed on both parts of the infrastructure (managed OSGi gateway and Management console).</p>
<p>A managed OSGi gateway must host the following bundles :
* JMX-MX4J Agent Service: provides a JMX agent. Either through a wrapper to jdk1.5 standard agent or through using a specific lightweight inner agent1 (originate from mx4j project). This agent service also declares a standard MBeanServer service interface..</p>
<ul>
<li>
<p>JMX rmiregistry: wraps RMI registry life cycle. It's used by the JMX remoting infrastructure to register</p>
</li>
<li>
<p>JMX RMI connector: wraps a standard JMX remoting RMI connector</p>
</li>
<li>
<p>Remote Logger: notifies log informations</p>
</li>
</ul>
<p>A JMX Console is an OSGi framework also (for simplicity) which should host two bundles :
<em> JMX Console: the graphical framework that will host graphical plugins
</em> jmxconsole common tabs: tabs that are common to all gateways. For the moment it only concerns a tab that shows remote notification (it works whith remote logger)</p>
<h1 id="osgijmx-mbean-registration">OSGi/JMX MBean registration<a class="headerlink" href="#osgijmx-mbean-registration" title="Permanent link">&para;</a></h1>
<p>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.
<em> In the direct code, one can register an MBean to the agent through the standard service interface : </em>javax.management.MBeanServer*</p>
<p>Example:</p>
<div class="codehilite"><pre><span class="n">org</span><span class="p">.</span><span class="n">osgi</span><span class="p">.</span><span class="n">framework</span><span class="p">.</span><span class="n">ServiceReference</span> <span class="n">sr</span> <span class="p">=</span> <span class="n">context</span><span class="p">.</span><span class="n">getServiceReference</span><span class="p">(</span><span class="n">javax</span><span class="p">.</span><span class="n">management</span><span class="p">.</span><span class="n">MBeanServer</span><span class="p">.</span><span class="n">class</span><span class="p">.</span><span class="n">getName</span><span class="p">());</span>
<span class="n">javax</span><span class="p">.</span><span class="n">management</span><span class="p">.</span><span class="n">MBeanServer</span> <span class="n">mbs</span><span class="p">=(</span><span class="n">javax</span><span class="p">.</span><span class="n">management</span><span class="p">.</span><span class="n">MBeanServer</span><span class="p">)</span><span class="n">context</span><span class="p">.</span><span class="n">getService</span><span class="p">(</span><span class="n">sr</span><span class="p">);</span>
<span class="n">mbs</span><span class="p">.</span><span class="n">registerMBean</span><span class="p">(</span><span class="n">new</span> <span class="n">MBeanImpl</span><span class="p">(),</span> <span class="n">new</span> <span class="n">ObjectName</span><span class="p">(</span>&quot;<span class="n">Foo</span><span class="p">:</span><span class="n">FooName</span>&quot;<span class="p">);</span>
</pre></div>
<p>Exemple of such code is uses in <em>mosgi.managedelements.bundlesprobes</em> code in felix repository
<em> 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 </em>javax.management.DynamicMBean<em>, 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 </em>org.apache.felix.mosgi.jmx.agent.Constants.OBJECTNAME* property name or automatically build through introspection.</p>
<p>Example:</p>
<div class="codehilite"><pre><span class="n">java</span><span class="p">.</span><span class="n">util</span><span class="p">.</span><span class="n">Properties</span> <span class="n">prop</span><span class="p">=</span><span class="n">new</span> <span class="n">java</span><span class="p">.</span><span class="n">util</span><span class="p">.</span><span class="n">Properties</span><span class="p">();</span>
<span class="n">prop</span><span class="p">.</span><span class="n">add</span><span class="p">(</span> <span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">felix</span><span class="p">.</span><span class="n">mosgi</span><span class="p">.</span><span class="n">jmx</span><span class="p">.</span><span class="n">agent</span><span class="p">.</span><span class="n">Constants</span><span class="p">.</span><span class="n">OBJECTNAME</span><span class="p">,</span> &quot;<span class="n">Foo</span><span class="p">:</span><span class="n">FooName</span>&quot;<span class="p">);</span>
<span class="n">context</span><span class="p">.</span><span class="n">registerService</span><span class="p">(</span><span class="n">test</span><span class="p">.</span><span class="n">FooMBean</span><span class="p">.</span><span class="n">class</span><span class="p">.</span><span class="n">getName</span><span class="p">(),</span> <span class="n">new</span> <span class="n">test</span><span class="p">.</span><span class="n">Foo</span><span class="p">(),</span> <span class="n">prop</span><span class="p">);</span>
</pre></div>
<h1 id="management-console">Management Console<a class="headerlink" href="#management-console" title="Permanent link">&para;</a></h1>
<p>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.</p>
<p>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.!jmxconsoleGUI.png!</p>
<p>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 :
<em> ObrProbe : a probe that enables interaction with obr for bundle deployment
</em> BundleProbe : a probe that enables the bundle life-cycle management
<em> GNU-Linux : a probe that gets status from running host operating system
</em> OSGi Platform : a probe that gets information from current running gateway</p>
<p>These plugin are developed as simple examples and are available in felix repository. A <a href="/documentation/subprojects/mosgi-managed-osgi-framework/probeguide.html">ProbeGuide</a> that describes plugin integration is available. Plugin are dynamically removed and reinstalled each time you change your selected gateway.</p>
<h3 id="mbean-definition">MBean Definition<a class="headerlink" href="#mbean-definition" title="Permanent link">&para;</a></h3>
<p>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.&nbsp;</p>
<div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
Rev. 1700393 by cziegeler on Tue, 1 Sep 2015 06:04:06 +0000
</div>
<div class="trademarkFooter">
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.
</div>
</div>
</body>
</html>