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 [18/19] - /websites/staging/openejb/trunk/content/
Modified: websites/staging/openejb/trunk/content/tomcat.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/tomcat.cwiki (original)
+++ websites/staging/openejb/trunk/content/tomcat.cwiki Sun Jul 10 05:37:04 2011
@@ -1 +1,86 @@
-{include:OPENEJBx30:Tomcat}
\ No newline at end of file
+h1. Introduction
+
+The OpenEJB plugin for Tomcat makes all of the OpenEJB features available to Servlets, including:
+
+ * @Annotations
+ ** @Resource
+ ** @PersistenceUnit
+ ** @PersistenceContext
+ ** @EJB
+ * JPA - Java Persistence Architecture
+ * JMS - Java Messaging Service
+ * JTA - Transaction Processing
+ ** TransactionManager
+ ** Container Managed Transactions
+ ** XA Support
+ * JavaMail
+
+In addition, WAR files can contain EJB modules and JPA persistence units eliminating the annoying construction of .ear files. Adding EJBs and JPA Persistence beans to your application is as simple as adding the @Stateless, @Stateful, @MessageDriven or @Entity to a class. The packaging is refered to as [OPENEJB:Collapsed EAR] style as the war file, ejb jar, and persistence unit files are merged into one archive and share the same classloader.
+
+*Requirements:*
+ * OpenEJB 3.x
+ * Tomcat 6.x or 5.5
+ * Java 1.5 or 1.6
+
+h1. {anchor:quick instructions}Installation for the Impatient
+
+Assuming you have a [normal working Tomcat 6.x or 5.5 installation|Tomcat Installation]:
+
+# Download [openejb.war|OPENEJB:download]
+# Copy openejb.war to $\{catalina.base\}/webapps/openejb.war (Note: the file *must* be named openejb.war)
+# Start Tomcat if it is not already running
+# (optional) Visit [http://localhost:8080/openejb/installer] and click the 'install' button
+
+h1. Examples, Tutorials and Tests
+
+h2. ejb-examples.war
+
+See the webapps/ejb-examples/ directory in the [openejb-examples zip|OPENEJB:Download].
+
+h1. {anchor:problems} Problems?
+
+h2. HTTP Status 403
+
+Did you get a "HTTP Status 403" error page containing the description "Access to the specified resource () has been forbidden." when visiting [http://localhost:8080/openejb]?
+
+The openejb.war is protected by a Tomcat valve that restricts access to the application to the computer on which Tomcat is running. If your browser is running on the same computer as Tomcat, try accessing OpenEJB using this link instead [http://127.0.0.1:8080/openejb].
+
+If you want to access the openejb.war from another computer, you will need to either remove the valve, or modify the IP list in the valve declaration.
+
+The easiest way to remove the valve it to simply delete the webapps/openejb/META-INF/context.xml file and the webapps/openejb.war file *while Tomcat is stopped*. Warning that Tomcat keeps a copy of all context.xml files under conf/Catalina/localhost/<appname>.xml, so you may need to delete the conf/Catalina/localhost/openejb.xml file as well. The openejb.war file must be removed because some versions of Tomcat will use the context.xml file packed in the openejb.war file regardless of what is in the unpacked directory.
+
+h2. DuplicateDeploymentIdException:
+If you try to deploy the same ejb in two different web applications, then you will get the following exception (in conf/openejb.log):
+{code}
+org.apache.openejb.DuplicateDeploymentIdException: Application cannot be deployed as it contains deployment-ids which are in use:
+{code}
+To fix the issue, do the following:
+# Create a file named system.properties under the conf directory
+# Add the following to the system.properties file and save
+{code}
+openejb.deploymentId.format={moduleId}/{ejbName}
+{code}
+
+h2. java.lang.OutOfMemoryError: PermGen space
+By default, the JVM starts with a small PermGen. Tomcat does not increase this limit, so you may encounter this exception by the time Tomcat deploys and executes your application. If you get this exception, you should consider increasing the PermGen allocation for the Tomcat JVM. You can achieve this by adding "-XX:MaxPermSize=256m" to the CATALINA_OPTS environment variable before starting Tomcat.
+
+h2. Other Issues
+
+If you are having problems with the installation, please send a message to the OpenEJB users [mailing list|OPENEJB:mailing lists] containing any error message(s) and the following information:
+
+* OpenEJB Version
+* Tomcat Version
+* Java Version (execute java -version)
+* Operating System Type and Version
+
+
+h1. Limitations
+
+ *JavaAgent* - OpenEJB uses OpenJPA to provide JPA and CMP persistence, and OpenJPA currently requires a JavaAgent to function properly. This requirement is something that the OpenJPA project is working on removing. Once removed, the OpenEJB plugin for Tomcat will no longer need to modify the startup shell scripts and you will not need to restart Tomcat after the OpenEJB installation.
+
+h1. Misc
+
+This document is a starting point for using OpenEJB in Tomcat and will evolve based on user contributions. If you wish to contribute to this document, feel very welcome to click the 'Edit' link in the lower right and make changes and add new HOWTO's and other docs.
+
+h1. JSF Injection Support
+Now you can inject EJB's into JSF managed beans. Currently we have tested with JSF 1.2 RI (Mojarra) and MyFaces v1.2.3 . We would definitely appreciate any feedback on other JSF implementations.
\ No newline at end of file
Modified: websites/staging/openejb/trunk/content/tomcat.html
==============================================================================
--- websites/staging/openejb/trunk/content/tomcat.html (original)
+++ websites/staging/openejb/trunk/content/tomcat.html Sun Jul 10 05:37:04 2011
@@ -67,7 +67,170 @@
</div> <!-- lucy-left_nav_box -->
<div id="lucy-main_content_box" class="grid_9">
- <p>{include:OPENEJBx30:Tomcat}</p>
+ <p><a name="Tomcat-Introduction"></a></p>
+
+<h1>Introduction</h1>
+
+<p>The OpenEJB plugin for Tomcat makes all of the OpenEJB features available
+to Servlets, including:</p>
+
+<ul>
+<li>@Annotations
+<em>* @Resource
+<em></em> @PersistenceUnit
+<em></em> @PersistenceContext
+*</em> @EJB</li>
+<li>JPA - Java Persistence Architecture</li>
+<li>JMS - Java Messaging Service</li>
+<li>JTA - Transaction Processing
+<em>* TransactionManager
+<em></em> Container Managed Transactions
+*</em> XA Support</li>
+<li>JavaMail</li>
+</ul>
+
+<p>In addition, WAR files can contain EJB modules and JPA persistence units
+eliminating the annoying construction of .ear files. Adding EJBs and JPA
+Persistence beans to your application is as simple as adding the
+@Stateless, @Stateful, @MessageDriven or @Entity to a class. The packaging
+is refered to as <a href="openejb:collapsed-ear.html">OPENEJB:Collapsed EAR</a>
+ style as the war file, ejb jar, and persistence unit files are merged into
+one archive and share the same classloader.</p>
+
+<p><em>Requirements:</em>
+ * OpenEJB 3.x
+ * Tomcat 6.x or 5.5
+ * Java 1.5 or 1.6</p>
+
+<p><a name="Tomcat-{anchor:quickinstructions}InstallationfortheImpatient"></a></p>
+
+<h1>{anchor:quick instructions}Installation for the Impatient</h1>
+
+<p>Assuming you have a <a href="tomcat-installation.html">normal working Tomcat 6.x or 5.5 installation</a>
+:</p>
+
+<ol>
+<li>Download <a href="openejb:download.html">openejb.war</a></li>
+<li>Copy openejb.war to ${catalina.base}/webapps/openejb.war (Note: the
+file <em>must</em> be named openejb.war)</li>
+<li>Start Tomcat if it is not already running</li>
+<li>(optional) Visit <a href="http://localhost:8080/openejb/installer">http://localhost:8080/openejb/installer</a>
+and click the 'install' button</li>
+</ol>
+
+<p><a name="Tomcat-Examples,TutorialsandTests"></a></p>
+
+<h1>Examples, Tutorials and Tests</h1>
+
+<p><a name="Tomcat-ejb-examples.war"></a></p>
+
+<h2>ejb-examples.war</h2>
+
+<p>See the webapps/ejb-examples/ directory in the <a href="openejb:download.html">openejb-examples zip</a>
+.</p>
+
+<p><a name="Tomcat-{anchor:problems}Problems?"></a></p>
+
+<h1>{anchor:problems} Problems?</h1>
+
+<p><a name="Tomcat-HTTPStatus403"></a></p>
+
+<h2>HTTP Status 403</h2>
+
+<p>Did you get a "HTTP Status 403" error page containing the description
+"Access to the specified resource () has been forbidden." when visiting <a href="http://localhost:8080/openejb">http://localhost:8080/openejb</a>
+?</p>
+
+<p>The openejb.war is protected by a Tomcat valve that restricts access to the
+application to the computer on which Tomcat is running. If your browser is
+running on the same computer as Tomcat, try accessing OpenEJB using this
+link instead <a href="http://127.0.0.1:8080/openejb">http://127.0.0.1:8080/openejb</a>
+.</p>
+
+<p>If you want to access the openejb.war from another computer, you will need
+to either remove the valve, or modify the IP list in the valve declaration.</p>
+
+<p>The easiest way to remove the valve it to simply delete the
+webapps/openejb/META-INF/context.xml file and the webapps/openejb.war file
+<em>while Tomcat is stopped</em>. Warning that Tomcat keeps a copy of all
+context.xml files under conf/Catalina/localhost/<appname>.xml, so you may
+need to delete the conf/Catalina/localhost/openejb.xml file as well. The
+openejb.war file must be removed because some versions of Tomcat will use
+the context.xml file packed in the openejb.war file regardless of what is
+in the unpacked directory.</p>
+
+<p><a name="Tomcat-DuplicateDeploymentIdException:"></a></p>
+
+<h2>DuplicateDeploymentIdException:</h2>
+
+<p>If you try to deploy the same ejb in two different web applications, then
+you will get the following exception (in conf/openejb.log):</p>
+
+<pre><code>org.apache.openejb.DuplicateDeploymentIdException: Application cannot be
+</code></pre>
+
+<p>deployed as it contains deployment-ids which are in use: </p>
+
+<p>To fix the issue, do the following:
+1. Create a file named system.properties under the conf directory
+1. Add the following to the system.properties file and save</p>
+
+<pre><code>openejb.deploymentId.format={moduleId}/{ejbName}
+</code></pre>
+
+<p><a name="Tomcat-java.lang.OutOfMemoryError:PermGenspace"></a></p>
+
+<h2>java.lang.OutOfMemoryError: PermGen space</h2>
+
+<p>By default, the JVM starts with a small PermGen. Tomcat does not increase
+this limit, so you may encounter this exception by the time Tomcat deploys
+and executes your application. If you get this exception, you should
+consider increasing the PermGen allocation for the Tomcat JVM. You can
+achieve this by adding "-XX:MaxPermSize=256m" to the CATALINA_OPTS
+environment variable before starting Tomcat.</p>
+
+<p><a name="Tomcat-OtherIssues"></a></p>
+
+<h2>Other Issues</h2>
+
+<p>If you are having problems with the installation, please send a message to
+the OpenEJB users <a href="openejb:mailing-lists.html">mailing list</a>
+ containing any error message(s) and the following information:</p>
+
+<ul>
+<li>OpenEJB Version</li>
+<li>Tomcat Version</li>
+<li>Java Version (execute java -version)</li>
+<li>Operating System Type and Version</li>
+</ul>
+
+<p><a name="Tomcat-Limitations"></a></p>
+
+<h1>Limitations</h1>
+
+<p><em>JavaAgent</em> - OpenEJB uses OpenJPA to provide JPA and CMP persistence, and
+OpenJPA currently requires a JavaAgent to function properly. This
+requirement is something that the OpenJPA project is working on removing.
+Once removed, the OpenEJB plugin for Tomcat will no longer need to modify
+the startup shell scripts and you will not need to restart Tomcat after the
+OpenEJB installation.</p>
+
+<p><a name="Tomcat-Misc"></a></p>
+
+<h1>Misc</h1>
+
+<p>This document is a starting point for using OpenEJB in Tomcat and will
+evolve based on user contributions. If you wish to contribute to this
+document, feel very welcome to click the 'Edit' link in the lower right and
+make changes and add new HOWTO's and other docs. </p>
+
+<p><a name="Tomcat-JSFInjectionSupport"></a></p>
+
+<h1>JSF Injection Support</h1>
+
+<p>Now you can inject EJB's into JSF managed beans. Currently we have tested
+with JSF 1.2 RI (Mojarra) and MyFaces v1.2.3 . We would definitely
+appreciate any feedback on other JSF implementations. </p>
</div> <!-- lucy-main_content_box -->
<div class="clear"></div>
Added: websites/staging/openejb/trunk/content/transaction-annotations.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/transaction-annotations.cwiki (added)
+++ websites/staging/openejb/trunk/content/transaction-annotations.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,164 @@
+h1. Transaction Annotations
+
+_also see [Testing Transactions|Testing Transactions Example] for an example of how to use and test EJB transaction attributes_
+
+The *javax.ejb.TransactionAttribute* annotation (@TransactionAttribute) can be applied to a bean class or it's methods.
+
+Usage of the @TransactionAttribute requires you to specify one of six different transaction attribute types defined via the javax.ejb.TransactionAttributeType enum.
+
+ - TransactionAttributeType.*MANDATORY*
+ - TransactionAttributeType.*REQUIRED*
+ - TransactionAttributeType.*REQUIRES_NEW*
+ - TransactionAttributeType.*SUPPORTS*
+ - TransactionAttributeType.*NOT_SUPPORTED*
+ - TransactionAttributeType.*NEVER*
+
+Per EJB 3.0 the default transaction attribute for all EJB 3.0 applications is *REQUIRED*. The default transaction attribute for EJB 2.1, 2.0 and 1.1 applications is vendor specific. In OpenEJB EJB 2.1, 2.0 and 1.1 applications also use *REQUIRED* as the default.
+
+h2. Attribute Types summary
+
+A simplistic way to visualize the transaction attributes is as follows.
+
+| || Failing || Correcting || No Change ||
+|| Transacted | MANDATORY | REQUIRED, REQUIRES_NEW | SUPPORTS |
+|| Not Transacted | NEVER | NOT_SUPPORTED | SUPPORTS |
+
+The "*Transacted*" and "*Not Transacted*" categories represent the container guarantee, i.e. if the bean method will or will not be invoked in a transaction. The "*Failing*", "*Correcting*", and "*No Change*" categories represent the action take by the container to achieve that guarantee.
+
+For example, *Never* and *Mandatory* are categorized as "*Failing*" and will cause the container to throw an exception to the caller if there is (Tx Never) or is not (Tx Mandatory) a transaction in progress when the method is called. The attributes *Required*, *RequiresNew*, and *NotSupported* are categorized as "*Correcting*" as they will cause the container to adjust the transactional state automatically as needed to match the desired state, rather than blocking the invocation by throwing an exception.
+
+h3. Detailed description of each Attribute
+
+h4. MANDATORY
+
+A _MANDATORY_ method is guaranteed to always be executed in a transaction. However, it's the caller's job to take care of suppling the transaction. If the caller attempts to invoke the method *outside* of a transaction, then the container will block the call and throw them an *exception*.
+
+h4. REQUIRED
+
+A _REQUIRED_ method is guaranteed to always be executed in a transaction. If the caller attempts to invoke the method *outside* of a transaction, the container will *start* a transaction, execute the method, then *commit* the transaction.
+
+h4. REQUIRES_NEW
+
+A _REQUIRES_NEW_ method is guaranteed to always be executed in a transaction. If the caller attempts to invoke the method *inside or outside* of a transaction, the container will still *start* a transaction, execute the method, then *commit* the transaction. Any transaction the caller may have in progress will be *suspended* before the method execution then *resumed* afterward.
+
+h4. NEVER
+
+A _NEVER_ method is guaranteed to never be executed in a transaction. However, it's the caller's job to ensure there is no transaction. If the caller attempts to invoke the method *inside* of a transaction, then the container will block the call and throw them an *exception*.
+
+h4. NOT_SUPPORTED
+
+A _NOT_SUPPORTED_ method is guaranteed to never be executed in a transaction. If the caller attempts to invoke the method *inside* of a transaction, the container will *suspend* the caller's transaction, execute the method, then *resume* the caller's transaction.
+
+h4. SUPPORTS
+
+A _SUPPORTS_ method is guaranteed to adopt the exact transactional state of the caller. These methods can be invoked by caller's *inside or outside* of a transaction. The container will do nothing to change that state.
+
+
+h2. On Methods
+
+{code}
+@Stateless
+public static class MyBean implements MyBusinessInterface {
+
+ @TransactionAttribute(TransactionAttributeType.MANDATORY)
+ public String codeRed(String s) {
+ return s;
+ }
+
+ public String codeBlue(String s) {
+ return s;
+ }
+}
+{code}
+
+- _codeRed_ will be invoked with the attribute of _MANDATORY_
+- _codeBlue_ will be invoked with the default attribute of _REQUIRED_
+
+h2. On Classes
+
+{code}
+@Stateless
+@TransactionAttribute(TransactionAttributeType.MANDATORY)
+public static class MyBean implements MyBusinessInterface {
+
+ public String codeRed(String s) {
+ return s;
+ }
+
+ public String codeBlue(String s) {
+ return s;
+ }
+}
+{code}
+
+- _codeRed_ and _codeBlue_ will be invoked with the attribute of _MANDATORY_
+
+h2. Mixed on classes and methods
+
+{code}
+@Stateless
+@TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public static class MyBean implements MyBusinessInterface {
+
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public String codeRed(String s) {
+ return s;
+ }
+
+ public String codeBlue(String s) {
+ return s;
+ }
+
+ @TransactionAttribute(TransactionAttributeType.REQUIRED)
+ public String codeGreen(String s) {
+ return s;
+ }
+}
+{code}
+
+- _codeRed_ will be invoked with the attribute of _NEVER_
+- _codeBlue_ will be invoked with the attribute of _SUPPORTS_
+- _codeGreen_ will be invoked with the attribute of _REQUIRED_
+
+h1. Illegal Usage
+
+Generally, transaction annotationss cannot be made on AroundInvoke methods and most callbacks.
+
+The following usages of @TransactionAttribute have no effect.
+
+{code}
+@Stateful
+public class MyStatefulBean implements MyBusinessInterface {
+
+ @PostConstruct
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void constructed(){
+
+ }
+
+ @PreDestroy
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void destroy(){
+
+ }
+
+ @AroundInvoke
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public Object invoke(InvocationContext invocationContext) throws Exception {
+ return invocationContext.proceed();
+ }
+
+ @PostActivate
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void activated(){
+
+ }
+
+ @PrePassivate
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void passivate(){
+
+ }
+}
+{code}
+
Added: websites/staging/openejb/trunk/content/transaction-annotations.html
==============================================================================
--- websites/staging/openejb/trunk/content/transaction-annotations.html (added)
+++ websites/staging/openejb/trunk/content/transaction-annotations.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,323 @@
+<!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>Transaction Annotations</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> » <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="TransactionAnnotations-TransactionAnnotations"></a></p>
+
+<h1>Transaction Annotations</h1>
+
+<p><em>also see <a href="testing-transactions-example.html">Testing Transactions</a>
+ for an example of how to use and test EJB transaction attributes</em></p>
+
+<p>The <em>javax.ejb.TransactionAttribute</em> annotation (@TransactionAttribute) can
+be applied to a bean class or it's methods.</p>
+
+<p>Usage of the @TransactionAttribute requires you to specify one of six
+different transaction attribute types defined via the
+javax.ejb.TransactionAttributeType enum.</p>
+
+<ul>
+<li>TransactionAttributeType.<em>MANDATORY</em></li>
+<li>TransactionAttributeType.<em>REQUIRED</em></li>
+<li>TransactionAttributeType.<em>REQUIRES_NEW</em></li>
+<li>TransactionAttributeType.<em>SUPPORTS</em></li>
+<li>TransactionAttributeType.<em>NOT_SUPPORTED</em></li>
+<li>TransactionAttributeType.<em>NEVER</em></li>
+</ul>
+
+<p>Per EJB 3.0 the default transaction attribute for all EJB 3.0 applications
+is <em>REQUIRED</em>. The default transaction attribute for EJB 2.1, 2.0 and 1.1
+applications is vendor specific. In OpenEJB EJB 2.1, 2.0 and 1.1
+applications also use <em>REQUIRED</em> as the default.</p>
+
+<p><a name="TransactionAnnotations-AttributeTypessummary"></a></p>
+
+<h2>Attribute Types summary</h2>
+
+<p>A simplistic way to visualize the transaction attributes is as follows.</p>
+
+<table>
+<tr><td> </th><th> Failing </th><th> Correcting </th><th> No Change </th></tr>
+<tr><th> Transacted </td><td> MANDATORY </td><td> REQUIRED, REQUIRES_NEW </td><td> SUPPORTS </td></tr>
+<tr><th> Not Transacted </td><td> NEVER </td><td> NOT_SUPPORTED </td><td> SUPPORTS </td></tr>
+</table>
+
+<p>The "<em>Transacted</em>" and "<em>Not Transacted</em>" categories represent the
+container guarantee, i.e. if the bean method will or will not be invoked in
+a transaction. The "<em>Failing</em>", "<em>Correcting</em>", and "<em>No Change</em>"
+categories represent the action take by the container to achieve that
+guarantee.</p>
+
+<p>For example, <em>Never</em> and <em>Mandatory</em> are categorized as "<em>Failing</em>" and
+will cause the container to throw an exception to the caller if there is
+(Tx Never) or is not (Tx Mandatory) a transaction in progress when the
+method is called. The attributes <em>Required</em>, <em>RequiresNew</em>, and
+<em>NotSupported</em> are categorized as "<em>Correcting</em>" as they will cause the
+container to adjust the transactional state automatically as needed to
+match the desired state, rather than blocking the invocation by throwing an
+exception.</p>
+
+<p><a name="TransactionAnnotations-DetaileddescriptionofeachAttribute"></a></p>
+
+<h3>Detailed description of each Attribute</h3>
+
+<p><a name="TransactionAnnotations-MANDATORY"></a></p>
+
+<h4>MANDATORY</h4>
+
+<p>A <em>MANDATORY</em> method is guaranteed to always be executed in a transaction.
+However, it's the caller's job to take care of suppling the transaction.
+If the caller attempts to invoke the method <em>outside</em> of a transaction,
+then the container will block the call and throw them an <em>exception</em>.</p>
+
+<p><a name="TransactionAnnotations-REQUIRED"></a></p>
+
+<h4>REQUIRED</h4>
+
+<p>A <em>REQUIRED</em> method is guaranteed to always be executed in a transaction.
+If the caller attempts to invoke the method <em>outside</em> of a transaction, the
+container will <em>start</em> a transaction, execute the method, then <em>commit</em> the
+transaction.</p>
+
+<p><a name="TransactionAnnotations-REQUIRES_NEW"></a></p>
+
+<h4>REQUIRES_NEW</h4>
+
+<p>A <em>REQUIRES</em>NEW_ method is guaranteed to always be executed in a
+transaction. If the caller attempts to invoke the method <em>inside or
+outside</em> of a transaction, the container will still <em>start</em> a transaction,
+execute the method, then <em>commit</em> the transaction. Any transaction the
+caller may have in progress will be <em>suspended</em> before the method execution
+then <em>resumed</em> afterward.</p>
+
+<p><a name="TransactionAnnotations-NEVER"></a></p>
+
+<h4>NEVER</h4>
+
+<p>A <em>NEVER</em> method is guaranteed to never be executed in a transaction.
+However, it's the caller's job to ensure there is no transaction. If the
+caller attempts to invoke the method <em>inside</em> of a transaction, then the
+container will block the call and throw them an <em>exception</em>.</p>
+
+<p><a name="TransactionAnnotations-NOT_SUPPORTED"></a></p>
+
+<h4>NOT_SUPPORTED</h4>
+
+<p>A <em>NOT</em>SUPPORTED_ method is guaranteed to never be executed in a
+transaction. If the caller attempts to invoke the method <em>inside</em> of a
+transaction, the container will <em>suspend</em> the caller's transaction, execute
+the method, then <em>resume</em> the caller's transaction.</p>
+
+<p><a name="TransactionAnnotations-SUPPORTS"></a></p>
+
+<h4>SUPPORTS</h4>
+
+<p>A <em>SUPPORTS</em> method is guaranteed to adopt the exact transactional state of
+the caller. These methods can be invoked by caller's <em>inside or outside</em>
+of a transaction. The container will do nothing to change that state.</p>
+
+<p><a name="TransactionAnnotations-OnMethods"></a></p>
+
+<h2>On Methods</h2>
+
+<pre><code>@Stateless
+public static class MyBean implements MyBusinessInterface {
+
+ @TransactionAttribute(TransactionAttributeType.MANDATORY)
+ public String codeRed(String s) {
+ return s;
+ }
+
+ public String codeBlue(String s) {
+ return s;
+ }
+}
+</code></pre>
+
+<ul>
+<li><em>codeRed</em> will be invoked with the attribute of <em>MANDATORY</em></li>
+<li><em>codeBlue</em> will be invoked with the default attribute of <em>REQUIRED</em></li>
+</ul>
+
+<p><a name="TransactionAnnotations-OnClasses"></a></p>
+
+<h2>On Classes</h2>
+
+<pre><code>@Stateless
+@TransactionAttribute(TransactionAttributeType.MANDATORY)
+public static class MyBean implements MyBusinessInterface {
+
+ public String codeRed(String s) {
+ return s;
+ }
+
+ public String codeBlue(String s) {
+ return s;
+ }
+}
+</code></pre>
+
+<ul>
+<li><em>codeRed</em> and <em>codeBlue</em> will be invoked with the attribute of
+<em>MANDATORY</em></li>
+</ul>
+
+<p><a name="TransactionAnnotations-Mixedonclassesandmethods"></a></p>
+
+<h2>Mixed on classes and methods</h2>
+
+<pre><code>@Stateless
+@TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public static class MyBean implements MyBusinessInterface {
+
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public String codeRed(String s) {
+ return s;
+ }
+
+ public String codeBlue(String s) {
+ return s;
+ }
+
+ @TransactionAttribute(TransactionAttributeType.REQUIRED)
+ public String codeGreen(String s) {
+ return s;
+ }
+}
+</code></pre>
+
+<ul>
+<li><em>codeRed</em> will be invoked with the attribute of <em>NEVER</em></li>
+<li><em>codeBlue</em> will be invoked with the attribute of <em>SUPPORTS</em></li>
+<li><em>codeGreen</em> will be invoked with the attribute of <em>REQUIRED</em></li>
+</ul>
+
+<p><a name="TransactionAnnotations-IllegalUsage"></a></p>
+
+<h1>Illegal Usage</h1>
+
+<p>Generally, transaction annotationss cannot be made on AroundInvoke methods
+and most callbacks.</p>
+
+<p>The following usages of @TransactionAttribute have no effect.</p>
+
+<pre><code>@Stateful
+public class MyStatefulBean implements MyBusinessInterface {
+
+ @PostConstruct
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void constructed(){
+
+ }
+
+ @PreDestroy
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void destroy(){
+
+ }
+
+ @AroundInvoke
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public Object invoke(InvocationContext invocationContext) throws
+</code></pre>
+
+<p>Exception {
+ return invocationContext.proceed();
+ }</p>
+
+<pre><code> @PostActivate
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void activated(){
+
+ }
+
+ @PrePassivate
+ @TransactionAttribute(TransactionAttributeType.NEVER)
+ public void passivate(){
+
+ }
+}
+</code></pre>
+
+ </div> <!-- lucy-main_content_box -->
+ <div class="clear"></div>
+
+ </div> <!-- lucy-main_content -->
+
+ <div id="lucy-copyright" class="container_16">
+ <p>Copyright © 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/understanding-callbacks.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/understanding-callbacks.cwiki (added)
+++ websites/staging/openejb/trunk/content/understanding-callbacks.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,75 @@
+The rules here are pretty hard to follow without examples.
+
+When they say one AroundInvoke per class they mean that in the most literal sense as in one individual java class definition, not including it's parent class or classes, may exactly one AroundInvoke method. The bean or interceptor class may have an AroundInvoke method, its parent class may have an AroundInvoke method, the parent's parent class may have an AroundInvoke method and so on.
+
+So the following is legal.
+
+{code}
+ public class Plant {
+ @AroundInvoke
+ public Object a(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+ }
+
+ public class Fruit extends Plant {
+ @AroundInvoke
+ public Object b(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+ }
+
+ @Stateless
+ public class Apple extends Fruit implements AppleLocal {
+ @AroundInvoke
+ public Object c(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+
+ public String grow(){
+ return "ready to pick";
+ }
+ }
+
+ public interface AppleLocal {
+ public String grow();
+ }
+{code}
+
+The result is that when the "grow" method on AppleLocal (and consequently on Apple) is invoked, the container will first invoke the following AroundInvoke methods in this order; a, b, c.
+
+What the ejb spec doesn't do such a good job at stating is that there are ways to effectively shut off the callbacks, including AroundInvoke, of a parent class by simply overriding the method. We can shut off the "a" around invoke with a slightly different version of Apple as follows:
+
+{code}
+ @Stateless
+ public class Apple extends Fruit implements AppleLocal {
+
+ // This will now never be called.
+ public Object a(InvocationContext ctx) throws Exception {
+ return null;
+ }
+
+ @AroundInvoke
+ public Object c(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+
+ public String grow(){
+ return "ready to pick";
+ }
+ }
+{code}
+
+The result of this is that when the "grow" method on AppleLocal is invoked, the container will first invoke the AroundInvoke methods "b" then "c" skipping "a" completely.
+
+When they say that an AroundInvoke method cannot be a business method, they mean that they cannot be exposed to clients through a local or remote interface. The following would be illegal.
+
+{code}
+ public interface AppleLocal {
+ public String grow();
+
+ // This is an AroundInvoke method in the bean class, not a legal business method!
+ public Object c(InvocationContext ctx) throws Exception;
+ }
+{code}
+
Added: websites/staging/openejb/trunk/content/understanding-callbacks.html
==============================================================================
--- websites/staging/openejb/trunk/content/understanding-callbacks.html (added)
+++ websites/staging/openejb/trunk/content/understanding-callbacks.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,174 @@
+<!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>Understanding Callbacks</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> » <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>The rules here are pretty hard to follow without examples. </p>
+
+<p>When they say one AroundInvoke per class they mean that in the most literal
+sense as in one individual java class definition, not including it's parent
+class or classes, may exactly one AroundInvoke method. The bean or
+interceptor class may have an AroundInvoke method, its parent class may
+have an AroundInvoke method, the parent's parent class may have an
+AroundInvoke method and so on.</p>
+
+<p>So the following is legal.</p>
+
+<pre><code> public class Plant {
+ @AroundInvoke
+ public Object a(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+ }
+
+ public class Fruit extends Plant {
+ @AroundInvoke
+ public Object b(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+ }
+
+ @Stateless
+ public class Apple extends Fruit implements AppleLocal {
+ @AroundInvoke
+ public Object c(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+
+ public String grow(){
+ return "ready to pick";
+ }
+ }
+
+ public interface AppleLocal {
+ public String grow();
+ }
+</code></pre>
+
+<p>The result is that when the "grow" method on AppleLocal (and consequently
+on Apple) is invoked, the container will first invoke the following
+AroundInvoke methods in this order; a, b, c.</p>
+
+<p>What the ejb spec doesn't do such a good job at stating is that there are
+ways to effectively shut off the callbacks, including AroundInvoke, of a
+parent class by simply overriding the method. We can shut off the "a"
+around invoke with a slightly different version of Apple as follows:</p>
+
+<pre><code> @Stateless
+ public class Apple extends Fruit implements AppleLocal {
+
+ // This will now never be called.
+ public Object a(InvocationContext ctx) throws Exception {
+ return null;
+ }
+
+ @AroundInvoke
+ public Object c(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+
+ public String grow(){
+ return "ready to pick";
+ }
+ }
+</code></pre>
+
+<p>The result of this is that when the "grow" method on AppleLocal is invoked,
+the container will first invoke the AroundInvoke methods "b" then "c"
+skipping "a" completely.</p>
+
+<p>When they say that an AroundInvoke method cannot be a business method, they
+mean that they cannot be exposed to clients through a local or remote
+interface. The following would be illegal.</p>
+
+<pre><code> public interface AppleLocal {
+ public String grow();
+
+ // This is an AroundInvoke method in the bean class, not a legal
+</code></pre>
+
+<p>business method!
+ public Object c(InvocationContext ctx) throws Exception;
+ }</p>
+
+ </div> <!-- lucy-main_content_box -->
+ <div class="clear"></div>
+
+ </div> <!-- lucy-main_content -->
+
+ <div id="lucy-copyright" class="container_16">
+ <p>Copyright © 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/understanding-the-directory-layout.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/understanding-the-directory-layout.cwiki (added)
+++ websites/staging/openejb/trunk/content/understanding-the-directory-layout.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,59 @@
+When freshly unpacked, OpenEJB will look like this:
+
+{panel}
+ openejb-3.0/
+ openejb-3.0/logs/
+ openejb-3.0/apps/
+ openejb-3.0/lib/
+ openejb-3.0/lib/_<several jars>_
+ openejb-3.0/LICENSE.txt
+ openejb-3.0/NOTICE.txt
+ openejb-3.0/README.txt
+ openejb-3.0/bin/
+ openejb-3.0/bin/openejb.bat
+ openejb-3.0/bin/openejb
+ openejb-3.0/conf/
+ openejb-3.0/conf/README.txt
+{panel}
+
+h1. Directories
+
+h2. bin/
+
+Contains commands to start/stop the server (You can also do a lot of other stuff like deploy/undeploy, but we will just talk about things needed to get you started)
+
+h2. lib/
+
+Contains several jar files (you only need of few of these jars in your classpath to do EJB development)
+
+h2. apps/
+
+Once you create your EJB's and jar them up, you can place your jar file in this directory and start the server. The server will automatically deploy all the EJB's contained in this JAR.
+
+h2. logs/
+
+Contains log files.
+
+h2. conf/
+
+This directory contains nothing but a README.txt file at the time OpenEJB is unpacked. The first time OpenEJB is started however, these files will be created:
+
+{noformat}
+ conf/
+ openejb.xml (main config file)
+
+ logging.properties (log levels and files)
+
+ login.config (jaas config file)
+ users.properties (users that can log in)
+ groups.properties (groups in which users belong)
+
+ admin.properties (network socket for administration)
+ ejbd.properties (network socket for ejb invocations)
+ hsql.properties (network socket for hsql client access)
+ httpejbd.properties (network socket for ejb invocations over http)
+ telnet.properties (network socket for telnet "server")
+{noformat}
+
+These files can be edited as desired. If at any time you are unhappy with your changes or simply wish to start over, you can delete or move any of the files above and a new one containing the default values will be automatically created.
+
Added: websites/staging/openejb/trunk/content/understanding-the-directory-layout.html
==============================================================================
--- websites/staging/openejb/trunk/content/understanding-the-directory-layout.html (added)
+++ websites/staging/openejb/trunk/content/understanding-the-directory-layout.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,168 @@
+<!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>Understanding the Directory Layout</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> » <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>When freshly unpacked, OpenEJB will look like this:</p>
+
+<p>{panel}
+ openejb-3.0/
+ openejb-3.0/logs/
+ openejb-3.0/apps/
+ openejb-3.0/lib/
+ openejb-3.0/lib/<em><several jars></em>
+ openejb-3.0/LICENSE.txt
+ openejb-3.0/NOTICE.txt
+ openejb-3.0/README.txt
+ openejb-3.0/bin/
+ openejb-3.0/bin/openejb.bat
+ openejb-3.0/bin/openejb
+ openejb-3.0/conf/
+ openejb-3.0/conf/README.txt
+{panel}</p>
+
+<p><a name="UnderstandingtheDirectoryLayout-Directories"></a></p>
+
+<h1>Directories</h1>
+
+<p><a name="UnderstandingtheDirectoryLayout-bin/"></a></p>
+
+<h2>bin/</h2>
+
+<p>Contains commands to start/stop the server (You can also do a lot of other
+stuff like deploy/undeploy, but we will just talk about things needed to
+get you started)</p>
+
+<p><a name="UnderstandingtheDirectoryLayout-lib/"></a></p>
+
+<h2>lib/</h2>
+
+<p>Contains several jar files (you only need of few of these jars in your
+classpath to do EJB development)</p>
+
+<p><a name="UnderstandingtheDirectoryLayout-apps/"></a></p>
+
+<h2>apps/</h2>
+
+<p>Once you create your EJB's and jar them up, you can place your jar file in
+this directory and start the server. The server will automatically deploy
+all the EJB's contained in this JAR.</p>
+
+<p><a name="UnderstandingtheDirectoryLayout-logs/"></a></p>
+
+<h2>logs/</h2>
+
+<p>Contains log files.</p>
+
+<p><a name="UnderstandingtheDirectoryLayout-conf/"></a></p>
+
+<h2>conf/</h2>
+
+<p>This directory contains nothing but a README.txt file at the time OpenEJB
+is unpacked. The first time OpenEJB is started however, these files will
+be created:</p>
+
+<pre><code> conf/
+ openejb.xml (main config file)
+
+ logging.properties (log levels and files)
+
+ login.config (jaas config file)
+ users.properties (users that can log in)
+ groups.properties (groups in which users belong)
+
+ admin.properties (network socket for administration)
+ ejbd.properties (network socket for ejb invocations)
+ hsql.properties (network socket for hsql client access)
+ httpejbd.properties (network socket for ejb invocations over
+</code></pre>
+
+<p>http)
+ telnet.properties (network socket for telnet "server") </p>
+
+<p>These files can be edited as desired. If at any time you are unhappy with
+your changes or simply wish to start over, you can delete or move any of
+the files above and a new one containing the default values will be
+automatically created.</p>
+
+ </div> <!-- lucy-main_content_box -->
+ <div class="clear"></div>
+
+ </div> <!-- lucy-main_content -->
+
+ <div id="lucy-copyright" class="container_16">
+ <p>Copyright © 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/unit-testing-transactions.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/unit-testing-transactions.cwiki (added)
+++ websites/staging/openejb/trunk/content/unit-testing-transactions.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,168 @@
+h1. Basic setup
+
+Add the following interface and bean to your test sources (they could even be inner classes of a test case):
+
+h2. Business interface
+
+{code}
+public interface Caller {
+ public <V> V call(Callable<V> callable) throws Exception;
+}
+{code}
+
+h2. Bean Implementation(s)
+
+{code}
+import java.util.concurrent.Callable;
+
+@Stateless
+@TransactionAttribute(REQUIRES_NEW)
+public class TransactionBean implements Caller {
+ public <V> V call(Callable<V> callable) throws Exception {
+ return callable.call();
+ }
+}
+{code}
+
+h2. Have them discovered
+
+In src/test/resources/ (or related) create an META-INF/ejb-jar.xml containing the text "<ejb-jar/>"
+
+h2. What we accomplished
+
+Essentially what we've done is added an ejb that will be picked up as part of your test code and deployed. You can then look it up and use it to execute test code with any particular transaction or security constraints that you want. The above bean specifies REQUIRES_NEW; functionally the same as REQUIRED as the test case itself won't have a transaction, but a little cleaner and more explicit.
+
+You could also annotate the bean with @RunAs("manager") for example and test that your security restrictions are how you like them. You can have as many of these test beans in your test code as you like, each with it's own transaction and security constraints allowing you to write some incredibly thorough tests.
+
+You do not need to use java.util.concurrent.Callable, any similar interface of your creation could work just as well. You may want something with return type void, for example, to eliminate useless 'return null' statements.
+
+h1. Usage
+
+There are a number of style choices for using the above bean, specifically around the creation of the Callable object you pass in, and it all really depends on what looks nice to you.
+
+In the examples below, the Movies bean being tested is simply a thin layer around JPA that allows us to use enforce various transaction semantics.
+
+{code}
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import static javax.ejb.TransactionAttributeType.MANDATORY;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful(name = "Movies")
+@TransactionAttribute(MANDATORY)
+public class MoviesImpl implements Movies {
+
+ @PersistenceContext(unitName = "movie-unit", type = PersistenceContextType.TRANSACTION)
+ private EntityManager entityManager;
+
+ public void addMovie(Movie movie) throws Exception {
+ entityManager.persist(movie);
+ }
+
+ public void deleteMovie(Movie movie) throws Exception {
+ entityManager.remove(movie);
+ }
+
+ public List<Movie> getMovies() throws Exception {
+ Query query = entityManager.createQuery("SELECT m from Movie as m");
+ return query.getResultList();
+ }
+}
+
+{code}
+
+Test code below.
+
+h2. Pure inlined
+
+The Callable can be created right in the test method itself.
+
+{code}
+public class MoviesTest extends TestCase {
+ private Context context;
+
+ protected void setUp() throws Exception {
+ // initialize jndi context as usual
+ }
+
+ public void test() throws Exception {
+ Caller transactionBean = (Caller) context.lookup("TransactionBeanLocal");
+
+ transactionBean.call(new Callable() {
+ public Object call() throws Exception {
+ Movies movies = (Movies) context.lookup("MoviesLocal");
+
+ movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+ movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+ movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+ List<Movie> list = movies.getMovies();
+ assertEquals("List.size()", 3, list.size());
+
+ for (Movie movie : list) {
+ movies.deleteMovie(movie);
+ }
+
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+
+ return null;
+ }
+ });
+ }
+}
+{code}
+
+h2. Same test code, different transaction scenarios
+
+Maybe you'd like to test how things behave with and without a transaction to guarantee everyone is doing the right thing in all situations. Negative testing is often a very good way to stomp out dangerous bugs.
+
+{code}
+public class MoviesTest extends TestCase {
+ private Context context;
+
+ protected void setUp() throws Exception {
+ // initialize jndi context as usual
+ }
+
+ private void doWork() throws Exception {
+ Movies movies = (Movies) context.lookup("MoviesLocal");
+
+ movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992));
+ movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+ movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));
+
+ List<Movie> list = movies.getMovies();
+ assertEquals("List.size()", 3, list.size());
+
+ for (Movie movie : list) {
+ movies.deleteMovie(movie);
+ }
+
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+ }
+
+ public void testWithTransaction() throws Exception {
+ Caller transactionBean = (Caller) context.lookup("TransactionBeanLocal");
+
+ transactionBean.call(new Callable(){
+ public Object call() throws Exception {
+ doWork();
+ return null;
+ }
+ });
+ }
+
+ public void testWithoutTransaction() throws Exception {
+ try {
+ doWork();
+ fail("The Movies bean should be using TransactionAttributeType.MANDATORY");
+ } catch (javax.transaction.TransactionRequiredException e) {
+ // good, our Movies bean is using TransactionAttributeType.MANDATORY as we want
+ }
+ }
+}
+{code}
\ No newline at end of file
Added: websites/staging/openejb/trunk/content/unit-testing-transactions.html
==============================================================================
--- websites/staging/openejb/trunk/content/unit-testing-transactions.html (added)
+++ websites/staging/openejb/trunk/content/unit-testing-transactions.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,308 @@
+<!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>Unit Testing Transactions</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> » <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="UnitTestingTransactions-Basicsetup"></a></p>
+
+<h1>Basic setup</h1>
+
+<p>Add the following interface and bean to your test sources (they could even
+be inner classes of a test case):</p>
+
+<p><a name="UnitTestingTransactions-Businessinterface"></a></p>
+
+<h2>Business interface</h2>
+
+<pre><code>public interface Caller {
+ public <V> V call(Callable<V> callable) throws Exception;
+}
+</code></pre>
+
+<p><a name="UnitTestingTransactions-BeanImplementation(s)"></a></p>
+
+<h2>Bean Implementation(s)</h2>
+
+<pre><code>import java.util.concurrent.Callable;
+
+@Stateless
+@TransactionAttribute(REQUIRES_NEW)
+public class TransactionBean implements Caller {
+ public <V> V call(Callable<V> callable) throws Exception {
+ return callable.call();
+ }
+}
+</code></pre>
+
+<p><a name="UnitTestingTransactions-Havethemdiscovered"></a></p>
+
+<h2>Have them discovered</h2>
+
+<p>In src/test/resources/ (or related) create an META-INF/ejb-jar.xml
+containing the text "<ejb-jar/>"</p>
+
+<p><a name="UnitTestingTransactions-Whatweaccomplished"></a></p>
+
+<h2>What we accomplished</h2>
+
+<p>Essentially what we've done is added an ejb that will be picked up as part
+of your test code and deployed. You can then look it up and use it to
+execute test code with any particular transaction or security constraints
+that you want. The above bean specifies REQUIRES_NEW; functionally the
+same as REQUIRED as the test case itself won't have a transaction, but a
+little cleaner and more explicit. </p>
+
+<p>You could also annotate the bean with @RunAs("manager") for example and
+test that your security restrictions are how you like them. You can have
+as many of these test beans in your test code as you like, each with it's
+own transaction and security constraints allowing you to write some
+incredibly thorough tests.</p>
+
+<p>You do not need to use java.util.concurrent.Callable, any similar interface
+of your creation could work just as well. You may want something with
+return type void, for example, to eliminate useless 'return null'
+statements.</p>
+
+<p><a name="UnitTestingTransactions-Usage"></a></p>
+
+<h1>Usage</h1>
+
+<p>There are a number of style choices for using the above bean, specifically
+around the creation of the Callable object you pass in, and it all really
+depends on what looks nice to you.</p>
+
+<p>In the examples below, the Movies bean being tested is simply a thin layer
+around JPA that allows us to use enforce various transaction semantics.</p>
+
+<pre><code>import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import static javax.ejb.TransactionAttributeType.MANDATORY;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import java.util.List;
+
+@Stateful(name = "Movies")
+@TransactionAttribute(MANDATORY)
+public class MoviesImpl implements Movies {
+
+ @PersistenceContext(unitName = "movie-unit", type =
+</code></pre>
+
+<p>PersistenceContextType.TRANSACTION)
+ private EntityManager entityManager;</p>
+
+<pre><code> public void addMovie(Movie movie) throws Exception {
+ entityManager.persist(movie);
+ }
+
+ public void deleteMovie(Movie movie) throws Exception {
+ entityManager.remove(movie);
+ }
+
+ public List<Movie> getMovies() throws Exception {
+ Query query = entityManager.createQuery("SELECT m from Movie as
+</code></pre>
+
+<p>m");
+ return query.getResultList();
+ }
+ }</p>
+
+<p>Test code below.</p>
+
+<p><a name="UnitTestingTransactions-Pureinlined"></a></p>
+
+<h2>Pure inlined</h2>
+
+<p>The Callable can be created right in the test method itself.</p>
+
+<pre><code>public class MoviesTest extends TestCase {
+ private Context context;
+
+ protected void setUp() throws Exception {
+ // initialize jndi context as usual
+ }
+
+ public void test() throws Exception {
+ Caller transactionBean = (Caller)
+</code></pre>
+
+<p>context.lookup("TransactionBeanLocal");</p>
+
+<pre><code> transactionBean.call(new Callable() {
+ public Object call() throws Exception {
+ Movies movies = (Movies) context.lookup("MoviesLocal");
+
+ movies.addMovie(new Movie("Quentin Tarantino", "Reservoir
+</code></pre>
+
+<p>Dogs", 1992));
+ movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+ movies.addMovie(new Movie("Joel Coen", "The Big Lebowski",
+1998));</p>
+
+<pre><code> List<Movie> list = movies.getMovies();
+ assertEquals("List.size()", 3, list.size());
+
+ for (Movie movie : list) {
+ movies.deleteMovie(movie);
+ }
+
+ assertEquals("Movies.getMovies()", 0,
+</code></pre>
+
+<p>movies.getMovies().size());</p>
+
+<pre><code> return null;
+ }
+ });
+ }
+}
+</code></pre>
+
+<p><a name="UnitTestingTransactions-Sametestcode,differenttransactionscenarios"></a></p>
+
+<h2>Same test code, different transaction scenarios</h2>
+
+<p>Maybe you'd like to test how things behave with and without a transaction
+to guarantee everyone is doing the right thing in all situations. Negative
+testing is often a very good way to stomp out dangerous bugs.</p>
+
+<pre><code>public class MoviesTest extends TestCase {
+ private Context context;
+
+ protected void setUp() throws Exception {
+ // initialize jndi context as usual
+ }
+
+ private void doWork() throws Exception {
+ Movies movies = (Movies) context.lookup("MoviesLocal");
+
+ movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs",
+</code></pre>
+
+<p>1992));
+ movies.addMovie(new Movie("Joel Coen", "Fargo", 1996));
+ movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998));</p>
+
+<pre><code> List<Movie> list = movies.getMovies();
+ assertEquals("List.size()", 3, list.size());
+
+ for (Movie movie : list) {
+ movies.deleteMovie(movie);
+ }
+
+ assertEquals("Movies.getMovies()", 0, movies.getMovies().size());
+ }
+
+ public void testWithTransaction() throws Exception {
+ Caller transactionBean = (Caller)
+</code></pre>
+
+<p>context.lookup("TransactionBeanLocal");</p>
+
+<pre><code> transactionBean.call(new Callable(){
+ public Object call() throws Exception {
+ doWork();
+ return null;
+ }
+ });
+ }
+
+ public void testWithoutTransaction() throws Exception {
+ try {
+ doWork();
+ fail("The Movies bean should be using
+</code></pre>
+
+<p>TransactionAttributeType.MANDATORY");
+ } catch (javax.transaction.TransactionRequiredException e) {
+ // good, our Movies bean is using
+TransactionAttributeType.MANDATORY as we want
+ }
+ }
+ }</p>
+
+ </div> <!-- lucy-main_content_box -->
+ <div class="clear"></div>
+
+ </div> <!-- lucy-main_content -->
+
+ <div id="lucy-copyright" class="container_16">
+ <p>Copyright © 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/users-guide.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/users-guide.cwiki (added)
+++ websites/staging/openejb/trunk/content/users-guide.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,15 @@
+Table of Contents:
+# [Getting Started]
+# [Understanding the Directory Layout]
+# [Introduction to the command line tools]
+# [OPENEJB:Persistence]
+# [Stateless Session Beans]
+# [OPENEJB:Stateful Session Beans]
+# [OPENEJB:Message Driven Beans
+# [Configuring the Server
+## [Configure a DataSource|Configuring DataSources]
+## [Configure Logging|OPENEJB:Logging]
+## System properties
+## Configure security
+
+{color:#ff0000}{*}TODO: Create separate pages for the above in users guide and link to them. Would be good to add "Next Page, Previous Page and Table of contents" links on each page.\**{color}
\ No newline at end of file
Added: websites/staging/openejb/trunk/content/users-guide.html
==============================================================================
--- websites/staging/openejb/trunk/content/users-guide.html (added)
+++ websites/staging/openejb/trunk/content/users-guide.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,104 @@
+<!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>Users Guide</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> » <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>Table of Contents:
+1. <a href="getting-started.html">Getting Started</a>
+1. <a href="understanding-the-directory-layout.html">Understanding the Directory Layout</a>
+1. <a href="introduction-to-the-command-line-tools.html">Introduction to the command line tools</a>
+1. <a href="openejb:persistence.html">OPENEJB:Persistence</a>
+1. <a href="stateless-session-beans.html">Stateless Session Beans</a>
+1. <a href="openejb:stateful-session-beans.html">OPENEJB:Stateful Session Beans</a>
+1. [OPENEJB:Message Driven Beans
+1. [Configuring the Server
+1. # <a href="configuring-datasources.html">Configure a DataSource</a>
+1. # <a href="openejb:logging.html">Configure Logging</a>
+1. # System properties
+1. # Configure security</p>
+
+<p>{color:#ff0000}{<em>}TODO: Create separate pages for the above in users guide
+and link to them. Would be good to add "Next Page, Previous Page and
+Table of contents" links on each page.*</em>{color}</p>
+
+ </div> <!-- lucy-main_content_box -->
+ <div class="clear"></div>
+
+ </div> <!-- lucy-main_content -->
+
+ <div id="lucy-copyright" class="container_16">
+ <p>Copyright © 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/users.cwiki
==============================================================================
(empty)
Added: websites/staging/openejb/trunk/content/users.html
==============================================================================
--- websites/staging/openejb/trunk/content/users.html (added)
+++ websites/staging/openejb/trunk/content/users.html Sun Jul 10 05:37:04 2011
@@ -0,0 +1,88 @@
+<!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>Users</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> » <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">
+
+
+ </div> <!-- lucy-main_content_box -->
+ <div class="clear"></div>
+
+ </div> <!-- lucy-main_content -->
+
+ <div id="lucy-copyright" class="container_16">
+ <p>Copyright © 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/webapp-based-ejbs.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/webapp-based-ejbs.cwiki (added)
+++ websites/staging/openejb/trunk/content/webapp-based-ejbs.cwiki Sun Jul 10 05:37:04 2011
@@ -0,0 +1,84 @@
+{note:title=THIS PAGE WILL BE ARCHIVED AND REMOVED}
+Instructions on Webapp-based EJBs can be found at [Collapsed EAR]
+
+{note}
+h1. Introduction
+
+The basic idea of this approach is that your Servlets and EJBs are together in your war file as one app.
+
+ * No classloader boundries between Serlvets & EJBs
+
+ * EJBs and Servlets can share all third-party libraries (like Spring!), no ear required.
+
+ * Can put the web.xml and ejb-jar.xml in the same archive (the war file).
+
+ * EJBs can see Serlvet classes and vice versa.
+
+How is this done? The support for running your EJBs (OpenEJB) is loaded into your webapp classloader and not visible to any other webapps.
+
+
+h2. Not quite J2EE
+
+This is very different than J2EE as defined by the spec as there aren't several levels of separation and heirarchy. This is going to take some getting used to and it should be understood that this style of packaging isn't J2EE compliant.
+
+J2EE classloading rules:
+
+ * You cannot ever have ejbs and servlets in the same classloader.
+
+ * Three classloader minimum; a classloader for the ear, one for each ejb jar, and one for each war file.
+
+ * Servlets can see EJBs, but EJBs cannot see Servlets.
+
+ To pull that off, J2EE has to kill you on packaging:
+
+ * You cannot have EJB classes and Servlet classes in the same archive.
+
+ * You need at least three archives to combine servlets and ejbs;
+ 1 ear containing 1 ejb jar and 1 servlet war.
+
+ * Shared libraries must go in the ear and be included in a
+ specially formatted 'Class-Path' entry in the ear's MANIFEST
+ file.
+
+Critically speaking, forcing more than one classloader on an application is where J2EE "jumps the shark" for a large majority of people's needs.
+
+h1. Setup
+
+This is new feature for OpenEJB 1.0.
+
+Configure OpenEJB per webapp requires the following steps:
+* Copy the _openejb-loader-*.jar_ into the WEB-INF/lib directory of the webapp that is to use EJBs deployed onto OpenEJB
+* Add the _loader_ servlet definition to the WEB-INF/web.xml file of the webapp with a valid value for openejb.home init-param.
+{code}
+<servlet>
+ <servlet-name>loader</servlet-name>
+ <servlet-class>org.openejb.loader.LoaderServlet</servlet-class>
+ <init-param>
+ <param-name>openejb.loader</param-name>
+ <param-value>tomcat-webapp</param-value>
+ </init-param>
+ <init-param>
+ <param-name>openejb.home</param-name>
+ <param-value>...define OPENEJB_HOME here...</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+{code}
+
+
+Should you define other OpenEJB configuration settings use another <init-param> stanza. It's just for that. These parameters are directly passed to OpenEJB at initialization of the servlet. Think about the loader servlet as a bridge between OpenEJB's world (EJBs) and Tomcat's world (servlets, JSPs).
+
+At startup OpenEJB prints out all of the configuration settings to Tomcat logs:
+
+{code}
+INFO: Installing web application at context path /openejb from URL file:C:\webapps\openejb
+OpenEJB init-params:
+ param-name: openejb.home, param-value: c:\openejb
+ param-name: openejb.configuration, param-value: conf\openejb.cfg
+ param-name: openejb.base, param-value: c:\webapps\openejb\WEB-INF\openejb
+ param-name: openejb.loader, param-value: tomcat-webapp
+{code}
+
+
+* Start up Tomcat and have fun with the EJBs
+