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 Mon, 26 Jul 2010 15:53:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/15/_/styles/combined.css?spaceKey=CXF&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF/Distributed+OSGi">Distributed
OSGi</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davidb@apache.org">David
Bosschaert</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Move from 1.1 to 1.2<br />
    </div>
        <br/>
                         <h4>Changes (3)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Welcome to Apache Felix Gogo <br>g!
install http://repo1.maven.org/maven2/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar
<br></td></tr>
            <tr><td class="diff-changed-lines" >g! start <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">http://www.apache.org/dist/cxf/dosgi/1.1/cxf-dosgi-ri-singlebundle-distribution-1.1.jar</span>
<span class="diff-added-words"style="background-color: #dfd;">http://www.apache.org/dist/cxf/dosgi/1.2/cxf-dosgi-ri-singlebundle-distribution-1.2.jar</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >... some log messages may appear...
<br>g! lb <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Bundle id is 1 <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >osgi&gt; install <span
class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">http://www.apache.org/dist/cxf/dosgi/1.1/cxf-dosgi-ri-singlebundle-distribution-1.1.jar</span>
<span class="diff-added-words"style="background-color: #dfd;">http://www.apache.org/dist/cxf/dosgi/1.2/cxf-dosgi-ri-singlebundle-distribution-1.2.jar</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >Bundle id is 2 <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >|| Sample || Description || Doc Page
|| <br>| *greeter* | a very simple demo of a Greeter OSGi Service exposed remotely and
a Consumer invoking on it. | [Walkthrough of the Greeter Demo | Distributed OSGi Greeter Demo
Walkthrough] | <br></td></tr>
            <tr><td class="diff-changed-lines" >| *greeter_rest* | <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">(starting
from 1.1-SNAPSHOT)</span> 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
| [Walkthrough of the Greeter Demo | Distributed OSGi Greeter Demo Walkthrough] | <br></td></tr>
            <tr><td class="diff-unchanged" >| *spring_dm* | a demo created using
Spring-DM. Rather than invoking on the OSGi API&#39;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. | [DOSGi Spring-DM Demo page] | <br>| *ds* | this
demo shows how Distributed OSGi can be used with OSGi Declarative Services (DS). | [DOSGi
DS Demo page] | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <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" class="external-link" 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>The 1.2 version of this project is also the Reference Implementation of the OSGi
Remote Service Admin specification, chapter 122 in the <a href="http://www.osgi.org/Download/Release4V42"
class="external-link" rel="nofollow">OSGi 4.2 Enterprise Specification</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/display/CXF/DOSGi+FAQ" title="DOSGi FAQ">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"
class="external-link" 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 3.0.1</em></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">../felix-3.0.1&gt; java -jar bin/felix.jar

Welcome to Apache Felix Gogo
g! install 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>g! start http:<span class="code-comment">//www.apache.org/dist/cxf/dosgi/1.2/cxf-dosgi-ri-singlebundle-distribution-1.2.jar
</span>... some log messages may appear...
g! lb
    0|Active     |    0|org.apache.felix.framework (3.0.1)
    1|Active     |    1|org.apache.felix.bundlerepository (1.6.2)
    2|Active     |    1|org.apache.felix.gogo.command (0.6.0)
    3|Active     |    1|org.apache.felix.gogo.runtime (0.6.0)
    4|Active     |    1|org.apache.felix.gogo.shell (0.6.0)
    5|Resolved   |    1|osgi.cmpn (4.2.0.200908310645)
    6|Active     |    1|cxf-dosgi-ri-singlebundle-distribution (1.2.0)</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.6</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.6.0.v20100517.jar
-console
osgi&gt; install install file:plugins/org.eclipse.osgi.services_3.2.100.v20100503.jar
Bundle id is 1

osgi&gt; install http:<span class="code-comment">//www.apache.org/dist/cxf/dosgi/1.2/cxf-dosgi-ri-singlebundle-distribution-1.2.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.6.0.v20100517
1       RESOLVED    org.eclipse.osgi.services_3.2.100.v20100503
2       ACTIVE      cxf-dosgi-ri-singlebundle-distribution_1.2.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>
<div class='table-wrap'>
<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'> 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"
class="external-link" rel="nofollow">DOSGi iPOJO Demo page</a> </td>
</tr>
</tbody></table>
</div>


<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"
class="external-link" 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="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CXF/Distributed+OSGi">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=105477&revisedVersion=55&originalVersion=54">View
Changes</a>
                |
        <a href="https://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