You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by bu...@apache.org on 2013/10/19 09:54:57 UTC

svn commit: r883256 - in /websites/staging/openwebbeans/trunk/content: ./ openwebbeans-spi.html

Author: buildbot
Date: Sat Oct 19 07:54:57 2013
New Revision: 883256

Log:
Staging update by buildbot for openwebbeans

Modified:
    websites/staging/openwebbeans/trunk/content/   (props changed)
    websites/staging/openwebbeans/trunk/content/openwebbeans-spi.html

Propchange: websites/staging/openwebbeans/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat Oct 19 07:54:57 2013
@@ -1 +1 @@
-1529155
+1533700

Modified: websites/staging/openwebbeans/trunk/content/openwebbeans-spi.html
==============================================================================
--- websites/staging/openwebbeans/trunk/content/openwebbeans-spi.html (original)
+++ websites/staging/openwebbeans/trunk/content/openwebbeans-spi.html Sat Oct 19 07:54:57 2013
@@ -75,7 +75,47 @@
 
         <div id="OwbContent_" class="wiki-content">
 <h1 id="openwebbeans-spi">OpenWebBeans SPI</h1>
-<p>Coming soon...</p>
+<h3 id="what-is-an-spi">What is an SPI?</h3>
+<blockquote>
+<p>Service Provider Interface (SPI) is an API intended to be implemented
+or extended by a third party. It can be used to enable framework
+extension and  replaceable components.
+- <a href="http://en.wikipedia.org/wiki/Service_provider_interface">wikipedia</a></p>
+</blockquote>
+<h3 id="how-does-the-spi-functionality-work-in-openwebbeans">How does the SPI functionality work in OpenWebBeans?</h3>
+<p>First off reading about <a href="openwebbeans-impl.html">OpenWebBeans Core</a> will give you the overall idea. 
+Now as mentioned in that description the SPI is simply used to integrate other 
+frameworks with OpenWebBeans. The point of gravity for Java EE is definitely going
+towards CDI today and the SPI pattern ensures that OpenWebBeans can manage this handily.</p>
+<p>From a more technical standpoint it's nothing more then a bunch of interfaces. 
+For example a part of the SPI is the following interface:</p>
+<div class="codehilite"><pre><span class="kn">package</span> <span class="n">org</span><span class="o">.</span><span class="na">apache</span><span class="o">.</span><span class="na">webbeans</span><span class="o">.</span><span class="na">spi</span><span class="o">;</span>
+
+<span class="cm">/**</span>
+<span class="cm">* Conversation related SPI.</span>
+<span class="cm">* @version $Rev$ $Date$</span>
+<span class="cm">*/</span>
+<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">ConversationService</span>
+<span class="o">{</span>
+    <span class="cm">/**</span>
+<span class="cm">    * Gets the current conversation id or null</span>
+<span class="cm">    * if there is no conversation.</span>
+<span class="cm">    * @return the current conversation id</span>
+<span class="cm">    */</span>
+    <span class="kd">public</span> <span class="n">String</span> <span class="nf">getConversationId</span><span class="o">();</span>
+
+    <span class="cm">/**</span>
+<span class="cm">    * Gets the session id of the current session.</span>
+<span class="cm">    * @return the session id of the current user session</span>
+<span class="cm">    */</span>
+    <span class="kd">public</span> <span class="n">String</span> <span class="nf">getConversationSessionId</span><span class="o">();</span>
+
+<span class="o">}</span>
+</pre></div>
+
+
+<p>After seeing this interface one can easily conclude that frameworks that want to utilize the Conversation Id functionality must implement this interface.
+Now since this is part of the specification for JSF 2.x the JSF plugin of course implements it and actually the JSF 1.2 plugin as well. Supporting the Conversation Id in another plugin should be rather intuitive and this is true for the SPI in general. </p>
         </div>
 
         <hr>