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 2012/02/23 00:51:08 UTC

svn commit: r805881 - in /websites/staging/openejb/trunk: ./ content/dev/configuration-and-assembly.html

Author: buildbot
Date: Wed Feb 22 23:51:07 2012
New Revision: 805881

Log:
Staging update by buildbot for openejb

Modified:
    websites/staging/openejb/trunk/   (props changed)
    websites/staging/openejb/trunk/content/dev/configuration-and-assembly.html

Propchange: websites/staging/openejb/trunk/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Feb 22 23:51:07 2012
@@ -1 +1 @@
-1292174
+1292588

Modified: websites/staging/openejb/trunk/content/dev/configuration-and-assembly.html
==============================================================================
--- websites/staging/openejb/trunk/content/dev/configuration-and-assembly.html (original)
+++ websites/staging/openejb/trunk/content/dev/configuration-and-assembly.html Wed Feb 22 23:51:07 2012
@@ -136,11 +136,10 @@
 </h1>
 </div>
 
-<p><div class="note">}
-Disclaimer that we do tweak and change this code frequently, without
+<p>Disclaimer that we do tweak and change this code frequently, without
 notice.  It is the very heart of OpenEJB.  To keep things tight and clean,
 we reserve the right to change it at anytime.  Do not consider it a stable
-public API.<div class="note">}</p>
+public API.</p>
 
 <p><a name="ConfigurationandAssembly-OverviewinCode"></a></p>
 
@@ -155,71 +154,98 @@ this.</p>
 give it to OpenEJB, OpenEJB doesn't know about it.  This is OpenEJB with
 all the magic stripped away.  At a high level:</p>
 
-<p># You build your app in code using the JAXB tree in code and hand it to the <code>ConfigurationFactory</code>.
-  ## The <code>org.apache.openejb.jee</code> package contains JAXB trees for ejb-jar.xml, beans.xml and all the Java EE deployment descriptors.
-  # The <code>ConfigurationFactory</code> will produce a fully canonical version of the app called the <code>Info</code> tree by:
-  ## Merging all sources of meta-data -- xml and annotations
-  ## Resolving all ejb, persistence unit, datasource and other references
-  ## Validating the app and looking for mistakes
-  # The <code>Info</code> tree is
-  ## The singular source of information about the application from this point forward.
-  ## Pure data with no smarts or logic of any kind.
-  ## The instruction set of what would be built by the assembler.
-  # The <code>Assembler</code> will build and start the application exactly as described in the <code>Info</code> tree.
-  ## When this step completes, you have a running application.
-  ## Any failures prior to this point require no cleanup.  Only the assembler builds "live" objects.</p>
+<ol>
+<li>You build your app in code using the JAXB tree in code and hand it to the <code>ConfigurationFactory</code>.
+<ol>
+<li>The <code>org.apache.openejb.jee</code> package contains JAXB trees for ejb-jar.xml, beans.xml and all the Java EE deployment descriptors.</li>
+</ol></li>
+<li>The <code>ConfigurationFactory</code> will produce a fully canonical version of the app called the <code>Info</code> tree by:
+<ol>
+<li>Merging all sources of meta-data -- xml and annotations</li>
+<li>Resolving all ejb, persistence unit, datasource and other references</li>
+<li>Validating the app and looking for mistakes</li>
+</ol></li>
+<li>The <code>Info</code> tree is
+<ol>
+<li>The singular source of information about the application from this point forward.</li>
+<li>Pure data with no smarts or logic of any kind.</li>
+<li>The instruction set of what would be built by the assembler.</li>
+</ol></li>
+<li>The <code>Assembler</code> will build and start the application exactly as described in the <code>Info</code> tree.</p>
+
+<ol>
+<li>When this step completes, you have a running application.</li>
+<li>Any failures prior to this point require no cleanup.  Only the assembler builds "live" objects.</li>
+</ol>
 
-<pre><code>import javax.ejb.LocalBean;
+<p>import javax.ejb.LocalBean;
 import javax.ejb.Stateful;
-import javax.naming.InitialContext;
+import javax.naming.InitialContext;</p>
 
-import junit.framework.TestCase;
+<p>import junit.framework.TestCase;
 import org.apache.openejb.assembler.classic.Assembler;
 import org.apache.openejb.assembler.classic.SecurityServiceInfo;
 import org.apache.openejb.assembler.classic.TransactionServiceInfo;
 import org.apache.openejb.client.LocalInitialContextFactory;
 import org.apache.openejb.config.ConfigurationFactory;
 import org.apache.openejb.jee.EjbJar;
-import org.apache.openejb.jee.StatefulBean;
+import org.apache.openejb.jee.StatefulBean;</p>
 
-public class StatefulTest extends TestCase {
+<p>public class StatefulTest extends TestCase {</p>
 
-    @Override
-    protected void setUp() throws Exception {
+<pre><code>@Override
+protected void setUp() throws Exception {
 
-        System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
 
-        ConfigurationFactory config = new ConfigurationFactory();
-        Assembler assembler = new Assembler();
+<pre><code>System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
 
-        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
-        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
 
-        EjbJar ejbJar = new EjbJar();
-        ejbJar.addEnterpriseBean(new StatefulBean(MyBean.class));
+ConfigurationFactory config = new ConfigurationFactory();
+Assembler assembler = new Assembler();
 
-        assembler.createApplication(config.configureApplication(ejbJar));
-    }
 
-    public void test() throws Exception {
-        InitialContext context = new InitialContext();
-        MyBean myBean = (MyBean) context.lookup("MyBeanLocalBean");
+assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
+assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
 
-        assertEquals("pan", myBean.echo("nap"));
-    }
 
-    @Stateful
-    @LocalBean
-    public static class MyBean {
+EjbJar ejbJar = new EjbJar();
+ejbJar.addEnterpriseBean(new StatefulBean(MyBean.class));
+
+
+assembler.createApplication(config.configureApplication(ejbJar));
+</code></pre>
 
-        public String echo(String string) {
-            StringBuilder sb = new StringBuilder(string);
-            return sb.reverse().toString();
-        }
-    }
 }
+
+
+public void test() throws Exception {
+    InitialContext context = new InitialContext();
+    MyBean myBean = (MyBean) context.lookup("MyBeanLocalBean");
+
+
+<pre><code>assertEquals("pan", myBean.echo("nap"));
 </code></pre>
 
+}
+
+
+@Stateful
+@LocalBean
+public static class MyBean {
+
+
+<pre><code>public String echo(String string) {
+    StringBuilder sb = new StringBuilder(string);
+    return sb.reverse().toString();
+}
+</code></pre>
+
+}
+</code></pre>
+
+<p>}</li>
+</ol>
+
 <p><a name="ConfigurationandAssembly-LogicalOverview"></a></p>
 
 <h1>Logical Overview</h1>