incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r780201 [3/17] - in /websites/staging/aries/trunk/content: ./ ct/ ct/0.2/ images/ resources/
Date Tue, 07 Dec 2010 04:14:18 GMT
Added: websites/staging/aries/trunk/content/blueprint.html
URL: http://svn.apache.org/viewvc/websites/staging/aries/trunk/content/blueprint.html?rev=780201&view=auto
==============================================================================
--- websites/staging/aries/trunk/content/blueprint.html (added)
+++ websites/staging/aries/trunk/content/blueprint.html Tue Dec  7 04:14:16 2010
@@ -0,0 +1,665 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+  <head>
+    <link type="text/css" rel="stylesheet"
+href="http://incubator.apache.org/aries/resources/site.css";></link>
+    <script src="http://incubator.apache.org/aries/resources/space.js";
+type="text/javascript"></script>
+<meta name="keywords" content="..."/>
+<meta name="description" content="..." />
+    <title>
+Apache Aries (incubating) -- $page.title
+    </title>
+  </head>
+<body onload="init()">
+
+<table width="100%" cellpadding="0" cellspacing="0">
+  <tr width="100%">
+    <td id="cell-0-0" colspan="2">&nbsp;</td>
+    <td id="cell-0-1">&nbsp;</td>
+    <td id="cell-0-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-1-0">&nbsp;</td>
+    <td id="cell-1-1">&nbsp;</td>
+    <td id="cell-1-2">
+      <div style="padding: 5px;">
+        <div id="banner">
+          <!-- Banner -->
+			<table border="0" cellpadding="0" cellspacing="0" width="100%">
+				<tr>
+					<td align="left" class="topbardiv" nowrap="">
+						<a href="http://incubator.apache.org/aries/" title="Apache Aries (incubating)"> <img border="0" src="http://incubator.apache.org/aries/images/Arieslogo_Horizontal.gif"> </a>
+					</td>
+					<td align="right" nowrap="">
+						<a href="http://www.apache.org/" title="The Apache Software Foundation"> <img border="0" src="http://incubator.apache.org/aries/images/apache-incubator-logo.png"> </a>
+      				</td>
+				</tr>
+			</table>
+          <!-- Banner -->
+        </div>
+      </div>
+      <div id="top-menu">
+        <table border="0" cellpadding="1" cellspacing="0" width="100%">
+          <tr>
+            <td>
+              <div align="left">
+                <!-- Breadcrumbs -->
+                <!-- Breadcrumbs -->
+              </div>
+            </td>
+            <td>
+              <div align="right">
+                <!-- Quicklinks -->
+					<DIV style="padding: 5px 5px 0px 25px;">
+						<FORM action="http://www.google.com/search" method="get" style="font-size: 10px;">
+						<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License</A> <A href="sitemap.html" title="SiteMap">Site Map</A> 
+						<INPUT name="ie" type="hidden" value="UTF-8"></INPUT>
+						<INPUT name="oe" type="hidden" value="UTF-8"></INPUT>
+						<INPUT maxlength="255" name="q" size="15" type="text" value></INPUT>
+						<INPUT name="btnG" type="submit" value="Search"></INPUT>
+						<INPUT name="domains" type="hidden" value="incubator.apache.org/aries"></INPUT>
+						<INPUT name="sitesearch" type="hidden" value="incubator.apache.org/aries"></INPUT>
+						</FORM>
+					</DIV>
+                <!-- Quicklinks -->
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </td>
+    <td id="cell-1-3">&nbsp;</td>
+    <td id="cell-1-4">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-2-0" colspan="2">&nbsp;</td>
+    <td id="cell-2-1">
+      <table>
+        <tr height="100%" valign="top">
+          <td height="100%">
+            <div id="wrapper-menu-page-right">
+              <div id="wrapper-menu-page-top">
+                <div id="wrapper-menu-page-bottom">
+                  <div id="menu-page">
+                    <!-- NavigationBar -->
+					<ul>
+<li />
+</ul>
+<h3 id="overviewoverviewhtml"><a href="overview.html">Overview</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="board_reportsboardreportshtml"><a href="boardreports.html">Board Reports</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="site_mapsitemaphtml"><a href="sitemap.html">Site Map</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="documentationdocumentationhtml"><a href="documentation.html">Documentation</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="programming_modelariesprogrammingmodelhtml"><a href="ariesprogrammingmodel.html">Programming Model</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="pointers_to_osgi_specspointerstoosgispecificationshtml"><a href="pointerstoosgispecifications.html">Pointers to OSGi specs</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="integrators_guideintegrators-guidehtml"><a href="integrators-guide.html">Integrators Guide</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="articlesarticleshtml"><a href="articles.html">Articles</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="slideshttpssvnapacheorgreposasfincubatorariesslides"><a href="https://svn.apache.org/repos/asf/incubator/aries/slides/">Slides</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="tutorialstutorialshtml"><a href="tutorials.html">Tutorials</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="downloadsdownloadshtml"><a href="downloads.html">Downloads</a></h3>
+<ul>
+<li />
+</ul>
+<h3 id="communitycommunityhtml"><a href="community.html">Community</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="getting_involvedgettinginvolvedhtml"><a href="gettinginvolved.html">Getting Involved</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="who_we_arepeoplehtml"><a href="people.html">Who we are</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="mailing_listsmailinglistshtml"><a href="mailinglists.html">Mailing lists</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="aries_group_bloghttpblogsapacheorgaries"><a href="http://blogs.apache.org/aries/">Aries Group Blog</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="developmentdevelopmenthtml"><a href="development.html">Development</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="source_control_httpssvnapacheorgreposasfincubatorarieshtml"><a href="https://svn.apache.org/repos/asf/incubator/aries/.html">Source Control </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="bug_trackinghttpsissuesapacheorgjirabrowsearieshtml"><a href="https://issues.apache.org/jira/browse/aries.html">Bug Tracking</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="building_aries_buildingarieshtml"><a href="buildingaries.html">Building Aries </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="releasing_aries_releasingarieshtml"><a href="releasingaries.html">Releasing Aries </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="osgi_compliance_tests_compliancetestinghtml"><a href="compliancetesting.html">OSGi Compliance Tests </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="build_systemhttphudsonzonesapacheorghudsonhtml"><a href="http://hudson.zones.apache.org/hudson/.html">Build System</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="web_site_maintenance_maintainingthewebpageshtml"><a href="maintainingthewebpages.html">Web Site Maintenance </a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="modulesmoduleshtml"><a href="modules.html">Modules</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="samplessampleshtml"><a href="samples.html">Samples</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="blueprintblueprinthtml"><a href="blueprint.html">Blueprint</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="jndijndiprojecthtml"><a href="jndiproject.html">JNDI</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="jpajpaprojecthtml"><a href="jpaproject.html">JPA</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="applicationsapplicationshtml"><a href="applications.html">Applications</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="transactionstransactionsprojecthtml"><a href="transactionsproject.html">Transactions</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="eba_maven_plugin_-ebamavenpluginprojecthtml"><a href="-ebamavenpluginproject.html">EBA Maven Plugin </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="spi_flyspi-flyhtml"><a href="spi-fly.html">SPI Fly</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="sponsorshipsponsorshiphtml"><a href="sponsorship.html">Sponsorship</a></h3> 
+                    <!-- NavigationBar -->
+                  </div>
+                </div>
+              </div>
+            </div>
+          </td>
+          <td height="100%" width="100%">
+            <!-- Content -->
+            <div class="wiki-content"><p><a name="Blueprint-Blueprint"></a></p>
+<h1 id="blueprint">Blueprint</h1>
+<p><a name="Blueprint-Introduction"></a></p>
+<h2 id="introduction">Introduction</h2>
+<p>Blueprint provides a dependency injection framework for OSGi and was
+standardized by the OSGi Alliance in OSGi Compendium R4.2. It is designed
+to deal with the dynamic nature of OSGi, where services can become
+available and unavailable at any time. The specification is also designed
+to work with plain old Java objects (POJOs) enabling simple components to
+be written and unit tested in a JSE environment without needing to be aware
+of how they are assembled. The Blueprint XML files that define and describe
+the assembly of various components are key to the Blueprint programming
+model. The specification describes how the components get instantiated and
+wired together to form a running module. </p>
+<p>The following documentation covers the 80:20 usage of Blueprint.  For
+further details, please refer to the OSGi Compendium R4.2 specification.</p>
+<p><a name="Blueprint-BlueprintBundles"></a></p>
+<h2 id="blueprint_bundles">Blueprint Bundles</h2>
+<p>The Blueprint Container specification uses an extender pattern, whereby an
+extender bundle monitors the state of bundles in the framework and performs
+actions on behalf of those bundles based on their state. The Blueprint
+extender bundle waits for the bundles to be activated and checks whether
+they are Blueprint bundles. A bundle is considered to be a Blueprint bundle
+when it contains one or more Blueprint XML files. These XML files are at a
+fixed location under the OSGI-INF/blueprint/ directory or are specified
+explicitly in the Bundle-Blueprint manifest header.</p>
+<p>Once the extender determines that a bundle is a Blueprint bundle, it
+creates a Blueprint Container on behalf of that bundle. The Blueprint
+Container is responsible for:</p>
+<div class="codehilite"><pre><span class="o">*</span> <span class="n">Parsing</span> <span class="n">the</span> <span class="n">Blueprint</span> <span class="n">XML</span> <span class="n">files</span>
+<span class="o">*</span> <span class="n">Instantiating</span> <span class="n">the</span> <span class="n">components</span>
+<span class="o">*</span> <span class="n">Wiring</span> <span class="n">the</span> <span class="n">components</span> <span class="n">together</span>
+<span class="o">*</span> <span class="n">Registering</span> <span class="n">services</span>
+<span class="o">*</span> <span class="n">Looking</span> <span class="n">up</span> <span class="n">service</span> <span class="n">references</span>
+</pre></div>
+
+
+<p>During initialization, the Blueprint Container ensures that mandatory
+service references are satisfied, registers all the services into the
+service registry, and creates initial component instances. The Blueprint
+extender bundle also destroys the Blueprint Container for a bundle when the
+bundle is stopped. </p>
+<p><a name="Blueprint-BlueprintXML"></a></p>
+<h2 id="blueprint_xml">Blueprint XML</h2>
+<p>The Blueprint XML file is identified by a top-level blueprint element, as
+shown below:</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;blueprint</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;</span><span class="nt">&gt;</span>
+    ...
+<span class="nt">&lt;/blueprint&gt;</span>
+</pre></div>
+
+
+<p>The XML namespace identifies the document as conforming to the Blueprint
+version 1.0.0.  The top-level blueprint element identifies the document as
+a blueprint module definition.</p>
+<p><em>TODO:</em> ensure id, activation and dependsOn get documented somewhere.</p>
+<p><a name="Blueprint-Beans"></a></p>
+<h2 id="beans">Beans</h2>
+<p>Beans are declared using the bean element.  The following defines a single
+bean called <em>accountOne</em> implemented by the POJO
+<em>org.apache.aries.simple.Account</em>.</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;blueprint</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.osgi.org/xmlns/blueprint/v1.0.0&quot;</span><span class="nt">&gt;</span>
+   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountOne&quot;</span> <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span> <span class="nt">/&gt;</span>
+<span class="nt">&lt;/blueprint&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-BeanConstruction"></a></p>
+<h3 id="bean_construction">Bean Construction</h3>
+<p>During object construction, the Blueprint Container must first find the
+right constructor or a factory method with a compatible set of parameters
+that matches the arguments specified in the XML. By default, the Blueprint
+Container uses the number and order of the argument elements in XML to find
+the right constructor or method. If the argument  elements cannot be mapped
+to the parameters in the order they are in, the Blueprint Container will
+attempt to reorder the argument elements and find the best-fitting
+arrangement.</p>
+<p>To help the Blueprint Container pick the right constructor, method, or
+parameter arrangement, additional attributes, such as index or type, can be
+specified on the argument element. For example, the type attribute
+specifies a class name used to match the argument element to a parameter by
+the exact type. </p>
+<p>A bean can be constructed using a class constructor. In the following
+example, the <em>class</em> attribute specifies the name of the Java class to
+instantiate. The Blueprint Container will create the <em>Account</em> object by
+passing <em>1</em> as the argument to the constructor. </p>
+<p>public class Account {    <br />
+       public Account(long number) {
+      ...
+       }
+       ...
+   }</p>
+<div class="codehilite"><pre>   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountOne&quot;</span> <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span><span class="nt">&gt;</span>
+       <span class="nt">&lt;argument</span> <span class="na">value=</span><span class="s">&quot;1&quot;</span><span class="nt">/&gt;</span>
+   <span class="nt">&lt;/bean&gt;</span>
+</pre></div>
+
+
+<p>A bean can be constructed using a static factory method.  In this example,
+the <em>class</em> attribute specifies the name of the class that contains a
+static factory method. The name of the static factory method is specified
+by the <em>factory-method</em>  attribute. The Blueprint Container will call the
+<em>createAccount()</em> static method on the <em>StaticAccountFactory</em> class and
+pass 2 as the argument to create the Account object. </p>
+<div class="codehilite"><pre>   public class StaticAccountFactory {      
+       public static Account createAccount(long number) {
+      return new Account(number);
+       }
+   }
+
+   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountTwo&quot;</span>
+    <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.StaticAccountFactory&quot;</span> 
+     <span class="na">factory-method=</span><span class="s">&quot;createAccount&quot;</span><span class="nt">&gt;</span>   
+       <span class="nt">&lt;argument</span> <span class="na">value=</span><span class="s">&quot;2&quot;</span><span class="nt">/&gt;</span>
+   <span class="nt">&lt;/bean&gt;</span>
+</pre></div>
+
+
+<p>A bean can be constructed using an instance factory method.  In the
+example, the <em>accountFactory</em> bean is the factory. The Blueprint
+Container will first create the <em>AccountFactory</em> instance with its own
+arguments and properties. In this case, only a single argument is
+specified: the factory name. The Blueprint Container will then call the
+<em>createAccount()</em> method on the <em>AccountFactory</em> instance and pass 3 as
+the argument to create the Account object.</p>
+<p>public class AccountFactory {    <br />
+       public AccountFactory(String factoryName) {
+      ...
+       }
+       public Account createAccount(long number) {
+      return new Account(number);
+       }
+   }</p>
+<div class="codehilite"><pre>   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountFactory&quot;</span>
+    <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.AccountFactory&quot;</span><span class="nt">&gt;</span>  
+       <span class="nt">&lt;argument</span> <span class="na">value=</span><span class="s">&quot;account factory&quot;</span><span class="nt">/&gt;</span>  
+   <span class="nt">&lt;/bean&gt;</span>
+
+   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountThree&quot;</span>
+     <span class="na">factory-ref=</span><span class="s">&quot;accountFactory&quot;</span> 
+     <span class="na">factory-method=</span><span class="s">&quot;createAccount&quot;</span><span class="nt">&gt;</span>   
+       <span class="nt">&lt;argument</span> <span class="na">value=</span><span class="s">&quot;3&quot;</span><span class="nt">/&gt;</span>
+   <span class="nt">&lt;/bean&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-BeanProperties"></a></p>
+<h3 id="bean_properties">Bean Properties</h3>
+<p>Beans can have property values injected.  Injection is performed
+immediately after the bean is constructed.  The following example creates
+the Account bean and then sets the description property using the Java
+Beans naming convention.</p>
+<p>public class Account {    <br />
+       public Account(long number) {
+      ...
+       }
+       public String getDescription() {
+      ...
+       }
+   }</p>
+<div class="codehilite"><pre>   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountOne&quot;</span> <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span><span class="nt">&gt;</span>
+       <span class="nt">&lt;argument</span> <span class="na">value=</span><span class="s">&quot;1&quot;</span><span class="nt">/&gt;</span>
+       <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;description&quot;</span> <span class="na">value=</span><span class="s">&quot;#1 account&quot;</span><span class="nt">/&gt;</span>
+   <span class="nt">&lt;/bean&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-BeanWiring"></a></p>
+<h4 id="bean_wiring">Bean Wiring</h4>
+<p>Property injection is used for wiring beans together.  In the following
+example <em>accountOne</em> is injected with a <em>Currency</em> bean.</p>
+<div class="codehilite"><pre>   public class Account {      
+       public Account() {
+      ...
+       }
+       public void setCurrency(Currency currency) {
+      ...
+       }
+   }
+
+   public class Currency {  
+       public Currency() {
+      ...
+       }
+   }
+
+   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountOne&quot;</span> <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span><span class="nt">&gt;</span>
+       <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;currency&quot;</span> <span class="na">ref=</span><span class="s">&quot;currency&quot;</span> <span class="nt">/&gt;</span>
+   <span class="nt">&lt;/bean&gt;</span>
+
+   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;currency&quot;</span> <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.Currency&quot;</span> <span class="nt">/&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-Services"></a></p>
+<h2 id="services">Services</h2>
+<p>In Blueprint XML, a service element defines the registration of a service
+in the OSGi service registry. </p>
+<p>The bean that provides the service object can be referenced using the
+<em>ref</em> attribute.  The interfaces under which the service is registered
+can be specified using the <em>interface</em> attribute:</p>
+<div class="codehilite"><pre>   <span class="n">public</span> <span class="n">class</span> <span class="n">AccountImpl</span> <span class="n">implements</span> <span class="n">Account</span> <span class="p">{</span>      
+       <span class="n">public</span> <span class="n">Account</span><span class="p">()</span> <span class="p">{</span>
+      <span class="o">...</span>
+       <span class="p">}</span>
+       <span class="n">public</span> <span class="n">void</span> <span class="n">setCurrency</span><span class="p">(</span><span class="n">Currency</span> <span class="n">currency</span><span class="p">)</span> <span class="p">{</span>
+      <span class="o">...</span>
+       <span class="p">}</span>
+   <span class="p">}</span>
+
+   <span class="o">&lt;</span><span class="n">service</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;serviceOne&quot;</span> <span class="nb">ref</span><span class="o">=</span><span class="s">&quot;account&quot;</span>
+    <span class="n">interface</span><span class="o">=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span> <span class="o">/&gt;</span>
+
+   <span class="o">&lt;</span><span class="n">bean</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;account&quot;</span> <span class="n">class</span><span class="o">=</span><span class="s">&quot;org.apache.aries.simple.AccountImpl&quot;</span> <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>The bean that provides the service object can be inlined in the service
+element as follows:</p>
+<div class="codehilite"><pre>   <span class="nt">&lt;service</span> <span class="na">id=</span><span class="s">&quot;serviceTwo&quot;</span>  <span class="na">interface=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span><span class="nt">&gt;</span>
+      <span class="nt">&lt;bean</span> <span class="na">class=</span><span class="s">&quot;org.apache.aries.simple.AccountImpl&quot;</span> <span class="nt">/&gt;</span>
+   <span class="nt">&lt;/service&gt;</span>
+</pre></div>
+
+
+<p>The interfaces under which a service is registered can be determined by
+Blueprint using <em>auto-export</em>.  The following registers the service under
+all the bean's interfaces:</p>
+<div class="codehilite"><pre>   <span class="o">&lt;</span><span class="n">service</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;serviceOne&quot;</span> <span class="nb">ref</span><span class="o">=</span><span class="s">&quot;account&quot;</span> <span class="n">auto</span><span class="o">-</span><span class="n">export</span><span class="o">=</span><span class="s">&quot;interfaces&quot;</span> <span class="o">/&gt;</span>
+
+   <span class="o">&lt;</span><span class="n">bean</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;account&quot;</span> <span class="n">class</span><span class="o">=</span><span class="s">&quot;org.apache.aries.simple.AccountImpl&quot;</span> <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>Other values for <em>auto-export</em> are <em>disabled</em> (the default)
+<em>class-hierarchy</em> and <em>all-classes</em>.</p>
+<p><a name="Blueprint-ServiceProperties"></a></p>
+<h3 id="service_properties">Service Properties</h3>
+<p>A service can also be registered with a set of properties that can be
+specified using the <em>service-properties</em>  sub-element. The
+<em>service-properties</em> element contains multiple <em>entry</em> sub-elements
+that represent the individual properties. The property key is specified
+using a <em>key</em> attribute, but the property value can be specified as a
+<em>value</em> attribute or inlined within the element. The service property
+values can be of different types, but only OSGi service property types are
+permitted: primitives, primitive wrapper classes, collections, or arrays of
+primitive types. </p>
+<p>The following is an example of a service registration with two service
+properties. The <em>active</em> service property has type of
+<em>java.lang.Boolean</em>. The <em>mode</em> property is of the default type,
+<em>String</em>. </p>
+<div class="codehilite"><pre>   <span class="nt">&lt;service</span> <span class="na">id=</span><span class="s">&quot;serviceFour&quot;</span> <span class="na">ref=</span><span class="s">&quot;account&quot;</span> <span class="na">autoExport=</span><span class="s">&quot;all-classes&quot;</span><span class="nt">&gt;</span>
+      <span class="nt">&lt;service-properties&gt;</span>
+      <span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;active&quot;</span><span class="nt">&gt;</span>
+          <span class="nt">&lt;value</span> <span class="na">type=</span><span class="s">&quot;java.lang.Boolean&quot;</span><span class="nt">&gt;</span>true<span class="nt">&lt;/value&gt;</span>
+      <span class="nt">&lt;/entry&gt;</span>
+      <span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;mode&quot;</span> <span class="na">value=</span><span class="s">&quot;shared&quot;</span><span class="nt">/&gt;</span>
+      <span class="nt">&lt;/service-properties&gt;</span>
+   <span class="nt">&lt;/service&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-ServiceRanking"></a></p>
+<h3 id="service_ranking">Service Ranking</h3>
+<p>Service ranking can be used to affect the choice of service when there are
+multiple matches.  When choosing between two services, the higher ranked
+service will be returned ahead of the lower.  The default ranking value is
+0. Service ranking is specified using the <em>ranking</em> attributes as
+follows:</p>
+<div class="codehilite"><pre>   <span class="o">&lt;</span><span class="n">service</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;serviceFive&quot;</span> <span class="nb">ref</span><span class="o">=</span><span class="s">&quot;account&quot;</span> <span class="n">auto</span><span class="o">-</span><span class="n">export</span><span class="o">=</span><span class="s">&quot;all-classes&quot;</span>
+    <span class="n">ranking</span><span class="o">=</span><span class="s">&quot;3&quot;</span> <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-References"></a></p>
+<h2 id="references">References</h2>
+<p>Services are found in the service registry using the reference element. The
+following shows a reference named <em>accountRef</em> to an <em>Account</em> service.
+ If a service matching this reference is found in the service registry then
+it is set on the <em>accountClient</em> bean through the <em>account</em> property.</p>
+<div class="codehilite"><pre>   <span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;accountClient&quot;</span> <span class="na">class=</span><span class="s">&quot;...&quot;</span><span class="nt">&gt;</span>
+       <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;account&quot;</span> <span class="na">ref=</span><span class="s">&quot;accountRef&quot;</span> <span class="nt">/&gt;</span>
+   <span class="nt">&lt;/bean&gt;</span>
+
+   <span class="nt">&lt;reference</span> <span class="na">id=</span><span class="s">&quot;accountRef&quot;</span> <span class="na">interface=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span>
+<span class="nt">/&gt;</span>
+</pre></div>
+
+
+<p><a name="Blueprint-ReferenceDynamism"></a></p>
+<h3 id="reference_dynamism">Reference Dynamism</h3>
+<p>The object that is injected for a reference is actually a proxy to the
+service registered in the service registry. A proxy enables the injected
+object to remain the same while the backing service can come and go or be
+replaced with another service. Calls on a proxy that does not have a
+backing service will block until a service becomes available or a timeout
+occurs at which point a ServiceUnavailableException will be thrown.</p>
+<div class="codehilite"><pre>   <span class="n">try</span> <span class="p">{</span>
+      <span class="n">balance</span> <span class="o">=</span> <span class="n">account</span><span class="o">.</span><span class="n">getBalance</span><span class="p">();</span>
+   <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">ServiceUnavailableException</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
+      <span class="o">...</span>
+   <span class="p">}</span>
+</pre></div>
+
+
+<p>The default timeout Blueprint will wait for is 300000 milliseconds (5
+minutes).  This value can be changed on a per bundle basis using directives
+on the Bundle-SymbolicName.  The following switches the timeout off
+completely (the default is true):</p>
+<div class="codehilite"><pre>   <span class="n">Bundle</span><span class="o">-</span><span class="n">SymbolicName:</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">aries</span><span class="o">.</span><span class="n">simple</span><span class="o">.</span><span class="n">account</span><span class="p">;</span>
+    <span class="n">blueprint</span><span class="o">.</span><span class="n">graceperiod:</span><span class="o">=</span><span class="n">false</span>
+</pre></div>
+
+
+<p>The following sets the timeout to 10000 milliseconds (10 seconds):</p>
+<div class="codehilite"><pre>   <span class="n">Bundle</span><span class="o">-</span><span class="n">SymbolicName:</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">aries</span><span class="o">.</span><span class="n">simple</span><span class="o">.</span><span class="n">account</span><span class="p">;</span>
+    <span class="n">blueprint</span><span class="o">.</span><span class="n">graceperiod:</span><span class="o">=</span><span class="n">false</span><span class="p">;</span> <span class="n">blueprint</span><span class="o">.</span><span class="n">timeout</span><span class="o">=</span><span class="mi">10000</span><span class="p">;</span>
+</pre></div>
+
+
+<p>The timeout can also be set on an individual reference using the
+<em>timeout</em> attribute.    The following sets the timeout for the account
+reference to 20000 milliseconds (20 seconds).</p>
+<div class="codehilite"><pre>   <span class="o">&lt;</span><span class="n">reference</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;accountRef&quot;</span> <span class="n">timeout</span><span class="o">=</span><span class="s">&quot;20000&quot;</span>
+    <span class="n">interface</span><span class="o">=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span> <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>In all cases, a value of 0 means wait indefinitely for the reference to
+become satisfied.</p>
+<p><a name="Blueprint-ReferenceLists"></a></p>
+<h3 id="reference_lists">Reference Lists</h3>
+<p>Multiple matching services can be found using the <em>reference-list</em>
+element.  The <em>reference-list</em> provides a <em>List</em> object that contains
+the service proxy objects or <em>ServiceReference</em> objects, depending on the
+<em>member-type</em> setting. The provided <em>List</em> object is dynamic, as it can
+grow and shrink as matching services are added or removed from the service
+registry. The <em>List</em> object is read-only and only supports a subset of
+the <em>List</em> API.</p>
+<p>The proxies in a <em>reference-list</em> are different from the proxies for a
+reference. The <em>reference-list</em> proxies target a specific service, do not
+have a <em>timeout</em>, and throw <em>ServiceUnavailableException</em> immediately
+if their service becomes unavailable.</p>
+<p>The following example shows a reference-list that returns a list of service
+objects (proxies).  This is the default value for the <em>member-type</em>
+attribute</p>
+<div class="codehilite"><pre>   <span class="o">&lt;</span><span class="n">reference</span><span class="o">-</span><span class="n">list</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;accountRefs&quot;</span> <span class="n">member</span><span class="o">-</span><span class="n">type</span><span class="o">=</span><span class="s">&quot;service-object&quot;</span>
+    <span class="n">interface</span><span class="o">=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span> <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>The following shows an example of a reference-list that returns a list of
+ServiceReferences:</p>
+<div class="codehilite"><pre>   <span class="o">&lt;</span><span class="n">reference</span><span class="o">-</span><span class="n">list</span> <span class="n">id</span><span class="o">=</span><span class="s">&quot;accountRefs&quot;</span> <span class="n">member</span><span class="o">-</span><span class="n">type</span><span class="o">=</span><span class="s">&quot;service-reference&quot;</span>
+    <span class="n">interface</span><span class="o">=</span><span class="s">&quot;org.apache.aries.simple.Account&quot;</span> <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>Example showing mandatory or optional references (availability)</p>
+<p>Example showing use of filter</p>
+<p><a name="Blueprint-BeanProperties"></a></p>
+<h2 id="bean_properties_1">Bean Properties</h2>
+<p>Example showing use of bean properties</p>
+<p><a name="Blueprint-Scopes"></a></p>
+<h2 id="scopes">Scopes</h2>
+<p>Example showing singleton scope</p>
+<p>Example showing prototype scope for beans</p>
+<p>Example showing prototype scope for services</p>
+<p><a name="Blueprint-ObjectValues"></a></p>
+<h2 id="object_values">Object Values</h2>
+<p>Intro to Object Values</p>
+<p>Examples showing the use of the various different object value types - ref,
+map, props collection (list, array, set).</p>
+<p><a name="Blueprint-Lifecycle"></a></p>
+<h2 id="lifecycle">Lifecycle</h2>
+<p>Example showing use of init/destroy-method</p>
+<p><a name="Blueprint-LazyandEagerActiviation"></a></p>
+<h2 id="lazy_and_eager_activiation">Lazy and Eager Activiation</h2>
+<p>Example showing lazy activiation.</p>
+<p>Example showing eager activation.</p>
+<p><a name="Blueprint-Dynamism"></a></p>
+<h2 id="dynamism">Dynamism</h2>
+<p>Example showing service-listener</p>
+<p>Example showing reference-listener</p>
+<p><a name="Blueprint-TypeConverters"></a></p>
+<h2 id="type_converters">Type Converters</h2></div>
+            <!-- Content -->
+          </td>
+        </tr>
+      </table>
+   </td>
+   <td id="cell-2-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+   <td id="cell-3-0">&nbsp;</td>
+   <td id="cell-3-1">&nbsp;</td>
+   <td id="cell-3-2">
+     <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+         <a href="http://incubator.apache.org/aries/privacy-policy.html";>Privacy
+Policy</a> 
+       </div>
+       <!-- Footer -->
+     </div>
+   </td>
+   <td id="cell-3-3">&nbsp;</td>
+   <td id="cell-3-4">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-4-0" colspan="2">&nbsp;</td>
+    <td id="cell-4-1">&nbsp;</td>
+    <td id="cell-4-2" colspan="2">&nbsp;</td>
+  </tr>
+</table>
+</body>
+</html> 

Added: websites/staging/aries/trunk/content/blueprintannotation.html
URL: http://svn.apache.org/viewvc/websites/staging/aries/trunk/content/blueprintannotation.html?rev=780201&view=auto
==============================================================================
--- websites/staging/aries/trunk/content/blueprintannotation.html (added)
+++ websites/staging/aries/trunk/content/blueprintannotation.html Tue Dec  7 04:14:16 2010
@@ -0,0 +1,496 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+  <head>
+    <link type="text/css" rel="stylesheet"
+href="http://incubator.apache.org/aries/resources/site.css";></link>
+    <script src="http://incubator.apache.org/aries/resources/space.js";
+type="text/javascript"></script>
+<meta name="keywords" content="..."/>
+<meta name="description" content="..." />
+    <title>
+Apache Aries (incubating) -- $page.title
+    </title>
+  </head>
+<body onload="init()">
+
+<table width="100%" cellpadding="0" cellspacing="0">
+  <tr width="100%">
+    <td id="cell-0-0" colspan="2">&nbsp;</td>
+    <td id="cell-0-1">&nbsp;</td>
+    <td id="cell-0-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-1-0">&nbsp;</td>
+    <td id="cell-1-1">&nbsp;</td>
+    <td id="cell-1-2">
+      <div style="padding: 5px;">
+        <div id="banner">
+          <!-- Banner -->
+			<table border="0" cellpadding="0" cellspacing="0" width="100%">
+				<tr>
+					<td align="left" class="topbardiv" nowrap="">
+						<a href="http://incubator.apache.org/aries/" title="Apache Aries (incubating)"> <img border="0" src="http://incubator.apache.org/aries/images/Arieslogo_Horizontal.gif"> </a>
+					</td>
+					<td align="right" nowrap="">
+						<a href="http://www.apache.org/" title="The Apache Software Foundation"> <img border="0" src="http://incubator.apache.org/aries/images/apache-incubator-logo.png"> </a>
+      				</td>
+				</tr>
+			</table>
+          <!-- Banner -->
+        </div>
+      </div>
+      <div id="top-menu">
+        <table border="0" cellpadding="1" cellspacing="0" width="100%">
+          <tr>
+            <td>
+              <div align="left">
+                <!-- Breadcrumbs -->
+                <!-- Breadcrumbs -->
+              </div>
+            </td>
+            <td>
+              <div align="right">
+                <!-- Quicklinks -->
+					<DIV style="padding: 5px 5px 0px 25px;">
+						<FORM action="http://www.google.com/search" method="get" style="font-size: 10px;">
+						<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License</A> <A href="sitemap.html" title="SiteMap">Site Map</A> 
+						<INPUT name="ie" type="hidden" value="UTF-8"></INPUT>
+						<INPUT name="oe" type="hidden" value="UTF-8"></INPUT>
+						<INPUT maxlength="255" name="q" size="15" type="text" value></INPUT>
+						<INPUT name="btnG" type="submit" value="Search"></INPUT>
+						<INPUT name="domains" type="hidden" value="incubator.apache.org/aries"></INPUT>
+						<INPUT name="sitesearch" type="hidden" value="incubator.apache.org/aries"></INPUT>
+						</FORM>
+					</DIV>
+                <!-- Quicklinks -->
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </td>
+    <td id="cell-1-3">&nbsp;</td>
+    <td id="cell-1-4">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-2-0" colspan="2">&nbsp;</td>
+    <td id="cell-2-1">
+      <table>
+        <tr height="100%" valign="top">
+          <td height="100%">
+            <div id="wrapper-menu-page-right">
+              <div id="wrapper-menu-page-top">
+                <div id="wrapper-menu-page-bottom">
+                  <div id="menu-page">
+                    <!-- NavigationBar -->
+					<ul>
+<li />
+</ul>
+<h3 id="overviewoverviewhtml"><a href="overview.html">Overview</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="board_reportsboardreportshtml"><a href="boardreports.html">Board Reports</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="site_mapsitemaphtml"><a href="sitemap.html">Site Map</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="documentationdocumentationhtml"><a href="documentation.html">Documentation</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="programming_modelariesprogrammingmodelhtml"><a href="ariesprogrammingmodel.html">Programming Model</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="pointers_to_osgi_specspointerstoosgispecificationshtml"><a href="pointerstoosgispecifications.html">Pointers to OSGi specs</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="integrators_guideintegrators-guidehtml"><a href="integrators-guide.html">Integrators Guide</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="articlesarticleshtml"><a href="articles.html">Articles</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="slideshttpssvnapacheorgreposasfincubatorariesslides"><a href="https://svn.apache.org/repos/asf/incubator/aries/slides/">Slides</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="tutorialstutorialshtml"><a href="tutorials.html">Tutorials</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="downloadsdownloadshtml"><a href="downloads.html">Downloads</a></h3>
+<ul>
+<li />
+</ul>
+<h3 id="communitycommunityhtml"><a href="community.html">Community</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="getting_involvedgettinginvolvedhtml"><a href="gettinginvolved.html">Getting Involved</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="who_we_arepeoplehtml"><a href="people.html">Who we are</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="mailing_listsmailinglistshtml"><a href="mailinglists.html">Mailing lists</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="aries_group_bloghttpblogsapacheorgaries"><a href="http://blogs.apache.org/aries/">Aries Group Blog</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="developmentdevelopmenthtml"><a href="development.html">Development</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="source_control_httpssvnapacheorgreposasfincubatorarieshtml"><a href="https://svn.apache.org/repos/asf/incubator/aries/.html">Source Control </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="bug_trackinghttpsissuesapacheorgjirabrowsearieshtml"><a href="https://issues.apache.org/jira/browse/aries.html">Bug Tracking</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="building_aries_buildingarieshtml"><a href="buildingaries.html">Building Aries </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="releasing_aries_releasingarieshtml"><a href="releasingaries.html">Releasing Aries </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="osgi_compliance_tests_compliancetestinghtml"><a href="compliancetesting.html">OSGi Compliance Tests </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="build_systemhttphudsonzonesapacheorghudsonhtml"><a href="http://hudson.zones.apache.org/hudson/.html">Build System</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="web_site_maintenance_maintainingthewebpageshtml"><a href="maintainingthewebpages.html">Web Site Maintenance </a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="modulesmoduleshtml"><a href="modules.html">Modules</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="samplessampleshtml"><a href="samples.html">Samples</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="blueprintblueprinthtml"><a href="blueprint.html">Blueprint</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="jndijndiprojecthtml"><a href="jndiproject.html">JNDI</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="jpajpaprojecthtml"><a href="jpaproject.html">JPA</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="applicationsapplicationshtml"><a href="applications.html">Applications</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="transactionstransactionsprojecthtml"><a href="transactionsproject.html">Transactions</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="eba_maven_plugin_-ebamavenpluginprojecthtml"><a href="-ebamavenpluginproject.html">EBA Maven Plugin </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="spi_flyspi-flyhtml"><a href="spi-fly.html">SPI Fly</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="sponsorshipsponsorshiphtml"><a href="sponsorship.html">Sponsorship</a></h3> 
+                    <!-- NavigationBar -->
+                  </div>
+                </div>
+              </div>
+            </div>
+          </td>
+          <td height="100%" width="100%">
+            <!-- Content -->
+            <div class="wiki-content"><p><a name="BlueprintAnnotation-Introduction"></a></p>
+<h1 id="introduction">Introduction</h1>
+<p>Blueprint annotation is being prototyped in Apache Aries in
+trunk/blueprint.   The blueprint annotation service is an optional service
+to the blueprint core and should not affect the blueprint core if
+annotation supported is not required.   If the blueprint annotation service
+is available, the bundle contains no blueprint definition XML and the
+bundle contains the manifest header <em>Bundle-Blueprint-Annotation</em> with
+the value set to true, the blueprint annotation service will attempt to
+scan the bundle for blueprint annotations, such as @Blueprint, @Bean,
+@Service, @Reference, @ReferenceList, etc.  The blueprint annotation api is
+available in trunk/blueprint/blueprint-annotation-api module, while the
+blueprint implementation is available in
+trunk/blueprint/blueprint-annotatiom-impl module.  A blueprint annotated
+sample is also provided in trunk/blueprint/blueprint-sample-annotation.</p>
+<p><a name="BlueprintAnnotation-OverviewofAvailableblueprintAnnotations"></a></p>
+<h2 id="overview_of_available_blueprint_annotations">Overview of Available blueprint Annotations</h2>
+<p><a name="BlueprintAnnotation-@InjectAnnotation"></a></p>
+<h3 id="inject_annotation">@Inject Annotation</h3>
+<p>@Inject annotation can be used to inject fields or methods.</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;bar&quot;</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">Bar</span> <span class="p">{</span>
+
+    <span class="nv">@Inject</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;Hello FooBar&quot;</span><span class="p">)</span>
+    <span class="n">private</span> <span class="n">String</span> <span class="n">value</span><span class="p">;</span>
+
+    <span class="nv">@Inject</span><span class="p">(</span><span class="nb">ref</span><span class="o">=</span><span class="s">&quot;blueprintBundleContext&quot;</span><span class="p">)</span>
+    <span class="n">private</span> <span class="n">BundleContext</span> <span class="n">context</span><span class="p">;</span>
+    <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p><a name="BlueprintAnnotation-@BeanAnnotation"></a></p>
+<h3 id="bean_annotation">@Bean Annotation</h3>
+<p>You can annotate a bean using @Bean annotation.  The bean id is currently
+required, even tho it is possible we may want to the annotation service to
+auto generate one in the future.  Optionally, you can also specify
+activation, dependsOn, description, scope, factoryRef, factoryMethod and
+args of the bean.</p>
+<p>* Example of using args property for the @Bean annotation.</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;accountOne&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="nv">@Arg</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;1&quot;</span><span class="p">))</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">Account</span> <span class="p">{</span>
+
+    <span class="n">private</span> <span class="n">long</span> <span class="n">accountNumber</span><span class="p">;</span>
+
+    <span class="n">public</span> <span class="n">Account</span><span class="p">(</span><span class="n">long</span> <span class="n">number</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">accountNumber</span> <span class="o">=</span> <span class="n">number</span><span class="p">;</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>* Example of using factoryMethod and args properties for the @Bean
+annotation</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;accountTwo&quot;</span><span class="p">,</span>
+      <span class="n">factoryMethod</span><span class="o">=</span><span class="s">&quot;createAccount&quot;</span><span class="p">,</span>
+      <span class="n">args</span> <span class="o">=</span> <span class="nv">@Arg</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;2&quot;</span><span class="p">))</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">StaticAccountFactory</span> <span class="p">{</span>
+
+    <span class="n">public</span> <span class="n">static</span> <span class="n">Account</span> <span class="n">createAccount</span><span class="p">(</span><span class="n">long</span> <span class="n">number</span><span class="p">)</span> <span class="p">{</span>
+    <span class="k">return</span> <span class="k">new</span> <span class="n">Account</span><span class="p">(</span><span class="n">number</span><span class="p">);</span>
+     <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>* Example of using factoryRef, factoryMethod, and args properties for the
+@Bean annotation</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;accountThree&quot;</span><span class="p">,</span>
+      <span class="n">factoryRef</span><span class="o">=</span><span class="s">&quot;accountFactory&quot;</span><span class="p">,</span>
+      <span class="n">factoryMethod</span><span class="o">=</span><span class="s">&quot;createAccount&quot;</span><span class="p">,</span>
+      <span class="n">args</span><span class="o">=</span><span class="nv">@Arg</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s">&quot;3&quot;</span><span class="p">))</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">NewAccount</span> <span class="p">{</span>
+
+    <span class="n">private</span> <span class="n">long</span> <span class="n">accountNumber</span><span class="p">;</span>
+
+    <span class="n">public</span> <span class="n">NewAccount</span><span class="p">(</span><span class="n">long</span> <span class="n">number</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">accountNumber</span> <span class="o">=</span> <span class="n">number</span><span class="p">;</span>
+    <span class="p">}</span>
+    <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p><a name="BlueprintAnnotation-@Service,@RegistrationListener,@Register,@UnregisterAnnotations"></a></p>
+<h3 id="service_registrationlistener_register_unregister_annotations">@Service, @RegistrationListener, @Register, @Unregister Annotations</h3>
+<p>If you want to register a bean as a service, you can use @Service
+annotation to do so.  You can specify ranking, autoExport, interfaces,
+serviceProperties and registrationListeners for the service.</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;foo&quot;</span><span class="p">)</span>
+<span class="nv">@Service</span><span class="p">(</span><span class="n">autoExport</span><span class="o">=</span><span class="s">&quot;all-classes&quot;</span><span class="p">,</span>
+    <span class="n">serviceProperties</span> <span class="o">=</span>
+<span class="nv">@ServiceProperty</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s">&quot;blueprint.annotation.sample&quot;</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="s">&quot;true&quot;</span><span class="p">),</span>
+    <span class="n">registerationListeners</span> <span class="o">=</span>
+<span class="nv">@RegistrationListener</span><span class="p">(</span><span class="nb">ref</span><span class="o">=</span><span class="s">&quot;fooRegistrationListener&quot;</span><span class="p">),</span> 
+    <span class="n">ranking</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">Foo</span> <span class="n">implements</span> <span class="n">Serializable</span> <span class="p">{</span>
+   <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>To annotation a class as registration listener, you can use the
+@RegistrationListener annotation.  @Register can be used to annotate the
+register-method for the registration listener and @Unregister annotation
+can be used on the unregister-method for the registration listener.</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;fooRegistrationListener&quot;</span><span class="p">)</span>
+<span class="nv">@RegistrationListener</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">FooRegistrationListener</span> <span class="p">{</span>
+
+    <span class="nv">@Register</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">serviceRegistered</span><span class="p">(</span><span class="n">Serializable</span> <span class="n">foo</span><span class="p">,</span> <span class="n">Map</span> <span class="n">props</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;Service registration notification: &quot;</span> <span class="o">+</span> <span class="n">foo</span> <span class="o">+</span> <span class="s">&quot;</span>
+<span class="s">    &quot;</span> <span class="o">+</span> <span class="n">props</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="nv">@Unregister</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">serviceUnregistered</span><span class="p">(</span><span class="n">Foo</span> <span class="n">foo</span><span class="p">,</span> <span class="n">Map</span> <span class="n">props</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;Service unregistration notification: &quot;</span> <span class="o">+</span> <span class="n">foo</span> <span class="o">+</span>
+    <span class="s">&quot; &quot;</span> <span class="o">+</span> <span class="n">props</span><span class="p">);</span>
+    <span class="p">}</span>
+
+<span class="p">}</span>
+</pre></div>
+
+
+<p><a name="BlueprintAnnotation-@Reference,@ReferenceList,@ReferenceListenerAnnotations"></a></p>
+<h3 id="reference_referencelist_referencelistener_annotations">@Reference, @ReferenceList, @ReferenceListener Annotations</h3>
+<p>For a bean that you want to act as a ReferenceListener, you can use
+@ReferenceListener to annotate the bean class. <br />
+</p>
+<p>For the service that you want to inject the reference, you can use the
+@Inject and @Reference annotation, with the id, serviceInterface, timeout
+and referenceListeners properties specified for the reference. <br />
+</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;bindingListener&quot;</span><span class="p">)</span>
+<span class="nv">@ReferenceListener</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">BindingListener</span> <span class="p">{</span>
+
+    <span class="nv">@Inject</span> <span class="nv">@Reference</span> <span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;ref2&quot;</span><span class="p">,</span> 
+        <span class="n">serviceInterface</span> <span class="o">=</span> <span class="n">InterfaceA</span><span class="o">.</span><span class="n">class</span><span class="p">,</span>
+        <span class="n">timeout</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span>
+<span class="n">referenceListeners</span><span class="o">=</span><span class="nv">@ReferenceListener</span><span class="p">(</span><span class="nb">ref</span><span class="o">=</span><span class="s">&quot;bindingListener&quot;</span><span class="p">))</span>
+    <span class="n">private</span> <span class="n">InterfaceA</span> <span class="n">a</span><span class="p">;</span>
+    <span class="o">...</span>
+    <span class="nv">@Init</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">init</span><span class="p">()</span> <span class="p">{</span>
+    <span class="p">}</span>
+
+    <span class="nv">@Bind</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="nb">bind</span><span class="p">(</span><span class="n">InterfaceA</span> <span class="n">a</span><span class="p">,</span> <span class="n">Map</span> <span class="n">props</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="n">a</span><span class="p">;</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">props</span> <span class="o">=</span> <span class="n">props</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="nv">@Unbind</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">unbind</span><span class="p">(</span><span class="n">InterfaceA</span> <span class="n">a</span><span class="p">,</span> <span class="n">Map</span> <span class="n">props</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
+    <span class="n">this</span><span class="o">.</span><span class="n">props</span> <span class="o">=</span> <span class="n">null</span><span class="p">;</span>
+    <span class="p">}</span>
+
+<span class="p">}</span>
+</pre></div>
+
+
+<p>@ReferenceList is very similar as @Reference, except that the timeout
+property is not supported in @ReferenceList, while the memberType property
+is supported in @ReferenceList.  This is same as the blueprint XML schema.</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;listBindingListener&quot;</span><span class="p">)</span>
+<span class="nv">@ReferenceListener</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">ListBindingListener</span> <span class="p">{</span>
+
+    <span class="nv">@Inject</span> <span class="nv">@ReferenceList</span> <span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;ref-list&quot;</span><span class="p">,</span> 
+        <span class="n">serviceInterface</span> <span class="o">=</span> <span class="n">InterfaceA</span><span class="o">.</span><span class="n">class</span><span class="p">,</span>
+
+<span class="n">referenceListeners</span><span class="o">=</span><span class="nv">@ReferenceListener</span><span class="p">(</span><span class="nb">ref</span><span class="o">=</span><span class="s">&quot;listBindingListener&quot;</span><span class="p">))</span>
+    <span class="n">private</span> <span class="n">InterfaceA</span> <span class="n">a</span><span class="p">;</span>
+    <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p><a name="BlueprintAnnotation-@Blueprintannotation"></a></p>
+<h3 id="blueprint_annotation">@Blueprint annotation</h3>
+<p>@Blueprint annotation can be used on any class to annotate the global
+property of the blueprint bundle, such as defaultActivation,
+defaultTimeout, defaultAvailability.</p>
+<div class="codehilite"><pre><span class="nv">@Blueprint</span><span class="p">(</span><span class="n">defaultActivation</span><span class="o">=</span><span class="s">&quot;eager&quot;</span><span class="p">,</span> <span class="n">defaultTimeout</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span>
+<span class="n">defaultAvailability</span><span class="o">=</span><span class="s">&quot;optional&quot;</span><span class="p">)</span>
+<span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;bar&quot;</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">Bar</span> <span class="p">{</span>
+    <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p><a name="BlueprintAnnotation-Typeconverters"></a></p>
+<h3 id="type_converters">Type converters</h3>
+<p>If type converters are desired, you can use the @Bean annotation for it. 
+The blueprint annotation service will recognize it as a type converter if
+it implements the <em>org.osgi.service.blueprint.container.Converter</em>
+interface</p>
+<div class="codehilite"><pre><span class="nv">@Bean</span><span class="p">(</span><span class="n">id</span><span class="o">=</span><span class="s">&quot;converter1&quot;</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">DateTypeConverter</span> <span class="n">implements</span> <span class="n">Converter</span> <span class="p">{</span>
+
+    <span class="nv">@Inject</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&quot;format&quot;</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="s">&quot;yyyy.MM.dd&quot;</span><span class="p">)</span>
+    <span class="n">DateFormat</span> <span class="n">dateFormat</span><span class="p">;</span>
+    <span class="o">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p><a name="BlueprintAnnotation-Limitation"></a></p>
+<h3 id="limitation">Limitation</h3>
+<p>Blueprint Annotation is still prototype work and currently only runtime
+annotation scanning is supported.  While it provides some basic useful
+functions, there are still many things that you cannot do using annotation,
+such as inject a list with values, inject inline beans, etc.</p></div>
+            <!-- Content -->
+          </td>
+        </tr>
+      </table>
+   </td>
+   <td id="cell-2-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+   <td id="cell-3-0">&nbsp;</td>
+   <td id="cell-3-1">&nbsp;</td>
+   <td id="cell-3-2">
+     <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+         <a href="http://incubator.apache.org/aries/privacy-policy.html";>Privacy
+Policy</a> 
+       </div>
+       <!-- Footer -->
+     </div>
+   </td>
+   <td id="cell-3-3">&nbsp;</td>
+   <td id="cell-3-4">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-4-0" colspan="2">&nbsp;</td>
+    <td id="cell-4-1">&nbsp;</td>
+    <td id="cell-4-2" colspan="2">&nbsp;</td>
+  </tr>
+</table>
+</body>
+</html> 

Added: websites/staging/aries/trunk/content/blueprinthelloworldtutorial.html
URL: http://svn.apache.org/viewvc/websites/staging/aries/trunk/content/blueprinthelloworldtutorial.html?rev=780201&view=auto
==============================================================================
--- websites/staging/aries/trunk/content/blueprinthelloworldtutorial.html (added)
+++ websites/staging/aries/trunk/content/blueprinthelloworldtutorial.html Tue Dec  7 04:14:16 2010
@@ -0,0 +1,483 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+  <head>
+    <link type="text/css" rel="stylesheet"
+href="http://incubator.apache.org/aries/resources/site.css";></link>
+    <script src="http://incubator.apache.org/aries/resources/space.js";
+type="text/javascript"></script>
+<meta name="keywords" content="..."/>
+<meta name="description" content="..." />
+    <title>
+Apache Aries (incubating) -- $page.title
+    </title>
+  </head>
+<body onload="init()">
+
+<table width="100%" cellpadding="0" cellspacing="0">
+  <tr width="100%">
+    <td id="cell-0-0" colspan="2">&nbsp;</td>
+    <td id="cell-0-1">&nbsp;</td>
+    <td id="cell-0-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-1-0">&nbsp;</td>
+    <td id="cell-1-1">&nbsp;</td>
+    <td id="cell-1-2">
+      <div style="padding: 5px;">
+        <div id="banner">
+          <!-- Banner -->
+			<table border="0" cellpadding="0" cellspacing="0" width="100%">
+				<tr>
+					<td align="left" class="topbardiv" nowrap="">
+						<a href="http://incubator.apache.org/aries/" title="Apache Aries (incubating)"> <img border="0" src="http://incubator.apache.org/aries/images/Arieslogo_Horizontal.gif"> </a>
+					</td>
+					<td align="right" nowrap="">
+						<a href="http://www.apache.org/" title="The Apache Software Foundation"> <img border="0" src="http://incubator.apache.org/aries/images/apache-incubator-logo.png"> </a>
+      				</td>
+				</tr>
+			</table>
+          <!-- Banner -->
+        </div>
+      </div>
+      <div id="top-menu">
+        <table border="0" cellpadding="1" cellspacing="0" width="100%">
+          <tr>
+            <td>
+              <div align="left">
+                <!-- Breadcrumbs -->
+                <!-- Breadcrumbs -->
+              </div>
+            </td>
+            <td>
+              <div align="right">
+                <!-- Quicklinks -->
+					<DIV style="padding: 5px 5px 0px 25px;">
+						<FORM action="http://www.google.com/search" method="get" style="font-size: 10px;">
+						<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License</A> <A href="sitemap.html" title="SiteMap">Site Map</A> 
+						<INPUT name="ie" type="hidden" value="UTF-8"></INPUT>
+						<INPUT name="oe" type="hidden" value="UTF-8"></INPUT>
+						<INPUT maxlength="255" name="q" size="15" type="text" value></INPUT>
+						<INPUT name="btnG" type="submit" value="Search"></INPUT>
+						<INPUT name="domains" type="hidden" value="incubator.apache.org/aries"></INPUT>
+						<INPUT name="sitesearch" type="hidden" value="incubator.apache.org/aries"></INPUT>
+						</FORM>
+					</DIV>
+                <!-- Quicklinks -->
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </td>
+    <td id="cell-1-3">&nbsp;</td>
+    <td id="cell-1-4">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-2-0" colspan="2">&nbsp;</td>
+    <td id="cell-2-1">
+      <table>
+        <tr height="100%" valign="top">
+          <td height="100%">
+            <div id="wrapper-menu-page-right">
+              <div id="wrapper-menu-page-top">
+                <div id="wrapper-menu-page-bottom">
+                  <div id="menu-page">
+                    <!-- NavigationBar -->
+					<ul>
+<li />
+</ul>
+<h3 id="overviewoverviewhtml"><a href="overview.html">Overview</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="board_reportsboardreportshtml"><a href="boardreports.html">Board Reports</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="site_mapsitemaphtml"><a href="sitemap.html">Site Map</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="documentationdocumentationhtml"><a href="documentation.html">Documentation</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="programming_modelariesprogrammingmodelhtml"><a href="ariesprogrammingmodel.html">Programming Model</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="pointers_to_osgi_specspointerstoosgispecificationshtml"><a href="pointerstoosgispecifications.html">Pointers to OSGi specs</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="integrators_guideintegrators-guidehtml"><a href="integrators-guide.html">Integrators Guide</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="articlesarticleshtml"><a href="articles.html">Articles</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="slideshttpssvnapacheorgreposasfincubatorariesslides"><a href="https://svn.apache.org/repos/asf/incubator/aries/slides/">Slides</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="tutorialstutorialshtml"><a href="tutorials.html">Tutorials</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="downloadsdownloadshtml"><a href="downloads.html">Downloads</a></h3>
+<ul>
+<li />
+</ul>
+<h3 id="communitycommunityhtml"><a href="community.html">Community</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="getting_involvedgettinginvolvedhtml"><a href="gettinginvolved.html">Getting Involved</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="who_we_arepeoplehtml"><a href="people.html">Who we are</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="mailing_listsmailinglistshtml"><a href="mailinglists.html">Mailing lists</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="aries_group_bloghttpblogsapacheorgaries"><a href="http://blogs.apache.org/aries/">Aries Group Blog</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="developmentdevelopmenthtml"><a href="development.html">Development</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="source_control_httpssvnapacheorgreposasfincubatorarieshtml"><a href="https://svn.apache.org/repos/asf/incubator/aries/.html">Source Control </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="bug_trackinghttpsissuesapacheorgjirabrowsearieshtml"><a href="https://issues.apache.org/jira/browse/aries.html">Bug Tracking</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="building_aries_buildingarieshtml"><a href="buildingaries.html">Building Aries </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="releasing_aries_releasingarieshtml"><a href="releasingaries.html">Releasing Aries </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="osgi_compliance_tests_compliancetestinghtml"><a href="compliancetesting.html">OSGi Compliance Tests </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="build_systemhttphudsonzonesapacheorghudsonhtml"><a href="http://hudson.zones.apache.org/hudson/.html">Build System</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="web_site_maintenance_maintainingthewebpageshtml"><a href="maintainingthewebpages.html">Web Site Maintenance </a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="modulesmoduleshtml"><a href="modules.html">Modules</a></h3>
+<ul>
+<li />
+</ul>
+<h4 id="samplessampleshtml"><a href="samples.html">Samples</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="blueprintblueprinthtml"><a href="blueprint.html">Blueprint</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="jndijndiprojecthtml"><a href="jndiproject.html">JNDI</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="jpajpaprojecthtml"><a href="jpaproject.html">JPA</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="applicationsapplicationshtml"><a href="applications.html">Applications</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="transactionstransactionsprojecthtml"><a href="transactionsproject.html">Transactions</a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="eba_maven_plugin_-ebamavenpluginprojecthtml"><a href="-ebamavenpluginproject.html">EBA Maven Plugin </a></h4>
+<ul>
+<li />
+</ul>
+<h4 id="spi_flyspi-flyhtml"><a href="spi-fly.html">SPI Fly</a></h4>
+<ul>
+<li />
+</ul>
+<h3 id="sponsorshipsponsorshiphtml"><a href="sponsorship.html">Sponsorship</a></h3> 
+                    <!-- NavigationBar -->
+                  </div>
+                </div>
+              </div>
+            </div>
+          </td>
+          <td height="100%" width="100%">
+            <!-- Content -->
+            <div class="wiki-content"><p><a name="BlueprintHelloWorldTutorial-Blueprinttutorial"></a></p>
+<h1 id="blueprint_tutorial">Blueprint tutorial</h1>
+<p><a name="BlueprintHelloWorldTutorial-Introduction"></a></p>
+<h3 id="introduction">Introduction</h3>
+<p>This tutorial is designed for people who are starting to use the Apache
+Aries Blueprint implementation. After you have worked through the tutorial
+you will 
+- be able to run a very simple piece of code in the Aries Blueprint container 
+- understand bean, service and reference definitions in Blueprint</p>
+<p>The tutorial assumes a basic working knowledge of Java development, Eclipse
+and some understanding of OSGi.</p>
+<p>In order to work through the tutorial you will need to do checkout and
+build copy of Aries, the instructions are <a href="http://incubator.apache.org/aries/building-aries.html">here</a>
+. This tutorial assumes that you have built Aries and imported the
+samples/helloworld projects into Eclipse. </p>
+<p><a name="BlueprintHelloWorldTutorial-TheAPI,ServerandClientprojects"></a></p>
+<h3 id="the_api_server_and_client_projects">The API, Server and Client projects</h3>
+<p>When you have checked out and built the Aries code your workspace will
+contain the four projects highlighted in the picture below. This is a
+screen shot taken from my Eclipse package explorer: <br>
+<br>
+<img alt="hw1" src="HW1.png" />
+<br>
+<br>
+The project called org.apache.aries.samples.helloworld.blueprint.assembly
+contains no Java code and is just used to pull together the minimal OSGi
+platform that is needed to run the sample.
+Expanding the org.apache.aries.samples.helloworld.blueprint.api project
+shows this:
+<br>
+<br>
+<img alt="hh2" src="HW2.png" />
+<br>
+<br>
+There are two interesting features of this project, the
+HelloWorldService.java interface and empty META-INF directory.
+HelloWorldService.java is the interface for the Helloworld service. It is
+good OSGi practice to keep interfaces and implementation classes in
+separate bundles. This allows implementations to be replaced independently
+of their interfaces. The META-INF directory is where you would expect to
+see a file called MANIFEST.MF. You don't see it because we are using a
+Maven plugin (look at the pom.xml) to generate the bundle manifest
+automatically.</p>
+<p>Expanding the org.apache.aries.samples.helloworld.blueprint.server project
+shows 
+<br>
+<br>
+<img alt="hw3" src="HW3.png" />
+<br>
+<br>
+There are again two interesting files. HelloWorldServiceImpl.java is an
+implementation of the HelloWorldService interface in the first
+blueprint-helloworld-api project. The file config.xml is the Blueprint
+configuration for this package. </p>
+<p>The org.apache.aries.samples.helloworld.blueprint.client project looks like
+this
+<br>
+<br>
+<img alt="hw4" src="HW4.png" />
+<br>
+<br>
+The client implementation is in HelloWorldClient.java. The file config.xml
+contains the Blueprint for the client.</p>
+<p><a name="BlueprintHelloWorldTutorial-TheBlueprintXML"></a></p>
+<h3 id="the_blueprint_xml">The Blueprint XML</h3>
+<p>Blueprint xml files contain all the information that the Blueprint runtime
+needs to internally wire a bundle's components. They also contain the
+information that the Blueprint runtime needs to register and locate
+services in the OSGi service registry. This allows for service-based
+interactions between bundles. </p>
+<p>This is a view of what the xml in the two config.xml files is describing:
+<br>
+<br>
+<img alt="hw5" src="BPTutorial5F.png" />
+<br>
+<br></p>
+<p>The client configuration file has one bean definition which names the Java
+class that it requires and gives the name of the method that will be run
+when the bean has been initialised. The bean definition also describes a
+property, helloWorldService, which points (see the arrow) to the reference
+definition. This is telling Blueprint that the bean (helloclient) needs the
+container to supply a service matched by the 'helloservice' reference,
+which in turns specifies the interface to be implemented by that service.
+<br>
+<br>
+<img alt="hw6" src="BPTutorial6F.png" />
+<br>
+<br></p>
+<p>The server configuration file is similar - with one bean definition which
+points to the Java class that implements HelloWorldService. The second
+element in this file is the service definition. This registers a service
+under the HelloWorldService interface, implemented by the 'helloservice'
+bean. 
+<br>
+<br>
+<img alt="hw7" src="BPTutorial7F.png" />
+<br>
+<br></p>
+<p><a name="BlueprintHelloWorldTutorial-TheJavaclasses"></a></p>
+<h3 id="the_java_classes">The Java classes</h3>
+<p>Both the Java classes are very simple, there are just a couple of minor
+points to make about each one. The HelloWorldClient class looks like
+this:
+<br>
+<br>
+<img alt="hw8" src="BPTutorial8F.png" />
+<br>
+<br></p>
+<ol>
+<li>The setHelloWorldService() method will be called by the Blueprint
+container in order to inject an object implementing the HelloWorldService
+interface. </li>
+<li>The startUp() method will be run when the bundle is started: remember
+that this was specified in the Blueprint. This method executes a hello()
+method which must be supplied by an implementation of HelloWorldService.
+The startUp() method in this case will only be run after dependencies have
+been injected. This is the default Blueprint behaviour.</li>
+</ol>
+<p>The HelloWorldServiceImpl class is even simpler. It has two
+methods:
+<br>
+<br>
+<img alt="hw9" src="BPTutorial9F.png" />
+<br>
+<br></p>
+<ol>
+<li>A startUp() method which writes a message to say that the bundle is being
+started </li>
+<li>A hello() method which writes a 'hello' message</li>
+</ol>
+<p><a name="BlueprintHelloWorldTutorial-Runningthecode"></a></p>
+<h3 id="running_the_code">Running the code</h3>
+<p>The code can be run on an Equinox (or Felix) framework. The
+org.apache.aries.samples.helloworld.blueprint.assembly package assembles an
+Equinox based platform that contains all of the OSGi bundles you need. To
+start it up go to the target directory in 
+org.apache.aries.samples.helloworld.blueprint.assembly, and from command
+line, type:</p>
+<div class="codehilite"><pre><span class="n">java</span> <span class="o">-</span><span class="n">jar</span> <span class="n">osgi</span><span class="o">-</span><span class="mi">3</span><span class="o">.</span><span class="mi">5</span><span class="o">.</span><span class="mi">0</span><span class="o">.</span><span class="n">v20090520</span><span class="o">.</span><span class="n">jar</span> <span class="o">-</span><span class="n">console</span>
+</pre></div>
+
+
+<p>You will see some messages, after which you should get the 'osgi&gt;' prompt;
+sometimes you will need to press return to see it. At the prompt, type 'ss'
+to see the status of the bundles:
+<br>
+<br>
+<img alt="hw10" src="BPTutorial10.png" />
+<br>
+<br>
+Next, start the Blueprint container bundle by typing 'start 5' at the osgi
+prompt.  You will see many debug messages in the code, this is because the
+target/configuration/config.ini specifies the message level to be DEBUG, if
+there are too many messages you can change this to 'INFO'. The debug
+messages are quite interesting to look through in themselves, but a little
+beyond the scope of this tutorial. The last debug message should indicate
+that a Blueprint container is running in state 'created'. After that, start
+the blueprint-helloworld-api in the same way by typing 'start 6' at the
+prompt.</p>
+<p>The next step is to  start the blueprint-helloworld-server bundle. In
+amongst the DEBUG messages you should see the single line of output from
+the startUp() method if the HelloWorldServiceImpl class:</p>
+<div class="codehilite"><pre><span class="o">======&gt;&gt;&gt;</span> <span class="n">Starting</span> <span class="n">HelloWorld</span> <span class="n">Server</span>
+</pre></div>
+
+
+<p>At this point it is possible to see if the HelloWorldService is registered,
+like this:</p>
+<div class="codehilite"><pre><span class="n">osgi</span><span class="o">&gt;</span> <span class="n">services</span> <span class="p">(</span><span class="n">objectClass</span><span class="o">=</span><span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">aries</span><span class="o">.</span><span class="n">samples</span><span class="o">.</span><span class="n">blueprint</span><span class="o">.</span><span class="n">helloworld</span><span class="o">.</span><span class="n">api</span><span class="o">.</span><span class="n">HelloWorldService</span><span class="p">)</span>
+</pre></div>
+
+
+<p>running this command will tell you that a service is registered but that
+nothing is using it.</p>
+<p>Finally, start the blueprint-helloworld-client bundle. If things have gone
+according to plan you should see a sequence of 3 messages from the
+startUp() method, the second message will be a 'hello' from
+HelloWorldService:</p>
+<div class="codehilite"><pre><span class="o">========&gt;&gt;&gt;&gt;</span><span class="n">Client</span> <span class="n">HelloWorld:</span> <span class="n">About</span> <span class="n">to</span> <span class="n">execute</span> <span class="n">a</span> <span class="n">method</span> <span class="n">from</span> <span class="n">the</span> <span class="n">Hello</span> <span class="n">World</span> <span class="n">server</span>
+<span class="o">======&gt;&gt;&gt;</span> <span class="n">A</span> <span class="n">message</span> <span class="n">from</span> <span class="n">the</span> <span class="n">server:</span> <span class="n">Hello</span> <span class="n">World</span><span class="o">!</span>
+<span class="o">========&gt;&gt;&gt;&gt;</span><span class="n">Client</span> <span class="n">HelloWorld:</span> <span class="o">...</span> <span class="k">if</span> <span class="n">you</span> <span class="n">didn</span><span class="err">&#39;</span><span class="n">t</span> <span class="n">just</span> <span class="n">see</span> <span class="n">a</span> <span class="n">Hello</span> <span class="n">World</span> <span class="n">message</span> <span class="n">something</span> <span class="n">went</span> <span class="n">wrong</span>
+</pre></div>
+
+
+<p>If you re-run the services command above it will tell you that the
+blueprint-helloworldclient bundle is using the blueprint-helloworldservice.</p>
+<p>One interesting experiment is to start the blueprint-helloworldclient
+bundle before the blueprint-helloworldserver bunde. When you do this, you
+will see no output until the second bundle is started because the
+'helloclient' bean cannot be initialised until that point. If you wait more
+than five minutes by default, there will be a timeout and the client will
+not be initialised at all.</p>
+<p><a name="BlueprintHelloWorldTutorial-Summary"></a></p>
+<h3 id="summary">Summary</h3>
+<p>In the tutorial you have seen how to construct three simple Blueprint
+bundles. The client bundle depends directly on the api and indirectly on
+the server bundle. Blueprint takes care of registering a service from the
+server bundle so that the client bundle can use it. You will have some
+appreciation of the classes and XML that form a Blueprint application, and
+you have seen a simple example working. Of course, this tutorial barely
+touches on many of the features provided by the Aries Blueprint
+implementation. Anyone keen to explore the features of Blueprint should
+look at this <a href="http://www.ibm.com/developerworks/opensource/library/os-osgiblueprint/index.html">article</a>
+ and continue by reading the [OSGi specification|http://www.osgi.org/Download/Release4V42]
+ (see the 4.2 Compendium spec, section 121, "Blueprint Container
+Specification") and making modifications to the sample code.</p></div>
+            <!-- Content -->
+          </td>
+        </tr>
+      </table>
+   </td>
+   <td id="cell-2-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+   <td id="cell-3-0">&nbsp;</td>
+   <td id="cell-3-1">&nbsp;</td>
+   <td id="cell-3-2">
+     <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+         <a href="http://incubator.apache.org/aries/privacy-policy.html";>Privacy
+Policy</a> 
+       </div>
+       <!-- Footer -->
+     </div>
+   </td>
+   <td id="cell-3-3">&nbsp;</td>
+   <td id="cell-3-4">&nbsp;</td>
+  </tr>
+  <tr width="100%">
+    <td id="cell-4-0" colspan="2">&nbsp;</td>
+    <td id="cell-4-1">&nbsp;</td>
+    <td id="cell-4-2" colspan="2">&nbsp;</td>
+  </tr>
+</table>
+</body>
+</html> 



Mime
View raw message