You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2012/01/20 22:18:42 UTC

svn commit: r802986 - in /websites/production/openejb: ./ content/ejb-refs.html content/properties-listing.html

Author: dblevins
Date: Fri Jan 20 21:18:42 2012
New Revision: 802986

Log:
Publishing merge to openejb site by dblevins

Modified:
    websites/production/openejb/   (props changed)
    websites/production/openejb/content/ejb-refs.html
    websites/production/openejb/content/properties-listing.html

Propchange: websites/production/openejb/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 20 21:18:42 2012
@@ -1 +1 @@
-/websites/staging/openejb/trunk:790824-802897
+/websites/staging/openejb/trunk:790824-802985

Modified: websites/production/openejb/content/ejb-refs.html
==============================================================================
--- websites/production/openejb/content/ejb-refs.html (original)
+++ websites/production/openejb/content/ejb-refs.html Fri Jan 20 21:18:42 2012
@@ -163,20 +163,18 @@ xml.  The following would be added to th
     <session>
       <ejb-name>SquareBean</ejb-name>
       <ejb-ref>
-    <ejb-ref-name>com.foo.shapes.SquareBean/orangeRemote</ejb-ref-name>
-    <ejb-ref-type>Session</ejb-ref-type>
-    <remote>com.foo.colors.OrangeRemote</remote>
-    <ejb-link>colorsApp.jar#OrangeBean</ejb-link>
-    <injection-target>
-</code></pre>
-
-<p><injection-target-class>com.foo.shapes.SquareBean</injection-target-class>
-          <injection-target-name>orangeRemote</injection-target-name>
-        </injection-target>
-          </ejb-ref>
-        </session></p>
+        &lt;ejb-ref-name&gt;com.foo.shapes.SquareBean/orangeRemote&lt;/ejb-ref-name&gt;
+        &lt;ejb-ref-type&gt;Session&lt;/ejb-ref-type&gt;
+        &lt;remote&gt;com.foo.colors.OrangeRemote&lt;/remote&gt;
+        &lt;ejb-link&gt;colorsApp.jar#OrangeBean&lt;/ejb-link&gt;
+        &lt;injection-target&gt;
+          &lt;injection-target-class&gt;com.foo.shapes.SquareBean&lt;/injection-target-class&gt;
+          &lt;injection-target-name&gt;orangeRemote&lt;/injection-target-name&gt;
+        &lt;/injection-target&gt;
+      &lt;/ejb-ref&gt;
+    &lt;/session&gt;
 
-<pre><code>  &lt;/enterprise-beans&gt;
+  &lt;/enterprise-beans&gt;
 &lt;/ejb-jar&gt;
 </code></pre>
 
@@ -185,6 +183,45 @@ above example would still work as there 
 match the <ejb-ref-name> and no one will likely be looking up the EJB as
 it's injected.</p>
 
+<h1>Referencing a bean in another server</h1>
+
+<p>As of OpenEJB 4.0.0-beta-3, server to server references work.</p>
+
+<p>First we need to configure and name the InitialContext that will be used to satisfy the lookup to the other server.</p>
+
+<p>In this example we are calling our InitialContext <code>shoe</code> for fun.</p>
+
+<pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;openejb&gt;
+
+  &lt;JndiProvider id="shoe"&gt;
+    java.naming.provider.url = ejbd://localhost:4201
+    java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory
+  &lt;/JndiProvider&gt;
+
+&lt;/openejb&gt;
+</code></pre>
+
+<p>Declaring the <code>@EJB</code> reference is then done using a <code>mappedName</code>  that references the named <code>InitialContext</code></p>
+
+<pre><code>public class BlueBean implements BlueRemote {
+
+    @EJB(mappedName = "jndi:ext://shoe/OrangeBeanRemote")
+    private OrangeRemote orangeRemote;
+
+    public void hasOrangeRemote() {
+        Assert.assertNotNull("orangeRemote is null", orangeRemote);
+        assertEquals("olleh", orangeRemote.echo("hello"));
+    }
+}
+</code></pre>
+
+<p>Specifically, the <code>mappedName</code> syntax is as follows:</p>
+
+<ul>
+<li>jndi:ext://<code>&lt;contextId&gt;</code>/<code>&lt;jndiName&gt;</code></li>
+</ul>
+
 
 
 

Modified: websites/production/openejb/content/properties-listing.html
==============================================================================
--- websites/production/openejb/content/properties-listing.html (original)
+++ websites/production/openejb/content/properties-listing.html Fri Jan 20 21:18:42 2012
@@ -156,6 +156,8 @@
 |openejb.web.xml.major | int | major version of web.xml. Can be useful to force tomcat to scan servlet 3 annotatino when deploying with a servlet 2.x web.xml|
 |tomee.jaxws.subcontext | string | sub context used to bind jaxws web services, default is
 webservices|
+|openejb.servicemanager.enabled| bool | run all services detected or only known available services (WS
+and RS|
 |tomee.jaxws.oldsubcontext| bool | wether or not activate old way to bind jaxws webservices directly
 on root context|</p>