You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by bu...@apache.org on 2013/02/03 07:45:22 UTC

svn commit: r849204 [19/33] - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/ documentation/subprojects/apache-felix-ipojo/ documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-devguide/ documentation/subprojects/apac...

Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/extender-pattern-handler.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/extender-pattern-handler.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/extender-pattern-handler.html Sun Feb  3 06:45:21 2013
@@ -20,9 +20,45 @@
   <head>
     <title>Apache Felix - Extender Pattern Handler</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">
+    <link rel="stylesheet" href="/site/media.data/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/ipojo/site/superfish.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/ipojo/site/style.css" type="text/css" media="all">
     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    
+    <!--
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>
+    -->
+    
+    <script type="text/javascript" src="/ipojo/site/jquery-1.js"></script>
+    <script type="text/javascript" src="/ipojo/site/hoverIntent.js"></script>
+    <script type="text/javascript" src="/ipojo/site/superfish.js"></script> 
+    <script type="text/javascript" src="/ipojo/site/supersubs.js"></script> 
+    
+    <script type="text/javascript"> 
+     
+        $(document).ready(function(){ 
+            $("ul.sf-menu").supersubs({ 
+                minWidth:    14,   // minimum width of sub-menus in em units 
+                maxWidth:    30,   // maximum width of sub-menus in em units 
+                extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
+                                   // due to slight rounding differences and font-family 
+            }).superfish();  // call supersubs first, then superfish, so that subs are 
+                             // not display:none when measuring. Call before initialising 
+                             // containing tabs for same reason. 
+        }); 
+     
+    </script>
+    
   </head>
   <body>
     <div class="title">
@@ -37,136 +73,228 @@
         </a>
       </div>
     </div>
+  
+    <div class="main">
+    <div class="main">
+    <div class="page-header">
+    <img src="/ipojo/site/header.png" class="header">
+    <a href="http://ipojo.org"><img src="/ipojo/site/ipojo.png" width="225" class="header-logo"></a>
+    <ul class="sf-menu sf-js-enabled sf-shadow" id="ipojo-menu">
+    <li class="current">
+    <!-- Menu Overview -->
+    <a href="#" class="sf-with-ul">Overview<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+        <li>
+        <a href="">Home</a>                          
+        </li>
+        <li>
+        <a href="">Why choose iPOJO</a>
+        </li>
+        <li>
+        <a href="">Success stories</a>
+        </li>
+        <li>
+        <a href="">Features</a>
+        </li>
+    </ul>
+    </li>   
     
-    <div class="menu"> 
-      <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="/mailinglists.html">mailing lists</a>  <br />
-<a href="/documentation/community/contributing.html">contributing</a>  <br />
-<a href="/sitemap.html">site map</a>  <br />
-<a href="http://www.apache.org/">asf</a>  <br />
-<a href="http://www.apache.org/security/">security</a>  <br />
-<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
-<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>  <br />
-</p>
-<iframe
-    src="http://www.apache.org/ads/button.html"
-    style="border-width:0; float: left"
-    frameborder="0"
-    scrolling="no"
-    width="135"
-    height="135">
-</iframe>
-    </div>
+    <li class="">           
+    <!-- Menu download -->
+    <li>
+    <a href="/downloads.cgi">Download </a>
+    </li>
     
-    <div class="main">
-      <div class="breadcrump" style="font-size: 80%;">
-        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo.html">Apache Felix iPOJO</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide.html">apache-felix-ipojo-userguide</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components.html">Describing components</a>
-      </div>
-
+    <li class="">                   
+    <!-- Menu Documentation -->
+    <a href="#" class="sf-with-ul">Documentation<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+        <!-- sub-menu : getting started -->
+        <li class="">
+        <a href="#" class="sf-with-ul">Getting Started<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+        <ul>
+         <li><a href="">iPOJO in 10 minutes</a></li>
+         <li><a href="">Using Annotations</a></li>
+         <li><a href="">Maven tutorial</a></li>
+         <li><a href="">Advanced tutorial</a></li>
+         <li><a href="">Using Distributed OSGi</a></li>
+         <li><a href="">Application Composition</a></li>
+        </ul>
+        </li> <!-- end of getting started -->
+        <!-- sub menu : Describing Components -->
+         <li class="">
+            <a href="" class="sf-with-ul">Describing components<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+            <ul>
+            <li><a href="">Requiring a service</a></li>
+            <li><a href="">Providing a service</a></li>
+            <li><a href="">Lifecycle management</a></li>
+            <li><a href="">Configuration</a></li>
+            <li><a href="">Introspection</a></li>
+            <li><a href="">Impacting the lifecycle</a></li>
+            <li><a href="">Asynchronous communication</a></li>
+            <li><a href="">JMX management</a></li>
+            <li><a href="">Extender pattern</a></li>
+            <li><a href="">Whiteboard pattern</a></li>
+            <li><a href="">Temporal dependencies</a></li>
+            </ul>
+         </li> <!-- End of describing components -->
+        <!-- sub-menu : User Guide -->
+        <li class="">
+        <a href="" class="sf-with-ul">User Guide<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+            <ul>
+            <li><a href="">iPOJO and config admin</a></li>
+            <li><a href="">Factories and Instances</a></li>
+            <li><a href="">XML Schemas</a></li>
+            <li><a href="">API</a></li>
+            <li><a href="">Testing components</a></li>
+            <li><a href="">Eclipse Integration</a></li>
+            <li><a href="">FAQ</a></li>
+            <li><a href="">Reference Card</a></li>
+            </ul>
+        </li> <!-- end of user guide -->
+        <!-- sub-menu : Dev Guide -->
+        <li> 
+        <a href="#" class="sf-with-ul">Advanced Topics<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+           <ul>
+            <li><a href="http://felix.apache.org/ipojo/api/1.6.0">Javadoc</a></li>
+            <li><a href="">Handler development</a></li>
+            <li><a href="">Manipulation Metadata </a></li>
+            <li><a href="">Dive into the iPOJO Manipulation depths</a></li>
+           </ul>
+        </li> <!-- End of Dev guide -->
+    </ul> 
+    </li> <!-- End of doc -->
+    <!-- Menu 4 : Tools -->
+    <li class="">
+    <a href="#" class="sf-with-ul">Tools<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+       <li><a href="">Ant Task</a></li>
+       <li><a href="">Eclipse Plugin</a></li>
+       <li><a href="">Maven Plugin</a></li>
+       <li><a href="">`arch` shell command</a></li>
+       <li><a href="">Online Manipulator</a></li>
+       <li><a href="">Webconsole plugin</a></li>
+       <li><a href="">Junit4OSGi</a></li>
+    </ul>   
+    </li><!-- End of tools -->  
+    <!-- Menu 5 : Support -->
+    <li>
+    <a href="">Support </a>
+    </li>
+    <!-- End of the menu 5 -->          
+    <!-- Menu 6 : Misc -->
+    <li class="">
+    <a href="#" class="sf-with-ul">Misc<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+       <li><a href="">Supported JVMs</a></li>
+       <li><a href="">Supported OSGi Implementations</a></li>
+       <li><a href="http://ipojo-dark-side.blogspot.com">iPOJO's Dark Side Blog</a></li>
+       <li><a href="">Article & Presentations</a></li>
+       <li><a href="http://www.apache.org/">ASF</a></li>
+       <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+       <li><a href="http://www.apache.org/foundation/thanks.html">Sponsors</a></li>
+    </ul>
+    </li><!-- End of misc -->
+    </ul> <!-- End of the menu -->
+    </div> <!-- Page header -->
+  
+      <!-- 
       
       <div class="tip">
            This page is a translated version of <a href="/site/extender-pattern-handler.html" target="felix_cwiki">/site/extender-pattern-handler.html</a>. In case of
            doubt you might want to refer to the old page.
       </div>
       
+      -->
       
       <h1>Extender Pattern Handler</h1>
-      <p>{include:apache-felix-ipojo-header}</p>
-<div class="content">
-
-#  The extender pattern handler
-*The objective of this handler is to simplify the development of extender-based architecture. This architecture-style is based on two different entities:*
-* *The extender (also called host)* 
-* *The extensions*
-
-{div:class=toc}
+      
+      <div class="content">
+        <h1 id="the-extender-pattern-handler">The extender pattern handler</h1>
+<p><em>The objective of this handler is to simplify the development of extender-based architecture. This architecture-style is based on two different entities:</em>
+<em> </em>The extender (also called host)<em> 
+</em> <em>The extensions</em></p>
+<p>{div:class=toc}
 [TOC]
-{div}
-
-## The Extender pattern
-
-This architecture-style is based on two different roles:
-* The extender 
-* The extension
-
-!extender.png!
-
-The relation is basically a 1..n relation. The extender tracks extensions. The particularity of this architecture-style is that extensions are packaged in different bundles. An extension is detected by analyzing the bundle. Indeed these bundles can have a special mark in their manifest of a special file...
+{div}</p>
+<h2 id="the-extender-pattern">The Extender pattern</h2>
+<p>This architecture-style is based on two different roles:
+<em> The extender 
+</em> The extension</p>
+<p>!extender.png!</p>
+<p>The relation is basically a 1..n relation. The extender tracks extensions. The particularity of this architecture-style is that extensions are packaged in different bundles. An extension is detected by analyzing the bundle. Indeed these bundles can have a special mark in their manifest of a special file...
 Implementing an extender pattern could be complex as the extender needs to track these marks dynamically. When a bundle starts, it needs to look at the mark. Then a bundle leave, the extender must release all object created from this bundle.
 This handler tracks bundle for you based on the specified required mark. At each time a matching bundle appears or disappears, a callback is invoked. The mark is currently a header in the bundle manifest.
-Nowadays, a lot of frameworks use this pattern such as iPOJO it-self (to find both bundles containing components and bundles adding a new implementation type), Spring-DM ...
-
-## Using the handler
-First of all, you need to configure the component type to use the handler such as:
-
-    <ipojo xmlns:extender="org.apache.felix.ipojo.extender">
-        <component
-            classname="org.apache.felix.ipojo.extender.MyExtender">
-
-                    <!-- Extender Pattern handler configuration -->
-            <extender:extender 
-                      extension="My-Extension"
-                      onArrival="onBundleArrival" 
-                      onDeparture="onBundleDeparture" 
-                    />
-
-            <callback transition="invalidate" method="stopping" />
-            <callback transition="validate" method="starting" />
-            <provides />
-        </component>
-    </ipojo>
-
-Notice that, this handler is an external handler. So, it uses the "org.apache.felix.ipojo.extender" namespace.
-You can also use annotations:
-
-    @Component
-    @Extender(
-        onArrival="onBundleArrival",
-        onDeparture="onBundleDeparture",
-        extension="My-Extension")
-    public class MyExtender {
-
-        @Validate
-        public void starting() {
-          // ...
-        }
-
-        @Invalidate
-        public void stopping {
-          // ...
-        }
-
-        void onBundleArrival(Bundle bundle, String header) {
-                 // Do something
-        }
-
-        void onBundleDeparture(Bundle bundle) {
-                // Do something
-        }
-    }
-
-The methods specified methods will be called when a matching bundle arrives or leaves.
-In the previous example, these methods could be: 
-
-    void onBundleArrival(Bundle bundle, String header) {
-             // Do something
-    }
-
-    void onBundleDeparture(Bundle bundle) {
-            // Do something
-    }
-
-Notice the different signatures of the methods. The arrival method is called with the arriving bundle and the matching header value (i.e. the value of the My-Extension header of the bundle manifest). The departure method just receives the leaving bundle.
-
-## Configuration
-The handler has only three mandatory attributes:
-* Extension: declaring the looked manifest header.
-* onArrival: declaring the method to invoke when a matching bundle arrives
-* onDeparture: declaring the method to invoke when a matching bundle leaves
-
+Nowadays, a lot of frameworks use this pattern such as iPOJO it-self (to find both bundles containing components and bundles adding a new implementation type), Spring-DM ...</p>
+<h2 id="using-the-handler">Using the handler</h2>
+<p>First of all, you need to configure the component type to use the handler such as:</p>
+<div class="codehilite"><pre><span class="nt">&lt;ipojo</span> <span class="na">xmlns:extender=</span><span class="s">&quot;org.apache.felix.ipojo.extender&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;component</span>
+        <span class="na">classname=</span><span class="s">&quot;org.apache.felix.ipojo.extender.MyExtender&quot;</span><span class="nt">&gt;</span>
+
+                <span class="c">&lt;!-- Extender Pattern handler configuration --&gt;</span>
+        <span class="nt">&lt;extender:extender</span> 
+                  <span class="na">extension=</span><span class="s">&quot;My-Extension&quot;</span>
+                  <span class="na">onArrival=</span><span class="s">&quot;onBundleArrival&quot;</span> 
+                  <span class="na">onDeparture=</span><span class="s">&quot;onBundleDeparture&quot;</span> 
+                <span class="nt">/&gt;</span>
+
+        <span class="nt">&lt;callback</span> <span class="na">transition=</span><span class="s">&quot;invalidate&quot;</span> <span class="na">method=</span><span class="s">&quot;stopping&quot;</span> <span class="nt">/&gt;</span>
+        <span class="nt">&lt;callback</span> <span class="na">transition=</span><span class="s">&quot;validate&quot;</span> <span class="na">method=</span><span class="s">&quot;starting&quot;</span> <span class="nt">/&gt;</span>
+        <span class="nt">&lt;provides</span> <span class="nt">/&gt;</span>
+    <span class="nt">&lt;/component&gt;</span>
+<span class="nt">&lt;/ipojo&gt;</span>
+</pre></div>
+
+
+<p>Notice that, this handler is an external handler. So, it uses the "org.apache.felix.ipojo.extender" namespace.
+You can also use annotations:</p>
+<div class="codehilite"><pre><span class="nv">@Component</span>
+<span class="nv">@Extender</span><span class="p">(</span>
+    <span class="n">onArrival</span><span class="o">=</span><span class="s">&quot;onBundleArrival&quot;</span><span class="p">,</span>
+    <span class="n">onDeparture</span><span class="o">=</span><span class="s">&quot;onBundleDeparture&quot;</span><span class="p">,</span>
+    <span class="n">extension</span><span class="o">=</span><span class="s">&quot;My-Extension&quot;</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">MyExtender</span> <span class="p">{</span>
+
+    <span class="nv">@Validate</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">starting</span><span class="p">()</span> <span class="p">{</span>
+      <span class="sr">//</span> <span class="o">...</span>
+    <span class="p">}</span>
+
+    <span class="nv">@Invalidate</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">stopping</span> <span class="p">{</span>
+      <span class="sr">//</span> <span class="o">...</span>
+    <span class="p">}</span>
+
+    <span class="n">void</span> <span class="n">onBundleArrival</span><span class="p">(</span><span class="n">Bundle</span> <span class="n">bundle</span><span class="p">,</span> <span class="n">String</span> <span class="n">header</span><span class="p">)</span> <span class="p">{</span>
+             <span class="sr">//</span> <span class="n">Do</span> <span class="n">something</span>
+    <span class="p">}</span>
+
+    <span class="n">void</span> <span class="n">onBundleDeparture</span><span class="p">(</span><span class="n">Bundle</span> <span class="n">bundle</span><span class="p">)</span> <span class="p">{</span>
+            <span class="sr">//</span> <span class="n">Do</span> <span class="n">something</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>The methods specified methods will be called when a matching bundle arrives or leaves.
+In the previous example, these methods could be: </p>
+<div class="codehilite"><pre><span class="n">void</span> <span class="n">onBundleArrival</span><span class="p">(</span><span class="n">Bundle</span> <span class="n">bundle</span><span class="p">,</span> <span class="n">String</span> <span class="n">header</span><span class="p">)</span> <span class="p">{</span>
+         <span class="sr">//</span> <span class="n">Do</span> <span class="n">something</span>
+<span class="p">}</span>
+
+<span class="n">void</span> <span class="n">onBundleDeparture</span><span class="p">(</span><span class="n">Bundle</span> <span class="n">bundle</span><span class="p">)</span> <span class="p">{</span>
+        <span class="sr">//</span> <span class="n">Do</span> <span class="n">something</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Notice the different signatures of the methods. The arrival method is called with the arriving bundle and the matching header value (i.e. the value of the My-Extension header of the bundle manifest). The departure method just receives the leaving bundle.</p>
+<h2 id="configuration">Configuration</h2>
+<p>The handler has only three mandatory attributes:
+<em> Extension: declaring the looked manifest header.
+</em> onArrival: declaring the method to invoke when a matching bundle arrives
+* onDeparture: declaring the method to invoke when a matching bundle leaves</p>
 <div class="box">
     <div class="box-yellow-header">
     <div class="box-yellow-title">
@@ -179,39 +307,41 @@ The handler has only three mandatory att
     <div class="box-yellow-footer"></div>
 </div>
 
-## Download
-The handler is available on the [download](/documentation/subprojects/apache-felix-ipojo/download.html) page.
-Sources are available on the Felix trunk at the following location: [http://svn.apache.org/repos/asf/felix/trunk/ipojo/handler/extender/](http://svn.apache.org/repos/asf/felix/trunk/ipojo/handler/extender/)
-
-## Configuring the handler with annotations
-
-It is possible to configure the handler with a simple annotation available in the annotation pack ('annotation' project in the iPOJO trunk). Here is an example of usage:
+<h2 id="download">Download</h2>
+<p>The handler is available on the <a href="/documentation/subprojects/apache-felix-ipojo/download.html">download</a> page.
+Sources are available on the Felix trunk at the following location: <a href="http://svn.apache.org/repos/asf/felix/trunk/ipojo/handler/extender/">http://svn.apache.org/repos/asf/felix/trunk/ipojo/handler/extender/</a></p>
+<h2 id="configuring-the-handler-with-annotations">Configuring the handler with annotations</h2>
+<p>It is possible to configure the handler with a simple annotation available in the annotation pack ('annotation' project in the iPOJO trunk). Here is an example of usage:
 {code:java}
 import org.apache.felix.ipojo.annotations.Component;
-import org.osgi.framework.Bundle;
-
-@Component
+import org.osgi.framework.Bundle;</p>
+<p>@Component
 @org.apache.felix.ipojo.extender.Extender(extension="foo", onArrival="onArrival", onDeparture="onDeparture")
-public class Extender {
+public class Extender {</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">onArrival</span><span class="p">(</span><span class="n">Bundle</span> <span class="n">bundle</span><span class="p">,</span> <span class="n">String</span> <span class="n">foo</span><span class="p">)</span> <span class="p">{</span>
+    <span class="sr">//</span> <span class="k">do</span> <span class="n">something</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">void</span> <span class="n">onDeparture</span><span class="p">(</span><span class="n">Bundle</span> <span class="n">bundle</span><span class="p">)</span> <span class="p">{</span>
+    <span class="sr">//</span> <span class="k">do</span> <span class="n">something</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>}</p>
+<div class="codehilite"><pre><span class="n">The</span>  <span class="n">attribute</span> <span class="n">allows</span> <span class="n">setting</span> <span class="n">the</span> <span class="n">bundle</span> <span class="n">filter</span><span class="o">.</span>
+
+<span class="n">h2</span><span class="o">.</span> <span class="n">A</span> <span class="n">more</span> <span class="n">realistic</span> <span class="n">example</span>
+<span class="n">The</span> <span class="n">Junit4OSGi</span> <span class="n">framework</span><span class="p">,</span> <span class="n">available</span> <span class="p">[</span><span class="n">here</span><span class="o">|</span><span class="n">https:</span><span class="sr">//s</span><span class="n">vn</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">org</span><span class="sr">/repos/</span><span class="n">asf</span><span class="sr">/felix/</span><span class="n">trunk</span><span class="sr">/ipojo/</span><span class="n">examples</span><span class="o">/</span><span class="n">junit4osgi</span><span class="p">]</span> <span class="p">,</span> <span class="n">uses</span> <span class="n">this</span> <span class="n">handler</span> <span class="n">to</span> <span class="n">track</span> <span class="n">Junit</span> <span class="n">Test</span> <span class="n">Suite</span> <span class="n">offered</span> <span class="n">by</span> <span cla
 ss="n">the</span> <span class="n">installed</span> <span class="n">bundles</span><span class="o">.</span> <span class="n">The</span> <span class="n">Junit4Osgi</span> <span class="n">bundle</span> <span class="n">has</span> <span class="n">a</span> <span class="n">component</span> <span class="n">using</span> <span class="n">this</span> <span class="n">handler</span> <span class="n">to</span> <span class="n">be</span> <span class="n">notified</span> <span class="n">when</span> <span class="n">a</span> <span class="n">bundle</span> <span class="n">with</span> <span class="n">the</span>  <span class="n">header</span> <span class="n">appears</span> <span class="ow">or</span> <span class="n">leaves</span><span class="o">.</span>
+<span class="o">\\</span>
+<span class="o">\\</span>
+</pre></div>
+      </div>
+      
+      <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
 
-    public void onArrival(Bundle bundle, String foo) {
-        // do something
-    }
-
-    public void onDeparture(Bundle bundle) {
-        // do something
-    }
-}
-
-    The  attribute allows setting the bundle filter.
-
-    h2. A more realistic example
-    The Junit4OSGi framework, available [here|https://svn.apache.org/repos/asf/felix/trunk/ipojo/examples/junit4osgi] , uses this handler to track Junit Test Suite offered by the installed bundles. The Junit4Osgi bundle has a component using this handler to be notified when a bundle with the  header appears or leaves.
-    \\
-    \\
-    {include:apache-felix-ipojo-footer}
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1422427 by fmeschbe on Sun, 16 Dec 2012 00:36:51 +0000
+        Rev. 1441864 by fmeschbe on Sun, 3 Feb 2013 06:44:40 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
@@ -219,5 +349,18 @@ public class Extender {
         may be trademarks or registered trademarks of their respective owners.
       </div>
     </div>
+    </div>
+    
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    try{
+    var pageTracker = _gat._getTracker("UA-1518442-4");
+    pageTracker._trackPageview();
+    } catch(err) {}
+    </script>
+
   </body>
 </html>

Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/ipojo-jmx-handler.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/ipojo-jmx-handler.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components/ipojo-jmx-handler.html Sun Feb  3 06:45:21 2013
@@ -20,9 +20,45 @@
   <head>
     <title>Apache Felix - iPOJO JMX Handler</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">
+    <link rel="stylesheet" href="/site/media.data/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/ipojo/site/superfish.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/ipojo/site/style.css" type="text/css" media="all">
     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    
+    <!--
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
+    <script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>
+    -->
+    
+    <script type="text/javascript" src="/ipojo/site/jquery-1.js"></script>
+    <script type="text/javascript" src="/ipojo/site/hoverIntent.js"></script>
+    <script type="text/javascript" src="/ipojo/site/superfish.js"></script> 
+    <script type="text/javascript" src="/ipojo/site/supersubs.js"></script> 
+    
+    <script type="text/javascript"> 
+     
+        $(document).ready(function(){ 
+            $("ul.sf-menu").supersubs({ 
+                minWidth:    14,   // minimum width of sub-menus in em units 
+                maxWidth:    30,   // maximum width of sub-menus in em units 
+                extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
+                                   // due to slight rounding differences and font-family 
+            }).superfish();  // call supersubs first, then superfish, so that subs are 
+                             // not display:none when measuring. Call before initialising 
+                             // containing tabs for same reason. 
+        }); 
+     
+    </script>
+    
   </head>
   <body>
     <div class="title">
@@ -37,277 +73,359 @@
         </a>
       </div>
     </div>
+  
+    <div class="main">
+    <div class="main">
+    <div class="page-header">
+    <img src="/ipojo/site/header.png" class="header">
+    <a href="http://ipojo.org"><img src="/ipojo/site/ipojo.png" width="225" class="header-logo"></a>
+    <ul class="sf-menu sf-js-enabled sf-shadow" id="ipojo-menu">
+    <li class="current">
+    <!-- Menu Overview -->
+    <a href="#" class="sf-with-ul">Overview<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+        <li>
+        <a href="">Home</a>                          
+        </li>
+        <li>
+        <a href="">Why choose iPOJO</a>
+        </li>
+        <li>
+        <a href="">Success stories</a>
+        </li>
+        <li>
+        <a href="">Features</a>
+        </li>
+    </ul>
+    </li>   
     
-    <div class="menu"> 
-      <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="/mailinglists.html">mailing lists</a>  <br />
-<a href="/documentation/community/contributing.html">contributing</a>  <br />
-<a href="/sitemap.html">site map</a>  <br />
-<a href="http://www.apache.org/">asf</a>  <br />
-<a href="http://www.apache.org/security/">security</a>  <br />
-<a href="http://www.apache.org/foundation/sponsorship.html">sponsorship</a>  <br />
-<a href="http://www.apache.org/foundation/thanks.html">sponsors</a>  <br />
-</p>
-<iframe
-    src="http://www.apache.org/ads/button.html"
-    style="border-width:0; float: left"
-    frameborder="0"
-    scrolling="no"
-    width="135"
-    height="135">
-</iframe>
-    </div>
+    <li class="">           
+    <!-- Menu download -->
+    <li>
+    <a href="/downloads.cgi">Download </a>
+    </li>
     
-    <div class="main">
-      <div class="breadcrump" style="font-size: 80%;">
-        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/documentation.html">Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo.html">Apache Felix iPOJO</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide.html">apache-felix-ipojo-userguide</a>&nbsp;&raquo&nbsp;<a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components.html">Describing components</a>
-      </div>
-
+    <li class="">                   
+    <!-- Menu Documentation -->
+    <a href="#" class="sf-with-ul">Documentation<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+        <!-- sub-menu : getting started -->
+        <li class="">
+        <a href="#" class="sf-with-ul">Getting Started<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+        <ul>
+         <li><a href="">iPOJO in 10 minutes</a></li>
+         <li><a href="">Using Annotations</a></li>
+         <li><a href="">Maven tutorial</a></li>
+         <li><a href="">Advanced tutorial</a></li>
+         <li><a href="">Using Distributed OSGi</a></li>
+         <li><a href="">Application Composition</a></li>
+        </ul>
+        </li> <!-- end of getting started -->
+        <!-- sub menu : Describing Components -->
+         <li class="">
+            <a href="" class="sf-with-ul">Describing components<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+            <ul>
+            <li><a href="">Requiring a service</a></li>
+            <li><a href="">Providing a service</a></li>
+            <li><a href="">Lifecycle management</a></li>
+            <li><a href="">Configuration</a></li>
+            <li><a href="">Introspection</a></li>
+            <li><a href="">Impacting the lifecycle</a></li>
+            <li><a href="">Asynchronous communication</a></li>
+            <li><a href="">JMX management</a></li>
+            <li><a href="">Extender pattern</a></li>
+            <li><a href="">Whiteboard pattern</a></li>
+            <li><a href="">Temporal dependencies</a></li>
+            </ul>
+         </li> <!-- End of describing components -->
+        <!-- sub-menu : User Guide -->
+        <li class="">
+        <a href="" class="sf-with-ul">User Guide<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+            <ul>
+            <li><a href="">iPOJO and config admin</a></li>
+            <li><a href="">Factories and Instances</a></li>
+            <li><a href="">XML Schemas</a></li>
+            <li><a href="">API</a></li>
+            <li><a href="">Testing components</a></li>
+            <li><a href="">Eclipse Integration</a></li>
+            <li><a href="">FAQ</a></li>
+            <li><a href="">Reference Card</a></li>
+            </ul>
+        </li> <!-- end of user guide -->
+        <!-- sub-menu : Dev Guide -->
+        <li> 
+        <a href="#" class="sf-with-ul">Advanced Topics<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+           <ul>
+            <li><a href="http://felix.apache.org/ipojo/api/1.6.0">Javadoc</a></li>
+            <li><a href="">Handler development</a></li>
+            <li><a href="">Manipulation Metadata </a></li>
+            <li><a href="">Dive into the iPOJO Manipulation depths</a></li>
+           </ul>
+        </li> <!-- End of Dev guide -->
+    </ul> 
+    </li> <!-- End of doc -->
+    <!-- Menu 4 : Tools -->
+    <li class="">
+    <a href="#" class="sf-with-ul">Tools<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+       <li><a href="">Ant Task</a></li>
+       <li><a href="">Eclipse Plugin</a></li>
+       <li><a href="">Maven Plugin</a></li>
+       <li><a href="">`arch` shell command</a></li>
+       <li><a href="">Online Manipulator</a></li>
+       <li><a href="">Webconsole plugin</a></li>
+       <li><a href="">Junit4OSGi</a></li>
+    </ul>   
+    </li><!-- End of tools -->  
+    <!-- Menu 5 : Support -->
+    <li>
+    <a href="">Support </a>
+    </li>
+    <!-- End of the menu 5 -->          
+    <!-- Menu 6 : Misc -->
+    <li class="">
+    <a href="#" class="sf-with-ul">Misc<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator"> »</span></a>
+    <ul>
+       <li><a href="">Supported JVMs</a></li>
+       <li><a href="">Supported OSGi Implementations</a></li>
+       <li><a href="http://ipojo-dark-side.blogspot.com">iPOJO's Dark Side Blog</a></li>
+       <li><a href="">Article & Presentations</a></li>
+       <li><a href="http://www.apache.org/">ASF</a></li>
+       <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+       <li><a href="http://www.apache.org/foundation/thanks.html">Sponsors</a></li>
+    </ul>
+    </li><!-- End of misc -->
+    </ul> <!-- End of the menu -->
+    </div> <!-- Page header -->
+  
+      <!-- 
       
       <div class="tip">
            This page is a translated version of <a href="/site/ipojo-jmx-handler.html" target="felix_cwiki">/site/ipojo-jmx-handler.html</a>. In case of
            doubt you might want to refer to the old page.
       </div>
       
+      -->
       
       <h1>iPOJO JMX Handler</h1>
-      <p>{include:apache-felix-ipojo-header}</p>
-<div class="content">
-
-# iPOJO JMX Handler
-
-*This handler provides JMX management of component instance. It could be useful to manage instance remotely. As the handler exposes MBeans, you must have a MBean server running on your platform (as the platform MBean server or the MOSGi MBean Server).*
-
-{div:class=toc}
+      
+      <div class="content">
+        <h1 id="ipojo-jmx-handler">iPOJO JMX Handler</h1>
+<p><em>This handler provides JMX management of component instance. It could be useful to manage instance remotely. As the handler exposes MBeans, you must have a MBean server running on your platform (as the platform MBean server or the MOSGi MBean Server).</em></p>
+<p>{div:class=toc}
 [TOC]
-{div}
-
-## Features
-
-The handler allows to:
-* Expose attributes accessible via JMX (with right management).
-* Expose methods to be called through JMX.
-* Get notifications when attributes are modified .
-
-## Prerequisites
-
-To be functional this handler must register on an MBean Server,thus you obviously need it. Several servers are currently supported : the standard platform MBean server (included in the JDK), MOSGi (provided with Felix), ...
+{div}</p>
+<h2 id="features">Features</h2>
+<p>The handler allows to:
+<em> Expose attributes accessible via JMX (with right management).
+</em> Expose methods to be called through JMX.
+* Get notifications when attributes are modified .</p>
+<h2 id="prerequisites">Prerequisites</h2>
+<p>To be functional this handler must register on an MBean Server,thus you obviously need it. Several servers are currently supported : the standard platform MBean server (included in the JDK), MOSGi (provided with Felix), ...
 To use MOSGi, you have to deploy at least the following three bundles of MOSGi:
-* org.apache.felix.mosgi.jmx.agent
-* org.apache.felix.mosgi.jmx.registry
-* org.apache.felix.mosgi.jmx.rmiconnector
-
-You can find MOSGi documentation on [http://cwiki.apache.org/FELIX/mosgi-managed-osgi-framework.html](http://cwiki.apache.org/FELIX/mosgi-managed-osgi-framework.html)
-
-## Download
-
-The JMX handler is available in the Felix trunk in the iPOJO project. See the [Download](/documentation/subprojects/apache-felix-ipojo/download.html) page to download and compile these sources.
-
-## How to use it
-
-The handler needs to be added in the metadata.xml, you just add a namespace (e.g., jmx) :
+<em> org.apache.felix.mosgi.jmx.agent
+</em> org.apache.felix.mosgi.jmx.registry
+* org.apache.felix.mosgi.jmx.rmiconnector</p>
+<p>You can find MOSGi documentation on <a href="http://cwiki.apache.org/FELIX/mosgi-managed-osgi-framework.html">http://cwiki.apache.org/FELIX/mosgi-managed-osgi-framework.html</a></p>
+<h2 id="download">Download</h2>
+<p>The JMX handler is available in the Felix trunk in the iPOJO project. See the <a href="/documentation/subprojects/apache-felix-ipojo/download.html">Download</a> page to download and compile these sources.</p>
+<h2 id="how-to-use-it">How to use it</h2>
+<p>The handler needs to be added in the metadata.xml, you just add a namespace (e.g., jmx) :</p>
+<div class="codehilite"><pre><span class="nt">&lt;ipojo</span> <span class="na">xmlns:jmx=</span><span class="s">&quot;org.apache.felix.ipojo.handlers.jmx&quot;</span><span class="nt">&gt;</span>
+    ...
+<span class="nt">&lt;/ipojo&gt;</span>
+</pre></div>
+
+
+<p>So, you could now expose in JMX properties and methods of your component. They are surrounded by the <jmx:config>
+tag.</p>
+<div class="codehilite"><pre><span class="nt">&lt;jmx:config&gt;</span>
+    <span class="nt">&lt;jmx:property</span> <span class="na">name=</span><span class="s">&quot;message&quot;</span> <span class="na">field=</span><span class="s">&quot;m_msg&quot;</span> <span class="na">rights=</span><span class="s">&quot;w&quot;</span> <span class="na">notification=</span><span class="s">&quot;true&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;jmx:method</span> <span class="na">name=</span><span class="s">&quot;doSomethingBad&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;jmx:method</span> <span class="na">name=</span><span class="s">&quot;doSomethingGood&quot;</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;/jmx:config&gt;</span>
+</pre></div>
 
-    <ipojo xmlns:jmx="org.apache.felix.ipojo.handlers.jmx">
-        ...
-    </ipojo>
-
-So, you could now expose in JMX properties and methods of your component. They are surrounded by the <jmx:config>
-tag.
-
-    <jmx:config>
-        <jmx:property name="message" field="m_msg" rights="w" notification="true"/>
-        <jmx:method name="doSomethingBad"/>
-        <jmx:method name="doSomethingGood"/>
-    </jmx:config>
 
 <div class="info" markdown="1">
 **Serialization**
 Be careful that the argument and return type of methods must be serializable. In case of several methods have the same name, each of them will be exposed.
 </div>
 
-## JMX Handler options
-
-Here you can find all configuration options of the JMX handler. There are two kinds of manageable elements : properties and methods. First is described the global configuration of the handler. Then elements can be configured, using several attributes, as described below.
-
-## Global handler attributes
-{div:class=borderedTable}
+<h2 id="jmx-handler-options">JMX Handler options</h2>
+<p>Here you can find all configuration options of the JMX handler. There are two kinds of manageable elements : properties and methods. First is described the global configuration of the handler. Then elements can be configured, using several attributes, as described below.</p>
+<h2 id="global-handler-attributes">Global handler attributes</h2>
+<p>{div:class=borderedTable}
 |Attribute name | Required | Description|
 |--|--|--|
 |objectName|NO|The complete object name of the managed component. The syntax of this attribute must be compliant with the ObjectName syntax, detailed in the JMX specification.
 If neither domain nor name attributes are specified, the default value  is determined by the package, the type and the instance name of the component. This attribute overrides the domain and name attributes.
-*Example:* "my.domain:type=myType,name=myName"|
+<em>Example:</em> "my.domain:type=myType,name=myName"|
 |domain|NO|The domain of the managed object (i.e., the left part of the object name). This attribute must be compliant with the domain syntax, as described in the JMX specification.
-*Example:* "my.domain"|
+<em>Example:</em> "my.domain"|
 |name|NO|The name property of the managed object. The value of this attribute must comply with the ObjectName value syntax, as described in the JMX specification.
 |usesMOSGi|NO|Determines if the component must be register on the MOSGi MBean server or not.
 |preRegister 
 postRegister 
 preDeregister
 postDeregister|NO|These attributes allow to specify methods to carry out operations before and after being registered or unregistered from the MBean server.|
-{div}
-
-## Properties attributes
-{div:class=borderedTable}
+{div}</p>
+<h2 id="properties-attributes">Properties attributes</h2>
+<p>{div:class=borderedTable}
 |Attribute name|Required|Description|
 |--|--|--|
 |field|YES|The name of the component's field to expose.|
 |name|NO|The name of the property as it will appear in JMX. If unspecified, the default value is the name of the exposed field.|
 |rights|NO|Specify the access permission of the exposed field. The accepted values are : 
-* "r" : read-only access, the default value.
-* "w" : read and write access.|
+<em> "r" : read-only access, the default value.
+</em> "w" : read and write access.|
 |notification|NO|Enable or disable attribute change notification sending for this property. If set to "true", a notification is sent each time the value of the field changes.|
-{div}
-## Methods attributes
-{div:class=borderedTable}
+{div}</p>
+<h2 id="methods-attributes">Methods attributes</h2>
+<p>{div:class=borderedTable}
 |Attribute name|Required|Description|
 |--|--|--|
 |name|YES|The name of the method to expose. If multiple methods have the same name, all of them are exposed.|
 |description|NO|The description of the exposed method, as it will appear in JMX.|
-{div}
-
-## Examples
-
-In this part, we will give you a complete example of a component managed with JMX, using the JConsole provided by the SUN JDK.
-
-### Exposing Attributes
-
-In first time we create a simple component named MyComponent. We have add two fields named m*level (int) and m*message (String).
-
-    public class
-    MyComponent ... {
-        // Exposed attributes
-        private String m_message;
-        private int m_level;
-    }
-
-We expose now the attributes in the jmx:config
-tag in the metadata :
-
-    <?xml version="1.0" encoding="UTF-8"?>
-    <iPOJO xmlns:jmx="org.apache.felix.ipojo.handlers.jmx">
-        <component className="...MyComponent"
-          architecture="true"
-          immediate="true">
-
-          <provides/>
-          <jmx:config>
-        <!-- Exposed properties -->
-        <jmx:property field="m_level"
-              name="The level"
-              rights="r"/>
-        <jmx:property field="m_message"
-              name="The message"
-              rights="w"/>
-          </jmx:config>
-        </component>
-        <instance
-          component="...MyComponent"/>
-    </iPOJO>
-
-Now, we could get and write the properties in the JConsole :
-!JMXHandler_1.png!
-
-### Exposing Methods
-
-We could now add methods in the initial class :
-
-    /**
-    Do something good
-    */
-    public void doSomethingGood() {
-            ...
-    }
-
-    /**
-    Do something bad
-    */
-    public void doSomethingBad() {
-            ...
-    }
-
-    /**
-    Do nothing
-    */
-    public void doNothing() {
-            ...
-    }
-
-We add corresponding tags in the metadata to expose these methods:
-
-    <!-- Exposed methods -->
-    <jmx:method name="doSomethingGood"
-          description="Do something good."/>
-    <jmx:method name="doSomethingBad"
-          description="Do something bad."/>
-    <jmx:method name="doNothing"
-          description="Do absolutely nothing."/>
-
-Now the three methods are exposed in the operations tab of the JConsole. We can invoked these methods :
-
-!JMXHandler_2.png!
-
-### Attribute Notifications:
-
-You could subscribe to attribute notification by adding the notification attribute in property tag. In our example if we want to be notified when m_level is modified, we change the property line in the metatada like this:
-
-    <jmx:property field="m_level"
-          name="The level"
-          rights="r"
-          notification="true"/>
-
-So now if we change the string through JConsole (or in the VisualVM) or if the POJO is modified in other way, a notification will be sent to every listener. For example, we subscribe in the notification tab, and we get notification when the message changes :
-
-!JMXHandler_3.png!
-
-## Configuring the handler with annotations
-
-It is possible to configure the handler with simple annotations available with iPOJO annotations. Here is an example of usage:
+{div}</p>
+<h2 id="examples">Examples</h2>
+<p>In this part, we will give you a complete example of a component managed with JMX, using the JConsole provided by the SUN JDK.</p>
+<h3 id="exposing-attributes">Exposing Attributes</h3>
+<p>In first time we create a simple component named MyComponent. We have add two fields named m<em>level (int) and m</em>message (String).</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span>
+<span class="n">MyComponent</span> <span class="o">...</span> <span class="p">{</span>
+    <span class="sr">//</span> <span class="n">Exposed</span> <span class="n">attributes</span>
+    <span class="n">private</span> <span class="n">String</span> <span class="n">m_message</span><span class="p">;</span>
+    <span class="n">private</span> <span class="nb">int</span> <span class="n">m_level</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>We expose now the attributes in the jmx:config
+tag in the metadata :</p>
+<div class="codehilite"><pre><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
+<span class="nt">&lt;iPOJO</span> <span class="na">xmlns:jmx=</span><span class="s">&quot;org.apache.felix.ipojo.handlers.jmx&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;component</span> <span class="na">className=</span><span class="s">&quot;...MyComponent&quot;</span>
+      <span class="na">architecture=</span><span class="s">&quot;true&quot;</span>
+      <span class="na">immediate=</span><span class="s">&quot;true&quot;</span><span class="nt">&gt;</span>
+
+      <span class="nt">&lt;provides/&gt;</span>
+      <span class="nt">&lt;jmx:config&gt;</span>
+    <span class="c">&lt;!-- Exposed properties --&gt;</span>
+    <span class="nt">&lt;jmx:property</span> <span class="na">field=</span><span class="s">&quot;m_level&quot;</span>
+          <span class="na">name=</span><span class="s">&quot;The level&quot;</span>
+          <span class="na">rights=</span><span class="s">&quot;r&quot;</span><span class="nt">/&gt;</span>
+    <span class="nt">&lt;jmx:property</span> <span class="na">field=</span><span class="s">&quot;m_message&quot;</span>
+          <span class="na">name=</span><span class="s">&quot;The message&quot;</span>
+          <span class="na">rights=</span><span class="s">&quot;w&quot;</span><span class="nt">/&gt;</span>
+      <span class="nt">&lt;/jmx:config&gt;</span>
+    <span class="nt">&lt;/component&gt;</span>
+    <span class="nt">&lt;instance</span>
+      <span class="na">component=</span><span class="s">&quot;...MyComponent&quot;</span><span class="nt">/&gt;</span>
+<span class="nt">&lt;/iPOJO&gt;</span>
+</pre></div>
+
+
+<p>Now, we could get and write the properties in the JConsole :
+!JMXHandler_1.png!</p>
+<h3 id="exposing-methods">Exposing Methods</h3>
+<p>We could now add methods in the initial class :</p>
+<div class="codehilite"><pre><span class="o">/**</span>
+<span class="n">Do</span> <span class="n">something</span> <span class="n">good</span>
+<span class="o">*/</span>
+<span class="n">public</span> <span class="n">void</span> <span class="n">doSomethingGood</span><span class="p">()</span> <span class="p">{</span>
+        <span class="o">...</span>
+<span class="p">}</span>
+
+<span class="o">/**</span>
+<span class="n">Do</span> <span class="n">something</span> <span class="n">bad</span>
+<span class="o">*/</span>
+<span class="n">public</span> <span class="n">void</span> <span class="n">doSomethingBad</span><span class="p">()</span> <span class="p">{</span>
+        <span class="o">...</span>
+<span class="p">}</span>
+
+<span class="o">/**</span>
+<span class="n">Do</span> <span class="n">nothing</span>
+<span class="o">*/</span>
+<span class="n">public</span> <span class="n">void</span> <span class="n">doNothing</span><span class="p">()</span> <span class="p">{</span>
+        <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>We add corresponding tags in the metadata to expose these methods:</p>
+<div class="codehilite"><pre><span class="o">&lt;!--</span> <span class="n">Exposed</span> <span class="n">methods</span> <span class="o">--&gt;</span>
+<span class="o">&lt;</span><span class="n">jmx:method</span> <span class="n">name</span><span class="o">=</span><span class="s">&quot;doSomethingGood&quot;</span>
+      <span class="n">description</span><span class="o">=</span><span class="s">&quot;Do something good.&quot;</span><span class="o">/&gt;</span>
+<span class="o">&lt;</span><span class="n">jmx:method</span> <span class="n">name</span><span class="o">=</span><span class="s">&quot;doSomethingBad&quot;</span>
+      <span class="n">description</span><span class="o">=</span><span class="s">&quot;Do something bad.&quot;</span><span class="o">/&gt;</span>
+<span class="o">&lt;</span><span class="n">jmx:method</span> <span class="n">name</span><span class="o">=</span><span class="s">&quot;doNothing&quot;</span>
+      <span class="n">description</span><span class="o">=</span><span class="s">&quot;Do absolutely nothing.&quot;</span><span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>Now the three methods are exposed in the operations tab of the JConsole. We can invoked these methods :</p>
+<p>!JMXHandler_2.png!</p>
+<h3 id="attribute-notifications">Attribute Notifications:</h3>
+<p>You could subscribe to attribute notification by adding the notification attribute in property tag. In our example if we want to be notified when m_level is modified, we change the property line in the metatada like this:</p>
+<div class="codehilite"><pre><span class="o">&lt;</span><span class="n">jmx:property</span> <span class="n">field</span><span class="o">=</span><span class="s">&quot;m_level&quot;</span>
+      <span class="n">name</span><span class="o">=</span><span class="s">&quot;The level&quot;</span>
+      <span class="n">rights</span><span class="o">=</span><span class="s">&quot;r&quot;</span>
+      <span class="n">notification</span><span class="o">=</span><span class="s">&quot;true&quot;</span><span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>So now if we change the string through JConsole (or in the VisualVM) or if the POJO is modified in other way, a notification will be sent to every listener. For example, we subscribe in the notification tab, and we get notification when the message changes :</p>
+<p>!JMXHandler_3.png!</p>
+<h2 id="configuring-the-handler-with-annotations">Configuring the handler with annotations</h2>
+<p>It is possible to configure the handler with simple annotations available with iPOJO annotations. Here is an example of usage:
 {code:java}
 import org.apache.felix.ipojo.annotations.Component;
 import org.apache.felix.ipojo.handlers.jmx.Config;
 import org.apache.felix.ipojo.handlers.jmx.Method;
-import org.apache.felix.ipojo.handlers.jmx.Property;
-
-@Component
+import org.apache.felix.ipojo.handlers.jmx.Property;</p>
+<p>@Component
 @Config(domain="my-domain", usesMOSGi=false)
-public class JMXSimple {
-
-    @Property(name="prop", notification=true, rights="w") // Field published in the MBean
-    String m_foo;
+public class JMXSimple {</p>
+<div class="codehilite"><pre><span class="nv">@Property</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;prop&quot;</span><span class="p">,</span> <span class="n">notification</span><span class="o">=</span><span class="n">true</span><span class="p">,</span> <span class="n">rights</span><span class="o">=</span><span class="s">&quot;w&quot;</span><span class="p">)</span> <span class="sr">//</span> <span class="n">Field</span> <span class="n">published</span> <span class="n">in</span> <span class="n">the</span> <span class="n">MBean</span>
+<span class="n">String</span> <span class="n">m_foo</span><span class="p">;</span>
+
+<span class="nv">@Method</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s">&quot;set the foo prop&quot;</span><span class="p">)</span> <span class="sr">//</span> <span class="n">Method</span> <span class="n">published</span> <span class="n">in</span> <span class="n">the</span> <span class="n">MBean</span>
+<span class="n">public</span> <span class="n">void</span> <span class="n">setFoo</span><span class="p">(</span><span class="n">String</span> <span class="n">mes</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Set foo to &quot;</span> <span class="o">+</span> <span class="n">mes</span><span class="p">);</span>
+    <span class="n">m_foo</span> <span class="o">=</span> <span class="n">mes</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="nv">@Method</span><span class="p">(</span><span class="n">description</span><span class="o">=</span><span class="s">&quot;get the foo prop&quot;</span><span class="p">)</span> <span class="sr">//</span> <span class="n">Method</span> <span class="n">published</span> <span class="n">in</span> <span class="n">the</span> <span class="n">MBean</span>
+<span class="n">public</span> <span class="n">String</span> <span class="n">getFoo</span><span class="p">()</span> <span class="p">{</span>
+    <span class="k">return</span> <span class="n">m_foo</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>}</p>
+<div class="codehilite"><pre><span class="n">The</span>  <span class="p">(</span> <span class="k">if</span> <span class="n">the</span> <span class="nb">package</span> <span class="n">it</span> <span class="n">correctly</span> <span class="n">imported</span><span class="p">)</span> <span class="n">annotation</span> <span class="n">is</span> <span class="n">a</span> <span class="n">type</span> <span class="n">annotation</span> <span class="p">(</span><span class="n">so</span> <span class="n">placed</span> <span class="n">on</span> <span class="n">the</span>  <span class="n">element</span><span class="o">.</span> <span class="n">This</span> <span class="n">annotation</span> <span class="n">indicates</span> <span class="n">that</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">will</span> <span class="n">be</span> <span class="n">exposed</span> <span class="n">as</span> <span class="n">an</span> <span class="n">MBean</span><span class="o">.</span>
  <span class="n">This</span> <span class="n">annotation</span> <span class="n">supports:</span>
+<span class="o">*</span> <span class="n">usesMOSGi:</span> <span class="n">set</span> <span class="n">to</span>  <span class="n">to</span> <span class="k">use</span> <span class="n">MOSGi</span><span class="o">.</span> <span class="n">Otherwise</span><span class="p">,</span> <span class="n">the</span> <span class="n">MBean</span> <span class="n">will</span> <span class="n">be</span> <span class="n">exposed</span> <span class="n">in</span> <span class="n">the</span> <span class="n">MBean</span> <span class="n">Platform</span> <span class="n">Server</span> <span class="p">(</span><span class="n">default:</span> <span class="p">)</span><span class="o">.</span>
+<span class="o">*</span> <span class="n">objectname:</span> <span class="n">set</span> <span class="n">the</span> <span class="n">MBean</span> <span class="n">objectname</span><span class="o">.</span> <span class="n">The</span> <span class="n">objectname</span> <span class="n">must</span> <span class="n">follow</span> <span class="n">JMX</span> <span class="n">specification</span><span class="o">.</span> <span class="p">(</span><span class="n">default:</span> <span class="p">)</span>
+<span class="o">*</span> <span class="n">domain:</span> <span class="n">set</span> <span class="n">the</span> <span class="n">MBean</span> <span class="n">domain</span><span class="o">.</span> <span class="p">(</span><span class="n">default:</span> <span class="p">)</span>
+<span class="o">*</span> <span class="n">name:</span> <span class="n">set</span> <span class="n">the</span> <span class="n">MBean</span> <span class="n">name</span><span class="o">.</span> <span class="p">(</span><span class="n">default:</span> <span class="p">)</span><span class="o">.</span>
+
+<span class="n">The</span>  <span class="p">()</span> <span class="n">annotation</span> <span class="n">is</span> <span class="n">a</span> <span class="n">field</span> <span class="n">annotation</span> <span class="n">indicating</span> <span class="n">that</span> <span class="n">the</span> <span class="n">field</span> <span class="n">is</span> <span class="n">exposed</span> <span class="n">in</span> <span class="n">the</span> <span class="n">MBean</span><span class="o">.</span> <span class="n">The</span> <span class="n">supported</span> <span class="n">attributes</span> <span class="n">are:</span>
+<span class="o">*</span> <span class="n">name:</span> <span class="n">set</span> <span class="n">the</span> <span class="n">property</span> <span class="n">name</span>
+<span class="o">*</span> <span class="n">rights:</span> <span class="n">set</span> <span class="n">the</span> <span class="n">access</span> <span class="n">permission</span><span class="o">.</span> <span class="n">Possible</span> <span class="nb">values</span> <span class="n">are</span>  <span class="p">(</span><span class="nb">read</span> <span class="n">only</span><span class="p">)</span> <span class="ow">and</span>  <span class="p">(</span><span class="nb">read</span> <span class="ow">and</span> <span class="nb">write</span><span class="p">)</span><span class="o">.</span> <span class="n">By</span> <span class="n">default</span><span class="p">,</span> <span class="n">properties</span> <span class="n">are</span> <span class="n">in</span> <span class="nb">read</span><span class="o">-</span><span class="n">only</span> <span class="n">mode</span><span class="o">.</span>
+<span class="o">*</span> <span class="n">notification:</span> <span class="n">enables</span> <span class="n">notification</span> <span class="n">on</span> <span class="n">this</span> <span class="n">property</span><span class="o">.</span> <span class="n">By</span> <span class="n">default</span> <span class="n">notifications</span> <span class="n">are</span> <span class="n">disabled</span><span class="o">.</span>
+
+<span class="n">The</span>  <span class="p">()</span> <span class="n">annotation</span> <span class="n">is</span> <span class="n">a</span> <span class="n">method</span> <span class="n">annotation</span> <span class="n">indicating</span> <span class="n">that</span> <span class="n">the</span> <span class="n">method</span> <span class="n">is</span> <span class="n">exposed</span> <span class="n">in</span> <span class="n">the</span> <span class="n">MBean</span><span class="o">.</span> <span class="n">Only</span> <span class="n">one</span> <span class="n">attribute</span> <span class="n">can</span> <span class="n">be</span> <span class="n">customized:</span>
+<span class="o">*</span> <span class="n">description:</span> <span class="n">set</span> <span class="n">the</span> <span class="n">method</span> <span class="n">description</span><span class="o">.</span>
+<span class="o">\\</span>
+<span class="o">\\</span>
+</pre></div>
+      </div>
+      
+      <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
 
-    @Method(description="set the foo prop") // Method published in the MBean
-    public void setFoo(String mes) {
-        System.out.println("Set foo to " + mes);
-        m_foo = mes;
-    }
-
-    @Method(description="get the foo prop") // Method published in the MBean
-    public String getFoo() {
-        return m_foo;
-    }
-}
-
-    The  ( if the package it correctly imported) annotation is a type annotation (so placed on the  element. This annotation indicates that the instance will be exposed as an MBean. This annotation supports:
-    * usesMOSGi: set to  to use MOSGi. Otherwise, the MBean will be exposed in the MBean Platform Server (default: ).
-    * objectname: set the MBean objectname. The objectname must follow JMX specification. (default: )
-    * domain: set the MBean domain. (default: )
-    * name: set the MBean name. (default: ).
-
-    The  () annotation is a field annotation indicating that the field is exposed in the MBean. The supported attributes are:
-    * name: set the property name
-    * rights: set the access permission. Possible values are  (read only) and  (read and write). By default, properties are in read-only mode.
-    * notification: enables notification on this property. By default notifications are disabled.
-
-    The  () annotation is a method annotation indicating that the method is exposed in the MBean. Only one attribute can be customized:
-    * description: set the method description.
-    \\
-    \\
-    {include:apache-felix-ipojo-footer}
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1422427 by fmeschbe on Sun, 16 Dec 2012 00:36:51 +0000
+        Rev. 1441864 by fmeschbe on Sun, 3 Feb 2013 06:44:40 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project
@@ -315,5 +433,18 @@ public class JMXSimple {
         may be trademarks or registered trademarks of their respective owners.
       </div>
     </div>
+    </div>
+    
+    <script type="text/javascript">
+    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+    </script>
+    <script type="text/javascript">
+    try{
+    var pageTracker = _gat._getTracker("UA-1518442-4");
+    pageTracker._trackPageview();
+    } catch(err) {}
+    </script>
+
   </body>
 </html>