You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2011/12/27 23:03:59 UTC

svn commit: r801141 [2/2] - in /websites/production/openejb: ./ content/ content/dev/ content/examples-trunk/ content/examples-trunk/applicationexception/ content/examples-trunk/applicationexception/src/test/java/org/superbiz/appexception/ content/exam...

Modified: websites/production/openejb/content/examples-trunk/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java (original)
+++ websites/production/openejb/content/examples-trunk/mbean-auto-registration/src/test/java/org/superbiz/mbean/GuessHowManyMBeanTest.java Tue Dec 27 22:03:54 2011
@@ -28,9 +28,6 @@ import java.util.Properties;
 
 import static junit.framework.Assert.assertEquals;
 
-/**
- * @author Romain Manni-Bucau
- */
 public class GuessHowManyMBeanTest {
     private static final String OBJECT_NAME = "openejb.user.mbeans:group=org.superbiz.mbean,application=mbean-auto-registration,name=GuessHowManyMBean";
 

Modified: websites/production/openejb/content/examples-trunk/pom.xml
==============================================================================
--- websites/production/openejb/content/examples-trunk/pom.xml (original)
+++ websites/production/openejb/content/examples-trunk/pom.xml Tue Dec 27 22:03:54 2011
@@ -17,7 +17,7 @@
     limitations under the License.
 -->
 
-<!-- $Rev: 1208817 $ $Date: 2011-11-30 21:52:15 +0000 (Wed, 30 Nov 2011) $ -->
+<!-- $Rev: 1222309 $ $Date: 2011-12-22 16:10:10 +0000 (Thu, 22 Dec 2011) $ -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
@@ -30,70 +30,72 @@
   <packaging>pom</packaging>
   <name>OpenEJB :: Examples</name>
   <modules>
-    <module>applicationexception</module>
+    <module>access-timeout-meta</module>
+    <module>access-timeout</module>
+    <module>alternate-descriptors</module>
     <module>application-composer</module>
-    <module>simple-stateful</module>
-    <module>simple-stateless</module>
-    <module>simple-stateless-with-descriptor</module>
-    <module>simple-singleton</module>
-    <module>simple-mdb</module>
-    <module>simple-mdb-and-cdi</module>
-    <module>simple-mdb-with-descriptor</module>
-    <module>simple-cmp2</module>
-    <module>simple-webservice</module>
+    <module>applicationexception</module>
+    <module>async-methods</module>
+    <module>bean-validation-design-by-contract</module>
+    <module>cdi-alternative-and-stereotypes</module>
+    <module>cdi-basic</module>
+    <module>cdi-events</module>
+    <module>cdi-interceptors</module>
+    <module>cdi-produces-disposes</module>
     <module>component-interfaces</module>
-    <module>injection-of-ejbs</module>
-    <module>injection-of-env-entry</module>
+    <module>custom-injection</module>
+    <module>datasource-ciphered-password</module>
+    <module>decorators</module>
+    <module>dynamic-dao-implementation</module>
+    <module>dynamic-datasource-routing</module>
+    <module>dynamic-implementation</module>
+    <module>dynamic-proxy-to-access-mbean</module>
+    <module>ear-testing</module>
+    <module>helloworld-weblogic</module>
+    <module>injection-of-connectionfactory</module>
     <module>injection-of-datasource</module>
+    <module>injection-of-ejbs</module>
     <module>injection-of-entitymanager</module>
-    <module>injection-of-connectionfactory</module>
-    <module>testing-transactions</module>
-    <module>testing-security</module>
-    <module>testing-security-2</module>
-    <module>testcase-injection</module>
-    <module>alternate-descriptors</module>
-    <module>ear-testing</module>
+    <module>injection-of-env-entry</module>
     <module>interceptors</module>
-    <module>custom-injection</module>
-    <module>helloworld-weblogic</module>
-    <module>jpa-hibernate</module>
     <module>jpa-eclipselink</module>
-    <module>spring-integration</module>
-    <module>telephone-stateful</module>
-    <module>quartz-app</module>
-    <module>webservice-attachments</module>
-    <module>webapps</module>
-    <module>webservice-security</module>
-    <module>webservice-ws-security</module>
-    <module>webservice-inheritance</module>
-    <module>transaction-rollback</module>
-    <module>troubleshooting</module>
-    <module>access-timeout</module>
-    <module>access-timeout-meta</module>
-    <module>async-methods</module>
-    <module>lookup-of-ejbs-with-descriptor</module>
+    <module>jpa-hibernate</module>
     <module>lookup-of-ejbs</module>
-    <module>schedule-methods</module>
-    <module>schedule-expression</module>
+    <module>lookup-of-ejbs-with-descriptor</module>
+    <module>mbean-auto-registration</module>
     <module>movies-complete-meta</module>
     <module>movies-complete</module>
+    <module>quartz-app</module>
+    <module>reload-persistence-unit-properties</module>
+    <module>rest-on-ejb</module>
+    <module>schedule-expression</module>
     <module>schedule-methods-meta</module>
+    <module>schedule-methods</module>
+    <module>simple-cdi-interceptor</module>
+    <module>simple-cmp2</module>
+    <module>simple-mdb-and-cdi</module>
+    <module>simple-mdb</module>
+    <module>simple-mdb-with-descriptor</module>
+    <module>simple-osgi</module>
+    <module>simple-singleton</module>
+    <module>simple-stateful</module>
+    <module>simple-stateless</module>
+    <module>simple-stateless-with-descriptor</module>
+    <module>simple-webservice</module>
+    <module>spring-integration</module>
+    <module>telephone-stateful</module>
+    <module>testcase-injection</module>
+    <module>testing-security-2</module>
     <module>testing-security-meta</module>
-    <module>decorators</module>
-    <module>dynamic-datasource-routing</module>
-    <module>mbean-auto-registration</module>
-    <module>datasource-ciphered-password</module>
-    <module>bean-validation-design-by-contract</module>
-    <module>cdi-basic</module>
-    <module>cdi-interceptors</module>
-    <module>rest-on-ejb</module>
-    <module>dynamic-dao-implementation</module>
-    <module>cdi-produces-disposes</module>
-    <module>dynamic-implementation</module>
-    <module>cdi-alternative-and-stereotypes</module>
-    <module>cdi-events</module>
-    <module>dynamic-proxy-to-access-mbean</module>
-    <module>reload-persistence-unit-properties</module>
+    <module>testing-security</module>
+    <module>testing-transactions</module>
+    <module>transaction-rollback</module>
+    <module>troubleshooting</module>
+    <module>webapps</module>
+    <module>webservice-attachments</module>
+    <module>webservice-inheritance</module>
+    <module>webservice-security</module>
+    <module>webservice-ws-security</module>
   </modules>
   <profiles>
     <profile>

Modified: websites/production/openejb/content/examples-trunk/quartz-app/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/quartz-app/README.html (original)
+++ websites/production/openejb/content/examples-trunk/quartz-app/README.html Tue Dec 27 22:03:54 2011
@@ -238,7 +238,7 @@ public class QuartzMdbTest {
 
         if (null == initialContext) {
             Properties properties = new Properties();
-            properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+            properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
 
             initialContext = new InitialContext(properties);
         }

Modified: websites/production/openejb/content/examples-trunk/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java (original)
+++ websites/production/openejb/content/examples-trunk/quartz-app/quartz-beans/src/test/java/org/superbiz/quartz/QuartzMdbTest.java Tue Dec 27 22:03:54 2011
@@ -35,7 +35,7 @@ public class QuartzMdbTest {
         System.setProperty(OutputGeneratedDescriptors.OUTPUT_DESCRIPTORS, "false"); // just to avoid to dump files in /tmp
         if (null == initialContext) {
             Properties properties = new Properties();
-            properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+            properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
 
             initialContext = new InitialContext(properties);
         }

Modified: websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java (original)
+++ websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/Person.java Tue Dec 27 22:03:54 2011
@@ -3,9 +3,6 @@ package org.superbiz.reloadable.pu;
 import javax.persistence.Entity;
 import javax.persistence.Id;
 
-/**
- * @author rmannibucau
- */
 @Entity
 public class Person {
     @Id private long id;

Modified: websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java (original)
+++ websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/main/java/org/superbiz/reloadable/pu/PersonManager.java Tue Dec 27 22:03:54 2011
@@ -6,9 +6,6 @@ import javax.ejb.TransactionAttributeTyp
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 
-/**
- * @author rmannibucau
- */
 @Singleton
 public class PersonManager {
     private static int ID = 0;

Modified: websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java (original)
+++ websites/production/openejb/content/examples-trunk/reload-persistence-unit-properties/src/test/java/org/superbiz/reloadable/pu/CacheActivationTest.java Tue Dec 27 22:03:54 2011
@@ -25,9 +25,6 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertNull;
 
-/**
- * @author rmannibucau
- */
 public class CacheActivationTest {
     private static final Logger LOGGER = LoggerFactory.getLogger(CacheActivationTest.class);
 

Modified: websites/production/openejb/content/examples-trunk/rest-on-ejb/src/main/java/org/superbiz/rest/User.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/rest-on-ejb/src/main/java/org/superbiz/rest/User.java (original)
+++ websites/production/openejb/content/examples-trunk/rest-on-ejb/src/main/java/org/superbiz/rest/User.java Tue Dec 27 22:03:54 2011
@@ -24,9 +24,6 @@ import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.xml.bind.annotation.XmlRootElement;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Entity
 @NamedQueries({
         @NamedQuery(name = "user.list", query = "select u from User u")

Modified: websites/production/openejb/content/examples-trunk/rest-on-ejb/src/main/java/org/superbiz/rest/UserService.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/rest-on-ejb/src/main/java/org/superbiz/rest/UserService.java (original)
+++ websites/production/openejb/content/examples-trunk/rest-on-ejb/src/main/java/org/superbiz/rest/UserService.java Tue Dec 27 22:03:54 2011
@@ -38,7 +38,6 @@ import java.util.List;
 /**
  * Outputs are copied because of the enhancement of OpenJPA.
  *
- * @author Romain Manni-Bucau
  */
 @Singleton
 @Lock(LockType.WRITE)

Modified: websites/production/openejb/content/examples-trunk/rest-on-ejb/src/test/java/org/superbiz/rest/UserServiceTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/rest-on-ejb/src/test/java/org/superbiz/rest/UserServiceTest.java (original)
+++ websites/production/openejb/content/examples-trunk/rest-on-ejb/src/test/java/org/superbiz/rest/UserServiceTest.java Tue Dec 27 22:03:54 2011
@@ -37,9 +37,6 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertNull;
 import static junit.framework.Assert.fail;
 
-/**
- * @author Romain Manni-Bucau
- */
 public class UserServiceTest {
     private static Context context;
     private static UserService service;

Modified: websites/production/openejb/content/examples-trunk/schedule-expression/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/schedule-expression/README.html (original)
+++ websites/production/openejb/content/examples-trunk/schedule-expression/README.html Tue Dec 27 22:03:54 2011
@@ -82,10 +82,24 @@
 <h1>Schedule Expression</h1>
 </div>
 
-<p><em>Help us document this example! Source available in <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/schedule-expression">svn</a> or <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/schedule-expression">git</a>. Open a <a href="https://issues.apache.org/jira/browse/TOMEE">JIRA</a> with patch or pull request</em></p>
+<p>In this example we exercise the <code>TimerService</code>.</p>
+
+<blockquote>
+  <p>"The TimerService interface provides enterprise bean components with access to the container-provided Timer Service. 
+  The EJB Timer Service allows entity beans, stateless session beans, and message-driven beans to be registered for timer 
+  callback events at a specified time, after a specified elapsed time, or after a specified interval."</p>
+</blockquote>
+
+<p>For a complete description of the TimerService, please refer to the JEE tutorial dedicated to the 
+<a href="http://docs.oracle.com/javaee/6/tutorial/doc/bnboy.html">Timer Service</a>.</p>
 
 <h2>FarmerBrown</h2>
 
+<p>At <code>PostConstruct</code> we create 5 programmatic timers. First four will most likely not be triggered during the test
+execution, however the last one will timeout a couple of times.</p>
+
+<p>Each timer contains an info attribute, which can be inspected at timeout.   </p>
+
 <pre><code>package org.superbiz.corn;
 
 import javax.annotation.PostConstruct;
@@ -161,6 +175,8 @@ public class FarmerBrown {
 
 <h2>FarmerBrownTest</h2>
 
+<p>The test class acquires an instance from the context and waits for 5 seconds to give the timers a chance to timeout.</p>
+
 <pre><code>package org.superbiz.corn;
 
 import junit.framework.TestCase;

Modified: websites/production/openejb/content/examples-trunk/simple-cmp2/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-cmp2/README.html (original)
+++ websites/production/openejb/content/examples-trunk/simple-cmp2/README.html Tue Dec 27 22:03:54 2011
@@ -249,7 +249,7 @@ public class MoviesTest extends TestCase
 
     public void test() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put("movieDatabase", "new://Resource?type=DataSource");
         p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
         p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");

Modified: websites/production/openejb/content/examples-trunk/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java (original)
+++ websites/production/openejb/content/examples-trunk/simple-cmp2/src/test/java/org/superbiz/cmp2/MoviesTest.java Tue Dec 27 22:03:54 2011
@@ -30,7 +30,7 @@ public class MoviesTest extends TestCase
 
     public void test() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put("movieDatabase", "new://Resource?type=DataSource");
         p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
         p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");

Modified: websites/production/openejb/content/examples-trunk/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java (original)
+++ websites/production/openejb/content/examples-trunk/simple-mdb-and-cdi/src/main/java/org/superbiz/mdb/ChatRespondCreator.java Tue Dec 27 22:03:54 2011
@@ -1,8 +1,5 @@
 package org.superbiz.mdb;
 
-/**
- * @author rmannibucau
- */
 public class ChatRespondCreator {
     public String respond(String question) {
         if ("Hello World!".equals(question)) {

Modified: websites/production/openejb/content/examples-trunk/simple-singleton/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-singleton/README.html (original)
+++ websites/production/openejb/content/examples-trunk/simple-singleton/README.html Tue Dec 27 22:03:54 2011
@@ -198,7 +198,7 @@ public class ComponentRegistry {
 <li>We use <code>@Lock(READ)</code> on the <code>get()</code> and <code>values()</code> methods as they do not change the map state and are guaranteed not to be called at the same as any of the <code>@Lock(WRITE)</code> methods, so we know the state of the HashMap is no being mutated and therefore safe for reading.</li>
 </ol>
 
-<p>The end result is that the threading model for this bean will switch from multi-threaded access to single-threaded access dynamically as needed depending on the which methods are being invoked. This gives Singletons a bit of an advantage over Servlets for processing multi-threaded requests.</p>
+<p>The end result is that the threading model for this bean will switch from multi-threaded access to single-threaded access dynamically as needed, depending on the method being invoked. This gives Singletons a bit of an advantage over Servlets for processing multi-threaded requests.</p>
 
 <p>See the <a href="../../singleton-beans.html">Singleton Beans</a> page for  more advanced details on Container-Managed Concurrency.</p>
 

Modified: websites/production/openejb/content/examples-trunk/simple-stateful/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-stateful/README.html (original)
+++ websites/production/openejb/content/examples-trunk/simple-stateful/README.html Tue Dec 27 22:03:54 2011
@@ -82,7 +82,20 @@
 <h1>Simple Stateful</h1>
 </div>
 
-<p><em>Help us document this example! Source available in <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/simple-stateful">svn</a> or <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/simple-stateful">git</a>. Open a <a href="https://issues.apache.org/jira/browse/TOMEE">JIRA</a> with patch or pull request</em></p>
+<p>This example demonstrates a simple deployment of a Stateful session bean.</p>
+
+<blockquote>
+  <p>"As its name suggests, a stateful session bean is similar to an interactive session. A stateful session bean is not shared; 
+  it can have only one client, in the same way that an interactive session can have only one user. 
+  When the client terminates, its stateful session bean appears to terminate and is no longer associated with the client."</p>
+</blockquote>
+
+<p>The <code>Counter</code> class is a Stateful session bean that maintains a state in a form of a <code>count</code> integer field.
+It exposes three methods: <code>count()</code>, <code>increment()</code> and <code>reset()</code> to manipulate and view its state.</p>
+
+<p>Typically, Stateful and Stateless beans implement Local and/or Remote interfaces to determine which methods should
+be exposed. In this case, the bean is using a no-interface view, which means that all public methods are exposed
+as a local view. </p>
 
 <h2>Counter</h2>
 
@@ -126,6 +139,10 @@ public class Counter {
 
 <h2>CounterTest</h2>
 
+<p>The <code>Counter</code> class is tested by obtaining a <code>Context</code> object and performing a JNDI lookup on it, to retrieve
+an instance of the <code>Counter</code> bean. After some state manipulation, a new instance is fetched from the container
+and we can see that it's a new instance.</p>
+
 <pre><code>package org.superbiz.counter;
 
 import junit.framework.TestCase;

Modified: websites/production/openejb/content/examples-trunk/simple-stateless-with-descriptor/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-stateless-with-descriptor/README.html (original)
+++ websites/production/openejb/content/examples-trunk/simple-stateless-with-descriptor/README.html Tue Dec 27 22:03:54 2011
@@ -82,7 +82,8 @@
 <h1>Simple Stateless with Descriptor</h1>
 </div>
 
-<p><em>Help us document this example! Source available in <a href="http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/simple-stateless-with-descriptor">svn</a> or <a href="https://github.com/apache/openejb/tree/trunk/openejb/examples/simple-stateless-with-descriptor">git</a>. Open a <a href="https://issues.apache.org/jira/browse/TOMEE">JIRA</a> with patch or pull request</em></p>
+<p>This test is similar to simple-stateless, with two major differences. In this case all the classes are regular POJOs without annotations.
+The EJB-specific metadata is provided via an XML descriptor. The second difference is the explicite use of Local and Remote interfaces. </p>
 
 <h2>CalculatorImpl</h2>
 
@@ -141,6 +142,8 @@ public interface CalculatorRemote {
 
 <h2>ejb-jar.xml</h2>
 
+<p>The XML descriptor defines the EJB class and both local and remote interfaces.</p>
+
 <pre><code>&lt;ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
@@ -160,6 +163,9 @@ public interface CalculatorRemote {
 
 <h2>CalculatorTest</h2>
 
+<p>Two tests obtain a Local and Remote interface to the bean instance. This time an <code>InitialContext</code> object is directly created, 
+as opposed to getting the context from <code>EJBContainer</code>, as we did in the previous example. </p>
+
 <pre><code>package org.superbiz.calculator;
 
 import junit.framework.TestCase;
@@ -174,7 +180,7 @@ public class CalculatorTest extends Test
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
 
         initialContext = new InitialContext(properties);
     }

Modified: websites/production/openejb/content/examples-trunk/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java (original)
+++ websites/production/openejb/content/examples-trunk/simple-stateless-with-descriptor/src/test/java/org/superbiz/calculator/CalculatorTest.java Tue Dec 27 22:03:54 2011
@@ -29,7 +29,7 @@ public class CalculatorTest extends Test
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
 
         initialContext = new InitialContext(properties);
     }

Modified: websites/production/openejb/content/examples-trunk/simple-webservice/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-webservice/README.html (original)
+++ websites/production/openejb/content/examples-trunk/simple-webservice/README.html Tue Dec 27 22:03:54 2011
@@ -275,7 +275,7 @@ public class CalculatorTest extends Test
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         initialContext = new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java (original)
+++ websites/production/openejb/content/examples-trunk/simple-webservice/src/test/java/org/superbiz/calculator/CalculatorTest.java Tue Dec 27 22:03:54 2011
@@ -45,7 +45,7 @@ public class CalculatorTest extends Test
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         initialContext = new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/spring-integration/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/spring-integration/README.html (original)
+++ websites/production/openejb/content/examples-trunk/spring-integration/README.html Tue Dec 27 22:03:54 2011
@@ -409,7 +409,7 @@ public class Theaters {
 
   &lt;!--
   Loads the EJBs from the classpath just as when embedding OpenEJB via
-  the org.apache.openejb.client.LocalInitialContextFactory.  All the discovered
+  the org.apache.openejb.localclient.LocalInitialContextFactory.  All the discovered
   EJBs are imported into this context and available for injection here.
   --&gt;
   &lt;bean name="classPathApplication" class="org.apache.openejb.spring.ClassPathApplication"/&gt;

Modified: websites/production/openejb/content/examples-trunk/spring-integration/src/main/resources/movies.xml
==============================================================================
--- websites/production/openejb/content/examples-trunk/spring-integration/src/main/resources/movies.xml (original)
+++ websites/production/openejb/content/examples-trunk/spring-integration/src/main/resources/movies.xml Tue Dec 27 22:03:54 2011
@@ -54,7 +54,7 @@
 
   <!--
   Loads the EJBs from the classpath just as when embedding OpenEJB via
-  the org.apache.openejb.client.LocalInitialContextFactory.  All the discovered
+  the org.apache.openejb.localclient.LocalInitialContextFactory.  All the discovered
   EJBs are imported into this context and available for injection here.
   -->
   <bean name="classPathApplication" class="org.apache.openejb.spring.ClassPathApplication"/>

Modified: websites/production/openejb/content/examples-trunk/telephone-stateful/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/telephone-stateful/README.html (original)
+++ websites/production/openejb/content/examples-trunk/telephone-stateful/README.html Tue Dec 27 22:03:54 2011
@@ -187,7 +187,7 @@ public class TelephoneTest extends TestC
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
         // Uncomment these properties to change the defaults
         //properties.setProperty("ejbd.port", "4202");
@@ -207,7 +207,7 @@ public class TelephoneTest extends TestC
     public void testTalkOverLocalNetwork() throws Exception {
 
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         InitialContext localContext = new InitialContext(properties);
 
         Telephone telephone = (Telephone) localContext.lookup("TelephoneBeanRemote");

Modified: websites/production/openejb/content/examples-trunk/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java (original)
+++ websites/production/openejb/content/examples-trunk/telephone-stateful/src/test/java/org/superbiz/telephone/TelephoneTest.java Tue Dec 27 22:03:54 2011
@@ -23,7 +23,7 @@ import javax.naming.InitialContext;
 import java.util.Properties;
 
 /**
- * @version $Rev: 1090810 $ $Date: 2011-04-10 14:49:26 +0000 (Sun, 10 Apr 2011) $
+ * @version $Rev: 1222119 $ $Date: 2011-12-22 09:23:14 +0000 (Thu, 22 Dec 2011) $
  */
 public class TelephoneTest extends TestCase {
 
@@ -31,7 +31,7 @@ public class TelephoneTest extends TestC
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
         // Uncomment these properties to change the defaults
         //properties.setProperty("ejbd.port", "4202");
@@ -53,7 +53,7 @@ public class TelephoneTest extends TestC
     public void testTalkOverLocalNetwork() throws Exception {
 
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         InitialContext localContext = new InitialContext(properties);
 
         Telephone telephone = (Telephone) localContext.lookup("TelephoneBeanRemote");

Modified: websites/production/openejb/content/examples-trunk/testing-security-2/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/testing-security-2/README.html (original)
+++ websites/production/openejb/content/examples-trunk/testing-security-2/README.html Tue Dec 27 22:03:54 2011
@@ -226,7 +226,7 @@ public class MovieTest extends TestCase 
 
     public void testAsManager() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put(Context.SECURITY_PRINCIPAL, "jane");
         p.put(Context.SECURITY_CREDENTIALS, "waterfall");
 
@@ -252,7 +252,7 @@ public class MovieTest extends TestCase 
 
     public void testAsEmployee() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put(Context.SECURITY_PRINCIPAL, "joe");
         p.put(Context.SECURITY_CREDENTIALS, "cool");
 

Modified: websites/production/openejb/content/examples-trunk/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java (original)
+++ websites/production/openejb/content/examples-trunk/testing-security-2/src/test/java/org/superbiz/injection/secure/MovieTest.java Tue Dec 27 22:03:54 2011
@@ -47,7 +47,7 @@ public class MovieTest extends TestCase 
 
     public void testAsManager() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put(Context.SECURITY_PRINCIPAL, "jane");
         p.put(Context.SECURITY_CREDENTIALS, "waterfall");
 
@@ -73,7 +73,7 @@ public class MovieTest extends TestCase 
 
     public void testAsEmployee() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put(Context.SECURITY_PRINCIPAL, "joe");
         p.put(Context.SECURITY_CREDENTIALS, "cool");
 

Modified: websites/production/openejb/content/examples-trunk/webapps/moviefun/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/moviefun/README.html (original)
+++ websites/production/openejb/content/examples-trunk/webapps/moviefun/README.html Tue Dec 27 22:03:54 2011
@@ -954,7 +954,7 @@ public class MoviesTest extends TestCase
 
     public void setUp() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put("movieDatabase", "new://Resource?type=DataSource");
         p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
         p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");

Modified: websites/production/openejb/content/examples-trunk/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/moviefun/app/src/test/java/org/superbiz/moviefun/MoviesTest.java Tue Dec 27 22:03:54 2011
@@ -43,7 +43,7 @@ public class MoviesTest extends TestCase
 
     public void setUp() throws Exception {
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put("movieDatabase", "new://Resource?type=DataSource");
         p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
         p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");

Modified: websites/production/openejb/content/examples-trunk/webapps/moviefun/monitor/src/main/resources/jndi.properties
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/moviefun/monitor/src/main/resources/jndi.properties (original)
+++ websites/production/openejb/content/examples-trunk/webapps/moviefun/monitor/src/main/resources/jndi.properties Tue Dec 27 22:03:54 2011
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-java.naming.factory.initial=org.apache.openejb.client.LocalInitialContextFactory
+java.naming.factory.initial=org.apache.openejb.localclient.LocalInitialContextFactory
 Default\ JMS\ Resource\ Adapter=new://Resource?type=ActiveMQResourceAdapter
 Default\ JMS\ Resource\ Adapter.BrokerXmlConfig=broker:vm://localhost
 Default\ JMS\ Resource\ Adapter.ServerUrl=tcp://localhost:61616

Modified: websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/bean/Manager.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/bean/Manager.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/bean/Manager.java Tue Dec 27 22:03:54 2011
@@ -21,9 +21,6 @@ import org.superbiz.resource.ManagerReso
 import javax.annotation.Resource;
 import javax.ejb.Singleton;
 
-/**
- * @author rmannibucau
- */
 @Singleton
 public class Manager {
     @Resource(name = "My Manager Team", type = ManagerResource.class)

Modified: websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/resource/ManagerResource.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/resource/ManagerResource.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/resource/ManagerResource.java Tue Dec 27 22:03:54 2011
@@ -16,9 +16,6 @@
  */
 package org.superbiz.resource;
 
-/**
- * @author rmannibucau
- */
 public class ManagerResource {
     public String resourceType() {
         return "team";

Modified: websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/servlet/ManagerServlet.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/servlet/ManagerServlet.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/resources-declared-in-webapp/src/main/java/org/superbiz/servlet/ManagerServlet.java Tue Dec 27 22:03:54 2011
@@ -26,9 +26,6 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
-/**
- * @author rmannibucau
- */
 @WebServlet(name = "manager servlet", urlPatterns = "/")
 public class ManagerServlet extends HttpServlet {
     @EJB

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/ApplicationConfig.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/ApplicationConfig.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/ApplicationConfig.java Tue Dec 27 22:03:54 2011
@@ -22,9 +22,6 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
 
-/**
- * @author rmannibucau
- */
 @ApplicationPath("/rest-prefix")
 public class ApplicationConfig extends Application {
     public Set<Class<?>> getClasses() {

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTEJB.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTEJB.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTEJB.java Tue Dec 27 22:03:54 2011
@@ -23,9 +23,6 @@ import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import java.util.Date;
 
-/**
- * @author rmannibucau
- */
 @Singleton
 @Lock(LockType.READ)
 @Path("/ejb")

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTPojo.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTPojo.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTPojo.java Tue Dec 27 22:03:54 2011
@@ -20,9 +20,6 @@ import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import java.util.Date;
 
-/**
- * @author rmannibucau
- */
 @Path("/pojo")
 public class SimpleRESTPojo {
     @GET

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/CommentDAO.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/CommentDAO.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/CommentDAO.java Tue Dec 27 22:03:54 2011
@@ -24,9 +24,6 @@ import javax.ejb.Stateless;
 import java.util.Collections;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Stateless
 public class CommentDAO extends DAO {
     @EJB

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/DAO.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/DAO.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/DAO.java Tue Dec 27 22:03:54 2011
@@ -26,7 +26,6 @@ import java.util.List;
  * Simply maps the entitymanager.
  * It simplifies refactoring (unitName change) and wraps some logic (limited queries).
  *
- * @author Romain Manni-Bucau
  */
 @Stateless
 public class DAO {

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/PostDAO.java Tue Dec 27 22:03:54 2011
@@ -23,9 +23,6 @@ import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Stateless
 public class PostDAO {
     @EJB

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/dao/UserDAO.java Tue Dec 27 22:03:54 2011
@@ -22,9 +22,6 @@ import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Stateless
 public class UserDAO {
     @EJB

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Comment.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Comment.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Comment.java Tue Dec 27 22:03:54 2011
@@ -28,9 +28,6 @@ import javax.validation.constraints.Size
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Entity
 @NamedQueries({
         @NamedQuery(name = "comment.list", query = "select c from Comment c")

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/DatedModel.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/DatedModel.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/DatedModel.java Tue Dec 27 22:03:54 2011
@@ -20,9 +20,6 @@ import javax.persistence.MappedSuperclas
 import javax.persistence.PrePersist;
 import java.util.Date;
 
-/**
- * @author Romain Manni-Bucau
- */
 @MappedSuperclass
 public abstract class DatedModel extends Model {
     private Date created;

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Model.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Model.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Model.java Tue Dec 27 22:03:54 2011
@@ -24,9 +24,6 @@ import javax.persistence.MappedSuperclas
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 
-/**
- * @author Romain Manni-Bucau
- */
 @MappedSuperclass
 @Access(AccessType.FIELD)
 @XmlAccessorType(XmlAccessType.FIELD)

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Post.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Post.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/Post.java Tue Dec 27 22:03:54 2011
@@ -30,9 +30,6 @@ import javax.xml.bind.annotation.XmlRoot
 import java.util.ArrayList;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Entity
 @NamedQueries({
         @NamedQuery(name = "post.list", query = "select p from Post p")

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/User.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/User.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/model/User.java Tue Dec 27 22:03:54 2011
@@ -24,9 +24,6 @@ import javax.validation.constraints.Patt
 import javax.validation.constraints.Size;
 import javax.xml.bind.annotation.XmlRootElement;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Entity
 @NamedQueries({
         @NamedQuery(name = "user.list", query = "select u from User u")

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/CommentService.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/CommentService.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/CommentService.java Tue Dec 27 22:03:54 2011
@@ -31,9 +31,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Path("/api/comment")
 @Produces({"text/xml", "application/json"})
 public class CommentService {

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/PostService.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/PostService.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/PostService.java Tue Dec 27 22:03:54 2011
@@ -31,9 +31,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Path("/api/post")
 @Produces({"text/xml", "application/json"})
 public class PostService {

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/UserService.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/UserService.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/main/java/org/superbiz/rest/service/UserService.java Tue Dec 27 22:03:54 2011
@@ -31,9 +31,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import java.util.List;
 
-/**
- * @author Romain Manni-Bucau
- */
 @Path("/api/user")
 @Produces({"text/xml", "application/json"})
 public class UserService {

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/test/java/org/superbiz/rest/dao/UserDaoTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/test/java/org/superbiz/rest/dao/UserDaoTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/test/java/org/superbiz/rest/dao/UserDaoTest.java Tue Dec 27 22:03:54 2011
@@ -26,9 +26,6 @@ import javax.naming.NamingException;
 
 import static junit.framework.Assert.assertNotNull;
 
-/**
- * @author rmannibucau
- */
 public class UserDaoTest {
     private static EJBContainer container;
 

Modified: websites/production/openejb/content/examples-trunk/webapps/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/rest-example/src/test/java/org/superbiz/rest/dao/UserServiceTest.java Tue Dec 27 22:03:54 2011
@@ -37,9 +37,6 @@ import java.util.Properties;
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertNotNull;
 
-/**
- * @author rmannibucau
- */
 public class UserServiceTest {
 
     private static EJBContainer container;

Modified: websites/production/openejb/content/examples-trunk/webapps/struts/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/struts/README.html (original)
+++ websites/production/openejb/content/examples-trunk/webapps/struts/README.html Tue Dec 27 22:03:54 2011
@@ -139,7 +139,7 @@ public class AddUser {
             UserService service = null;
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY,
-                    "org.apache.openejb.client.LocalInitialContextFactory");
+                    "org.apache.openejb.localclient.LocalInitialContextFactory");
             Context ctx = new InitialContext(props);
             service = (UserService) ctx.lookup("UserServiceImplLocal");
             service.add(new User(id, firstName, lastName));
@@ -208,7 +208,7 @@ public class FindUser {
             UserService service = null;
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY,
-                    "org.apache.openejb.client.LocalInitialContextFactory");
+                    "org.apache.openejb.localclient.LocalInitialContextFactory");
             Context ctx = new InitialContext(props);
             service = (UserService) ctx.lookup("UserServiceImplLocal");
             this.user = service.find(id);
@@ -278,7 +278,7 @@ public class ListAllUsers {
             UserService service = null;
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY,
-                    "org.apache.openejb.client.LocalInitialContextFactory");
+                    "org.apache.openejb.localclient.LocalInitialContextFactory");
             Context ctx = new InitialContext(props);
             service = (UserService) ctx.lookup("UserServiceImplLocal");
             this.users = service.findAll();

Modified: websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/AddUser.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/AddUser.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/AddUser.java Tue Dec 27 22:03:54 2011
@@ -68,7 +68,7 @@ public class AddUser {
             UserService service = null;
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY,
-                    "org.apache.openejb.client.LocalInitialContextFactory");
+                    "org.apache.openejb.localclient.LocalInitialContextFactory");
             Context ctx = new InitialContext(props);
             service = (UserService) ctx.lookup("UserServiceImplLocal");
             service.add(new User(id, firstName, lastName));

Modified: websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/FindUser.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/FindUser.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/FindUser.java Tue Dec 27 22:03:54 2011
@@ -57,7 +57,7 @@ public class FindUser {
             UserService service = null;
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY,
-                    "org.apache.openejb.client.LocalInitialContextFactory");
+                    "org.apache.openejb.localclient.LocalInitialContextFactory");
             Context ctx = new InitialContext(props);
             service = (UserService) ctx.lookup("UserServiceImplLocal");
             this.user = service.find(id);

Modified: websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/ListAllUsers.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/ListAllUsers.java (original)
+++ websites/production/openejb/content/examples-trunk/webapps/struts/src/main/java/org/superbiz/struts/ListAllUsers.java Tue Dec 27 22:03:54 2011
@@ -58,7 +58,7 @@ public class ListAllUsers {
             UserService service = null;
             Properties props = new Properties();
             props.put(Context.INITIAL_CONTEXT_FACTORY,
-                    "org.apache.openejb.client.LocalInitialContextFactory");
+                    "org.apache.openejb.localclient.LocalInitialContextFactory");
             Context ctx = new InitialContext(props);
             service = (UserService) ctx.lookup("UserServiceImplLocal");
             this.users = service.findAll();

Modified: websites/production/openejb/content/examples-trunk/webservice-attachments/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-attachments/README.html (original)
+++ websites/production/openejb/content/examples-trunk/webservice-attachments/README.html Tue Dec 27 22:03:54 2011
@@ -196,7 +196,7 @@ public class AttachmentTest extends Test
     protected void setUp() throws Exception {
 
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         initialContext = new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webservice-attachments/src/test/java/org/superbiz/attachment/AttachmentTest.java Tue Dec 27 22:03:54 2011
@@ -38,7 +38,7 @@ public class AttachmentTest extends Test
     protected void setUp() throws Exception {
 
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         initialContext = new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/webservice-inheritance/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-inheritance/README.html (original)
+++ websites/production/openejb/content/examples-trunk/webservice-inheritance/README.html Tue Dec 27 22:03:54 2011
@@ -334,7 +334,7 @@ public class InheritanceTest extends Tes
     protected void setUp() throws Exception {
 
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put("wakeBoardDatabase", "new://Resource?type=DataSource");
         p.put("wakeBoardDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
         p.put("wakeBoardDatabase.JdbcUrl", "jdbc:hsqldb:mem:wakeBoarddb");

Modified: websites/production/openejb/content/examples-trunk/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webservice-inheritance/src/test/java/org/superbiz/inheritance/InheritanceTest.java Tue Dec 27 22:03:54 2011
@@ -35,7 +35,7 @@ public class InheritanceTest extends Tes
     protected void setUp() throws Exception {
 
         Properties p = new Properties();
-        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         p.put("wakeBoardDatabase", "new://Resource?type=DataSource");
         p.put("wakeBoardDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
         p.put("wakeBoardDatabase.JdbcUrl", "jdbc:hsqldb:mem:wakeBoarddb");

Modified: websites/production/openejb/content/examples-trunk/webservice-security/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-security/README.html (original)
+++ websites/production/openejb/content/examples-trunk/webservice-security/README.html Tue Dec 27 22:03:54 2011
@@ -201,7 +201,7 @@ public class CalculatorTest extends Test
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         initialContext = new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webservice-security/src/test/java/org/superbiz/calculator/CalculatorTest.java Tue Dec 27 22:03:54 2011
@@ -33,7 +33,7 @@ public class CalculatorTest extends Test
 
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         initialContext = new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/webservice-ws-security/README.html
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-ws-security/README.html (original)
+++ websites/production/openejb/content/examples-trunk/webservice-ws-security/README.html Tue Dec 27 22:03:54 2011
@@ -400,7 +400,7 @@ public class CalculatorTest extends Test
     //START SNIPPET: setup
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         new InitialContext(properties);

Modified: websites/production/openejb/content/examples-trunk/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java
==============================================================================
--- websites/production/openejb/content/examples-trunk/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java (original)
+++ websites/production/openejb/content/examples-trunk/webservice-ws-security/src/test/java/org/superbiz/calculator/CalculatorTest.java Tue Dec 27 22:03:54 2011
@@ -47,7 +47,7 @@ public class CalculatorTest extends Test
     //START SNIPPET: setup
     protected void setUp() throws Exception {
         Properties properties = new Properties();
-        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.localclient.LocalInitialContextFactory");
         properties.setProperty("openejb.embedded.remotable", "true");
 
         new InitialContext(properties);

Modified: websites/production/openejb/content/singleton-example.html
==============================================================================
--- websites/production/openejb/content/singleton-example.html (original)
+++ websites/production/openejb/content/singleton-example.html Tue Dec 27 22:03:54 2011
@@ -72,148 +72,180 @@
 <h1>Singleton Example</h1>
 </div>
 
-<p><div class="tip">:title=OpenEJB 3.1 or later required}
-<a name="SingletonExample-Overview"></a></p>
-
 <h1>Overview</h1>
 
-<p>As the name implies a javax.ejb.Singleton is a session bean with a
-guarantee that there is at most one instance in the application.</p>
-
-<p>What it gives you that is completely missing in EJB 3.0 and prior versions
-is the ability to have an EJB that is notified when the application starts
-and notified when the application stops.  So you can do all sorts of things
-that you previously could only do with a load-on-startup servlet.  It also
-gives you a place to hold data that pertains to the entire application and
-all users using it, without the need for a static.  Additionally, Singleton
-beans can be invoked by several threads at one time similar to a Servlet.</p>
+<p>As the name implies a javax.ejb.Singleton is a session bean with a guarantee that there is at most one instance in the application.</p>
 
-<p><em>See the <a href="singleton-beans.html">Singleton Beans</a>
- page for a full description of the javax.ejb.Singleton api.</em></p>
+<p>What it gives that is completely missing in EJB 3.0 and prior versions is the ability to have an EJB that is notified when the application starts and notified when the application stops. So you can do all sorts of things that you previously could only do with a load-on-startup servlet. It also gives you a place to hold data that pertains to the entire application and all users using it, without the need for a static. Additionally, Singleton beans can be invoked by several threads at one time similar to a Servlet.</p>
 
-<p><a name="SingletonExample-TheCode"></a></p>
+<p>See the Singleton Beans Javadocs linked at the bottom for a full description.</p>
 
 <h1>The Code</h1>
 
-<p><a name="SingletonExample-PropertyRegistryBean"></a></p>
+<p>PropertyRegistryBean</p>
 
-<h2>PropertyRegistryBean</h2>
+<p>Here we see a bean that uses the Bean-Managed Concurrency option as well as the @Startup annotation which causes the bean to be instantiated by the container when the application starts. Singleton beans with @ConcurrencyManagement(BEAN) are responsible for their own thread-safety. The bean shown is a simple properties "registry" and provides a place where options could be set and retrieved by all beans in the application.</p>
 
-<p>Here we see a bean that uses the Bean-Managed Concurrency option as well as
-the <em>@Startup</em> annotation which causes the bean to be instantiated by the
-container when the application starts.  Singleton beans with
-<em>@ConcurrencyManagement(BEAN)</em> are responsible for their own thread-safety.
- The bean shown is a simple properties "registry" and provides a place
-where options could be set and retrieved by all beans in the application.
-<div class="snippet">:url=openejb3/examples/simple-singleton/src/main/java/org/superbiz/registry/PropertyRegistryBean.java|lang=java|id=code}</p>
-
-<p><a name="SingletonExample-ComponentRegistryBean"></a></p>
-
-<h2>ComponentRegistryBean</h2>
-
-<p>Here we see a bean that uses the Container-Managed Concurrency option, the
-default.  With <em>@ConcurrencyManagement(CONTAINER)</em> the container controls
-whether multi-threaded access should be allowed to the bean (<em>@Lock(READ)</em>)
-or if single-threaded access should be enforced (<em>@Lock(WRITE)</em>).
-<div class="snippet">:url=openejb3/examples/simple-singleton/src/main/java/org/superbiz/registry/ComponentRegistryBean.java|lang=java|id=code}</p>
-
-<p>Unless specified explicitly on the bean class or a method, the default
-@Lock value is @Lock(WRITE).  The code above uses the @Lock(READ)
-annotation on bean class to change the default so that multi-threaded
-access is granted by default.  We then only need to apply the @Lock(WRITE)
-annotation to the methods that modify the state of the bean.</p>
-
-<p>Essentially @Lock(READ) allows multithreaded access to the Singleton bean
-instance <em>unless</em> someone is invoking an @Lock(WRITE) method.  With
-@Lock(WRITE), the thread invoking the bean will be guaranteed to have
-exclusive access to the Singleton bean instance for the duration of its
-invocation.  This combination allows the bean instance to use data types
-that are not normally thread safe.  Great care must still be used, though.  </p>
+<pre><code>
+import static javax.ejb.ConcurrencyManagementType.BEAN;
+import javax.ejb.Singleton;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.Startup;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import java.util.Properties;
+@Singleton
+@ConcurrencyManagement(BEAN)
+@Startup
+public class PropertyRegistryBean implements PropertyRegistry {
+    // Note the java.util.Properties object is a thread-safe
+    // collections that uses synchronization.  If it didn't
+    // you would have to use some form of synchronization
+    // to ensure the PropertyRegistryBean is thread-safe.
+    private final Properties properties = new Properties();
+
+    // The @Startup method ensures that this method is
+    // called when the application starts up.
+    @PostConstruct
+    public void applicationStartup() {
+        properties.putAll(System.getProperties());
+    }
+    @PreDestroy
+    public void applicationShutdown() {
+        properties.clear();
+    }
+    public String getProperty(String key) {
+        return properties.getProperty(key);
+    }
+
+    public String setProperty(String key, String value) {
+        return (String) properties.setProperty(key, value);
+    }
+
+    public String removeProperty(String key) {
+        return (String) properties.remove(key);
+    }
+</div>
+</code></pre>
 
-<p>In the example we see ComponentRegistryBean using a java.util.HashMap which
-is not synchronized.  To make this ok we do three things:</p>
+<p>ComponentRegistryBean</p>
 
-<ol>
-<li>Encapsulation.  We don't expose the HashMap instance directly; including
-its iterators, key set, value set or entry set.</li>
-<li>We use @Lock(WRITE) on the methods that mutate the map such as the put()
-and remove() methods.  </li>
-<li>We use @Lock(READ) on the get() and values() methods as they do not
-change the map state and are guaranteed not to be called at the same as any
-of the @Lock(WRITE) methods, so we know the state of the HashMap is no
-being mutated and therefore safe for reading.</li>
-</ol>
+<p>Here we see a bean that uses the Container-Managed Concurrency option, the default. With @ConcurrencyManagement(CONTAINER) the container controls whether multi-threaded access should be allowed to the bean (@Lock(READ)) or if single-threaded access should be enforced (@Lock(WRITE)).</p>
 
-<p>The end result is that the threading model for this bean will switch from
-multi-threaded access to single-threaded access dynamically as needed
-depending on the which methods are being invoked.  This gives Singletons a
-bit of an advantage over Servlets for processing multi-threaded requests.</p>
+<pre><code>
+import static javax.ejb.LockType.READ;
+import static javax.ejb.LockType.WRITE;
+import javax.ejb.Lock;
+import javax.ejb.Singleton;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collection;
+import java.util.ArrayList;
+
+@Singleton
+@Lock(READ)
+public class ComponentRegistryBean implements ComponentRegistry {
+
+    private final Map<Class, Object> components = new HashMap<Class, Object>();
+
+    public <T> T getComponent(Class<T> type) {
+        return (T) components.get(type);
+    }
+
+    public Collection<?> getComponents() {
+        return new ArrayList(components.values());
+    }
+
+    @Lock(WRITE)
+    public <T> T setComponent(Class<T> type, T value) {
+        return (T) components.put(type, value);
+    }
+
+    @Lock(WRITE)
+    public <T> T removeComponent(Class<T> type) {
+        return (T) components.remove(type);
+    }
+</div>
+</code></pre>
 
-<p><em>See the <a href="singleton-beans.html">Singleton Beans</a>
- page for more advanced details on Container-Managed Concurrency.</em></p>
+<p>Unless specified explicitly on the bean class or a method, the default @Lock value is @Lock(WRITE). The code above uses the @Lock(READ) annotation on bean class to change the default so that multi-threaded access is granted by default. We then only need to apply the @Lock(WRITE) annotation to the methods that modify the state of the bean.</p>
 
-<p><a name="SingletonExample-TestCase"></a></p>
+<p>Essentially @Lock(READ) allows multithreaded access to the Singleton bean instance unless someone is invoking an @Lock(WRITE) method. With @Lock(WRITE), the thread invoking the bean will be guaranteed to have exclusive access to the Singleton bean instance for the duration of its invocation. This combination allows the bean instance to use data types that are not normally thread safe. Great care must still be used, though.</p>
 
-<h1>Test Case</h1>
+<p>In the example we see ComponentRegistryBean using a java.util.HashMap which is not synchronized. To make this ok we do three things:</p>
 
-<p><div class="snippet">:url=openejb3/examples/simple-singleton/src/test/java/org/superbiz/registry/ComponentRegistryBeanTest.java|lang=java|id=code}</p>
+<ol>
+<li>Encapsulation. We don't expose the HashMap instance directly; including its iterators, key set, value set or entry set.</li>
+<li>We use @Lock(WRITE) on the methods that mutate the map such as the put() and remove() methods.</li>
+<li>We use @Lock(READ) on the get() and values() methods as they do not change the map state and are guaranteed not to be called at the same as any of the @Lock(WRITE) methods, so we know the state of the HashMap is no being mutated and therefore safe for reading.</li>
+</ol>
+
+<p>The end result is that the threading model for this bean will switch from multi-threaded access to single-threaded access dynamically as needed depending on the which methods are being invoked. This gives Singletons a bit of an advantage over Servlets for processing multi-threaded requests.</p>
 
-<p><a name="SingletonExample-Running"></a></p>
+<p>See the Singleton Beans page for more advanced details on Container-Managed Concurrency.
+Test Case</p>
+
+<pre><code>
+public class ComponentRegistryBeanTest extends TestCase {
+    public void test() throws Exception {
+        Properties props = new Properties();
+        props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+        InitialContext context = new InitialContext(props);
+        // Both references below will point to the exact same instance
+        ComponentRegistry one = (ComponentRegistry) context.lookup("ComponentRegistryBeanLocal");
+        ComponentRegistry two = (ComponentRegistry) context.lookup("ComponentRegistryBeanLocal");
+        URI expectedUri = new URI("foo://bar/baz");
+        one.setComponent(URI.class, expectedUri);
+        URI actualUri = two.getComponent(URI.class);
+        assertSame(expectedUri, actualUri);
+        Date expectedDate = new Date();
+        two.setComponent(Date.class, expectedDate);
+        Date actualDate = one.getComponent(Date.class);
+        assertSame(expectedDate, actualDate);
+    </div>}
+</code></pre>
 
 <h1>Running</h1>
 
-<p>Running the example is fairly simple.  In the "simple-singleton" directory
-run:</p>
+<p>Running the example is fairly simple. In the "simple-singleton" directory run:</p>
 
 <p>$ mvn clean install</p>
 
 <p>Which should create output like the following.</p>
 
-<pre><code>-------------------------------------------------------
- T E S T S
--------------------------------------------------------
+<h1>Tests</h1>
+
+<pre><code>
 Running org.superbiz.registry.ComponentRegistryBeanTest
 Apache OpenEJB 3.1-SNAPSHOT    build: 20080820-09:53
 http://openejb.apache.org/
-INFO - openejb.home =
-</code></pre>
+INFO - openejb.home = /Users/dblevins/work/openejb3/examples/simple-singleton
+INFO - openejb.base = /Users/dblevins/work/openejb3/examples/simple-singleton
+INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Found EjbModule in classpath: /Users/dblevins/work/openejb3/examples/simple-singleton/target/classes
+INFO - Beginning load: /Users/dblevins/work/openejb3/examples/simple-singleton/target/classes
+INFO - Configuring enterprise application: classpath.ear
+INFO - Configuring Service(id=Default Singleton Container, type=Container, provider-id=Default Singleton Container)
+INFO - Auto-creating a container for bean ComponentRegistryBean: Container(type=SINGLETON, id=Default Singleton Container)
+INFO - Enterprise application "classpath.ear" loaded.
+INFO - Assembling app: classpath.ear
+INFO - Jndi(name=ComponentRegistryBeanLocal) --> Ejb(deployment-id=ComponentRegistryBean)
+INFO - Jndi(name=PropertyRegistryBeanLocal) --> Ejb(deployment-id=PropertyRegistryBean)
+INFO - Created Ejb(deployment-id=ComponentRegistryBean, ejb-name=ComponentRegistryBean, container=Default Singleton Container)
+INFO - Created Ejb(deployment-id=PropertyRegistryBean, ejb-name=PropertyRegistryBean, container=Default Singleton Container)
+INFO - Deployed Application(path=classpath.ear)
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.879 sec
+Running org.superbiz.registry.PropertiesRegistryBeanTest
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec
 
-<p>/Users/dblevins/work/openejb3/examples/simple-singleton
-    INFO - openejb.base =
-/Users/dblevins/work/openejb3/examples/simple-singleton
-    INFO - Configuring Service(id=Default Security Service,
-type=SecurityService, provider-id=Default Security Service)
-    INFO - Configuring Service(id=Default Transaction Manager,
-type=TransactionManager, provider-id=Default Transaction Manager)
-    INFO - Found EjbModule in classpath:
-/Users/dblevins/work/openejb3/examples/simple-singleton/target/classes
-    INFO - Beginning load:
-/Users/dblevins/work/openejb3/examples/simple-singleton/target/classes
-    INFO - Configuring enterprise application: classpath.ear
-    INFO - Configuring Service(id=Default Singleton Container, type=Container,
-provider-id=Default Singleton Container)
-    INFO - Auto-creating a container for bean ComponentRegistryBean:
-Container(type=SINGLETON, id=Default Singleton Container)
-    INFO - Enterprise application "classpath.ear" loaded.
-    INFO - Assembling app: classpath.ear
-    INFO - Jndi(name=ComponentRegistryBeanLocal) -->
-Ejb(deployment-id=ComponentRegistryBean)
-    INFO - Jndi(name=PropertyRegistryBeanLocal) -->
-Ejb(deployment-id=PropertyRegistryBean)
-    INFO - Created Ejb(deployment-id=ComponentRegistryBean,
-ejb-name=ComponentRegistryBean, container=Default Singleton Container)
-    INFO - Created Ejb(deployment-id=PropertyRegistryBean,
-ejb-name=PropertyRegistryBean, container=Default Singleton Container)
-    INFO - Deployed Application(path=classpath.ear)
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.879 sec
-    Running org.superbiz.registry.PropertiesRegistryBeanTest
-    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec</p>
-
-<pre><code>Results :
+Results :
 
 Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
 </code></pre>
 
+<p></div></p>
+