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 [16/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.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide.html Sun Feb 3 06:45:21 2013
@@ -20,9 +20,45 @@
<head>
<title>Apache Felix - apache-felix-ipojo-userguide</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,58 +73,157 @@
</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> » <a href="/documentation.html">Documentation</a> » <a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a> » <a href="/documentation/subprojects/apache-felix-ipojo.html">Apache Felix iPOJO</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="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/how-to-use-ipojo-annotations.html">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="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components.html" 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="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/using-xml-schemas.html">XML Schemas</a></li>
+ <li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-api.html">API</a></li>
+ <li><a href="">Testing components</a></li>
+ <li><a href="">Eclipse Integration</a></li>
+ <li><a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-faq.html">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/apache-felix-ipojo-userguide.html" target="felix_cwiki">/site/apache-felix-ipojo-userguide.html</a>. In case of
doubt you might want to refer to the old page.
</div>
+ -->
<h1>apache-felix-ipojo-userguide</h1>
- <p>{include:apache-felix-ipojo-header}</p>
-<div class="content">
-
-# User Guide
-This page references pages composing the iPOJO User Guide:
-* [apache-felix-ipojo-api](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-api.html)
-* [Describing components](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components.html)
-* [How to use iPOJO Annotations](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/how-to-use-ipojo-annotations.html)
-* [iPOJO Advanced Topics](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics.html)
-* [iPOJO FAQ](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-faq.html)
-* [Using XML Schemas](/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/using-xml-schemas.html)
+
+ <div class="content">
+ <h1 id="user-guide">User Guide</h1>
+<p>This page references pages composing the iPOJO User Guide:
+<em> <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-api.html">apache-felix-ipojo-api</a>
+</em> <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/describing-components.html">Describing components</a>
+<em> <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/how-to-use-ipojo-annotations.html">How to use iPOJO Annotations</a>
+</em> <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-advanced-topics.html">iPOJO Advanced Topics</a>
+<em> <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/ipojo-faq.html">iPOJO FAQ</a>
+</em> <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/using-xml-schemas.html">Using XML Schemas</a></p>
+ </div>
+
+ <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
-{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
@@ -96,5 +231,18 @@ This page references pages composing the
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/apache-felix-ipojo-api.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-api.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide/apache-felix-ipojo-api.html Sun Feb 3 06:45:21 2013
@@ -20,9 +20,45 @@
<head>
<title>Apache Felix - apache-felix-ipojo-api</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,130 +73,218 @@
</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> » <a href="/documentation.html">Documentation</a> » <a href="/documentation/subprojects.html">Apache Felix Subproject Documentation</a> » <a href="/documentation/subprojects/apache-felix-ipojo.html">Apache Felix iPOJO</a> » <a href="/documentation/subprojects/apache-felix-ipojo/apache-felix-ipojo-userguide.html">apache-felix-ipojo-userguide</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/apache-felix-ipojo-api.html" target="felix_cwiki">/site/apache-felix-ipojo-api.html</a>. In case of
doubt you might want to refer to the old page.
</div>
+ -->
<h1>apache-felix-ipojo-api</h1>
- <p>{include:apache-felix-ipojo-header}</p>
-<div class="content">
-
-# iPOJO API
-
-*The iPOJO API provides a third way to describe iPOJO components and instances. With the API, you can dynamically create new components types and create instances from them. Your component types are described with a Java API. To use the API, deploy and start the iPOJO-API bundle and the iPOJO core bundle.*
-
-{div:class=toc}
+
+ <div class="content">
+ <h1 id="ipojo-api">iPOJO API</h1>
+<p><em>The iPOJO API provides a third way to describe iPOJO components and instances. With the API, you can dynamically create new components types and create instances from them. Your component types are described with a Java API. To use the API, deploy and start the iPOJO-API bundle and the iPOJO core bundle.</em></p>
+<p>{div:class=toc}
[TOC]
-{div}
-
-## A simple example
-
-Let's imagine a simple component providing a service Foo. The following code is the implementation class of our component:
+{div}</p>
+<h2 id="a-simple-example">A simple example</h2>
+<p>Let's imagine a simple component providing a service Foo. The following code is the implementation class of our component:
{code:java}
-package org.example.service.impl;
-
-import org.example.service.Foo;
-
-public class FooImpl implements Foo {
-
- public void doSomething() {
- // Do something...
- }
+package org.example.service.impl;</p>
+<p>import org.example.service.Foo;</p>
+<p>public class FooImpl implements Foo {</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">doSomething</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="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>}</p>
+<div class="codehilite"><pre><span class="n">To</span> <span class="n">create</span> <span class="n">the</span> <span class="n">component</span> <span class="n">type</span> <span class="ow">and</span> <span class="n">an</span> <span class="n">instance</span> <span class="n">of</span> <span class="n">the</span> <span class="n">component</span> <span class="n">type</span> <span class="n">just</span> <span class="n">create</span> <span class="n">a</span> <span class="n">class</span><span class="p">,</span> <span class="n">get</span> <span class="n">the</span> <span class="n">bundle</span> <span class="n">context</span> <span class="p">(</span><span class="n">either</span> <span class="n">from</span> <span class="n">a</span> <span class="n">Bundle</span><span class="o">-</span><span class="n">Activator</span><span class="p">,</span> <span class="ow">or</span> <span class="n">from</span> <span class="n">an</span> <span class="n">iPOJO</span> <span class="n">component</span><span
class="p">),</span> <span class="ow">and</span> <span class="nb">write</span> <span class="n">the</span> <span class="n">following</span> <span class="n">code:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="k">new</span> <span class="n">PrimitiveComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setClassName</span><span class="p">(</span><span class="n">FooImpl</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">())</span>
+ <span class="o">.</span><span class="n">addService</span><span class="p">(</span><span class="k">new</span> <span class="n">Service</span><span class="p">())</span> <span class="sr">//</span> <span class="n">Provide</span> <span class="n">the</span> <span class="n">Foo</span> <span class="n">service</span>
+ <span class="o">.</span><span class="n">createInstance</span><span class="p">();</span> <span class="sr">//</span> <span class="n">Create</span> <span class="n">the</span> <span class="n">instance</span>
+</pre></div>
-}
- To create the component type and an instance of the component type just create a class, get the bundle context (either from a Bundle-Activator, or from an iPOJO component), and write the following code:
- {code:java}
- new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(FooImpl.class.getName())
- .addService(new Service()) // Provide the Foo service
- .createInstance(); // Create the instance
-
-So, now let's imagine another component using this service. The following code is the implementation class of this component type:
+<p>So, now let's imagine another component using this service. The following code is the implementation class of this component type:
{code:java}
-package org.example.service.impl;
-
-import org.example.service.Foo;
-
-public class MyComponentImpl {
- private Foo myFoo;
-
- public void start() {
- myFoo.doSomething();
- }
-
-}
-
- It is a regular iPOJO component expecting to get a Foo service in the field. It also has a method executed when the instance is valid using the Foo service. To describe this component, just write the following lines:
- {code:java}
- new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(MyComponentImpl.class.getName())
- .addDependency(new Dependency().setField("myFoo"))
- .setValidateMethod("start")
- .createInstance();
-
-## Deploying the API
-Before being able to create component types at runtime, you need to deploy 3 bundles:
-* iPOJO (core)
-* iPOJO Composite
-* iPOJO API
-
-You can deploy all these bundles in one step thanks to OBR:
-
- obr start "Apache Felix iPOJO API"
-
-## Primitive Component Type basics
-
-When you create a new Primitive component type (so, using a Java class as implementation), you must set the bundle context and the class name. Everything else is optional.
-
-Note about inner classes: iPOJO is based on a bytecode manipulation. The API embeds the manipulator. So, when you initialize the component type, the specified class name is manipulated (if not already manipulated). So, as this force using a customized classloader, inner classes cannot be manipulated. So, inner class injection is not supported with the API.
-
-## Immediate Component, Validate and Invalidate Method
-To set the component type as immediate, just call the `setImmediate(immediate)` method on the primitive component type object.
-To set validate and invalidate methods, just call the `setValidate(method)` and `setInvalidate(method)`. Specify the method name that you want to call in argument.
-
-## Declaring services
-To declare that a component provides a service, add a new service to your primitive component type.
+package org.example.service.impl;</p>
+<p>import org.example.service.Foo;</p>
+<p>public class MyComponentImpl {
+ private Foo myFoo;</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">start</span><span class="p">()</span> <span class="p">{</span>
+ <span class="n">myFoo</span><span class="o">.</span><span class="n">doSomething</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>}</p>
+<div class="codehilite"><pre><span class="n">It</span> <span class="n">is</span> <span class="n">a</span> <span class="n">regular</span> <span class="n">iPOJO</span> <span class="n">component</span> <span class="n">expecting</span> <span class="n">to</span> <span class="n">get</span> <span class="n">a</span> <span class="n">Foo</span> <span class="n">service</span> <span class="n">in</span> <span class="n">the</span> <span class="n">field</span><span class="o">.</span> <span class="n">It</span> <span class="n">also</span> <span class="n">has</span> <span class="n">a</span> <span class="n">method</span> <span class="n">executed</span> <span class="n">when</span> <span class="n">the</span> <span class="n">instance</span> <span class="n">is</span> <span class="n">valid</span> <span class="n">using</span> <span class="n">the</span> <span class="n">Foo</span> <span class="n">service</span><span class="o">.</span> <span class="n">To</span> <span class="n">describe</span> <span cl
ass="n">this</span> <span class="n">component</span><span class="p">,</span> <span class="n">just</span> <span class="nb">write</span> <span class="n">the</span> <span class="n">following</span> <span class="n">lines:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="k">new</span> <span class="n">PrimitiveComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setClassName</span><span class="p">(</span><span class="n">MyComponentImpl</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">())</span>
+ <span class="o">.</span><span class="n">addDependency</span><span class="p">(</span><span class="k">new</span> <span class="n">Dependency</span><span class="p">()</span><span class="o">.</span><span class="n">setField</span><span class="p">(</span><span class="s">"myFoo"</span><span class="p">))</span>
+ <span class="o">.</span><span class="n">setValidateMethod</span><span class="p">(</span><span class="s">"start"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">createInstance</span><span class="p">();</span>
+</pre></div>
+
+
+<h2 id="deploying-the-api">Deploying the API</h2>
+<p>Before being able to create component types at runtime, you need to deploy 3 bundles:
+<em> iPOJO (core)
+</em> iPOJO Composite
+* iPOJO API</p>
+<p>You can deploy all these bundles in one step thanks to OBR:</p>
+<div class="codehilite"><pre><span class="n">obr</span> <span class="n">start</span> <span class="s">"Apache Felix iPOJO API"</span>
+</pre></div>
+
+
+<h2 id="primitive-component-type-basics">Primitive Component Type basics</h2>
+<p>When you create a new Primitive component type (so, using a Java class as implementation), you must set the bundle context and the class name. Everything else is optional. </p>
+<p>Note about inner classes: iPOJO is based on a bytecode manipulation. The API embeds the manipulator. So, when you initialize the component type, the specified class name is manipulated (if not already manipulated). So, as this force using a customized classloader, inner classes cannot be manipulated. So, inner class injection is not supported with the API.</p>
+<h2 id="immediate-component-validate-and-invalidate-method">Immediate Component, Validate and Invalidate Method</h2>
+<p>To set the component type as immediate, just call the <code>setImmediate(immediate)</code> method on the primitive component type object.
+To set validate and invalidate methods, just call the <code>setValidate(method)</code> and <code>setInvalidate(method)</code>. Specify the method name that you want to call in argument. </p>
+<h2 id="declaring-services">Declaring services</h2>
+<p>To declare that a component provides a service, add a new service to your primitive component type.
The Service object can be configured. By default, it exposed every implemented interface (regular iPOJO behavior). So, you can:
* Add service property
* Set the creation strategy
- * Set the exposed service specifications
-
-{code:java}
+ * Set the exposed service specifications</p>
+<p>{code:java}
new PrimitiveComponentType()
.setBundleContext(context)
.setClassName(org.example.service.impl.MyComponentImpl.class.getName())
@@ -169,23 +293,24 @@ new PrimitiveComponentType()
.setField("myServiceProperty")
.setName("sample.myProperty"))
.setCreationStrategy(Service.INSTANCE_STRATEGY))
- .createInstance();
+ .createInstance();</p>
+<div class="codehilite"><pre><span class="n">h2</span><span class="o">.</span> <span class="n">Service</span> <span class="n">Dependencies</span>
+<span class="n">To</span> <span class="n">declare</span> <span class="n">a</span> <span class="n">service</span> <span class="n">dependency</span><span class="p">,</span> <span class="n">create</span> <span class="ow">and</span> <span class="n">add</span> <span class="n">a</span> <span class="n">Dependency</span> <span class="n">object</span><span class="o">.</span> <span class="n">The</span> <span class="n">dependency</span> <span class="n">object</span> <span class="n">offers</span> <span class="n">all</span> <span class="n">the</span> <span class="n">iPOJO</span> <span class="n">service</span> <span class="n">dependency</span> <span class="n">features</span><span class="o">.</span> <span class="n">You</span> <span class="n">can</span> <span class="n">set</span> <span class="n">the</span> <span class="n">injected</span> <span class="n">field</span> <span class="ow">and</span><span class="sr">/or bind/</span><span class="n">unbind</span> <span class="n">methods</span><span
class="o">.</span> <span class="n">Here</span> <span class="n">is</span> <span class="n">an</span> <span class="n">example:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="k">new</span> <span class="n">PrimitiveComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setClassName</span><span class="p">(</span><span class="n">org</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">service</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">MyComponentImpl</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">())</span>
+ <span class="o">.</span><span class="n">addDependency</span><span class="p">(</span>
+ <span class="k">new</span> <span class="n">Dependency</span><span class="p">()</span><span class="o">.</span><span class="n">setField</span><span class="p">(</span><span class="s">"myFoo"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setOptional</span><span class="p">(</span><span class="n">true</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setDefaultImplementation</span><span class="p">(</span><span class="s">"org.sample.FooDefaultImplementation"</span><span class="p">)</span>
+ <span class="p">)</span>
+ <span class="o">.</span><span class="n">createInstance</span><span class="p">();</span>
+</pre></div>
- h2. Service Dependencies
- To declare a service dependency, create and add a Dependency object. The dependency object offers all the iPOJO service dependency features. You can set the injected field and/or bind/unbind methods. Here is an example:
- {code:java}
- new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(org.example.service.impl.MyComponentImpl.class.getName())
- .addDependency(
- new Dependency().setField("myFoo")
- .setOptional(true)
- .setDefaultImplementation("org.sample.FooDefaultImplementation")
- )
- .createInstance();
-## Properties
-Thanks to the `addProperty` method, you can create component properties. Here is some example of properties:
+<h2 id="properties">Properties</h2>
+<p>Thanks to the <code>addProperty</code> method, you can create component properties. Here is some example of properties:
{code:java}
new PrimitiveComponentType()
.setBundleContext(context)
@@ -198,184 +323,186 @@ new PrimitiveComponentType()
.setMethod("setMethod")
.setName("prop")
)
- .createInstance();
-
- h2. Temporal Dependencies
- Temporal dependencies are also supported:
- {code:java}
- new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(MyComponentImpl.class.getName())
- .addDependency(
- new TemporalDependency().setField("myFoo")
- .setOnTimeoutPolicy(TemporalDependency.NULLABLE)
- .setTimeout(3000)
- .setProxy(true)
- )
- .createInstance();
-
-## Instance creation
-The API allows you to create instances from the component type you described. Three differents methods.
-The `createInstance()` method just creates an instance. The `createInstance(String name)` method allows to set the instance name. Finally, the `createInstance(Dictionary configuration)` allows setting the instance configuration. All those methods returns the ComponentInstance object allowing to manage the instance (stop, start, dispose).
-
-## Managed Service and Propagation
-You can enable/disable the property propagation thanks to the `setPropagation` method on the PrimitiveComponentType object.
-You can also set the the managed service PID with the `setManagedServicePID` method. This method should be only use to give a default value of for singleton component. In all other case, the managed service pid has to be provided inside the instance configuration.
-
-## Managing iPOJO Factory
-Beyond the PrimitiveComponentType, an iPOJO factory is hidden. You can configure this factory to be public or private with the `setPublic` method. You can also set the name of the factory with the `setName` method.
-
-Then, you can access to the Factory object by calling the `getFactory` method.
-
-## Access to the introspection API
-The API provides bridge to get access to the iPOJO introspection API. The introspection API allows reconfiguring at runtime an instance (properties, service dependencies...). From Service and Dependency, Property and ServiceProperty objects, call the `getXXXDescription` method. You must give the instance that you want to introspect in argument. If the lookup success, you get an object allowing reconfiguring the service, dependency or property.
-
-## Singleton Component Type
-If you are sure to create only one instance of your component type, you can use the singleton component type class. This is a kind of primitive component type, but when you start it (with the `create` method), it will automatically create an instance.
+ .createInstance();</p>
+<div class="codehilite"><pre><span class="n">h2</span><span class="o">.</span> <span class="n">Temporal</span> <span class="n">Dependencies</span>
+<span class="n">Temporal</span> <span class="n">dependencies</span> <span class="n">are</span> <span class="n">also</span> <span class="n">supported:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="k">new</span> <span class="n">PrimitiveComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setClassName</span><span class="p">(</span><span class="n">MyComponentImpl</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">())</span>
+ <span class="o">.</span><span class="n">addDependency</span><span class="p">(</span>
+ <span class="k">new</span> <span class="n">TemporalDependency</span><span class="p">()</span><span class="o">.</span><span class="n">setField</span><span class="p">(</span><span class="s">"myFoo"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setOnTimeoutPolicy</span><span class="p">(</span><span class="n">TemporalDependency</span><span class="o">.</span><span class="n">NULLABLE</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setTimeout</span><span class="p">(</span><span class="mi">3000</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setProxy</span><span class="p">(</span><span class="n">true</span><span class="p">)</span>
+ <span class="p">)</span>
+ <span class="o">.</span><span class="n">createInstance</span><span class="p">();</span>
+</pre></div>
+
+
+<h2 id="instance-creation">Instance creation</h2>
+<p>The API allows you to create instances from the component type you described. Three differents methods.
+The <code>createInstance()</code> method just creates an instance. The <code>createInstance(String name)</code> method allows to set the instance name. Finally, the <code>createInstance(Dictionary configuration)</code> allows setting the instance configuration. All those methods returns the ComponentInstance object allowing to manage the instance (stop, start, dispose). </p>
+<h2 id="managed-service-and-propagation">Managed Service and Propagation</h2>
+<p>You can enable/disable the property propagation thanks to the <code>setPropagation</code> method on the PrimitiveComponentType object.
+You can also set the the managed service PID with the <code>setManagedServicePID</code> method. This method should be only use to give a default value of for singleton component. In all other case, the managed service pid has to be provided inside the instance configuration.</p>
+<h2 id="managing-ipojo-factory">Managing iPOJO Factory</h2>
+<p>Beyond the PrimitiveComponentType, an iPOJO factory is hidden. You can configure this factory to be public or private with the <code>setPublic</code> method. You can also set the name of the factory with the <code>setName</code> method. </p>
+<p>Then, you can access to the Factory object by calling the <code>getFactory</code> method.</p>
+<h2 id="access-to-the-introspection-api">Access to the introspection API</h2>
+<p>The API provides bridge to get access to the iPOJO introspection API. The introspection API allows reconfiguring at runtime an instance (properties, service dependencies...). From Service and Dependency, Property and ServiceProperty objects, call the <code>getXXXDescription</code> method. You must give the instance that you want to introspect in argument. If the lookup success, you get an object allowing reconfiguring the service, dependency or property. </p>
+<h2 id="singleton-component-type">Singleton Component Type</h2>
+<p>If you are sure to create only one instance of your component type, you can use the singleton component type class. This is a kind of primitive component type, but when you start it (with the <code>create</code> method), it will automatically create an instance.
{code:java}
PrimitiveComponentType type = new SingletonComponentType()
.setBundleContext(context)
.setClassName(org.example.service.impl.MyComponentImpl.class.getName())
.addDependency(new Dependency().setField("myFoo"))
- .setValidateMethod("start");
-
- ((SingletonComponentType) type)
- .setObject(new MyComponentImpl(5)) // Inject a pojo object
- .create();// Create an instance
+ .setValidateMethod("start");</p>
+<div class="codehilite"><pre> <span class="p">((</span><span class="n">SingletonComponentType</span><span class="p">)</span> <span class="n">type</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setObject</span><span class="p">(</span><span class="k">new</span> <span class="n">MyComponentImpl</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span> <span class="sr">//</span> <span class="n">Inject</span> <span class="n">a</span> <span class="n">pojo</span> <span class="n">object</span>
+ <span class="o">.</span><span class="n">create</span><span class="p">();</span><span class="sr">//</span> <span class="n">Create</span> <span class="n">an</span> <span class="n">instance</span>
+
+<span class="n">The</span> <span class="n">type</span> <span class="n">created</span> <span class="n">with</span> <span class="n">the</span> <span class="n">singleton</span> <span class="n">component</span> <span class="n">type</span> <span class="n">are</span> <span class="n">set</span> <span class="n">to</span> <span class="n">by</span> <span class="n">default</span><span class="o">.</span> <span class="n">Instead</span> <span class="n">of</span> <span class="n">calling</span> <span class="n">the</span> <span class="n">method</span><span class="p">,</span> <span class="n">you</span> <span class="n">have</span> <span class="n">to</span> <span class="n">call</span> <span class="n">one</span> <span class="n">of</span> <span class="n">the</span> <span class="n">methods</span> <span class="n">to</span> <span class="n">start</span> <span class="n">the</span> <span class="n">type</span> <span class="ow">and</span> <span class="n">create</span> <span class="n">the</span> <span
class="n">instance</span><span class="o">.</span>
+
+<span class="n">You</span> <span class="n">can</span> <span class="n">also</span> <span class="n">set</span> <span class="n">the</span> <span class="n">contained</span> <span class="n">POJO</span> <span class="n">object</span> <span class="n">by</span> <span class="n">using</span> <span class="n">the</span> <span class="n">method</span><span class="o">.</span> <span class="n">The</span> <span class="n">given</span> <span class="n">object</span> <span class="n">MUST</span> <span class="n">be</span> <span class="n">compatible</span> <span class="n">with</span> <span class="n">the</span> <span class="n">component</span> <span class="n">implementation</span> <span class="n">class</span><span class="o">.</span>
+
+<span class="n">h2</span><span class="o">.</span> <span class="n">Using</span> <span class="n">external</span> <span class="n">handlers</span>
+<span class="n">iPOJO</span> <span class="n">is</span> <span class="n">extensible</span><span class="o">...</span> <span class="n">So</span><span class="p">,</span> <span class="n">it</span> <span class="n">makes</span> <span class="n">sense</span> <span class="n">that</span> <span class="n">the</span> <span class="n">API</span> <span class="n">is</span> <span class="n">also</span> <span class="n">extensible</span><span class="o">.</span> <span class="n">So</span> <span class="n">component</span> <span class="n">type</span> <span class="n">provides</span> <span class="n">a</span> <span class="n">method</span> <span class="n">allowing</span> <span class="n">to</span> <span class="n">add</span> <span class="n">external</span> <span class="n">handler</span> <span class="n">configuration:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="p">}</span>
+<span class="k">return</span> <span class="k">new</span> <span class="n">PrimitiveComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setClassName</span><span class="p">(</span><span class="n">HostImpl</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">())</span>
+ <span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="k">new</span> <span class="n">Whiteboard</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">onArrival</span><span class="p">(</span><span class="s">"arrival"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">onDeparture</span><span class="p">(</span><span class="s">"departure"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setFilter</span><span class="p">(</span><span class="s">"(foo=foo)"</span><span class="p">)</span>
+ <span class="p">);</span>
+</pre></div>
- The type created with the singleton component type are set to by default. Instead of calling the method, you have to call one of the methods to start the type and create the instance.
-
- You can also set the contained POJO object by using the method. The given object MUST be compatible with the component implementation class.
-
- h2. Using external handlers
- iPOJO is extensible... So, it makes sense that the API is also extensible. So component type provides a method allowing to add external handler configuration:
- {code:java}
- return new PrimitiveComponentType()
- .setBundleContext(context)
- .setClassName(HostImpl.class.getName())
- .addHandler(new Whiteboard()
- .onArrival("arrival")
- .onDeparture("departure")
- .setFilter("(foo=foo)")
- );
-The `addHandler` method allows you to add any handler description. A handler description is an object of a class implementing `org.apache.felix.ipojo.api.HandlerConfiguration`. Handler provider willing to support the API have to provide this class. For example, the example above uses `Whiteboard` that is the Whiteboard pattern handler description. This class is very simple, and is shown below:
+<p>The <code>addHandler</code> method allows you to add any handler description. A handler description is an object of a class implementing <code>org.apache.felix.ipojo.api.HandlerConfiguration</code>. Handler provider willing to support the API have to provide this class. For example, the example above uses <code>Whiteboard</code> that is the Whiteboard pattern handler description. This class is very simple, and is shown below:
{code:java}
-public class Whiteboard implements HandlerConfiguration {
+public class Whiteboard implements HandlerConfiguration {</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">static</span> <span class="n">final</span> <span class="n">String</span> <span class="n">NAME</span> <span class="o">=</span> <span class="s">"wbp"</span><span class="p">;</span>
- public static final String NAME = "wbp";
+<span class="n">public</span> <span class="n">static</span> <span class="n">final</span> <span class="n">String</span> <span class="n">NAMESPACE</span> <span class="o">=</span> <span class="s">"org.apache.felix.ipojo.whiteboard"</span><span class="p">;</span>
- public static final String NAMESPACE = "org.apache.felix.ipojo.whiteboard";
+<span class="n">private</span> <span class="n">String</span> <span class="n">arrival</span><span class="p">;</span>
- private String arrival;
+<span class="n">private</span> <span class="n">String</span> <span class="n">departure</span><span class="p">;</span>
- private String departure;
-
- private String modification;
-
- private String filter;
-
- public Whiteboard onArrival(String method) {
- arrival = method;
- return this;
- }
-
- public Whiteboard onDeparture(String method) {
- departure = method;
- return this;
- }
-
- public Whiteboard onModification(String method) {
- modification = method;
- return this;
- }
-
- public Whiteboard setFilter(String fil) {
- filter = fil;
- return this;
- }
-
- public Element getElement() {
- ensureValidity();
- // Create the root element.
- Element element = new Element(NAME, NAMESPACE);
- // Mandatory attributes
- element.addAttribute(new Attribute("onArrival", arrival));
- element.addAttribute(new Attribute("onDeparture", departure));
- element.addAttribute(new Attribute("filter", filter));
-
- // Optional attribute
- if (modification != null) {
- element.addAttribute(new Attribute("onModification", modification));
- }
-
- return element;
- }
-
- private void ensureValidity() {
- if (arrival == null) {
- throw new IllegalStateException("The whiteboard pattern configuration must have a onArrival method");
- }
- if (departure == null) {
- throw new IllegalStateException("The whiteboard pattern configuration must have a onDeparture method");
- }
- if (filter == null) {
- throw new IllegalStateException("The whiteboard pattern configuration must have a filter");
- }
-
- }
-
- The only required method is returning the Element-Attribute structure representing the handler configuration (this uses the internal iPOJO data format). If the metadata cannot be generated, the class throws IllegalStateExceptions.
-
- h2. Creating composition with the API
- The API also allows you to create iPOJO compositions in a pretty simple way. So you can create compositions:
- * containing internal instances
- * importing services
- * instantiating sub-services
- * exporting services
- * providing services (by delegation)
-
- Here are some examples:
- {code:java|title=Contained instances}
- PrimitiveComponentType prov = createAProvider(); // Create a primitive type
- PrimitiveComponentType cons = createAConsumer(); // Create another primitive type
-
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp1")
- .addInstance(new Instance(prov.getFactory().getName())) // Create an instance in the composite
- .addInstance(new Instance(cons.getFactory().getName()));
+<span class="n">private</span> <span class="n">String</span> <span class="n">modification</span><span class="p">;</span>
+
+<span class="n">private</span> <span class="n">String</span> <span class="n">filter</span><span class="p">;</span>
+
+<span class="n">public</span> <span class="n">Whiteboard</span> <span class="n">onArrival</span><span class="p">(</span><span class="n">String</span> <span class="n">method</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">arrival</span> <span class="o">=</span> <span class="n">method</span><span class="p">;</span>
+ <span class="k">return</span> <span class="n">this</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">Whiteboard</span> <span class="n">onDeparture</span><span class="p">(</span><span class="n">String</span> <span class="n">method</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">departure</span> <span class="o">=</span> <span class="n">method</span><span class="p">;</span>
+ <span class="k">return</span> <span class="n">this</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">Whiteboard</span> <span class="n">onModification</span><span class="p">(</span><span class="n">String</span> <span class="n">method</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">modification</span> <span class="o">=</span> <span class="n">method</span><span class="p">;</span>
+ <span class="k">return</span> <span class="n">this</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">Whiteboard</span> <span class="n">setFilter</span><span class="p">(</span><span class="n">String</span> <span class="n">fil</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">filter</span> <span class="o">=</span> <span class="n">fil</span><span class="p">;</span>
+ <span class="k">return</span> <span class="n">this</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">public</span> <span class="n">Element</span> <span class="n">getElement</span><span class="p">()</span> <span class="p">{</span>
+ <span class="n">ensureValidity</span><span class="p">();</span>
+ <span class="sr">//</span> <span class="n">Create</span> <span class="n">the</span> <span class="n">root</span> <span class="n">element</span><span class="o">.</span>
+ <span class="n">Element</span> <span class="n">element</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Element</span><span class="p">(</span><span class="n">NAME</span><span class="p">,</span> <span class="n">NAMESPACE</span><span class="p">);</span>
+ <span class="sr">//</span> <span class="n">Mandatory</span> <span class="n">attributes</span>
+ <span class="n">element</span><span class="o">.</span><span class="n">addAttribute</span><span class="p">(</span><span class="k">new</span> <span class="n">Attribute</span><span class="p">(</span><span class="s">"onArrival"</span><span class="p">,</span> <span class="n">arrival</span><span class="p">));</span>
+ <span class="n">element</span><span class="o">.</span><span class="n">addAttribute</span><span class="p">(</span><span class="k">new</span> <span class="n">Attribute</span><span class="p">(</span><span class="s">"onDeparture"</span><span class="p">,</span> <span class="n">departure</span><span class="p">));</span>
+ <span class="n">element</span><span class="o">.</span><span class="n">addAttribute</span><span class="p">(</span><span class="k">new</span> <span class="n">Attribute</span><span class="p">(</span><span class="s">"filter"</span><span class="p">,</span> <span class="n">filter</span><span class="p">));</span>
+
+ <span class="sr">//</span> <span class="n">Optional</span> <span class="n">attribute</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">modification</span> <span class="o">!=</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">element</span><span class="o">.</span><span class="n">addAttribute</span><span class="p">(</span><span class="k">new</span> <span class="n">Attribute</span><span class="p">(</span><span class="s">"onModification"</span><span class="p">,</span> <span class="n">modification</span><span class="p">));</span>
+ <span class="p">}</span>
+
+ <span class="k">return</span> <span class="n">element</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="n">private</span> <span class="n">void</span> <span class="n">ensureValidity</span><span class="p">()</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">arrival</span> <span class="o">==</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">throw</span> <span class="k">new</span> <span class="n">IllegalStateException</span><span class="p">(</span><span class="s">"The whiteboard pattern configuration must have a onArrival method"</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">departure</span> <span class="o">==</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">throw</span> <span class="k">new</span> <span class="n">IllegalStateException</span><span class="p">(</span><span class="s">"The whiteboard pattern configuration must have a onDeparture method"</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">filter</span> <span class="o">==</span> <span class="n">null</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">throw</span> <span class="k">new</span> <span class="n">IllegalStateException</span><span class="p">(</span><span class="s">"The whiteboard pattern configuration must have a filter"</span><span class="p">);</span>
+ <span class="p">}</span>
+
+<span class="p">}</span>
+
+<span class="n">The</span> <span class="n">only</span> <span class="n">required</span> <span class="n">method</span> <span class="n">is</span> <span class="n">returning</span> <span class="n">the</span> <span class="n">Element</span><span class="o">-</span><span class="n">Attribute</span> <span class="n">structure</span> <span class="n">representing</span> <span class="n">the</span> <span class="n">handler</span> <span class="n">configuration</span> <span class="p">(</span><span class="n">this</span> <span class="n">uses</span> <span class="n">the</span> <span class="n">internal</span> <span class="n">iPOJO</span> <span class="n">data</span> <span class="nb">format</span><span class="p">)</span><span class="o">.</span> <span class="n">If</span> <span class="n">the</span> <span class="n">metadata</span> <span class="n">cannot</span> <span class="n">be</span> <span class="n">generated</span><span class="p">,</span> <span class="n">the</span> <span class="n">class</span> <span
class="n">throws</span> <span class="n">IllegalStateExceptions</span><span class="o">.</span>
+
+<span class="n">h2</span><span class="o">.</span> <span class="n">Creating</span> <span class="n">composition</span> <span class="n">with</span> <span class="n">the</span> <span class="n">API</span>
+<span class="n">The</span> <span class="n">API</span> <span class="n">also</span> <span class="n">allows</span> <span class="n">you</span> <span class="n">to</span> <span class="n">create</span> <span class="n">iPOJO</span> <span class="n">compositions</span> <span class="n">in</span> <span class="n">a</span> <span class="n">pretty</span> <span class="n">simple</span> <span class="n">way</span><span class="o">.</span> <span class="n">So</span> <span class="n">you</span> <span class="n">can</span> <span class="n">create</span> <span class="n">compositions:</span>
+<span class="o">*</span> <span class="n">containing</span> <span class="n">internal</span> <span class="n">instances</span>
+<span class="o">*</span> <span class="n">importing</span> <span class="n">services</span>
+<span class="o">*</span> <span class="n">instantiating</span> <span class="n">sub</span><span class="o">-</span><span class="n">services</span>
+<span class="o">*</span> <span class="n">exporting</span> <span class="n">services</span>
+<span class="o">*</span> <span class="n">providing</span> <span class="n">services</span> <span class="p">(</span><span class="n">by</span> <span class="n">delegation</span><span class="p">)</span>
+
+<span class="n">Here</span> <span class="n">are</span> <span class="n">some</span> <span class="n">examples:</span>
+<span class="p">{</span><span class="n">code:java</span><span class="o">|</span><span class="n">title</span><span class="o">=</span><span class="n">Contained</span> <span class="n">instances</span><span class="p">}</span>
+ <span class="n">PrimitiveComponentType</span> <span class="n">prov</span> <span class="o">=</span> <span class="n">createAProvider</span><span class="p">();</span> <span class="sr">//</span> <span class="n">Create</span> <span class="n">a</span> <span class="n">primitive</span> <span class="n">type</span>
+ <span class="n">PrimitiveComponentType</span> <span class="n">cons</span> <span class="o">=</span> <span class="n">createAConsumer</span><span class="p">();</span> <span class="sr">//</span> <span class="n">Create</span> <span class="n">another</span> <span class="n">primitive</span> <span class="n">type</span>
+
+ <span class="n">CompositeComponentType</span> <span class="n">type</span> <span class="o">=</span> <span class="k">new</span> <span class="n">CompositeComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setComponentTypeName</span><span class="p">(</span><span class="s">"comp1"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">addInstance</span><span class="p">(</span><span class="k">new</span> <span class="n">Instance</span><span class="p">(</span><span class="n">prov</span><span class="o">.</span><span class="n">getFactory</span><span class="p">()</span><span class="o">.</span><span class="n">getName</span><span class="p">()))</span> <span class="sr">//</span> <span class="n">Create</span> <span class="n">an</span> <span class="n">instance</span> <span class="n">in</span> <span class="n">the</span> <span class="n">composite</span>
+ <span class="o">.</span><span class="n">addInstance</span><span class="p">(</span><span class="k">new</span> <span class="n">Instance</span><span class="p">(</span><span class="n">cons</span><span class="o">.</span><span class="n">getFactory</span><span class="p">()</span><span class="o">.</span><span class="n">getName</span><span class="p">()));</span>
- ComponentInstance ci = type.createInstance();
+ <span class="n">ComponentInstance</span> <span class="n">ci</span> <span class="o">=</span> <span class="n">type</span><span class="o">.</span><span class="n">createInstance</span><span class="p">();</span>
+</pre></div>
-{code:java|title=Importing services}
+
+<p>{code:java|title=Importing services}
CompositeComponentType type = new CompositeComponentType()
.setBundleContext(context)
.setComponentTypeName("comp3")
.addSubService(new InstantiatedService() // Importation
.setSpecification(Foo.class.getName())
- .setOptional(true));
+ .setOptional(true));</p>
+<div class="codehilite"><pre><span class="p">{</span><span class="n">code:java</span><span class="o">|</span><span class="n">title</span><span class="o">=</span><span class="n">Instantiated</span> <span class="n">sub</span><span class="o">-</span><span class="n">services</span><span class="p">}</span>
+ <span class="n">CompositeComponentType</span> <span class="n">type</span> <span class="o">=</span> <span class="k">new</span> <span class="n">CompositeComponentType</span><span class="p">()</span>
+ <span class="o">.</span><span class="n">setBundleContext</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">setComponentTypeName</span><span class="p">(</span><span class="s">"comp2"</span><span class="p">)</span>
+ <span class="o">.</span><span class="n">addSubService</span><span class="p">(</span><span class="k">new</span> <span class="n">InstantiatedService</span><span class="p">()</span> <span class="sr">//</span> <span class="n">Instantiated</span> <span class="n">service</span>
+ <span class="o">.</span><span class="n">setSpecification</span><span class="p">(</span><span class="n">Foo</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">getName</span><span class="p">()))</span>
+ <span class="o">.</span><span class="n">addInstance</span><span class="p">(</span><span class="k">new</span> <span class="n">Instance</span><span class="p">(</span><span class="n">cons</span><span class="o">.</span><span class="n">getFactory</span><span class="p">()</span><span class="o">.</span><span class="n">getName</span><span class="p">()));</span>
+</pre></div>
- {code:java|title=Instantiated sub-services}
- CompositeComponentType type = new CompositeComponentType()
- .setBundleContext(context)
- .setComponentTypeName("comp2")
- .addSubService(new InstantiatedService() // Instantiated service
- .setSpecification(Foo.class.getName()))
- .addInstance(new Instance(cons.getFactory().getName()));
-{code:java|title=Exported Services}
+<p>{code:java|title=Exported Services}
CompositeComponentType type = new CompositeComponentType()
.setBundleContext(context)
.setComponentTypeName("compExport")
.addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
.addService(new ExportedService()
- .setSpecification(Foo.class.getName())); // Exports a service
+ .setSpecification(Foo.class.getName())); // Exports a service</p>
+<div class="codehilite"><pre><span class="o">\\</span>
+</pre></div>
+ </div>
+
+ <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
- \\
- {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
@@ -383,5 +510,18 @@ CompositeComponentType type = new Compos
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>