<?xml version="1.0" encoding="UTF-8"?>

<xwikidoc>
<web>Main.Documentation</web>
<name>ALEonOSGi</name>
<language></language>
<defaultLanguage>en</defaultLanguage>
<translation>0</translation>
<parent>Main.Documentation</parent>
<creator>xwiki:XWiki.gabo_pedraza</creator>
<author>xwiki:XWiki.donsez</author>
<contentAuthor>xwiki:XWiki.donsez</contentAuthor>
<creationDate>1269527467000</creationDate>
<date>1286568447000</date>
<contentUpdateDate>1286568447000</contentUpdateDate>
<version>1.89</version>
<title>Aspire :: Deployment of Filtering And Collection Server on OSGi</title>
<template></template>
<attachment>
<filename>ltkjava-0.1.1.jar</filename>
<filesize>1420892</filesize>
<author>xwiki:XWiki.gabo_pedraza</author>
<date>1277458764000</date>
<version>1.1</version>
<comment></comment>
</attachment>
<attachment>
<filename>ALE-OSGi.png</filename>
<filesize>31036</filesize>
<author>xwiki:XWiki.gabo_pedraza</author>
<date>1276076174000</date>
<version>1.1</version>
<comment></comment>
</attachment>
<attachment>
<filename>wireadmin.jar</filename>
<filesize>24086</filesize>
<author>xwiki:XWiki.gabo_pedraza</author>
<date>1277464237000</date>
<version>1.1</version>
<comment></comment>
</attachment>
<attachment>
<filename>wireadmin-binder.jar</filename>
<filesize>68047</filesize>
<author>xwiki:XWiki.gabo_pedraza</author>
<date>1277464272000</date>
<version>1.1</version>
<comment></comment>
</attachment>
<attachment>
<filename>aleosgiarch.png</filename>
<filesize>221894</filesize>
<author>xwiki:XWiki.donsez</author>
<date>1278846906000</date>
<version>1.2</version>
<comment></comment>
</attachment>
<content>1 Aspire :: Deployment of Filtering And Collection Server on OSGi


----
#toc("" "" "true")
----

1.1 Introduction


Deployment of the Filtering And Collection Server on OSGi platform provides to the middleware two important properties:


* Modularity: Extensions to the F&amp;amp;C server as addition of new readers or sensors should be provided in a modular fashion. Using OSGi approach, new readers are developed without introduce their driver code in the same archive (war) used to package the ALE Server.
* Dynamicity: These new modules will be deployed (or undeployed) on the platform dynamically without stopping the applications that are currently in execution.


However, deployment on OSGi imposes some conditions on the F&amp;amp;C server provisioning. This document will explain how to deploy the Fosstrak ALE Server on OSGi platform. The document is organized as follows: first installation of OSGi platform is presented. Then, how the war archive is transformed in a compliant OSGi bundled is showed. Next, the installation of a reader driver is illustrated, follow by installation of a sensor driver. Finally, additional features installation is explained.


{image:aleosgiarch.png|width=784|height=445}

Figure : architecture of the ALEServer' OSGi profile ({attach:HiRes picture|file=aleosgiarch.png})

1.1 Transformation of ALE Server web application in an OSGi compliant bundle


This transformation consists only in the addition of a MANIFEST.MF file into the war archive. This manifest file must be OSGi compliant, indicating the bundle dependencies and capabilities and also other meta-data used by the OSGi platform. In OSGi profile, we have added the manifest file, also Sensor communication and JMX management features. In the project *aleserver-bundle* the specific files to support these features are found.

Instructions to build the F&amp;C server are [here&gt;http://wiki.aspire.ow2.org/xwiki/bin/view/Main.Documentation/Filtering%26Collection#HBuilding]

1.1 Deployment of F&amp;C Server on OSGI platform

1.1.1 Installation of an OSGi platform with web application support

First download an OSGi distribution such as [Apache Felix&gt;http://felix.apache.org] (current version is 2.0.1). Then, install [Pax Web&gt;http://wiki.ops4j.org/display/paxweb/Pax+Web] (implementation of OSGi Http Service) and their dependencies (current version is 0.7.2). Finally, install the [Pax Web Extender&gt;http://wiki.ops4j.org/display/paxweb/Pax+Web] (current version is 0.7.2) with provides a transparent (for JEE war archive) registration of servlets on the OSGi platform.


These steps can be performed easily using the [Pax Runner&gt;http://paxrunner.ops4j.org/space/Pax+Runner] tool (an intenet connection is required). Simply, download the Pax Runner, then in a console execute the command ~~ pax-run \-\-platform=felix \-\-dir=ale war config~~


This command install (and launch) the Felix platform into the directory ~~ale~~.  The last arguments indicate to Pax Runner which [profiles&gt;http://paxrunner.ops4j.org/display/paxrunner/Pax+Runner+profiles+list] it should install, war is the web support profile and config the configuration admin service.

In some windows system the command must be typed as ~~pax-run &amp;quot;\-\-platform=felix&amp;quot; &amp;quot;\-\-dir=ale&amp;quot; war config~~

1.1.1 Other necessary bundles

In order to support sensor extensions is necessary also to install the [Wire Admin&gt;http://svn.apache.org/viewvc/felix/trunk/wireadmin/] bundle (compiled version {attach:wireadmin.jar} ) and [Wire Admin Binder&gt;http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/readme.html?view=co] (compiled version {attach:wireadmin-binder.jar}) bundles.

Install the bundles using the associated command in your OSGi distribution. For Felix distribution use the next commands

~~install file:path/wireadmin.jar~~
~~install file:path/wireadmin-binder.jar~~

1.1.1 Instalation of F&amp;C server bundle

In Felix platform you can install the server bundle using the next command 

~~install file:path/aleserver-bundle.war~~


1.1 Installation of Readers' Drivers

Readers' Drivers are installed as bundles on the OSGi platform. Next readers' drivers have been included in the OSGi profile:

* [Simple Reader (an reader simulator)&gt;Main.Documentation.Bundles.SimpleReader]
* [ProximaRF Desktop USB reader&gt;Main.Documentation.Bundles.ProximaRFDesktopReader]
* [TagSys Medio Serial reader&gt;Main.Documentation.Bundles.TagSysMedioReader]
* [ACR 122 USB reader&gt;Main.Documentation.Bundles.ACR122Reader]
* [OneWire reader&gt;Main.Documentation.Bundles.OneWireReader]

Use the Felix command [install&gt;http://felix.apache.org/site/documentation.html] to deploy each reader bundle and its dependencies.

1.1 Installation of the temperature sensors


Two temperature sensors are provided in this distribution, At first,a fictive sensor that can be used for test purposes, and a Temper sensor that is the driver of an usb sensor temperature device. Require bundles are also provided (iPojo version 1.4.0).

Readers' bundles and sensors' bundles are shown in the next osgi console snapshot:

{image:ALE-OSGi.png}

1.1 Installation of other features bundles


The platform can be enriched using other bundles to add different features. By example, a bundle allowing administration of OSGi platform using the [Visual VM OSGi plugin&gt;http://membres-liglab.imag.fr/kiev.gama/dev/osgi/visualvm/] is provided.


1.1 All-in-one distribution

A distribution with all required bundles is available [here&gt;http://chaphe.free.fr/aspire/ale.zip]. Download the file and unzip it, then execute run.sh (or run.bat in Windows).


1.1 Misc
* [CiliaALE&gt;Main.Documentation.ALEinCilia] : a flexible and dynamically reconfigurable ALE Server for Android platforms (phones and tablets) 
</content>
<renderedcontent>&lt;h2 class="heading-1"&gt;&lt;span id="HAspire3A3ADeploymentofFilteringAndCollectionServeronOSGi"&gt;Aspire :: Deployment of Filtering And Collection Server on OSGi&lt;/span&gt;&lt;/h2&gt;&lt;p class="paragraph"/&gt;
&lt;hr class="line"/&gt;
            &lt;ul&gt;
          &lt;li&gt;&lt;a href="#HIntroduction"&gt;1 Introduction&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HTransformationofALEServerwebapplicationinanOSGicompliantbundle"&gt;2 Transformation of ALE Server web application in an OSGi compliant bundle&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HDeploymentofF26CServeronOSGIplatform"&gt;3 Deployment of F&amp;C Server on OSGI platform&lt;/a&gt; 
        &lt;ul&gt;
          &lt;li&gt;&lt;a href="#HInstallationofanOSGiplatformwithwebapplicationsupport"&gt;3.1 Installation of an OSGi platform with web application support&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HOthernecessarybundles"&gt;3.2 Other necessary bundles&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HInstalationofF26Cserverbundle"&gt;3.3 Instalation of F&amp;C server bundle&lt;/a&gt; 
        &lt;/ul&gt;
          &lt;li&gt;&lt;a href="#HInstallationofReaders27Drivers"&gt;4 Installation of Readers' Drivers&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HInstallationofthetemperaturesensors"&gt;5 Installation of the temperature sensors&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HInstallationofotherfeaturesbundles"&gt;6 Installation of other features bundles&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HAllinonedistribution"&gt;7 All-in-one distribution&lt;/a&gt; 
      &lt;li&gt;&lt;a href="#HMisc"&gt;8 Misc&lt;/a&gt; 
      &lt;/ul&gt; &lt;hr class="line"/&gt;
&lt;h3 class="heading-1-1"&gt;&lt;span id="HIntroduction"&gt;1 Introduction&lt;/span&gt;&lt;/h3&gt;&lt;p class="paragraph"/&gt;
Deployment of the Filtering And Collection Server on OSGi platform provides to the middleware two important properties:
&lt;ul class="star"&gt;
&lt;li&gt;Modularity: Extensions to the F&amp;amp;C server as addition of new readers or sensors should be provided in a modular fashion. Using OSGi approach, new readers are developed without introduce their driver code in the same archive (war) used to package the ALE Server.&lt;/li&gt;
&lt;li&gt;Dynamicity: These new modules will be deployed (or undeployed) on the platform dynamically without stopping the applications that are currently in execution.&lt;/li&gt;
&lt;/ul&gt;However, deployment on OSGi imposes some conditions on the F&amp;amp;C server provisioning. This document will explain how to deploy the Fosstrak ALE Server on OSGi platform. The document is organized as follows: first installation of OSGi platform is presented. Then, how the war archive is transformed in a compliant OSGi bundled is showed. Next, the installation of a reader driver is illustrated, follow by installation of a sensor driver. Finally, additional features installation is explained.&lt;p class="paragraph"/&gt;
&lt;img src="/xwiki/bin/download/Main.Documentation/ALEonOSGi/aleosgiarch.png" height="445" width="784" alt="aleosgiarch.png" /&gt;&lt;p class="paragraph"/&gt;Figure : architecture of the ALEServer' OSGi profile (&lt;a href="/xwiki/bin/download/Main.Documentation/ALEonOSGi/aleosgiarch.png" /&gt;HiRes picture&lt;/a&gt;)
&lt;h3 class="heading-1-1"&gt;&lt;span id="HTransformationofALEServerwebapplicationinanOSGicompliantbundle"&gt;2 Transformation of ALE Server web application in an OSGi compliant bundle&lt;/span&gt;&lt;/h3&gt;&lt;p class="paragraph"/&gt;
This transformation consists only in the addition of a MANIFEST.MF file into the war archive. This manifest file must be OSGi compliant, indicating the bundle dependencies and capabilities and also other meta-data used by the OSGi platform. In OSGi profile, we have added the manifest file, also Sensor communication and JMX management features. In the project &lt;strong class="strong"&gt;aleserver-bundle&lt;/strong&gt; the specific files to support these features are found.&lt;p class="paragraph"/&gt;Instructions to build the F&amp;C server are &lt;span class="wikiexternallink"&gt;&lt;a href="http://wiki.aspire.ow2.org/xwiki/bin/view/Main.Documentation/Filtering%26Collection#HBuilding"&gt;&amp;#104;ere&lt;/a&gt;&lt;/span&gt;
&lt;h3 class="heading-1-1"&gt;&lt;span id="HDeploymentofF26CServeronOSGIplatform"&gt;3 Deployment of F&amp;C Server on OSGI platform&lt;/span&gt;&lt;/h3&gt; 
&lt;h4 class="heading-1-1-1"&gt;&lt;span id="HInstallationofanOSGiplatformwithwebapplicationsupport"&gt;3.1 Installation of an OSGi platform with web application support&lt;/span&gt;&lt;/h4&gt;&lt;p class="paragraph"/&gt;First download an OSGi distribution such as &lt;span class="wikiexternallink"&gt;&lt;a href="http://felix.apache.org"&gt;&amp;#65;pache Felix&lt;/a&gt;&lt;/span&gt; (current version is 2.0.1). Then, install &lt;span class="wikiexternallink"&gt;&lt;a href="http://wiki.ops4j.org/display/paxweb/Pax+Web"&gt;&amp;#80;ax Web&lt;/a&gt;&lt;/span&gt; (implementation of OSGi Http Service) and their dependencies (current version is 0.7.2). Finally, install the &lt;span class="wikiexternallink"&gt;&lt;a href="http://wiki.ops4j.org/display/paxweb/Pax+Web"&gt;&amp;#80;ax Web Extender&lt;/a&gt;&lt;/span&gt; (current version is 0.7.2) with provides a transparent (for JEE war archive) registration of servlets on the OSGi platform.&lt;p class="paragraph"/&gt;
These steps can be performed easily using the &lt;span class="wikiexternallink"&gt;&lt;a href="http://paxrunner.ops4j.org/space/Pax+Runner"&gt;&amp;#80;ax Runner&lt;/a&gt;&lt;/span&gt; tool (an intenet connection is required). Simply, download the Pax Runner, then in a console execute the command &lt;i class="italic"&gt; pax-run &amp;#45;&amp;#45;platform=felix &amp;#45;&amp;#45;dir=ale war config&lt;/i&gt;&lt;p class="paragraph"/&gt;
This command install (and launch) the Felix platform into the directory &lt;i class="italic"&gt;ale&lt;/i&gt;.  The last arguments indicate to Pax Runner which &lt;span class="wikiexternallink"&gt;&lt;a href="http://paxrunner.ops4j.org/display/paxrunner/Pax+Runner+profiles+list"&gt;&amp;#112;rofiles&lt;/a&gt;&lt;/span&gt; it should install, war is the web support profile and config the configuration admin service.&lt;p class="paragraph"/&gt;In some windows system the command must be typed as &lt;i class="italic"&gt;pax-run &amp;quot;&amp;#45;&amp;#45;platform=felix&amp;quot; &amp;quot;&amp;#45;&amp;#45;dir=ale&amp;quot; war config&lt;/i&gt;
&lt;h4 class="heading-1-1-1"&gt;&lt;span id="HOthernecessarybundles"&gt;3.2 Other necessary bundles&lt;/span&gt;&lt;/h4&gt;&lt;p class="paragraph"/&gt;In order to support sensor extensions is necessary also to install the &lt;span class="wikiexternallink"&gt;&lt;a href="http://svn.apache.org/viewvc/felix/trunk/wireadmin/"&gt;&amp;#87;ire Admin&lt;/a&gt;&lt;/span&gt; bundle (compiled version &lt;a href="/xwiki/bin/download/Main.Documentation/ALEonOSGi/wireadmin.jar" /&gt;&amp;#119;ireadmin.jar&lt;/a&gt; ) and &lt;span class="wikiexternallink"&gt;&lt;a href="http://svn.apache.org/viewvc/felix/sandbox/donsez/wireadminbinder/src/site/readme.html?view=co"&gt;&amp;#87;ire Admin Binder&lt;/a&gt;&lt;/span&gt; (compiled version &lt;a href="/xwiki/bin/download/Main.Documentation/ALEonOSGi/wireadmin-binder.jar" /&gt;&amp;#119;ireadmin-binder.jar&lt;/a&gt;) bundles.&lt;p class="paragraph"/&gt;Install the bundles using the associated command in your OSGi distribution. For Felix distribution use the next commands&lt;p class="paragraph"/&gt;&lt;i class="italic"&gt;install file:path/wireadmin.jar&lt;/i&gt;
&lt;i class="italic"&gt;install file:path/wireadmin-binder.jar&lt;/i&gt;
&lt;h4 class="heading-1-1-1"&gt;&lt;span id="HInstalationofF26Cserverbundle"&gt;3.3 Instalation of F&amp;C server bundle&lt;/span&gt;&lt;/h4&gt;&lt;p class="paragraph"/&gt;In Felix platform you can install the server bundle using the next command&lt;p class="paragraph"/&gt;&lt;i class="italic"&gt;install file:path/aleserver-bundle.war&lt;/i&gt;
&lt;h3 class="heading-1-1"&gt;&lt;span id="HInstallationofReaders27Drivers"&gt;4 Installation of Readers' Drivers&lt;/span&gt;&lt;/h3&gt;&lt;p class="paragraph"/&gt;Readers' Drivers are installed as bundles on the OSGi platform. Next readers' drivers have been included in the OSGi profile:
&lt;ul class="star"&gt;
&lt;li&gt;&lt;span class="wikilink"&gt;&lt;a href="/xwiki/bin/view/Main.Documentation.Bundles/SimpleReader"&gt;Simple Reader (an reader simulator)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="wikilink"&gt;&lt;a href="/xwiki/bin/view/Main.Documentation.Bundles/ProximaRFDesktopReader"&gt;ProximaRF Desktop USB reader&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="wikilink"&gt;&lt;a href="/xwiki/bin/view/Main.Documentation.Bundles/TagSysMedioReader"&gt;TagSys Medio Serial reader&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="wikilink"&gt;&lt;a href="/xwiki/bin/view/Main.Documentation.Bundles/ACR122Reader"&gt;ACR 122 USB reader&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="wikilink"&gt;&lt;a href="/xwiki/bin/view/Main.Documentation.Bundles/OneWireReader"&gt;OneWire reader&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;Use the Felix command &lt;span class="wikiexternallink"&gt;&lt;a href="http://felix.apache.org/site/documentation.html"&gt;&amp;#105;nstall&lt;/a&gt;&lt;/span&gt; to deploy each reader bundle and its dependencies.
&lt;h3 class="heading-1-1"&gt;&lt;span id="HInstallationofthetemperaturesensors"&gt;5 Installation of the temperature sensors&lt;/span&gt;&lt;/h3&gt;&lt;p class="paragraph"/&gt;
Two temperature sensors are provided in this distribution, At first,a fictive sensor that can be used for test purposes, and a Temper sensor that is the driver of an usb sensor temperature device. Require bundles are also provided (iPojo version 1.4.0).&lt;p class="paragraph"/&gt;Readers' bundles and sensors' bundles are shown in the next osgi console snapshot:&lt;p class="paragraph"/&gt;&lt;img src="/xwiki/bin/download/Main.Documentation/ALEonOSGi/ALE-OSGi.png" alt="ALE-OSGi.png" /&gt;
&lt;h3 class="heading-1-1"&gt;&lt;span id="HInstallationofotherfeaturesbundles"&gt;6 Installation of other features bundles&lt;/span&gt;&lt;/h3&gt;&lt;p class="paragraph"/&gt;
The platform can be enriched using other bundles to add different features. By example, a bundle allowing administration of OSGi platform using the &lt;span class="wikiexternallink"&gt;&lt;a href="http://membres-liglab.imag.fr/kiev.gama/dev/osgi/visualvm/"&gt;&amp;#86;isual VM OSGi plugin&lt;/a&gt;&lt;/span&gt; is provided.
&lt;h3 class="heading-1-1"&gt;&lt;span id="HAllinonedistribution"&gt;7 All-in-one distribution&lt;/span&gt;&lt;/h3&gt;&lt;p class="paragraph"/&gt;A distribution with all required bundles is available &lt;span class="wikiexternallink"&gt;&lt;a href="http://chaphe.free.fr/aspire/ale.zip"&gt;&amp;#104;ere&lt;/a&gt;&lt;/span&gt;. Download the file and unzip it, then execute run.sh (or run.bat in Windows).
&lt;h3 class="heading-1-1"&gt;&lt;span id="HMisc"&gt;8 Misc&lt;/span&gt;&lt;/h3&gt; 
&lt;ul class="star"&gt;
&lt;li&gt;&lt;span class="wikilink"&gt;&lt;a href="/xwiki/bin/view/Main.Documentation/ALEinCilia"&gt;CiliaALE&lt;/a&gt;&lt;/span&gt; : a flexible and dynamically reconfigurable ALE Server for Android platforms (phones and tablets)&lt;/li&gt;
&lt;/ul&gt;
</renderedcontent>
</xwikidoc>