You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by bu...@apache.org on 2011/07/10 07:37:10 UTC

svn commit: r792466 [13/19] - /websites/staging/openejb/trunk/content/

Added: websites/staging/openejb/trunk/content/openjpa.html
==============================================================================
--- websites/staging/openejb/trunk/content/openjpa.html (added)
+++ websites/staging/openejb/trunk/content/openjpa.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,211 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>OpenJPA</title>
+    <link rel="stylesheet" type="text/css" media="screen" href="http://incubator.apache.org/lucy/css/lucy.css">
+  </head>
+
+  <body>
+
+    <div id="lucy-rigid_wrapper">
+
+      <div id="lucy-top" class="container_16 lucy-white_box_3d">
+
+        <div id="lucy-logo_box" class="grid_8">
+          <a href="/OpenEJB/"><img src="http://openejb.apache.org/images/logo_openejb.gif" alt="Apache OpenEJB™"></a>
+        </div> <!-- lucy-logo_box -->
+
+        <div #id="lucy-top_nav_box" class="grid_8">
+          <div id="lucy-top_nav_bar" class="container_8">
+            <ul>
+              <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li>
+              <li><a href="http://www.apache.org/licenses/" title="License">License</a></li>
+              <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li>
+              <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li>
+              <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li>
+            </ul>
+          </div> <!-- lucy-top_nav_bar -->
+          <p><a href="http://www.apache.org/">Apache</a>&nbsp;&raquo&nbsp;<a href="/">Incubator</a></p>
+          <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get">
+            <input value="*.apache.org" name="sitesearch" type="hidden"/>
+            <input type="text" name="q" id="query" style="width:85%">
+            <input type="submit" id="submit" value="Search">
+          </form>
+        </div> <!-- lucy-top_nav_box -->
+
+        <div class="clear"></div>
+
+      </div> <!-- lucy-top -->
+
+      <div id="lucy-main_content" class="container_16 lucy-white_box_3d">
+
+        <div class="grid_4" id="lucy-left_nav_box">
+          <h6>About</h6>
+            <ul>
+              <li><a href="/lucy/">Welcome</a></li>
+              <li><a href="/lucy/faq.html">FAQ</a></li>
+              <li><a href="/lucy/people.html">People</a></li>
+            </ul>
+          <h6>Resources</h6>
+            <ul>
+              <li><a href="/lucy/download.html">Download</a></li>
+              <li><a href="/lucy/mailing_lists.html">Mailing Lists</a></li>
+              <li><a href="/lucy/docs/perl/">Documentation</a></li>
+              <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li>
+              <li><a href="/lucy/version_control.html">Version Control</a></li>
+            </ul>
+          <h6>Related Projects</h6>
+            <ul>
+              <li><a href="http://lucene.apache.org/java/">Lucene</a></li>
+              <li><a href="http://lucene.apache.org/solr/">Solr</a></li>
+              <li><a href="http://incubator.apache.org/lucene.net/">Lucene.NET</a></li>
+              <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li>
+              <li><a href="http://lucene.apache.org/openrelevance/">Open Relevance</a></li>
+            </ul>
+        </div> <!-- lucy-left_nav_box -->
+
+        <div id="lucy-main_content_box" class="grid_9">
+          <p>OpenJPA is bundled with OpenEJB as the default persistence provider.</p>
+
+<p>An example of  working persistence.xml for OpenJPA:</p>
+
+<p>{code:xml|title=persistence.xml}
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"></p>
+
+<p><persistence-unit name="movie-unit">
+    <jta-data-source>movieDatabase</jta-data-source>
+    <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source>
+    <class>org.superbiz.injection.jpa.Movie</class></p>
+
+<pre><code>&lt;properties&gt;
+  &lt;property name="openjpa.jdbc.SynchronizeMappings"
+</code></pre>
+
+<p>value="buildSchema(ForeignKeys=true)"/>
+    </properties>
+  </persistence-unit>
+</persistence></p>
+
+<pre><code>Where the datasources above are configured in your openejb.xml as follows:
+
+{code:xml|title=openejb.xml}
+&lt;Resource id="movieDatabase" type="DataSource"&gt;
+  JdbcDriver = org.hsqldb.jdbcDriver
+  JdbcUrl = jdbc:hsqldb:mem:moviedb
+&lt;/Resource&gt;
+
+&lt;Resource id="movieDatabaseUnmanaged" type="DataSource"&gt;
+  JdbcDriver = org.hsqldb.jdbcDriver
+  JdbcUrl = jdbc:hsqldb:mem:moviedb
+  JtaManaged = false
+&lt;/Resource&gt;
+</code></pre>
+
+<p>Or in properties as follows:</p>
+
+<p>{code:xml|title=java.lang.System or InitialContext properties}
+p.put("movieDatabase", "new://Resource?type=DataSource");
+p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
+p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");</p>
+
+<p>p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
+p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
+p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
+p.put("movieDatabaseUnmanaged.JtaManaged", "false");</p>
+
+<pre><code>h1. Common exceptions
+
+h2. Table not found in statement
+
+Or as derby will report it "Table 'abc.xyz' doesn't exist"
+
+Someone has to create the database structure for your persistent objects. 
+</code></pre>
+
+<p>If you add the <em>openjpa.jdbc.SynchronizeMappings</em> property as shown below
+OpenJPA will auto-create all your tables, all your primary keys and all
+foreign keys exactly to match your objects.</p>
+
+<pre><code>{code:xml|title=persistence.xml}
+&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"&gt;
+
+ &lt;persistence-unit name="movie-unit"&gt;
+   &lt;!-- your other stuff --&gt;
+
+   &lt;properties&gt;
+     &lt;property name="openjpa.jdbc.SynchronizeMappings"
+</code></pre>
+
+<p>value="buildSchema(ForeignKeys=true)"/>
+       </properties>
+     </persistence-unit>
+    </persistence></p>
+
+<p><a name="OpenJPA-Auto-commitcannotbesetwhileenrolledinatransaction"></a></p>
+
+<h2>Auto-commit can not be set while enrolled in a transaction</h2>
+
+<p>Pending</p>
+
+<p><a name="OpenJPA-Thisbrokerisnotconfiguredtousemanagedtransactions."></a></p>
+
+<h2>This broker is not configured to use managed transactions.</h2>
+
+<p><a name="OpenJPA-Setup"></a></p>
+
+<h3>Setup</h3>
+
+<p>Using a EXTENDED persistence context ...
+<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>bean code</B></DIV><DIV class="codeContent panelContent">
+    @PersistenceContext(unitName = "movie-unit", type =
+PersistenceContextType.EXTENDED)
+    EntityManager entityManager;</p>
+
+<p>on a persistence unit setup as RESOURCE_LOCAL ...
+{code:xml|title=persistence.xml}
+<persistence-unit name="movie-unit" transaction-type="RESOURCE_LOCAL">
+  ...
+</persistence-unit></p>
+
+<pre><code>inside of a transaction.
+{code:title=bean code}
+@TransactionAttribute(TransactionAttributeType.REQUIRED)
+public void addMovie(Movie movie) throws Exception {
+    entityManager.persist(movie);
+}
+</code></pre>
+
+<p>Note the default transaction attribute for any ejb method is REQUIRED
+unless explicitly set otherwise in the bean class or method in question.</p>
+
+<p><a name="OpenJPA-Solutions"></a></p>
+
+<h3>Solutions</h3>
+
+<p>You can either:
+1. Change your bean or it's method to use
+TransactionAttributeType.NOT_REQUIRED or TransactionAttributeType.NEVER
+which will guarantee it will not be invoked in a JTA transaction.
+1. Change your persistence.xml so the persistence-unit uses
+transaction-type="TRANSACTION" making it capable of participating in a JTA
+transaction.</p>
+
+        </div> <!-- lucy-main_content_box --> 
+        <div class="clear"></div>
+
+      </div> <!-- lucy-main_content -->
+
+      <div id="lucy-copyright" class="container_16">
+        <p>Copyright &#169; 2010-2011 The Apache Software Foundation, Licensed under the 
+           <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+           <br/>
+          
+        </p>
+      </div> <!-- lucy-copyright -->
+
+    </div> <!-- lucy-rigid_wrapper -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/persistence-context.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/persistence-context.cwiki (added)
+++ websites/staging/openejb/trunk/content/persistence-context.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,50 @@
+h1.  Via annotation
+
+Both lookup and injection of an EntityManager can be configured via the @PersistenceContext annotation.
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz;
+
+import javax.persistence.PersistenceContext;
+import javax.persistence.EntityManager;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+
+@Stateless
+@PersistenceContext(name = "myFooEntityManager", unitName = "foo-unit")
+public class MyBean implements MyInterface {
+
+    @PersistenceContext(unitName = "bar-unit")
+    private EntityManager myBarEntityManager;
+
+    public void someBusinessMethod() throws Exception {
+        if (myBarEntityManager == null) throw new NullPointerException("myBarEntityManager not injected");
+
+        // Both can be looked up from JNDI as well
+        InitialContext context = new InitialContext();
+        EntityManager fooEntityManager = (EntityManager) context.lookup("java:comp/env/myFooEntityManager");
+        EntityManager barEntityManager = (EntityManager) context.lookup("java:comp/env/org.superbiz.MyBean/myBarEntityManager");
+    }
+}
+{code}
+
+h1. Via xml
+
+The above @PersistenceContext annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-context-ref>
+    <persistence-context-ref-name>myFooEntityManager</persistence-context-ref-name>
+    <persistence-unit-name>foo-unit</persistence-unit-name>
+    <persistence-context-type>Transaction</persistence-context-type>
+</persistence-context-ref>
+<persistence-context-ref>
+    <persistence-context-ref-name>org.superbiz.calculator.MyBean/myBarEntityManager</persistence-context-ref-name>
+    <persistence-unit-name>bar-unit</persistence-unit-name>
+    <persistence-context-type>Transaction</persistence-context-type>
+    <injection-target>
+        <injection-target-class>org.superbiz.calculator.MyBean</injection-target-class>
+        <injection-target-name>myBarEntityManager</injection-target-name>
+    </injection-target>
+</persistence-context-ref>
+{code}
\ No newline at end of file

Added: websites/staging/openejb/trunk/content/persistence-context.html
==============================================================================
--- websites/staging/openejb/trunk/content/persistence-context.html (added)
+++ websites/staging/openejb/trunk/content/persistence-context.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,151 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>persistence-context</title>
+    <link rel="stylesheet" type="text/css" media="screen" href="http://incubator.apache.org/lucy/css/lucy.css">
+  </head>
+
+  <body>
+
+    <div id="lucy-rigid_wrapper">
+
+      <div id="lucy-top" class="container_16 lucy-white_box_3d">
+
+        <div id="lucy-logo_box" class="grid_8">
+          <a href="/OpenEJB/"><img src="http://openejb.apache.org/images/logo_openejb.gif" alt="Apache OpenEJB™"></a>
+        </div> <!-- lucy-logo_box -->
+
+        <div #id="lucy-top_nav_box" class="grid_8">
+          <div id="lucy-top_nav_bar" class="container_8">
+            <ul>
+              <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li>
+              <li><a href="http://www.apache.org/licenses/" title="License">License</a></li>
+              <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li>
+              <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li>
+              <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li>
+            </ul>
+          </div> <!-- lucy-top_nav_bar -->
+          <p><a href="http://www.apache.org/">Apache</a>&nbsp;&raquo&nbsp;<a href="/">Incubator</a></p>
+          <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get">
+            <input value="*.apache.org" name="sitesearch" type="hidden"/>
+            <input type="text" name="q" id="query" style="width:85%">
+            <input type="submit" id="submit" value="Search">
+          </form>
+        </div> <!-- lucy-top_nav_box -->
+
+        <div class="clear"></div>
+
+      </div> <!-- lucy-top -->
+
+      <div id="lucy-main_content" class="container_16 lucy-white_box_3d">
+
+        <div class="grid_4" id="lucy-left_nav_box">
+          <h6>About</h6>
+            <ul>
+              <li><a href="/lucy/">Welcome</a></li>
+              <li><a href="/lucy/faq.html">FAQ</a></li>
+              <li><a href="/lucy/people.html">People</a></li>
+            </ul>
+          <h6>Resources</h6>
+            <ul>
+              <li><a href="/lucy/download.html">Download</a></li>
+              <li><a href="/lucy/mailing_lists.html">Mailing Lists</a></li>
+              <li><a href="/lucy/docs/perl/">Documentation</a></li>
+              <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li>
+              <li><a href="/lucy/version_control.html">Version Control</a></li>
+            </ul>
+          <h6>Related Projects</h6>
+            <ul>
+              <li><a href="http://lucene.apache.org/java/">Lucene</a></li>
+              <li><a href="http://lucene.apache.org/solr/">Solr</a></li>
+              <li><a href="http://incubator.apache.org/lucene.net/">Lucene.NET</a></li>
+              <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li>
+              <li><a href="http://lucene.apache.org/openrelevance/">Open Relevance</a></li>
+            </ul>
+        </div> <!-- lucy-left_nav_box -->
+
+        <div id="lucy-main_content_box" class="grid_9">
+          <p><a name="persistence-context-Viaannotation"></a></p>
+
+<h1>Via annotation</h1>
+
+<p>Both lookup and injection of an EntityManager can be configured via the
+@PersistenceContext annotation.</p>
+
+<p><DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Usable by EJB, Interceptor, Servlet, Filter, or Listener</B></DIV><DIV class="codeContent panelContent">
+    package org.superbiz;</p>
+
+<pre><code>import javax.persistence.PersistenceContext;
+import javax.persistence.EntityManager;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+
+@Stateless
+@PersistenceContext(name = "myFooEntityManager", unitName = "foo-unit")
+public class MyBean implements MyInterface {
+
+    @PersistenceContext(unitName = "bar-unit")
+    private EntityManager myBarEntityManager;
+
+    public void someBusinessMethod() throws Exception {
+    if (myBarEntityManager == null) throw new
+</code></pre>
+
+<p>NullPointerException("myBarEntityManager not injected");</p>
+
+<pre><code>    // Both can be looked up from JNDI as well
+    InitialContext context = new InitialContext();
+    EntityManager fooEntityManager = (EntityManager)
+</code></pre>
+
+<p>context.lookup("java:comp/env/myFooEntityManager");
+        EntityManager barEntityManager = (EntityManager)
+context.lookup("java:comp/env/org.superbiz.MyBean/myBarEntityManager");
+        }
+    }</p>
+
+<p><a name="persistence-context-Viaxml"></a></p>
+
+<h1>Via xml</h1>
+
+<p>The above @PersistenceContext annotation usage is 100% equivalent to the
+following xml.</p>
+
+<p>{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-context-ref></p>
+
+<p><persistence-context-ref-name>myFooEntityManager</persistence-context-ref-name>
+    <persistence-unit-name>foo-unit</persistence-unit-name>
+    <persistence-context-type>Transaction</persistence-context-type>
+</persistence-context-ref>
+<persistence-context-ref></p>
+
+<p><persistence-context-ref-name>org.superbiz.calculator.MyBean/myBarEntityManager</persistence-context-ref-name>
+    <persistence-unit-name>bar-unit</persistence-unit-name>
+    <persistence-context-type>Transaction</persistence-context-type>
+    <injection-target></p>
+
+<p><injection-target-class>org.superbiz.calculator.MyBean</injection-target-class>
+    <injection-target-name>myBarEntityManager</injection-target-name>
+    </injection-target>
+</persistence-context-ref></p>
+
+        </div> <!-- lucy-main_content_box --> 
+        <div class="clear"></div>
+
+      </div> <!-- lucy-main_content -->
+
+      <div id="lucy-copyright" class="container_16">
+        <p>Copyright &#169; 2010-2011 The Apache Software Foundation, Licensed under the 
+           <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+           <br/>
+          
+        </p>
+      </div> <!-- lucy-copyright -->
+
+    </div> <!-- lucy-rigid_wrapper -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/persistence-unit-ref.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/persistence-unit-ref.cwiki (added)
+++ websites/staging/openejb/trunk/content/persistence-unit-ref.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,82 @@
+Both lookup and injection of an EntityManagerFactory can be configured via the @PersistenceUnit annotation or <persistence-unit-ref> in xml.  Annotations and xml have equal function in both lookup and injection.
+
+h1.  Injection and Lookup
+
+h2.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz;
+
+import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
+import javax.ejb.Stateless;
+import javax.naming.InitialUnit;
+
+@Stateless
+public class MyBean implements MyInterface {
+
+    @PersistenceUnit(unitName = "bar-unit")
+    private EntityManagerFactory myBarEntityManagerFactory;
+
+    public void someBusinessMethod() throws Exception {
+        if (myBarEntityManagerFactory == null) throw new NullPointerException("myBarEntityManagerFactory not injected");
+
+        // Both can be looked up from JNDI as well
+        InitialContext unit = new InitialContext();
+        EntityManagerFactory barEntityManagerFactory = (EntityManagerFactory) context.lookup("java:comp/env/org.superbiz.MyBean/myBarEntityManagerFactory");
+    }
+}
+{code}
+
+h2. Via xml
+
+The above @PersistenceUnit annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref>
+    <persistence-unit-ref-name>org.superbiz.calculator.MyBean/myBarEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>bar-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+    <injection-target>
+        <injection-target-class>org.superbiz.calculator.MyBean</injection-target-class>
+        <injection-target-name>myBarEntityManagerFactory</injection-target-name>
+    </injection-target>
+</persistence-unit-ref>
+{code}
+
+
+h1. Lookup only
+
+h2.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz;
+
+import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
+import javax.ejb.Stateless;
+import javax.naming.InitialUnit;
+
+@Stateless
+@PersistenceUnit(name = "myFooEntityManagerFactory", unitName = "foo-unit")
+public class MyBean implements MyInterface {
+
+    public void someBusinessMethod() throws Exception {
+        InitialContext context = new InitialContext();
+        EntityManagerFactory fooEntityManagerFactory = (EntityManagerFactory) context.lookup("java:comp/env/myFooEntityManagerFactory");
+    }
+}
+{code}
+
+h1. Via xml
+
+The above @PersistenceUnit annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref>
+    <persistence-unit-ref-name>myFooEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>foo-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+</persistence-unit-ref>
+{code}
+

Added: websites/staging/openejb/trunk/content/persistence-unit-ref.html
==============================================================================
--- websites/staging/openejb/trunk/content/persistence-unit-ref.html (added)
+++ websites/staging/openejb/trunk/content/persistence-unit-ref.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,190 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>persistence-unit-ref</title>
+    <link rel="stylesheet" type="text/css" media="screen" href="http://incubator.apache.org/lucy/css/lucy.css">
+  </head>
+
+  <body>
+
+    <div id="lucy-rigid_wrapper">
+
+      <div id="lucy-top" class="container_16 lucy-white_box_3d">
+
+        <div id="lucy-logo_box" class="grid_8">
+          <a href="/OpenEJB/"><img src="http://openejb.apache.org/images/logo_openejb.gif" alt="Apache OpenEJB™"></a>
+        </div> <!-- lucy-logo_box -->
+
+        <div #id="lucy-top_nav_box" class="grid_8">
+          <div id="lucy-top_nav_bar" class="container_8">
+            <ul>
+              <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li>
+              <li><a href="http://www.apache.org/licenses/" title="License">License</a></li>
+              <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li>
+              <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li>
+              <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li>
+            </ul>
+          </div> <!-- lucy-top_nav_bar -->
+          <p><a href="http://www.apache.org/">Apache</a>&nbsp;&raquo&nbsp;<a href="/">Incubator</a></p>
+          <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get">
+            <input value="*.apache.org" name="sitesearch" type="hidden"/>
+            <input type="text" name="q" id="query" style="width:85%">
+            <input type="submit" id="submit" value="Search">
+          </form>
+        </div> <!-- lucy-top_nav_box -->
+
+        <div class="clear"></div>
+
+      </div> <!-- lucy-top -->
+
+      <div id="lucy-main_content" class="container_16 lucy-white_box_3d">
+
+        <div class="grid_4" id="lucy-left_nav_box">
+          <h6>About</h6>
+            <ul>
+              <li><a href="/lucy/">Welcome</a></li>
+              <li><a href="/lucy/faq.html">FAQ</a></li>
+              <li><a href="/lucy/people.html">People</a></li>
+            </ul>
+          <h6>Resources</h6>
+            <ul>
+              <li><a href="/lucy/download.html">Download</a></li>
+              <li><a href="/lucy/mailing_lists.html">Mailing Lists</a></li>
+              <li><a href="/lucy/docs/perl/">Documentation</a></li>
+              <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li>
+              <li><a href="/lucy/version_control.html">Version Control</a></li>
+            </ul>
+          <h6>Related Projects</h6>
+            <ul>
+              <li><a href="http://lucene.apache.org/java/">Lucene</a></li>
+              <li><a href="http://lucene.apache.org/solr/">Solr</a></li>
+              <li><a href="http://incubator.apache.org/lucene.net/">Lucene.NET</a></li>
+              <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li>
+              <li><a href="http://lucene.apache.org/openrelevance/">Open Relevance</a></li>
+            </ul>
+        </div> <!-- lucy-left_nav_box -->
+
+        <div id="lucy-main_content_box" class="grid_9">
+          <p>Both lookup and injection of an EntityManagerFactory can be configured via
+the @PersistenceUnit annotation or <persistence-unit-ref> in xml. 
+Annotations and xml have equal function in both lookup and injection.</p>
+
+<p><a name="persistence-unit-ref-InjectionandLookup"></a></p>
+
+<h1>Injection and Lookup</h1>
+
+<p><a name="persistence-unit-ref-Viaannotation"></a></p>
+
+<h2>Via annotation</h2>
+
+<p><DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Usable by EJB, Interceptor, Servlet, Filter, or Listener</B></DIV><DIV class="codeContent panelContent">
+    package org.superbiz;</p>
+
+<pre><code>import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
+import javax.ejb.Stateless;
+import javax.naming.InitialUnit;
+
+@Stateless
+public class MyBean implements MyInterface {
+
+    @PersistenceUnit(unitName = "bar-unit")
+    private EntityManagerFactory myBarEntityManagerFactory;
+
+    public void someBusinessMethod() throws Exception {
+    if (myBarEntityManagerFactory == null) throw new
+</code></pre>
+
+<p>NullPointerException("myBarEntityManagerFactory not injected");</p>
+
+<pre><code>    // Both can be looked up from JNDI as well
+    InitialContext unit = new InitialContext();
+    EntityManagerFactory barEntityManagerFactory =
+</code></pre>
+
+<p>(EntityManagerFactory)
+context.lookup("java:comp/env/org.superbiz.MyBean/myBarEntityManagerFactory");
+        }
+    }</p>
+
+<p><a name="persistence-unit-ref-Viaxml"></a></p>
+
+<h2>Via xml</h2>
+
+<p>The above @PersistenceUnit annotation usage is 100% equivalent to the
+following xml.</p>
+
+<p>{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref></p>
+
+<p><persistence-unit-ref-name>org.superbiz.calculator.MyBean/myBarEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>bar-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+    <injection-target></p>
+
+<p><injection-target-class>org.superbiz.calculator.MyBean</injection-target-class></p>
+
+<p><injection-target-name>myBarEntityManagerFactory</injection-target-name>
+    </injection-target>
+</persistence-unit-ref></p>
+
+<pre><code>h1. Lookup only
+
+h2.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz;
+
+import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
+import javax.ejb.Stateless;
+import javax.naming.InitialUnit;
+
+@Stateless
+@PersistenceUnit(name = "myFooEntityManagerFactory", unitName = "foo-unit")
+public class MyBean implements MyInterface {
+
+    public void someBusinessMethod() throws Exception {
+    InitialContext context = new InitialContext();
+    EntityManagerFactory fooEntityManagerFactory =
+</code></pre>
+
+<p>(EntityManagerFactory)
+context.lookup("java:comp/env/myFooEntityManagerFactory");
+        }
+    }</p>
+
+<p><a name="persistence-unit-ref-Viaxml"></a></p>
+
+<h1>Via xml</h1>
+
+<p>The above @PersistenceUnit annotation usage is 100% equivalent to the
+following xml.</p>
+
+<p>{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref></p>
+
+<p><persistence-unit-ref-name>myFooEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>foo-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+</persistence-unit-ref></p>
+
+        </div> <!-- lucy-main_content_box --> 
+        <div class="clear"></div>
+
+      </div> <!-- lucy-main_content -->
+
+      <div id="lucy-copyright" class="container_16">
+        <p>Copyright &#169; 2010-2011 The Apache Software Foundation, Licensed under the 
+           <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+           <br/>
+          
+        </p>
+      </div> <!-- lucy-copyright -->
+
+    </div> <!-- lucy-rigid_wrapper -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/properties-tool.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/properties-tool.cwiki (added)
+++ websites/staging/openejb/trunk/content/properties-tool.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,194 @@
+h1. Properties Command line Tool
+
+To see all configurable properties in use by OpenEJB, using the following tool against a running server:
+
+{quote}
+./bin/openejb properties
+{quote}
+
+The output of this tool takes all overrideable components OpenEJB sees and outputs their properties along with the current value.  This allows you to easily see what is running in your system, what properties are available for overriding, and what exact values are for each component.  OpenEJB has a number of flags that can be passed to it not associated with any particular component, these are output as well.
+
+Content from this file can be safely copied as-is into the conf/system.properties file or sent to the users list with bug reports.  These properties may also be applied back into the openejb.xml file by pasting the properties without the "<id>." prefix into the respective component declarations.  The only warning is that any properties of type "<id>.password" will have their values masked, so make sure you edit them if you reapply them back into conf/openejb.xml or conf/system.properties.
+
+h1. Property Overriding
+
+Any component configured in OpenEJB via the openejb.xml (and some that aren't) can be overridden using system properties.  The format is:
+
+<id>.<property-name>=<property-value>
+
+And this can be done on the command line as follows:
+
+./bin/openejb -D<id>.<property-name>=<property-value> ...
+
+Or by adding the property to the conf/system.properties file.  Note that command line overrides win over overrides in the
+conf/system.properties file.
+
+In an embedded environment, the properties can be added to the Hashtable passed into the javax.naming.InitialContext when using the LocalInitialContextFactory or also to the System.getProperties() object before OpenEJB is embedded (which will be when the first InitialContext is created).
+
+At startup, OpenEJB will find the component with the given id and apply the new property value before constructing the individual component.
+
+h1. Example output
+
+{code:none}
+# Container(id=Default CMP Container)
+# className: org.apache.openejb.core.cmp.CmpContainer
+# 
+Default\ CMP\ Container.CmpEngineFactory=org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+Default\ CMP\ Container.Engine=instantdb
+Default\ CMP\ Container.ConnectorName=Default JDBC Database
+
+# Container(id=Default BMP Container)
+# className: org.apache.openejb.core.entity.EntityContainer
+# 
+Default\ BMP\ Container.PoolSize=10
+
+# Container(id=Default Stateful Container)
+# className: org.apache.openejb.core.stateful.StatefulContainer
+# 
+Default\ Stateful\ Container.BulkPassivate=50
+Default\ Stateful\ Container.Passivator=org.apache.openejb.core.stateful.SimplePassivater
+Default\ Stateful\ Container.TimeOut=20
+Default\ Stateful\ Container.PoolSize=500
+
+# Container(id=Default Stateless Container)
+# className: org.apache.openejb.core.stateless.StatelessContainer
+# 
+Default\ Stateless\ Container.PoolSize=10
+Default\ Stateless\ Container.StrictPooling=true
+Default\ Stateless\ Container.TimeOut=0
+
+# Container(id=Default MDB Container)
+# className: org.apache.openejb.core.mdb.MdbContainer
+# 
+Default\ MDB\ Container.ResourceAdapter=Default JMS Resource Adapter
+Default\ MDB\ Container.InstanceLimit=10
+Default\ MDB\ Container.MessageListenerInterface=javax.jms.MessageListener
+Default\ MDB\ Container.ActivationSpecClass=org.apache.activemq.ra.ActiveMQActivationSpec
+
+# ConnectionManager(id=Default Local TX ConnectionManager)
+# className: org.apache.openejb.resource.SharedLocalConnectionManager
+# 
+
+# Resource(id=Default JMS Resource Adapter)
+# className: org.apache.activemq.ra.ActiveMQResourceAdapter
+# 
+Default\ JMS\ Resource\ Adapter.ServerUrl=vm\://localhost?async\=true
+Default\ JMS\ Resource\ Adapter.BrokerXmlConfig=broker\:(tcp\://localhost\:61616)
+Default\ JMS\ Resource\ Adapter.ThreadPoolSize=30
+
+# Resource(id=Default JDBC Database)
+# className: org.apache.openejb.resource.jdbc.BasicManagedDataSource
+# 
+Default\ JDBC\ Database.MinIdle=0
+Default\ JDBC\ Database.Password=xxxx
+Default\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ JDBC\ Database.MaxIdle=20
+Default\ JDBC\ Database.ConnectionProperties=
+Default\ JDBC\ Database.MaxWait=-1
+Default\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ JDBC\ Database.MaxActive=20
+Default\ JDBC\ Database.DefaultAutoCommit=true
+Default\ JDBC\ Database.AccessToUnderlyingConnectionAllowed=false
+Default\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ JDBC\ Database.TestWhileIdle=false
+Default\ JDBC\ Database.UserName=sa
+Default\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ JDBC\ Database.TestOnBorrow=true
+Default\ JDBC\ Database.PoolPreparedStatements=false
+Default\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ JDBC\ Database.TestOnReturn=false
+Default\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ JDBC\ Database.InitialSize=0
+
+# Resource(id=Default Unmanaged JDBC Database)
+# className: org.apache.openejb.resource.jdbc.BasicDataSource
+# 
+Default\ Unmanaged\ JDBC\ Database.MaxWait=-1
+Default\ Unmanaged\ JDBC\ Database.InitialSize=0
+Default\ Unmanaged\ JDBC\ Database.DefaultAutoCommit=true
+Default\ Unmanaged\ JDBC\ Database.ConnectionProperties=
+Default\ Unmanaged\ JDBC\ Database.MaxActive=10
+Default\ Unmanaged\ JDBC\ Database.TestOnBorrow=true
+Default\ Unmanaged\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ Unmanaged\ JDBC\ Database.TestOnReturn=false
+Default\ Unmanaged\ JDBC\ Database.AccessToUnderlyingConnectionAllowed=false
+Default\ Unmanaged\ JDBC\ Database.Password=xxxx
+Default\ Unmanaged\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ Unmanaged\ JDBC\ Database.PoolPreparedStatements=false
+Default\ Unmanaged\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ Unmanaged\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ Unmanaged\ JDBC\ Database.MinIdle=0
+Default\ Unmanaged\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ Unmanaged\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ Unmanaged\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ Unmanaged\ JDBC\ Database.UserName=sa
+Default\ Unmanaged\ JDBC\ Database.MaxIdle=10
+Default\ Unmanaged\ JDBC\ Database.TestWhileIdle=false
+
+# Resource(id=Default JMS Connection Factory)
+# className: org.apache.activemq.ra.ActiveMQManagedConnectionFactory
+# 
+Default\ JMS\ Connection\ Factory.ConnectionInterface=javax.jms.ConnectionFactory, \
+javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory
+Default\ JMS\ Connection\ Factory.ResourceAdapter=Default JMS Resource Adapter
+
+# SecurityService(id=Default Security Service)
+# className: org.apache.openejb.core.security.SecurityServiceImpl
+# 
+
+# TransactionManager(id=Default Transaction Manager)
+# className: org.apache.geronimo.transaction.manager.GeronimoTransactionManager
+# 
+
+# ServerService(id=httpejbd)
+# className: org.apache.openejb.server.httpd.HttpEjbServer
+# 
+httpejbd.port=4204
+httpejbd.name=httpejbd
+httpejbd.disabled=false
+httpejbd.server=org.apache.openejb.server.httpd.HttpEjbServer
+httpejbd.threads=200
+httpejbd.bind=127.0.0.1
+
+# ServerService(id=telnet)
+# className: org.apache.openejb.server.telnet.TelnetServer
+# 
+telnet.port=4202
+telnet.name=telnet
+telnet.disabled=false
+telnet.bind=127.0.0.1
+telnet.threads=5
+telnet.server=org.apache.openejb.server.telnet.TelnetServer
+
+# ServerService(id=ejbd)
+# className: org.apache.openejb.server.ejbd.EjbServer
+# 
+ejbd.disabled=false
+ejbd.bind=127.0.0.1
+ejbd.server=org.apache.openejb.server.ejbd.EjbServer
+ejbd.port=4201
+ejbd.name=ejbd
+ejbd.threads=200
+
+# ServerService(id=hsql)
+# className: org.apache.openejb.server.hsql.HsqlService
+# 
+hsql.port=9001
+hsql.name=hsql
+hsql.disabled=false
+hsql.server=org.apache.openejb.server.hsql.HsqlService
+hsql.bind=127.0.0.1
+
+# ServerService(id=admin)
+# className: org.apache.openejb.server.admin.AdminDaemon
+# 
+admin.disabled=false
+admin.bind=127.0.0.1
+admin.only_from=localhost
+admin.port=4200
+admin.threads=1
+admin.name=admin
+admin.server=org.apache.openejb.server.admin.AdminDaemon
+{code}
+

Added: websites/staging/openejb/trunk/content/properties-tool.html
==============================================================================
--- websites/staging/openejb/trunk/content/properties-tool.html (added)
+++ websites/staging/openejb/trunk/content/properties-tool.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,291 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Properties Tool</title>
+    <link rel="stylesheet" type="text/css" media="screen" href="http://incubator.apache.org/lucy/css/lucy.css">
+  </head>
+
+  <body>
+
+    <div id="lucy-rigid_wrapper">
+
+      <div id="lucy-top" class="container_16 lucy-white_box_3d">
+
+        <div id="lucy-logo_box" class="grid_8">
+          <a href="/OpenEJB/"><img src="http://openejb.apache.org/images/logo_openejb.gif" alt="Apache OpenEJB™"></a>
+        </div> <!-- lucy-logo_box -->
+
+        <div #id="lucy-top_nav_box" class="grid_8">
+          <div id="lucy-top_nav_bar" class="container_8">
+            <ul>
+              <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li>
+              <li><a href="http://www.apache.org/licenses/" title="License">License</a></li>
+              <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li>
+              <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li>
+              <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li>
+            </ul>
+          </div> <!-- lucy-top_nav_bar -->
+          <p><a href="http://www.apache.org/">Apache</a>&nbsp;&raquo&nbsp;<a href="/">Incubator</a></p>
+          <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get">
+            <input value="*.apache.org" name="sitesearch" type="hidden"/>
+            <input type="text" name="q" id="query" style="width:85%">
+            <input type="submit" id="submit" value="Search">
+          </form>
+        </div> <!-- lucy-top_nav_box -->
+
+        <div class="clear"></div>
+
+      </div> <!-- lucy-top -->
+
+      <div id="lucy-main_content" class="container_16 lucy-white_box_3d">
+
+        <div class="grid_4" id="lucy-left_nav_box">
+          <h6>About</h6>
+            <ul>
+              <li><a href="/lucy/">Welcome</a></li>
+              <li><a href="/lucy/faq.html">FAQ</a></li>
+              <li><a href="/lucy/people.html">People</a></li>
+            </ul>
+          <h6>Resources</h6>
+            <ul>
+              <li><a href="/lucy/download.html">Download</a></li>
+              <li><a href="/lucy/mailing_lists.html">Mailing Lists</a></li>
+              <li><a href="/lucy/docs/perl/">Documentation</a></li>
+              <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li>
+              <li><a href="/lucy/version_control.html">Version Control</a></li>
+            </ul>
+          <h6>Related Projects</h6>
+            <ul>
+              <li><a href="http://lucene.apache.org/java/">Lucene</a></li>
+              <li><a href="http://lucene.apache.org/solr/">Solr</a></li>
+              <li><a href="http://incubator.apache.org/lucene.net/">Lucene.NET</a></li>
+              <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li>
+              <li><a href="http://lucene.apache.org/openrelevance/">Open Relevance</a></li>
+            </ul>
+        </div> <!-- lucy-left_nav_box -->
+
+        <div id="lucy-main_content_box" class="grid_9">
+          <p><a name="PropertiesTool-PropertiesCommandlineTool"></a></p>
+
+<h1>Properties Command line Tool</h1>
+
+<p>To see all configurable properties in use by OpenEJB, using the following
+tool against a running server:</p>
+
+<p>{quote}
+./bin/openejb properties
+{quote}</p>
+
+<p>The output of this tool takes all overrideable components OpenEJB sees and
+outputs their properties along with the current value.  This allows you to
+easily see what is running in your system, what properties are available
+for overriding, and what exact values are for each component.  OpenEJB has
+a number of flags that can be passed to it not associated with any
+particular component, these are output as well.</p>
+
+<p>Content from this file can be safely copied as-is into the
+conf/system.properties file or sent to the users list with bug reports. 
+These properties may also be applied back into the openejb.xml file by
+pasting the properties without the "<id>." prefix into the respective
+component declarations.  The only warning is that any properties of type
+"<id>.password" will have their values masked, so make sure you edit them
+if you reapply them back into conf/openejb.xml or conf/system.properties.</p>
+
+<p><a name="PropertiesTool-PropertyOverriding"></a></p>
+
+<h1>Property Overriding</h1>
+
+<p>Any component configured in OpenEJB via the openejb.xml (and some that
+aren't) can be overridden using system properties.  The format is:</p>
+
+<p><id>.<property-name>=<property-value></p>
+
+<p>And this can be done on the command line as follows:</p>
+
+<p>./bin/openejb -D<id>.<property-name>=<property-value> ...</p>
+
+<p>Or by adding the property to the conf/system.properties file.  Note that
+command line overrides win over overrides in the
+conf/system.properties file.</p>
+
+<p>In an embedded environment, the properties can be added to the Hashtable
+passed into the javax.naming.InitialContext when using the
+LocalInitialContextFactory or also to the System.getProperties() object
+before OpenEJB is embedded (which will be when the first InitialContext is
+created).</p>
+
+<p>At startup, OpenEJB will find the component with the given id and apply the
+new property value before constructing the individual component.</p>
+
+<p><a name="PropertiesTool-Exampleoutput"></a></p>
+
+<h1>Example output</h1>
+
+<p>{code:none}
+1. Container(id=Default CMP Container)
+1. className: org.apache.openejb.core.cmp.CmpContainer
+1. Default\ CMP\
+Container.CmpEngineFactory=org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+Default\ CMP\ Container.Engine=instantdb
+Default\ CMP\ Container.ConnectorName=Default JDBC Database</p>
+
+<ol>
+<li>Container(id=Default BMP Container)</li>
+<li>className: org.apache.openejb.core.entity.EntityContainer</li>
+<li><p>Default\ BMP\ Container.PoolSize=10</p></li>
+<li><p>Container(id=Default Stateful Container)</p></li>
+<li>className: org.apache.openejb.core.stateful.StatefulContainer</li>
+<li><p>Default\ Stateful\ Container.BulkPassivate=50
+Default\ Stateful\
+Container.Passivator=org.apache.openejb.core.stateful.SimplePassivater
+Default\ Stateful\ Container.TimeOut=20
+Default\ Stateful\ Container.PoolSize=500</p></li>
+<li><p>Container(id=Default Stateless Container)</p></li>
+<li>className: org.apache.openejb.core.stateless.StatelessContainer</li>
+<li><p>Default\ Stateless\ Container.PoolSize=10
+Default\ Stateless\ Container.StrictPooling=true
+Default\ Stateless\ Container.TimeOut=0</p></li>
+<li><p>Container(id=Default MDB Container)</p></li>
+<li>className: org.apache.openejb.core.mdb.MdbContainer</li>
+<li><p>Default\ MDB\ Container.ResourceAdapter=Default JMS Resource Adapter
+Default\ MDB\ Container.InstanceLimit=10
+Default\ MDB\ Container.MessageListenerInterface=javax.jms.MessageListener
+Default\ MDB\
+Container.ActivationSpecClass=org.apache.activemq.ra.ActiveMQActivationSpec</p></li>
+<li><p>ConnectionManager(id=Default Local TX ConnectionManager)</p></li>
+<li>className: org.apache.openejb.resource.SharedLocalConnectionManager</li>
+<li>
+<ol>
+<li>Resource(id=Default JMS Resource Adapter)</li>
+</ol></li>
+<li>className: org.apache.activemq.ra.ActiveMQResourceAdapter</li>
+<li><p>Default\ JMS\ Resource\ Adapter.ServerUrl=vm\://localhost?async\=true
+Default\ JMS\ Resource\
+Adapter.BrokerXmlConfig=broker\:(tcp\://localhost\:61616)
+Default\ JMS\ Resource\ Adapter.ThreadPoolSize=30</p></li>
+<li><p>Resource(id=Default JDBC Database)</p></li>
+<li>className: org.apache.openejb.resource.jdbc.BasicManagedDataSource</li>
+<li><p>Default\ JDBC\ Database.MinIdle=0
+Default\ JDBC\ Database.Password=xxxx
+Default\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ JDBC\ Database.MaxIdle=20
+Default\ JDBC\ Database.ConnectionProperties=
+Default\ JDBC\ Database.MaxWait=-1
+Default\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ JDBC\ Database.MaxActive=20
+Default\ JDBC\ Database.DefaultAutoCommit=true
+Default\ JDBC\ Database.AccessToUnderlyingConnectionAllowed=false
+Default\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ JDBC\ Database.TestWhileIdle=false
+Default\ JDBC\ Database.UserName=sa
+Default\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ JDBC\ Database.TestOnBorrow=true
+Default\ JDBC\ Database.PoolPreparedStatements=false
+Default\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ JDBC\ Database.TestOnReturn=false
+Default\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ JDBC\ Database.InitialSize=0</p></li>
+<li><p>Resource(id=Default Unmanaged JDBC Database)</p></li>
+<li>className: org.apache.openejb.resource.jdbc.BasicDataSource</li>
+<li><p>Default\ Unmanaged\ JDBC\ Database.MaxWait=-1
+Default\ Unmanaged\ JDBC\ Database.InitialSize=0
+Default\ Unmanaged\ JDBC\ Database.DefaultAutoCommit=true
+Default\ Unmanaged\ JDBC\ Database.ConnectionProperties=
+Default\ Unmanaged\ JDBC\ Database.MaxActive=10
+Default\ Unmanaged\ JDBC\ Database.TestOnBorrow=true
+Default\ Unmanaged\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ Unmanaged\ JDBC\ Database.TestOnReturn=false
+Default\ Unmanaged\ JDBC\
+Database.AccessToUnderlyingConnectionAllowed=false
+Default\ Unmanaged\ JDBC\ Database.Password=xxxx
+Default\ Unmanaged\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ Unmanaged\ JDBC\ Database.PoolPreparedStatements=false
+Default\ Unmanaged\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ Unmanaged\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ Unmanaged\ JDBC\ Database.MinIdle=0
+Default\ Unmanaged\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ Unmanaged\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ Unmanaged\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ Unmanaged\ JDBC\ Database.UserName=sa
+Default\ Unmanaged\ JDBC\ Database.MaxIdle=10
+Default\ Unmanaged\ JDBC\ Database.TestWhileIdle=false</p></li>
+<li><p>Resource(id=Default JMS Connection Factory)</p></li>
+<li>className: org.apache.activemq.ra.ActiveMQManagedConnectionFactory</li>
+<li><p>Default\ JMS\ Connection\
+Factory.ConnectionInterface=javax.jms.ConnectionFactory, \
+javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory
+Default\ JMS\ Connection\ Factory.ResourceAdapter=Default JMS Resource
+Adapter</p></li>
+<li><p>SecurityService(id=Default Security Service)</p></li>
+<li>className: org.apache.openejb.core.security.SecurityServiceImpl</li>
+<li>
+<ol>
+<li>TransactionManager(id=Default Transaction Manager)</li>
+</ol></li>
+<li>className:
+org.apache.geronimo.transaction.manager.GeronimoTransactionManager</li>
+<li>
+<ol>
+<li>ServerService(id=httpejbd)</li>
+</ol></li>
+<li>className: org.apache.openejb.server.httpd.HttpEjbServer</li>
+<li><p>httpejbd.port=4204
+httpejbd.name=httpejbd
+httpejbd.disabled=false
+httpejbd.server=org.apache.openejb.server.httpd.HttpEjbServer
+httpejbd.threads=200
+httpejbd.bind=127.0.0.1</p></li>
+<li><p>ServerService(id=telnet)</p></li>
+<li>className: org.apache.openejb.server.telnet.TelnetServer</li>
+<li><p>telnet.port=4202
+telnet.name=telnet
+telnet.disabled=false
+telnet.bind=127.0.0.1
+telnet.threads=5
+telnet.server=org.apache.openejb.server.telnet.TelnetServer</p></li>
+<li><p>ServerService(id=ejbd)</p></li>
+<li>className: org.apache.openejb.server.ejbd.EjbServer</li>
+<li><p>ejbd.disabled=false
+ejbd.bind=127.0.0.1
+ejbd.server=org.apache.openejb.server.ejbd.EjbServer
+ejbd.port=4201
+ejbd.name=ejbd
+ejbd.threads=200</p></li>
+<li><p>ServerService(id=hsql)</p></li>
+<li>className: org.apache.openejb.server.hsql.HsqlService</li>
+<li><p>hsql.port=9001
+hsql.name=hsql
+hsql.disabled=false
+hsql.server=org.apache.openejb.server.hsql.HsqlService
+hsql.bind=127.0.0.1</p></li>
+<li><p>ServerService(id=admin)</p></li>
+<li>className: org.apache.openejb.server.admin.AdminDaemon</li>
+<li>admin.disabled=false
+admin.bind=127.0.0.1
+admin.only_from=localhost
+admin.port=4200
+admin.threads=1
+admin.name=admin
+admin.server=org.apache.openejb.server.admin.AdminDaemon</li>
+</ol>
+
+        </div> <!-- lucy-main_content_box --> 
+        <div class="clear"></div>
+
+      </div> <!-- lucy-main_content -->
+
+      <div id="lucy-copyright" class="container_16">
+        <p>Copyright &#169; 2010-2011 The Apache Software Foundation, Licensed under the 
+           <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+           <br/>
+          
+        </p>
+      </div> <!-- lucy-copyright -->
+
+    </div> <!-- lucy-rigid_wrapper -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/property-overriding.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/property-overriding.cwiki (added)
+++ websites/staging/openejb/trunk/content/property-overriding.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,29 @@
+OpenEJB consists of several components (containers, resource adapters, security services, etc.) all of which are pluggable and have their own unique set of configurable properties.  These components are required to specify their default property values in their service-jar.xml file.  This means that at a minimum you as a user only need to specify what you'd like to be different.  You specify the property name and the new value and the default value will be overwritten before the component is created.
+
+We call this overriding and there are several ways to do it.
+
+h1.  The openejb.xml
+
+The default openejb.xml file has most of the useful properties for each component explicitly listed with default values for documentation purposes.  It is safe to delete them and be assured that no behavior will change if a smaller config file is desired.
+
+
+Overriding can also be done via the command line or plain Java system properties.  See [System Properties] for details.
+
+h2. What properties are available?
+    
+To know what properties can be overriden the './bin/openejb properties' command is very useful: see [Properties Tool]
+    
+It's function is to connect to a running server and print a canonical list of all properties OpenEJB can see via the various means of configuration.  When sending requests for help to the users list or jira, it is highly encouraged to send the output of this tool with your message.
+
+h2. Not configurable via openejb.xml
+    
+The only thing not yet configurable via this file are ServerServices due to OpenEJB's embeddable nature and resulting long standing tradition of keeping the container system separate from the server layer.  This may change someday, but untill then ServerServices are configurable via conf/<service-id>.properties files such as conf/ejbd.properties to configure the main protocol that services EJB client requests.
+
+The format those properties files is greatly adapted from the xinet.d style of configuration and even shares similar functionality and properties such as host-based authorization (HBA) via the 'only_from' property.
+
+h2. Restoring openejb.xml to the defaults
+
+To restore this file to its original default state, you can simply delete it or rename it and OpenEJB will see it's missing and unpack another openejb.xml into the conf/ directory when it starts.
+
+This is not only handy for recovering from a non-functional config, but also for upgrading as OpenEJB will not overwrite your existing configuration file should you choose to unpack an new distro over the top of an old one -- this style of upgrade is safe provided you move your old lib/ directory first.
+

Added: websites/staging/openejb/trunk/content/property-overriding.html
==============================================================================
--- websites/staging/openejb/trunk/content/property-overriding.html (added)
+++ websites/staging/openejb/trunk/content/property-overriding.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,150 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Property Overriding</title>
+    <link rel="stylesheet" type="text/css" media="screen" href="http://incubator.apache.org/lucy/css/lucy.css">
+  </head>
+
+  <body>
+
+    <div id="lucy-rigid_wrapper">
+
+      <div id="lucy-top" class="container_16 lucy-white_box_3d">
+
+        <div id="lucy-logo_box" class="grid_8">
+          <a href="/OpenEJB/"><img src="http://openejb.apache.org/images/logo_openejb.gif" alt="Apache OpenEJB™"></a>
+        </div> <!-- lucy-logo_box -->
+
+        <div #id="lucy-top_nav_box" class="grid_8">
+          <div id="lucy-top_nav_bar" class="container_8">
+            <ul>
+              <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li>
+              <li><a href="http://www.apache.org/licenses/" title="License">License</a></li>
+              <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li>
+              <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li>
+              <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li>
+            </ul>
+          </div> <!-- lucy-top_nav_bar -->
+          <p><a href="http://www.apache.org/">Apache</a>&nbsp;&raquo&nbsp;<a href="/">Incubator</a></p>
+          <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get">
+            <input value="*.apache.org" name="sitesearch" type="hidden"/>
+            <input type="text" name="q" id="query" style="width:85%">
+            <input type="submit" id="submit" value="Search">
+          </form>
+        </div> <!-- lucy-top_nav_box -->
+
+        <div class="clear"></div>
+
+      </div> <!-- lucy-top -->
+
+      <div id="lucy-main_content" class="container_16 lucy-white_box_3d">
+
+        <div class="grid_4" id="lucy-left_nav_box">
+          <h6>About</h6>
+            <ul>
+              <li><a href="/lucy/">Welcome</a></li>
+              <li><a href="/lucy/faq.html">FAQ</a></li>
+              <li><a href="/lucy/people.html">People</a></li>
+            </ul>
+          <h6>Resources</h6>
+            <ul>
+              <li><a href="/lucy/download.html">Download</a></li>
+              <li><a href="/lucy/mailing_lists.html">Mailing Lists</a></li>
+              <li><a href="/lucy/docs/perl/">Documentation</a></li>
+              <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li>
+              <li><a href="/lucy/version_control.html">Version Control</a></li>
+            </ul>
+          <h6>Related Projects</h6>
+            <ul>
+              <li><a href="http://lucene.apache.org/java/">Lucene</a></li>
+              <li><a href="http://lucene.apache.org/solr/">Solr</a></li>
+              <li><a href="http://incubator.apache.org/lucene.net/">Lucene.NET</a></li>
+              <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li>
+              <li><a href="http://lucene.apache.org/openrelevance/">Open Relevance</a></li>
+            </ul>
+        </div> <!-- lucy-left_nav_box -->
+
+        <div id="lucy-main_content_box" class="grid_9">
+          <p>OpenEJB consists of several components (containers, resource adapters,
+security services, etc.) all of which are pluggable and have their own
+unique set of configurable properties.  These components are required to
+specify their default property values in their service-jar.xml file.  This
+means that at a minimum you as a user only need to specify what you'd like
+to be different.  You specify the property name and the new value and the
+default value will be overwritten before the component is created.</p>
+
+<p>We call this overriding and there are several ways to do it.</p>
+
+<p><a name="PropertyOverriding-Theopenejb.xml"></a></p>
+
+<h1>The openejb.xml</h1>
+
+<p>The default openejb.xml file has most of the useful properties for each
+component explicitly listed with default values for documentation purposes.
+ It is safe to delete them and be assured that no behavior will change if a
+smaller config file is desired.</p>
+
+<p>Overriding can also be done via the command line or plain Java system
+properties.  See <a href="system-properties.html">System Properties</a>
+ for details.</p>
+
+<p><a name="PropertyOverriding-Whatpropertiesareavailable?"></a></p>
+
+<h2>What properties are available?</h2>
+
+<p>To know what properties can be overriden the './bin/openejb properties'
+command is very useful: see <a href="properties-tool.html">Properties Tool</a></p>
+
+<p>It's function is to connect to a running server and print a canonical list
+of all properties OpenEJB can see via the various means of configuration. 
+When sending requests for help to the users list or jira, it is highly
+encouraged to send the output of this tool with your message.</p>
+
+<p><a name="PropertyOverriding-Notconfigurableviaopenejb.xml"></a></p>
+
+<h2>Not configurable via openejb.xml</h2>
+
+<p>The only thing not yet configurable via this file are ServerServices due to
+OpenEJB's embeddable nature and resulting long standing tradition of
+keeping the container system separate from the server layer.  This may
+change someday, but untill then ServerServices are configurable via
+conf/<service-id>.properties files such as conf/ejbd.properties to
+configure the main protocol that services EJB client requests.</p>
+
+<p>The format those properties files is greatly adapted from the xinet.d style
+of configuration and even shares similar functionality and properties such
+as host-based authorization (HBA) via the 'only_from' property.</p>
+
+<p><a name="PropertyOverriding-Restoringopenejb.xmltothedefaults"></a></p>
+
+<h2>Restoring openejb.xml to the defaults</h2>
+
+<p>To restore this file to its original default state, you can simply delete
+it or rename it and OpenEJB will see it's missing and unpack another
+openejb.xml into the conf/ directory when it starts.</p>
+
+<p>This is not only handy for recovering from a non-functional config, but
+also for upgrading as OpenEJB will not overwrite your existing
+configuration file should you choose to unpack an new distro over the top
+of an old one -- this style of upgrade is safe provided you move your old
+lib/ directory first.</p>
+
+        </div> <!-- lucy-main_content_box --> 
+        <div class="clear"></div>
+
+      </div> <!-- lucy-main_content -->
+
+      <div id="lucy-copyright" class="container_16">
+        <p>Copyright &#169; 2010-2011 The Apache Software Foundation, Licensed under the 
+           <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+           <br/>
+          
+        </p>
+      </div> <!-- lucy-copyright -->
+
+    </div> <!-- lucy-rigid_wrapper -->
+
+  </body>
+</html>

Modified: websites/staging/openejb/trunk/content/quicklinks.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/quicklinks.cwiki (original)
+++ websites/staging/openejb/trunk/content/quicklinks.cwiki Sun Jul 10 05:37:04 2011
@@ -1 +1 @@
-[Home|Index] | [News] | [FAQ] | [Download] | [Lists|Mailing Lists] | {link:Issues|http://issues.apache.org/jira/browse/OPENEJB}
\ No newline at end of file
+[Home|OPENEJB:Index] | [Download|OPENEJB:Download] | [Lists|OPENEJB:Mailing Lists] | {link:Issues|http://issues.apache.org/jira/browse/OPENEJB}
\ No newline at end of file

Modified: websites/staging/openejb/trunk/content/quicklinks.html
==============================================================================
--- websites/staging/openejb/trunk/content/quicklinks.html (original)
+++ websites/staging/openejb/trunk/content/quicklinks.html Sun Jul 10 05:37:04 2011
@@ -67,11 +67,9 @@
         </div> <!-- lucy-left_nav_box -->
 
         <div id="lucy-main_content_box" class="grid_9">
-          <p><a href="index.html">Home</a>
- | [News]
- | [FAQ]
- | [Download]
- | [Lists|Mailing Lists]
+          <p><a href="openejb:index.html">Home</a>
+ | [Download|OPENEJB:Download]
+ | [Lists|OPENEJB:Mailing Lists]
  | {link:Issues|http://issues.apache.org/jira/browse/OPENEJB}</p>
 
         </div> <!-- lucy-main_content_box --> 

Added: websites/staging/openejb/trunk/content/resource-injection.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/resource-injection.cwiki (added)
+++ websites/staging/openejb/trunk/content/resource-injection.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,157 @@
+h1. Overview
+
+This example demonstrates the use of the injection of environment entries using *@Resource* annotation.
+
+The EJB 3.0 specification (*EJB Core Contracts and Requirements*) section 16.2.2 reads:
+
+_A field or method of a bean class may be annotated to request that an entry from the bean's environment be injected. Any of the types of resources or other environment entries[88] described in this chapter may be injected. Injection may also be requested using entries in the deployment descriptor corresponding to each of these resource types._
+
+_Environment entries may also be injected into the bean through bean methods that follow the naming conventions for JavaBeans properties. The annotation is applied to the set method for the property, which is the method that is called to inject the environment entry. The JavaBeans property name (not the method name) is used as the default JNDI name._
+
+The *PurchaseOrderBean* class shows use of field-level *@Resource* annotation.
+
+The *InvoiceBean* class shows the use of method-level *@Resource* annotation.
+
+The source for this example can be checked out from svn:
+
+ $ svn co http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/injection-of-env-entry
+
+To run it change your working directory to the directory *injection-of-env-entry* and run the following maven2 commands:
+
+$ cd injection-of-env-entry
+
+$ mvn clean install
+
+h1. The Code
+
+h2. Injection through field (field-level injection)
+
+The *maxLineItem* field in *PurchaseOrderBean* class is annotated with *@Resource* annotation to inform the EJB container _the place_ where in the code the injection of a simple environment entry should take place. The default value of 10 is assigned. Deployer can modify the value of the environment entries at deployment time using deployment descriptor (ejb-jar.xml).
+
+h4. @Resource annotation of a field
+
+{code}
+@Resource
+int maxLineItems = 10;
+{code}
+
+h2. Injection through a setter method (method-level injection)
+
+The *setMaxLineItem* method in *InvoiceBean* class is annotated with *@Resource* annotation to inject the simple environment entry. Only setters can be used as a way to inject environment entry values. 
+
+You could look up the env-entry using JNDI lookup() method and the following name:
+
+ * java:comp/env/org.apache.openejb.examples.resource.InvoiceBean/maxLineItems
+
+The pattern is to combine the fully-qualified class name and the name of a instance field (or a name of the setter method without _set_ prefix and the first letter lowercased).
+
+h4. @Resource annotation of a setter method
+
+{code} 
+@Resource
+public void setMaxLineItems(int maxLineItems) {
+    this.maxLineItems = maxLineItems;
+}
+{code} 
+
+h4. env-entry in ejb-jar.xml
+{code:xml}
+<env-entry>
+     <description>The maximum number of line items per invoice.</description>
+     <env-entry-name>org.apache.openejb.examples.injection.InvoiceBean/maxLineItems</env-entry-name>
+     <env-entry-type>java.lang.Integer</env-entry-type>
+     <env-entry-value>15</env-entry-value>
+</env-entry>
+{code}
+
+h4. Using @Resource annotated env-entry
+
+{tip:title=Using @Resource annotated env-entry}
+*maxLineItems* variable is injected by the *setMaxLine* method above. See also how env-entry is defined in ejb-jar.xml
+{tip}
+{code}
+public void addLineItem(LineItem item) throws TooManyItemsException {
+   if (item == null) {
+      throw new IllegalArgumentException("Line item must not be null");
+   }
+
+   if (itemCount <= maxLineItems) {
+      items.add(item);
+      itemCount++;
+   } else {
+      throw new TooManyItemsException("Number of items exceeded the maximum limit");
+   }
+}
+{code}
+
+h1. JUnit Test
+
+Writing an JUnit test for this example is quite simple. We need just to write a setup method to create and initialize the InitialContext, and then write our test methods.
+
+h4. Test fixture
+
+{code}
+protected void setUp() throws Exception {
+    Properties properties = new Properties();
+    properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+    properties.setProperty("openejb.deployments.classpath.include", ".*resource-injection.*");
+    initialContext = new InitialContext(properties);
+}
+{code}
+
+h4. Test methods
+{code}
+public void testAddLineItem() throws Exception {
+    Invoice order = (Invoice) initialContext.lookup("InvoiceBeanBusinessRemote");
+    assertNotNull(order);
+    LineItem item = new LineItem("ABC-1", "Test Item");
+
+    try {
+        order.addLineItem(item);
+    } catch (TooManyItemsException tmie) {
+        fail("Test failed due to: " + tmie.getMessage());
+    }
+}
+{code}
+
+h1. Running
+
+Running the example is fairly simple. Just execute the following commands:
+
+$ cd injection-of-env-entry
+$ mvn clean test
+
+{noformat}
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.superbiz.injection.PurchaseOrderBeanTest
+Apache OpenEJB 3.0.0-SNAPSHOT    build: 20071218-01:41
+http://openejb.apache.org/
+INFO - openejb.home = c:\oss\openejb3\examples\injection-of-env-entry
+INFO - openejb.base = c:\oss\openejb3\examples\injection-of-env-entry
+WARN - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+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 - Configuring Service(id=Default JDK 1.3 ProxyFactory, type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
+INFO - Found EjbModule in classpath: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Configuring app: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container)
+INFO - Auto-creating a container for bean InvoiceBean: Container(type=STATEFUL, id=Default Stateful Container)
+INFO - Loaded Module: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Assembling app: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Jndi(name=InvoiceBeanRemote) --> Ejb(deployment-id=InvoiceBean)
+INFO - Jndi(name=PurchaseOrderBeanRemote) --> Ejb(deployment-id=PurchaseOrderBean)
+INFO - Created Ejb(deployment-id=InvoiceBean, ejb-name=InvoiceBean, container=Default Stateful Container)
+INFO - Created Ejb(deployment-id=PurchaseOrderBean, ejb-name=PurchaseOrderBean, container=Default Stateful Container)
+INFO - Deployed Application(path=c:\oss\openejb3\examples\injection-of-env-entry\target\classes)
+INFO - OpenEJB ready.
+OpenEJB ready.
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.859 sec
+Running org.superbiz.injection.InvoiceBeanTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
+
+Results :
+
+Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
+{noformat}

Added: websites/staging/openejb/trunk/content/resource-injection.html
==============================================================================
--- websites/staging/openejb/trunk/content/resource-injection.html (added)
+++ websites/staging/openejb/trunk/content/resource-injection.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,318 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+    <title>Resource Injection</title>
+    <link rel="stylesheet" type="text/css" media="screen" href="http://incubator.apache.org/lucy/css/lucy.css">
+  </head>
+
+  <body>
+
+    <div id="lucy-rigid_wrapper">
+
+      <div id="lucy-top" class="container_16 lucy-white_box_3d">
+
+        <div id="lucy-logo_box" class="grid_8">
+          <a href="/OpenEJB/"><img src="http://openejb.apache.org/images/logo_openejb.gif" alt="Apache OpenEJB™"></a>
+        </div> <!-- lucy-logo_box -->
+
+        <div #id="lucy-top_nav_box" class="grid_8">
+          <div id="lucy-top_nav_bar" class="container_8">
+            <ul>
+              <li><a href="http://www.apache.org/" title="Apache Software Foundation">Apache Software Foundation</a></li>
+              <li><a href="http://www.apache.org/licenses/" title="License">License</a></li>
+              <li><a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsorship">Sponsorship</a></li>
+              <li><a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a></li>
+              <li><a href="http://www.apache.org/security/ " title="Security">Security</a></li>
+            </ul>
+          </div> <!-- lucy-top_nav_bar -->
+          <p><a href="http://www.apache.org/">Apache</a>&nbsp;&raquo&nbsp;<a href="/">Incubator</a></p>
+          <form name="lucy-top_search_box" id="lucy-top_search_box" action="http://www.google.com/search" method="get">
+            <input value="*.apache.org" name="sitesearch" type="hidden"/>
+            <input type="text" name="q" id="query" style="width:85%">
+            <input type="submit" id="submit" value="Search">
+          </form>
+        </div> <!-- lucy-top_nav_box -->
+
+        <div class="clear"></div>
+
+      </div> <!-- lucy-top -->
+
+      <div id="lucy-main_content" class="container_16 lucy-white_box_3d">
+
+        <div class="grid_4" id="lucy-left_nav_box">
+          <h6>About</h6>
+            <ul>
+              <li><a href="/lucy/">Welcome</a></li>
+              <li><a href="/lucy/faq.html">FAQ</a></li>
+              <li><a href="/lucy/people.html">People</a></li>
+            </ul>
+          <h6>Resources</h6>
+            <ul>
+              <li><a href="/lucy/download.html">Download</a></li>
+              <li><a href="/lucy/mailing_lists.html">Mailing Lists</a></li>
+              <li><a href="/lucy/docs/perl/">Documentation</a></li>
+              <li><a href="http://wiki.apache.org/lucy/">Wiki</a></li>
+              <li><a href="https://issues.apache.org/jira/browse/LUCY">Issue Tracker</a></li>
+              <li><a href="/lucy/version_control.html">Version Control</a></li>
+            </ul>
+          <h6>Related Projects</h6>
+            <ul>
+              <li><a href="http://lucene.apache.org/java/">Lucene</a></li>
+              <li><a href="http://lucene.apache.org/solr/">Solr</a></li>
+              <li><a href="http://incubator.apache.org/lucene.net/">Lucene.NET</a></li>
+              <li><a href="http://lucene.apache.org/pylucene/">PyLucene</a></li>
+              <li><a href="http://lucene.apache.org/openrelevance/">Open Relevance</a></li>
+            </ul>
+        </div> <!-- lucy-left_nav_box -->
+
+        <div id="lucy-main_content_box" class="grid_9">
+          <p><a name="ResourceInjection-Overview"></a></p>
+
+<h1>Overview</h1>
+
+<p>This example demonstrates the use of the injection of environment entries
+using <em>@Resource</em> annotation.</p>
+
+<p>The EJB 3.0 specification (<em>EJB Core Contracts and Requirements</em>) section
+16.2.2 reads:</p>
+
+<p><em>A field or method of a bean class may be annotated to request that an entry from the bean's environment be injected. Any of the types of resources or other environment entries<a href="88.html">88</a>
+ described in this chapter may be injected. Injection may also be requested
+using entries in the deployment descriptor corresponding to each of these
+resource types.</em></p>
+
+<p><em>Environment entries may also be injected into the bean through bean
+methods that follow the naming conventions for JavaBeans properties. The
+annotation is applied to the set method for the property, which is the
+method that is called to inject the environment entry. The JavaBeans
+property name (not the method name) is used as the default JNDI name.</em></p>
+
+<p>The <em>PurchaseOrderBean</em> class shows use of field-level <em>@Resource</em>
+annotation.</p>
+
+<p>The <em>InvoiceBean</em> class shows the use of method-level <em>@Resource</em>
+annotation.</p>
+
+<p>The source for this example can be checked out from svn:</p>
+
+<p>$ svn co
+http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/injection-of-env-entry</p>
+
+<p>To run it change your working directory to the directory
+<em>injection-of-env-entry</em> and run the following maven2 commands:</p>
+
+<p>$ cd injection-of-env-entry</p>
+
+<p>$ mvn clean install</p>
+
+<p><a name="ResourceInjection-TheCode"></a></p>
+
+<h1>The Code</h1>
+
+<p><a name="ResourceInjection-Injectionthroughfield(field-levelinjection)"></a></p>
+
+<h2>Injection through field (field-level injection)</h2>
+
+<p>The <em>maxLineItem</em> field in <em>PurchaseOrderBean</em> class is annotated with
+<em>@Resource</em> annotation to inform the EJB container <em>the place</em> where in the
+code the injection of a simple environment entry should take place. The
+default value of 10 is assigned. Deployer can modify the value of the
+environment entries at deployment time using deployment descriptor
+(ejb-jar.xml).</p>
+
+<p><a name="ResourceInjection-@Resourceannotationofafield"></a></p>
+
+<h4>@Resource annotation of a field</h4>
+
+<pre><code>@Resource
+int maxLineItems = 10;
+</code></pre>
+
+<p><a name="ResourceInjection-Injectionthroughasettermethod(method-levelinjection)"></a></p>
+
+<h2>Injection through a setter method (method-level injection)</h2>
+
+<p>The <em>setMaxLineItem</em> method in <em>InvoiceBean</em> class is annotated with
+<em>@Resource</em> annotation to inject the simple environment entry. Only setters
+can be used as a way to inject environment entry values. </p>
+
+<p>You could look up the env-entry using JNDI lookup() method and the
+following name:</p>
+
+<p>*
+java:comp/env/org.apache.openejb.examples.resource.InvoiceBean/maxLineItems</p>
+
+<p>The pattern is to combine the fully-qualified class name and the name of a
+instance field (or a name of the setter method without <em>set</em> prefix and the
+first letter lowercased).</p>
+
+<p><a name="ResourceInjection-@Resourceannotationofasettermethod"></a></p>
+
+<h4>@Resource annotation of a setter method</h4>
+
+<pre><code>@Resource
+public void setMaxLineItems(int maxLineItems) {
+    this.maxLineItems = maxLineItems;
+}
+</code></pre>
+
+<p><a name="ResourceInjection-env-entryinejb-jar.xml"></a></p>
+
+<h4>env-entry in ejb-jar.xml</h4>
+
+<pre><code>&lt;env-entry&gt;
+     &lt;description&gt;The maximum number of line items per
+</code></pre>
+
+<p>invoice.</description></p>
+
+<p><env-entry-name>org.apache.openejb.examples.injection.InvoiceBean/maxLineItems</env-entry-name>
+         <env-entry-type>java.lang.Integer</env-entry-type>
+         <env-entry-value>15</env-entry-value>
+    </env-entry></p>
+
+<p><a name="ResourceInjection-Using@Resourceannotatedenv-entry"></a></p>
+
+<h4>Using @Resource annotated env-entry</h4>
+
+<p>{tip:title=Using @Resource annotated env-entry}
+<em>maxLineItems</em> variable is injected by the <em>setMaxLine</em> method above. See
+also how env-entry is defined in ejb-jar.xml
+{tip}</p>
+
+<pre><code>public void addLineItem(LineItem item) throws TooManyItemsException {
+   if (item == null) {
+      throw new IllegalArgumentException("Line item must not be null");
+   }
+
+   if (itemCount &lt;= maxLineItems) {
+      items.add(item);
+      itemCount++;
+   } else {
+      throw new TooManyItemsException("Number of items exceeded the maximum
+</code></pre>
+
+<p>limit");
+       }
+    }</p>
+
+<p><a name="ResourceInjection-JUnitTest"></a></p>
+
+<h1>JUnit Test</h1>
+
+<p>Writing an JUnit test for this example is quite simple. We need just to
+write a setup method to create and initialize the InitialContext, and then
+write our test methods.</p>
+
+<p><a name="ResourceInjection-Testfixture"></a></p>
+
+<h4>Test fixture</h4>
+
+<pre><code>protected void setUp() throws Exception {
+    Properties properties = new Properties();
+    properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+</code></pre>
+
+<p>"org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty("openejb.deployments.classpath.include",
+".<em>resource-injection.</em>");
+        initialContext = new InitialContext(properties);
+    }</p>
+
+<p><a name="ResourceInjection-Testmethods"></a></p>
+
+<h4>Test methods</h4>
+
+<pre><code>public void testAddLineItem() throws Exception {
+    Invoice order = (Invoice)
+</code></pre>
+
+<p>initialContext.lookup("InvoiceBeanBusinessRemote");
+        assertNotNull(order);
+        LineItem item = new LineItem("ABC-1", "Test Item");</p>
+
+<pre><code>    try {
+    order.addLineItem(item);
+    } catch (TooManyItemsException tmie) {
+    fail("Test failed due to: " + tmie.getMessage());
+    }
+}
+</code></pre>
+
+<p><a name="ResourceInjection-Running"></a></p>
+
+<h1>Running</h1>
+
+<p>Running the example is fairly simple. Just execute the following commands:</p>
+
+<p>$ cd injection-of-env-entry
+$ mvn clean test</p>
+
+<pre><code>-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.superbiz.injection.PurchaseOrderBeanTest
+Apache OpenEJB 3.0.0-SNAPSHOT    build: 20071218-01:41
+http://openejb.apache.org/
+INFO - openejb.home = c:\oss\openejb3\examples\injection-of-env-entry
+INFO - openejb.base = c:\oss\openejb3\examples\injection-of-env-entry
+WARN - Cannot find the configuration file [conf/openejb.xml]
+</code></pre>
+
+<p>.  Will attempt to create one for the beans deployed.
+    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 - Configuring Service(id=Default JDK 1.3 ProxyFactory,
+type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
+    INFO - Found EjbModule in classpath:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Configuring app:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Configuring Service(id=Default Stateful Container, type=Container,
+provider-id=Default Stateful Container)
+    INFO - Auto-creating a container for bean InvoiceBean:
+Container(type=STATEFUL, id=Default Stateful Container)
+    INFO - Loaded Module:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Assembling app:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Jndi(name=InvoiceBeanRemote) --> Ejb(deployment-id=InvoiceBean)
+    INFO - Jndi(name=PurchaseOrderBeanRemote) -->
+Ejb(deployment-id=PurchaseOrderBean)
+    INFO - Created Ejb(deployment-id=InvoiceBean, ejb-name=InvoiceBean,
+container=Default Stateful Container)
+    INFO - Created Ejb(deployment-id=PurchaseOrderBean,
+ejb-name=PurchaseOrderBean, container=Default Stateful Container)
+    INFO - Deployed
+Application(path=c:\oss\openejb3\examples\injection-of-env-entry\target\classes)
+    INFO - OpenEJB ready.
+    OpenEJB ready.
+    Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.859 sec
+    Running org.superbiz.injection.InvoiceBeanTest
+    Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec</p>
+
+<pre><code>Results :
+
+Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
+</code></pre>
+
+        </div> <!-- lucy-main_content_box --> 
+        <div class="clear"></div>
+
+      </div> <!-- lucy-main_content -->
+
+      <div id="lucy-copyright" class="container_16">
+        <p>Copyright &#169; 2010-2011 The Apache Software Foundation, Licensed under the 
+           <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+           <br/>
+          
+        </p>
+      </div> <!-- lucy-copyright -->
+
+    </div> <!-- lucy-rigid_wrapper -->
+
+  </body>
+</html>

Added: websites/staging/openejb/trunk/content/resource-ref-for-datasource.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/resource-ref-for-datasource.cwiki (added)
+++ websites/staging/openejb/trunk/content/resource-ref-for-datasource.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,46 @@
+h1.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz.refs;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+@Stateless
+@Resource(name = "myFooDataSource", type = DataSource.class)
+public class MyDataSourceRefBean implements MyBeanInterface {
+
+    @Resource
+    private DataSource myBarDataSource;
+
+    public void someBusinessMethod() throws Exception {
+        if (myBarDataSource == null) throw new NullPointerException("myBarDataSource not injected");
+
+        // Both can be looked up from JNDI as well
+        InitialContext context = new InitialContext();
+        DataSource fooDataSource = (DataSource) context.lookup("java:comp/env/myFooDataSource");
+        DataSource barDataSource = (DataSource) context.lookup("java:comp/env/org.superbiz.refs.MyDataSourceRefBean/myBarDataSource");
+    }
+}
+{code}
+
+h1. Via xml
+
+The above @Resource annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<resource-ref>
+    <res-ref-name>myFooDataSource</res-ref-name>
+    <res-type>javax.sql.DataSource</res-type>
+</resource-ref>
+<resource-ref>
+    <res-ref-name>org.superbiz.refs.MyDataSourceRefBean/myBarDataSource</res-ref-name>
+    <res-type>javax.sql.DataSource</res-type>
+    <injection-target>
+        <injection-target-class>org.superbiz.refs.MyDataSourceRefBean</injection-target-class>
+        <injection-target-name>myBarDataSource</injection-target-name>
+    </injection-target>
+</resource-ref>
+{code}
\ No newline at end of file