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:52:37 UTC
svn commit: r805883 - in /websites/staging/openejb/trunk: ./
content/dev/configuration-and-assembly.html
Author: buildbot
Date: Wed Feb 22 23:52:37 2012
New Revision: 805883
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:52:37 2012
@@ -1 +1 @@
-1292588
+1292590
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:52:37 2012
@@ -171,81 +171,66 @@ all the magic stripped away. At a high
<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>
-
+<li>The <code>Assembler</code> will build and start the application exactly as described in the <code>Info</code> tree.
<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></li>
</ol>
-<p>import javax.ejb.LocalBean;
+<p>An example of what this looks like in code</p>
+
+<pre><code>import javax.ejb.LocalBean;
import javax.ejb.Stateful;
-import javax.naming.InitialContext;</p>
+import javax.naming.InitialContext;
-<p>import junit.framework.TestCase;
+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;</p>
+import org.apache.openejb.jee.StatefulBean;
-<p>public class StatefulTest extends TestCase {</p>
+public class StatefulTest extends TestCase {
-<pre><code>@Override
-protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
+ System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
-<pre><code>System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
+ ConfigurationFactory config = new ConfigurationFactory();
+ Assembler assembler = new Assembler();
+ assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
+ assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
-ConfigurationFactory config = new ConfigurationFactory();
-Assembler assembler = new Assembler();
+ EjbJar ejbJar = new EjbJar();
+ ejbJar.addEnterpriseBean(new StatefulBean(MyBean.class));
+ assembler.createApplication(config.configureApplication(ejbJar));
+ }
-assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
-assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
+ public void test() throws Exception {
+ InitialContext context = new InitialContext();
+ MyBean myBean = (MyBean) context.lookup("MyBeanLocalBean");
+ assertEquals("pan", myBean.echo("nap"));
+ }
-EjbJar ejbJar = new EjbJar();
-ejbJar.addEnterpriseBean(new StatefulBean(MyBean.class));
-
-
-assembler.createApplication(config.configureApplication(ejbJar));
-</code></pre>
+ @Stateful
+ @LocalBean
+ public static class MyBean {
+ 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>