chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r796370 - /websites/staging/chemistry/trunk/content/java/examples/example-osgi.html
Date Fri, 30 Sep 2011 11:41:21 GMT
Author: buildbot
Date: Fri Sep 30 11:41:20 2011
New Revision: 796370

Log:
Staging update by buildbot

Modified:
    websites/staging/chemistry/trunk/content/java/examples/example-osgi.html

Modified: websites/staging/chemistry/trunk/content/java/examples/example-osgi.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/examples/example-osgi.html (original)
+++ websites/staging/chemistry/trunk/content/java/examples/example-osgi.html Fri Sep 30 11:41:20
2011
@@ -184,8 +184,27 @@ Apache Chemistry - Using OSGI with OpenC
            <td height="100%">
              <!-- Content -->
              <div class="wiki-content"><h1 id="using_osgi_with_opencmis">Using
OSGI with OpenCMIS</h1>
-<p>This example shows how to use OpenCMIS with OSGI bundles.</p>
-<p>TODO</p></div>
+<h2 id="client_factory_with_osgi">Client Factory with OSGi</h2>
+<p>These examples show the first steps that are required in client applications: How
to create a session and connect to a repository using OSGi factory service.</p>
+<div class="codehilite"><pre><span class="c1">// OSGi factory service</span>
+
+<span class="n">BundleContext</span> <span class="n">bundleContext</span>
<span class="o">=</span> <span class="o">...;</span>  <span class="c1">//
retriev bundle context from OSGi runtime</span>
+<span class="n">ServiceReference</span> <span class="n">serviceReference</span>
<span class="o">=</span> <span class="n">bundleContext</span><span
class="o">.</span><span class="na">getServiceReference</span><span
class="o">(</span><span class="n">SessionFactory</span><span class="o">.</span><span
class="na">class</span><span class="o">.</span><span class="na">getName</span><span
class="o">());</span>
+<span class="n">SessionFactory</span> <span class="n">factory</span>
<span class="o">=</span> <span class="o">(</span><span class="n">SessionFactory</span><span
class="o">)</span> <span class="n">bundleContext</span><span class="o">.</span><span
class="na">getService</span><span class="o">(</span><span class="n">serviceReference</span><span
class="o">);</span> 
+<span class="n">Map</span><span class="o">&lt;</span><span
class="n">String</span><span class="o">,</span> <span class="n">String</span><span
class="o">&gt;</span> <span class="n">parameter</span> <span class="o">=</span>
<span class="k">new</span> <span class="n">HashMap</span><span
class="o">&lt;</span><span class="n">String</span><span class="o">,</span>
<span class="n">String</span><span class="o">&gt;();</span>
+
+<span class="c1">// fill in session parameter</span>
+<span class="n">parameter</span><span class="o">.</span><span
class="na">put</span><span class="o">(...);</span>
+
+<span class="c1">// create session</span>
+<span class="n">Session</span> <span class="n">session</span> <span
class="o">=</span> <span class="n">factory</span><span class="o">.</span><span
class="na">createSession</span><span class="o">(</span><span class="n">parameter</span><span
class="o">);</span>
+</pre></div>
+
+
+<ul>
+<li><a href="example-create-session.html">Creating a session</a></li>
+<li><a href="/java/developing/dev-osgi.html">OSGi support for OpenCMIS</a></li>
+</ul></div>
              <!-- Content -->
            </td>
           </tr>



Mime
View raw message