cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF > Distributed OSGi
Date Tue, 23 Mar 2010 20:57:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/11/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CXF/Distributed+OSGi">Distributed
OSGi</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~davidb@apache.org">David
Bosschaert</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <p>The Apache CXF Distributed OSGi subproject provides the Reference Implementation
of the Distribution Provider component of the OSGi Remote Services Specification (Chapter
13 in the <a href="http://www.osgi.org/Download/Release4V42" rel="nofollow">OSGi 4.2
Compendium Specification</a>).<br/>
It implements the Remote Services functionality using Web Services, leveraging SOAP over HTTP
and exposing the Service over a WSDL contract. Starting from version 1.1, Java interfaces
can also be exposed and consumed as RESTful JAX-RS services.</p>

<p>An implementation of an OSGi Remote Service Admin compliant Discovery Service is
also worked on in this project. (For more information on the Remote Service Admin specification
see <a href="http://www.osgi.org/download/osgi-4.2-enterprise-early-draft4.pdf" rel="nofollow">http://www.osgi.org/download/osgi-4.2-enterprise-early-draft4.pdf</a>).
</p>

<p>This page is about getting started and the demos, <b>further links</b>:</p>
<ul>
	<li><a href="/confluence/display/CXF/Distributed+OSGi+Reference" title="Distributed
OSGi Reference">Distributed OSGi Reference</a> guide</li>
	<li><a href="/confluence/display/CXF/DOSGi+Presentations+and+Articles" title="DOSGi
Presentations and Articles">DOSGi Presentations and Articles</a></li>
	<li><a href="/confluence/display/CXF/DOSGi+Releases" title="DOSGi Releases">DOSGi
Releases</a></li>
	<li><a href="/confluence/display/CXF/DOSGi+Build" title="DOSGi Build">DOSGi Build</a>
page</li>
	<li><a href="/confluence/pages/createpage.action?spaceKey=CXF&amp;title=DOSGi+Faq&amp;linkCreation=true&amp;fromPageId=105477"
class="createlink">DOSGi Faq</a> page</li>
</ul>


<h2><a name="DistributedOSGi-GettingStarted"></a>Getting Started</h2>

<p>To get started, get yourself a CXF-DOSGi distribution. The following distributions
are available:</p>
<ul>
	<li><b>Multi Bundle Distribution</b>: This distribution is a zip file containing
the Distributed OSGi bundles, as well as all their dependencies.</li>
	<li><b>Single Bundle Distribution</b>: This is a convenience distribution
of a single bundle that embeds all the dependencies.</li>
</ul>


<p>Which distribution to take? That depends on what you are doing. The single-bundle
distribution is a really convenient way of getting started as it provides all of Distributed
OSGi plus its dependencies in one. <br/>
The multi-bundle distribution is obviously a little more work to install, but the fine-grained
bundles do have an extra benefit: they allow sharing. So if your application depends on one
or more of the library bundles, it can use them from the multi-bundle distribution. Similarly,
the multi-bundle distribution makes it possible to update the dependency bundles - if compatible
- without having to replace the Distributed OSGi bundles.</p>

<p>Get a distribution by:</p>
<ul>
	<li>Downloading a built distribution. See the <a href="/confluence/display/CXF/DOSGi+Releases"
title="DOSGi Releases">DOSGi Releases</a> page.</li>
	<li>Alternatively, built the distribution yourself. See the <a href="/confluence/display/CXF/DOSGi+Build"
title="DOSGi Build">DOSGi Build</a> page.</li>
</ul>


<h3><a name="DistributedOSGi-SettingupyourOSGicontainer"></a>Setting up
your OSGi container</h3>
<p>Setting up the single-bundle distribution is really simple, see below. For instructions
on setting up the multi-bundle distribution see the <a href="/confluence/display/CXF/DOSGi+Multi+Bundle+Setup"
title="DOSGi Multi Bundle Setup">Multi Bundle Setup</a> page.</p>

<p><b>Prerequisites for the single-bundle distribution:</b><br/>
The single-bundle distribution requires some of the interfaces of the OSGi compendium specification.
These are provided with the Equinox and Felix OSGi distributions, but not installed by default.</p>

<h4><a name="DistributedOSGi-SettingupFelix"></a>Setting up Felix</h4>
<p>The compendium interfaces can be downloaded from the following various places, the
easiest is probably from Maven Central: <a href="http://repo1.maven.org/maven2/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar"
rel="nofollow">http://repo1.maven.org/maven2/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar</a>.</p>

<p>To set up Felix you can follow these steps:<br/>
<em>Verified with: Felix 1.8.0</em></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">../felix-1.8.0&gt; java -jar bin/felix.jar

Welcome to Felix.
=================

-&gt; start http:<span class="code-comment">//repo1.maven.org/maven2/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar
</span>-&gt; start http:<span class="code-comment">//www.apache.org/dist/cxf/dosgi/1.1/cxf-dosgi-ri-singlebundle-distribution-1.1.jar
</span>... some log messages may appear...
-&gt; ps
START LEVEL 1
   ID   State         Level  Name
[   0] [Active     ] [    0] <span class="code-object">System</span> Bundle (1.8.0)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.2.0)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.2.0)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.4.0)
[   4] [Active     ] [    1] osgi.cmpn (4.2.0.200908310645)
[   5] [Active     ] [    1] Distributed OSGi Distribution Software Single-Bundle Distribution
(1.1)</pre>
</div></div>

<p>However, you can also change the <tt>conf/config.properties</tt> file
to automatically load these bundles. This approach is described in the <a href="/confluence/display/CXF/DOSGi+Multi+Bundle+Setup"
title="DOSGi Multi Bundle Setup">Multi Bundle Setup</a> page.</p>

<h4><a name="DistributedOSGi-SettingupEquinox"></a>Setting up Equinox</h4>
<p>The compendium interfaces are part of the Equinox/Eclipse distribution and can be
found in a file called plugins/org.eclipse.osgi.services_3.2.0.v20090520-1800.jar (the timestamp
could vary).</p>

<p>To set up Equinox you can follow these steps:<br/>
<em>Verified with: Eclipse 3.5 RC 3</em></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">.../eclipse&gt; java -jar plugins/org.eclipse.osgi_3.5.0.v20090520.jar
-console
osgi&gt; install file:plugins/org.eclipse.osgi.services_3.2.0.v20090520-1800.jar
Bundle id is 1

osgi&gt; install http:<span class="code-comment">//www.apache.org/dist/cxf/dosgi/1.1/cxf-dosgi-ri-singlebundle-distribution-1.1.jar
</span>Bundle id is 2

osgi&gt; start 2
... some log messages may appear...
osgi&gt; ss

Framework is launched.

id      State       Bundle
0       ACTIVE      org.eclipse.osgi_3.5.0.v20090520
1       RESOLVED    org.eclipse.osgi.services_3.2.0.v20090520-1800
2       ACTIVE      cxf-dosgi-ri-singlebundle-distribution_1.1.0</pre>
</div></div>

<p>However, you can also create a <tt>config.ini</tt> file to automatically
load these bundles. This approach is described in the <a href="/confluence/display/CXF/DOSGi+Multi+Bundle+Setup"
title="DOSGi Multi Bundle Setup">Multi Bundle Setup</a> page.</p>

<h4><a name="DistributedOSGi-UsingEquinoxfromwithintheEclipseIDE"></a>Using
Equinox from within the Eclipse IDE</h4>
<p><em>This option is really handy for debugging. Verified with: Eclipse 3.5M4</em><br/>
<a href="/confluence/display/CXF/Setting+up+Eclipse+for+Running+and+Debugging+Distributed+OSGi"
title="Setting up Eclipse for Running and Debugging Distributed OSGi">Setting up Eclipse
for Running and Debugging Distributed OSGi</a></p>

<h3><a name="DistributedOSGi-SettingupCXF%2FDOSGiDiscovery"></a>Setting
up CXF/DOSGi Discovery</h3>
<p>See the <a href="/confluence/display/CXF/DOSGi+Discovery" title="DOSGi Discovery">DOSGi
Discovery</a> page and the <a href="/confluence/display/CXF/DOSGi+Discovery+Demo+page"
title="DOSGi Discovery Demo page">DOSGi Discovery Demo page</a>.</p>

<h2><a name="DistributedOSGi-TheSamples"></a>The Samples</h2>
<p>The samples directory contains these sample projects:</p>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Sample </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Doc Page </th>
</tr>
<tr>
<td class='confluenceTd'> <b>greeter</b> </td>
<td class='confluenceTd'> a very simple demo of a Greeter OSGi Service exposed remotely
and a Consumer invoking on it. </td>
<td class='confluenceTd'> <a href="/confluence/display/CXF/Distributed+OSGi+Greeter+Demo+Walkthrough"
title="Distributed OSGi Greeter Demo Walkthrough">Walkthrough of the Greeter Demo </a>
</td>
</tr>
<tr>
<td class='confluenceTd'> <b>greeter_rest</b> </td>
<td class='confluenceTd'> (starting from 1.1-SNAPSHOT) a very simple demo of a Greeter
OSGi Service exposed remotely as a RESTful service and a Consumer invoking on it. Virtually
identical to a greeter sample </td>
<td class='confluenceTd'> <a href="/confluence/display/CXF/Distributed+OSGi+Greeter+Demo+Walkthrough"
title="Distributed OSGi Greeter Demo Walkthrough">Walkthrough of the Greeter Demo </a>
</td>
</tr>
<tr>
<td class='confluenceTd'> <b>spring_dm</b> </td>
<td class='confluenceTd'> a demo created using Spring-DM. Rather than invoking on the
OSGi API's directly, the Spring-DM demo shows how you can use Spring to configure your beans
as OSGi Services and similarly how to use Spring-DM to invoke a (remote) OSGi Service. </td>
<td class='confluenceTd'> <a href="/confluence/display/CXF/DOSGi+Spring-DM+Demo+page"
title="DOSGi Spring-DM Demo page">DOSGi Spring&#45;DM Demo page</a> </td>
</tr>
<tr>
<td class='confluenceTd'> <b>ds</b> </td>
<td class='confluenceTd'> this demo shows how Distributed OSGi can be used with OSGi
Declarative Services (DS). </td>
<td class='confluenceTd'> <a href="/confluence/display/CXF/DOSGi+DS+Demo+page" title="DOSGi
DS Demo page">DOSGi DS Demo page</a> </td>
</tr>
<tr>
<td class='confluenceTd'> <b>discovery</b> </td>
<td class='confluenceTd'> this demo shows how to use Distributed OSGi with a dynamic
Discovery system such as the one based on Zookeeper that comes with CXF/DOSGi. </td>
<td class='confluenceTd'> <a href="/confluence/display/CXF/DOSGi+Discovery+Demo+page"
title="DOSGi Discovery Demo page">DOSGi Discovery Demo page</a> </td>
</tr>
<tr>
<td class='confluenceTd'> <b>iPOJO</b> </td>
<td class='confluenceTd'> this demo shows how Distributed OSGi can be used with iPOJO
</td>
<td class='confluenceTd'> <a href="http://felix.apache.org/site/apache-felix-ipojo-dosgi.html"
rel="nofollow">DOSGi iPOJO Demo page</a> </td>
</tr>
</tbody></table>

<p>The samples can be installed directly from the maven release repository (as described
in the demo documentation pages), but you can also build them yourself.<br/>
To build the samples from source:</p>
<ol>
	<li>simply check out the DOSGi trunk from SVN (<a href="http://svn.apache.org/repos/asf/cxf/dosgi/trunk"
rel="nofollow">http://svn.apache.org/repos/asf/cxf/dosgi/trunk</a>)</li>
	<li>go into the <tt>samples</tt> directory</li>
	<li>and build them using <tt>mvn install</tt></li>
</ol>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CXF/Distributed+OSGi">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=105477&revisedVersion=50&originalVersion=49">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CXF/Distributed+OSGi?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message