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 06:35:00 UTC
svn commit: r792464 [8/23] - /websites/staging/openejb/trunk/content/
Added: websites/staging/openejb/trunk/content/embedding-openejb.html
==============================================================================
--- websites/staging/openejb/trunk/content/embedding-openejb.html (added)
+++ websites/staging/openejb/trunk/content/embedding-openejb.html Sun Jul 10 04:34:53 2011
@@ -0,0 +1,401 @@
+<!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>Embedding OpenEJB</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>OpenEJB embedded in your app, server, IDE, or JUnit
+<a name="EmbeddingOpenEJB-Saywhat?!Alocalserver?"></a></p>
+
+<h1>Say what?! A local server?</h1>
+
+<p>Yes, you read correctly. OpenEJB can be embedded and treated as your very
+own personal EJB container.</p>
+
+<p>If they can have Local and Remote EJB's, why not Local and Remote EJB
+Servers too?</p>
+
+<p>Haven't you ever wanted EJBs without the heavy? I mean you need the "heavy"
+eventually, but not while you're developing. Well, there's the advantage of
+an EJB implementation that was designed with a very clean and well defined
+server-container contract, you can cut the server part out completely!</p>
+
+<p>So, if you wish to access ejbs locally and not in client/server mode, you
+can do so by embedding OpenEJB as a library and accessing ejbs through
+OpenEJB's built-in IntraVM (Local) Server. Why would someone want to do
+this?
+* Your application is a server or other middleware
+* You want to write an app that can be both stand alonedistributed
+* To test your EJBs with JUnit and don't want to start/stop servers and
+other nonsense
+* Imagine the power from being able to use your IDE debugger to step from
+your Client all the way into your EJB and back with no remote debugging
+voodoo.</p>
+
+<p>In this case, your application, test suite, IDE, or client accesses beans
+as you would from any other EJB Server. The EJB Server just happens to be
+running in the same virtual machine as your application. This EJB Server is
+thusly called the IntraVM Server, and, for all intense purposes, your
+application an IntraVM Client.</p>
+
+<p>There are some interesting differences though. The IntraVM Server isn't a
+heavyweight server as one normally associates with EJB. It doesn't open
+connections, launch threads for processing requests, introduce complex
+classloading heirarchies, or any of those "heavy" kind of things. All it
+does is dish out proxies to your app that can be used to shoot calls right
+into the EJB Container. Very light, very fast, very easy for testing,
+debugging, developing, etc.</p>
+
+<p><a name="EmbeddingOpenEJB-AccessingEJBslocally"></a></p>
+
+<h1>Accessing EJBs locally</h1>
+
+<p>Try something like this for a simple IntraVM (Local) Client:</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>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+ import java.util.Properties;
+ import javax.naming.Context;
+ import javax.naming.InitialContext;
+ import javax.rmi.PortableRemoteObject;
+ import FooHome;</p>
+
+<pre><code>public class MyEjbApplication {
+
+public static void main( String args[]
+</code></pre>
+
+<p>) {
+ try{</p>
+
+<pre><code> Properties properties = new Properties();
+
+ properties.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.openejb.client.LocalInitialContextFactory");
+
+ InitialContext ctx = new InitialContext(properties);
+
+ Object obj = ctx.lookup("my/bean/Foo");
+
+ FooHome ejbHome = (FooHome)
+ PortableRemoteObject.narrow(obj, FooHome.class);
+
+ } catch (Exception e){
+ e.printStackTRace();
+ }
+}
+}
+</code></pre>
+
+<p>That would be the simplest spec compliant client you could create. If you
+don't care about spec compliance and just want to "cheat", you can do this:</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>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+ import javax.naming.InitialContext;
+ import FooHome;</p>
+
+<pre><code>public class MyEjbApplication {
+
+public static void main( String args[]
+</code></pre>
+
+<p>) {
+ try{</p>
+
+<pre><code> FooHome ejbHome = (FooHome)new InitialContext().lookup(
+ "java:openejb/ejb/my/bean/Foo");
+
+ } catch (Exception e){
+ e.printStackTRace();
+ }
+}
+}
+</code></pre>
+
+<p>Now keep in mind, that is not spec compliant. Also keep in mind that we
+provide it as a convenience, so if there is something you don't like or
+think should be changed, send code.</p>
+
+<p><a name="EmbeddingOpenEJB-Passinginitializationparameters"></a></p>
+
+<h1>Passing initialization parameters</h1>
+
+<p>When accessing OpenEJB in local (intra-vm) mode, the IntraVM server will
+instantiate OpenEJB for you. When it instantiates OpenEJB, it puts default
+values for the items in the Properties object OpenEJB needs to actually
+instantiate.</p>
+
+<p>If you want to pass OpenEJB specific parameters, you can do this in two
+ways:* Call init yourself before any JNDI calls are made
+* Pass the parameters in the InitialContext hashtable</p>
+
+<p>Refer to the <a href="spec.html#openejb.api.html">OpenEJB Specification</a>
+ for information on the init method or the parameters you can pass to
+OpenEJB.</p>
+
+<p>Here is an example of passing the initialization parameters in to OpenEJB
+via the first InitialContext creation. I stress, this is only applicable
+the very first time and InitialContext is created within your Virtual
+Machine. After that, OpenEJB will have been initialized and the parameters
+will be ignored.</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>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+ import FooHome;
+ import java.util.Properties;
+ import javax.naming.Context;
+ import javax.naming.InitialContext;
+ import javax.rmi.PortableRemoteObject;</p>
+
+<pre><code>public class MyEjbApplication {
+
+public static void main( String args[]
+</code></pre>
+
+<p>) {
+ try{</p>
+
+<pre><code> Properties p = new Properties();
+
+ p.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.openejb.client.LocalInitialContextFactory");
+
+ p.put("openejb.home", "c:\\dir\\openejb");
+
+ p.put("openejb.configuration",
+ "c:\\my\\app\\conf\\openejb.conf");
+
+ InitialContext ctx = new InitialContext( p );
+
+ Object obj = ctx.lookup("my/bean/Foo");
+
+ FooHome ejbHome = (FooHome)
+ PortableRemoteObject.narrow(obj,FooHome.class);
+
+ } catch (Exception e){
+ e.printStackTRace();
+ }
+}
+}
+</code></pre>
+
+<p><a name="EmbeddingOpenEJB-Settheopenejb.homevariable"></a></p>
+
+<h1>Set the openejb.home variable</h1>
+
+<p>If you use OpenEJB Local Server, you are actually using OpenEJB as an
+embedded library. This means when your application starts, OpenEJB will be
+starting too, in your virtual machine. Odds are you will not want to
+execute your application in the directory where OpenEJB was installed, but
+will want to execute your application where you are developing it. This is
+fine, but you will need to tell OpenEJB where it was installed. To do this,
+set the "openejb.home" system variable.</p>
+
+<p>For example, if OpenEJB was unpacked in the directory in c:\dir\openejb,
+you can set the openejb.home variable as a java vm flag as follows.</p>
+
+<p><em>c:\my\app> java -Dopenejb.home=c:\dir\openejb MyEjbApplication</em></p>
+
+<p>You can also set the openejb.home variable by calling
+System.setProperty(...) in your application before any calls to the OpenEJB
+Local Server are made.</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>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+ ...
+ public static void main(String args[]
+) {</p>
+
+<pre><code> System.setProperty("openejb.home", "c:\\dir\\openejb");
+ ...
+
+}
+...
+</code></pre>
+
+<p>As mentioned above, you can pass OpenEJB parameters on your first call to
+the Local Server.</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>c:\my\app\MyEjbApplication.java</B></DIV><DIV class="codeContent panelContent">
+ ...
+ public static void main( String args[]
+) {</p>
+
+<pre><code> Properties p = new Properties();
+
+ p.put(Context.INITIAL_CONTEXT_FACTORY,
+ "org.openejb.client.LocalInitialContextFactory");
+
+ p.put("openejb.home", "c:\\dir\\openejb");
+
+ InitialContext ctx = new InitialContext( p );
+ ...
+}
+...
+</code></pre>
+
+<p>When OpenEJB is started, it will look for its configuration files in the
+OPENJB_HOME/conf directory. The paths to beans in your openejb.conf file
+are also resolved relative to the openejb.home variable.</p>
+
+<p><a name="EmbeddingOpenEJB-EmbeddedOpenEJBFAQ"></a></p>
+
+<h1>Embedded OpenEJB FAQ</h1>
+
+<p><a name="EmbeddingOpenEJB-Whatdoyoumeanembedded?"></a></p>
+
+<h2>What do you mean embedded?</h2>
+
+<p>When your clients run OpenEJB in the same VM using the IntraVM Server,
+you're using OpenEJB as an embedded EJB Server just like InstantDB and
+Cloudscape are embedded databases servers. Just like InstantDB and
+Cloudscape, OpenEJB needs configuration files and other files to do it's
+job.</p>
+
+<p>OpenEJB is the only EJB server that I know of that you can run as an
+embedded library, so the fact that you can even do it is a real feather in
+our cap. If anyone knows of another, please tell me.</p>
+
+<p>In fact, anyone already using InstantDB or Cloudscape as embedded database
+servers in a product could just as easily use OpenEJB as an embedded EJB
+Server and add instant EJB support to the product as well. OpenEJB can
+easily play with InstantDB or Cloudscape, so it would be pretty slick. This
+would be extremely useful for IDEs like Visual Cafe, JBuilder, Visual Age,
+etc.</p>
+
+<p><a name="EmbeddingOpenEJB-Moreinfoonopenejb.conffiles"></a></p>
+
+<h2>More info on openejb.conf files</h2>
+
+<p>Here is an example of this. The openejb.home variable, which we will refer
+to as OPENEJB_HOME, is set to "c:\dir\openejb". The following relative path
+in your openejb.conf file will be resolved assuming OPENEJB_HOME as the
+base path.</p>
+
+<p>{code:xml|title=openejb.conf}
+<openejb>
+...</p>
+
+<p><Deployments dir="beans\" />
+</openejb></p>
+
+<pre><code>The above deployment path, "beans\", would automatically be expanded to
+</code></pre>
+
+<p>"c:\dir\openejb\beans".</p>
+
+<pre><code>If you want tell OpenEJB to look outside the OPENEJB_HOME, then use an
+</code></pre>
+
+<p>absolute file path as shown below.</p>
+
+<pre><code>{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" /></openejb>
+</code></pre>
+
+<p>OpenEJB can look in any number of directories for beans, just add those
+directories to your openejb.conf file as such.</p>
+
+<p>{code:xml|title=openejb.conf}
+<openejb>
+...</p>
+
+<p><Deployments dir="beans\" />
+<Deployments dir="c:\my\app\my\beans\" /></openejb></p>
+
+<pre><code>Furthermore, you can add jars individually to OpenEJB's deployment path by
+</code></pre>
+
+<p>naming the jar directly.</p>
+
+<pre><code>{code:xml|title=openejb.conf}
+<openejb>
+...
+
+<Deployments dir="beans\" />
+<Deployments dir="c:\my\app\my\beans\" />
+<Deployments dir="c:\my\special\beans\" />
+<Deployments dir="c:\foo\ejbs\" />
+<Deployments dir="d:\files\ejbjars\" /></openejb>
+</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/embedding.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/embedding.cwiki (added)
+++ websites/staging/openejb/trunk/content/embedding.cwiki Sun Jul 10 04:34:53 2011
@@ -0,0 +1 @@
+{include:OPENEJBx30:Embedding}
\ No newline at end of file
Added: websites/staging/openejb/trunk/content/embedding.html
==============================================================================
--- websites/staging/openejb/trunk/content/embedding.html (added)
+++ websites/staging/openejb/trunk/content/embedding.html Sun Jul 10 04:34:53 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>Embedding</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>{include:OPENEJBx30:Embedding}</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/example-generated-documentation.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/example-generated-documentation.cwiki (added)
+++ websites/staging/openejb/trunk/content/example-generated-documentation.cwiki Sun Jul 10 04:34:53 2011
@@ -0,0 +1,130 @@
+{anchor: containers}
+h2. Containers
+{anchor:Default CMP Container-container}
+h3. Default CMP Container
+ || Property Name || Description ||
+ | CmpEngineFactory | Default value is _org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory_.||
+
+{anchor:Default BMP Container-container}
+h3. Default BMP Container
+ || Property Name || Description ||
+ | PoolSize | Specifies the size of the bean pools for this\\ bmp entity container.\\ \\ Default value is _10_.||
+
+{anchor:Default Stateless Container-container}
+h3. Default Stateless Container
+ || Property Name || Description ||
+ | TimeOut | Specifies the time to wait between invocations. This\\ value is measured in milliseconds. A value of 5 would\\ result in a time\-out of 5 milliseconds between invocations.\\ A value of zero would mean no timeout.\\ \\ Default value is _0_.||
+ | PoolSize | Specifies the size of the bean pools for this\\ stateless SessionBean container.\\ \\ Default value is _10_.||
+ | StrictPooling | StrictPooling tells the container what to do when the pool\\ reaches it's maximum size and there are incoming requests\\ that need instances.\\ \\ With strict pooling, requests will have to wait for instances\\ to become available. The pool size will never grow beyond the\\ the set PoolSize value.\\ \\ Without strict pooling, the container will create temporary\\ instances to meet demand. The instances will last for just one\\ method invocation and then are removed.\\ \\ Default value is _true_.||
+
+{anchor:Default Stateful Container-container}
+h3. Default Stateful Container
+ || Property Name || Description ||
+ | Passivator | The passivator is responsible for writing beans to disk\\ at passivation time. Different passivators can be used\\ by setting this property to the fully qualified class name\\ of the PassivationStrategy implementation. The passivator\\ is not responsible for invoking any callbacks or other\\ processing, its only responsibly is to write the bean state\\ to disk.\\ \\ Known implementations:\\ org.apache.openejb.core.stateful.RAFPassivater\\ org.apache.openejb.core.stateful.SimplePassivater\\ \\ Default value is _org.apache.openejb.core.stateful.SimplePassivater_.||
+ | TimeOut | Specifies the time to wait between invocations. This\\ value is measured in minutes. A value of 5 would\\ result in a time\-out of 5 minutes between invocations.\\ A value of zero would mean no timeout.\\ \\ Default value is _20_.||
+ | PoolSize | Specifies the size of the bean pools for this\\ stateful SessionBean container.\\ \\ Default value is _1000_.||
+ | BulkPassivate | Property name that specifies the number of instances\\ to passivate at one time when doing bulk passivation.\\ \\ Default value is _100_.||
+
+{anchor:Default MDB Container-container}
+h3. Default MDB Container
+ || Property Name || Description ||
+ | ResourceAdapter | The resource adapter delivers messages to the container\\ \\ Default value is _Default JMS Resource Adapter_.||
+ | MessageListenerInterface | Specifies the message listener interface handled by this container\\ \\ Default value is _javax.jms.MessageListener_.||
+ | ActivationSpecClass | Specifies the activation spec class\\ \\ Default value is _org.apache.activemq.ra.ActiveMQActivationSpec_.||
+ | InstanceLimit | Specifies the maximum number of bean instances that are\\ allowed to exist for each MDB deployment.\\ \\ Default value is _10_.||
+
+
+{anchor: resources}
+h2. Resources
+{anchor:Default JDBC Database-resource}
+h3. Default JDBC Database
+ || Property Name || Description ||
+ | JtaManaged | Determines wether or not this data source should be JTA managed\\ or user managed.{html} {html}If set to 'true' it will automatically be enrolled\\ in any ongoing transactions.{html} {html}Calling begin/commit/rollback or setAutoCommit\\ on the datasource or connection will not be allowed.{html} {html}If you need to perform\\ these functions yourself, set JtaManaged to 'false'\\ \\ In terms of JPA persistence.xml:\\ "JtaManaged=true" can be used as a 'jta\-data\-source'\\ "JtaManaged=false" can be used as a 'non\-jta\-data\-source'\\ \\ Default value is _true_.||
+ | JdbcDriver | Driver class name\\ \\ Default value is _org.hsqldb.jdbcDriver_.||
+ | JdbcUrl | Url for creating connections\\ \\ Default value is _jdbc:hsqldb:{html}file:{html}data/hsqldb/hsqldb_.||
+ | UserName | Default user name\\ \\ Default value is _sa_.||
+ | Password | Default password|
+ | ConnectionProperties | The connection properties that will be sent to the JDBC\\ driver when establishing new connections\\ \\ Format of the string must be \[propertyName=property;\]\*\\ \\ NOTE \- The "user" and "password" properties will be passed\\ explicitly, so they do not need to be included here.|
+ | DefaultAutoCommit | The default auto\-commit state of new connections\\ \\ Default value is _true_.||
+ | DefaultReadOnly | The default read\-only state of new connections\\ If not set then the setReadOnly method will not be called.\\ \(Some drivers don't support read only mode, ex: Informix\)|
+ | DefaultTransactionIsolation | The default TransactionIsolation state of new connections\\ If not set then the setTransactionIsolation method will not\\ be called. The allowed values for this property are:\\{html} {html} NONE\\{html} {html} READ\_COMMITTED\\{html} {html} READ\_UNCOMMITTED\\{html} {html} REPEATABLE\_READ\\{html} {html} SERIALIZABLE\\ \\ Note: Most JDBC drivers do not support all isolation levels|
+ | InitialSize | The initial number of connections that are created when the\\ pool is started\\ \\ Default value is _0_.||
+ | MaxActive | The maximum number of active connections that can be\\ allocated from this pool at the same time, or a negative\\ number for no limit.\\ \\ Default value is _20_.||
+ | MaxIdle | The maximum number of connections that can remain idle in\\ the pool, without extra ones being released, or a negative\\ number for no limit.\\ \\ Default value is _20_.||
+ | MinIdle | The minimum number of connections that can remain idle in\\ the pool, without extra ones being created, or zero to\\ create none.\\ \\ Default value is _0_.||
+ | MaxWait | The maximum number of milliseconds that the pool will wait\\ \(when there are no available connections\) for a connection\\ to be returned before throwing an exception, or \-1 to wait\\ indefinitely.\\ \\ Default value is _\-1_.||
+ | ValidationQuery | The SQL query that will be used to validate connections from\\ this pool before returning them to the caller. If specified,\\ this query MUST be an SQL SELECT statement that returns at\\ least one row.|
+ | TestOnBorrow | If true connections will be validated before being returned\\ from the pool. If the validation fails, the connection is\\ destroyed, and a new conection will be retrieved from the\\ pool \(and validated\).\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _true_.||
+ | TestOnReturn | If true connections will be validated before being returned\\ to the pool.{html} {html}If the validation fails, the connection is\\ destroyed instead of being returned to the pool.\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+ | TestWhileIdle | If true connections will be validated by the idle connection\\ evictor \(if any\). If the validation fails, the connection is\\ destroyed and removed from the pool\\ \\ NOTE \- for a true value to have any effect, the\\ timeBetweenEvictionRunsMillis property must be a positive\\ number and the ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+ | TimeBetweenEvictionRunsMillis | The number of milliseconds to sleep between runs of the idle\\ connection evictor thread. When set to a negative number, no\\ idle connection evictor thread will be run.\\ \\ Default value is _\-1_.||
+ | NumTestsPerEvictionRun | The number of connectionss to examine during each run of the\\ idle connection evictor thread \(if any\).\\ \\ Default value is _3_.||
+ | MinEvictableIdleTimeMillis | The minimum amount of time a connection may sit idle in the\\ pool before it is eligable for eviction by the idle\\ connection evictor \(if any\).\\ \\ Default value is _1800000_.||
+ | PoolPreparedStatements | If true, a statement pool is created for each Connection and\\ PreparedStatements created by one of the following methods are\\ pooled:\\{html} {html}public PreparedStatement prepareStatement\(String sql\);\\{html} {html}public PreparedStatement prepareStatement\(String sql,\\{html} {html}{html} {html}{html} {html}int resultSetType,\\{html} {html}{html} {html}{html} {html}int resultSetConcurrency\)\\ \\ Default value is _false_.||
+ | MaxOpenPreparedStatements | The maximum number of open statements that can be allocated\\ from the statement pool at the same time, or zero for no\\ limit.\\ \\ NOTE \- Some drivers have limits on the number of open\\ statements, so make sure there are some resources left\\ for the other \(non\-prepared\) statements.\\ \\ Default value is _0_.||
+ | AccessToUnderlyingConnectionAllowed | If true the raw physical connection to the database can be\\ accessed using the following construct:\\{html} {html} Connection conn = ds.getConnection\(\);\\{html} {html} Connection rawConn = \(\(DelegatingConnection\) conn\).getInnermostDelegate\(\);\\{html} {html} ...\\{html} {html} conn.close\(\)\\ \\ Default is false, because misbehaving programs can do harmfull\\ things to the raw connection shuch as closing the raw\\ connection or continuing to use the raw connection after it\\ has been assigned to another logical connection.{html} {html}Be carefull\\ and only use when you need direct access to driver specific\\ extentions.\\ \\ NOTE: Do NOT close the underlying connection, only the\\ original logical connection wrapper.\\ \\ Default value is _false_.||
+
+{anchor:Default Unmanaged JDBC Database-resource}
+h3. Default Unmanaged JDBC Database
+ || Property Name || Description ||
+ | JtaManaged | Default value is _false_.||
+ | JdbcDriver | Driver class name\\ \\ Default value is _org.hsqldb.jdbcDriver_.||
+ | JdbcUrl | Url for creating connections\\ \\ Default value is _jdbc:hsqldb:{html}file:{html}data/hsqldb/hsqldb_.||
+ | UserName | Default user name\\ \\ Default value is _sa_.||
+ | Password | Default password|
+ | ConnectionProperties | The connection properties that will be sent to the JDBC\\ driver when establishing new connections\\ \\ Format of the string must be \[propertyName=property;\]\*\\ \\ NOTE \- The "user" and "password" properties will be passed\\ explicitly, so they do not need to be included here.|
+ | DefaultAutoCommit | The default auto\-commit state of new connections\\ \\ Default value is _true_.||
+ | DefaultReadOnly | The default read\-only state of new connections\\ If not set then the setReadOnly method will not be called.\\ \(Some drivers don't support read only mode, ex: Informix\)|
+ | DefaultTransactionIsolation | The default TransactionIsolation state of new connections\\ If not set then the setTransactionIsolation method will not\\ be called. The allowed values for this property are:\\{html} {html} NONE\\{html} {html} READ\_COMMITTED\\{html} {html} READ\_UNCOMMITTED\\{html} {html} REPEATABLE\_READ\\{html} {html} SERIALIZABLE\\ \\ Note: Most JDBC drivers do not support all isolation levels|
+ | InitialSize | The initial number of connections that are created when the\\ pool is started\\ \\ Default value is _0_.||
+ | MaxActive | The maximum number of active connections that can be\\ allocated from this pool at the same time, or a negative\\ number for no limit.\\ \\ Default value is _10_.||
+ | MaxIdle | The maximum number of connections that can remain idle in\\ the pool, without extra ones being released, or a negative\\ number for no limit.\\ \\ Default value is _10_.||
+ | MinIdle | The minimum number of connections that can remain idle in\\ the pool, without extra ones being created, or zero to\\ create none.\\ \\ Default value is _0_.||
+ | MaxWait | The maximum number of milliseconds that the pool will wait\\ \(when there are no available connections\) for a connection\\ to be returned before throwing an exception, or \-1 to wait\\ indefinitely.\\ \\ Default value is _\-1_.||
+ | ValidationQuery | The SQL query that will be used to validate connections from\\ this pool before returning them to the caller. If specified,\\ this query MUST be an SQL SELECT statement that returns at\\ least one row.|
+ | TestOnBorrow | If true connections will be validated before being returned\\ from the pool. If the validation fails, the connection is\\ destroyed, and a new conection will be retrieved from the\\ pool \(and validated\).\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _true_.||
+ | TestOnReturn | If true connections will be validated before being returned\\ to the pool.{html} {html}If the validation fails, the connection is\\ destroyed instead of being returned to the pool.\\ \\ NOTE \- for a true value to have any effect, the\\ ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+ | TestWhileIdle | If true connections will be validated by the idle connection\\ evictor \(if any\). If the validation fails, the connection is\\ destroyed and removed from the pool\\ \\ NOTE \- for a true value to have any effect, the\\ timeBetweenEvictionRunsMillis property must be a positive\\ number and the ValidationQuery parameter must be set.\\ \\ Default value is _false_.||
+ | TimeBetweenEvictionRunsMillis | The number of milliseconds to sleep between runs of the idle\\ connection evictor thread. When set to a negative number, no\\ idle connection evictor thread will be run.\\ \\ Default value is _\-1_.||
+ | NumTestsPerEvictionRun | The number of connectionss to examine during each run of the\\ idle connection evictor thread \(if any\).\\ \\ Default value is _3_.||
+ | MinEvictableIdleTimeMillis | The minimum amount of time a connection may sit idle in the\\ pool before it is eligable for eviction by the idle\\ connection evictor \(if any\).\\ \\ Default value is _1800000_.||
+ | PoolPreparedStatements | If true, a statement pool is created for each Connection and\\ PreparedStatements created by one of the following methods are\\ pooled:\\{html} {html}public PreparedStatement prepareStatement\(String sql\);\\{html} {html}public PreparedStatement prepareStatement\(String sql,\\{html} {html}{html} {html}{html} {html}int resultSetType,\\{html} {html}{html} {html}{html} {html}int resultSetConcurrency\)\\ \\ Default value is _false_.||
+ | MaxOpenPreparedStatements | The maximum number of open statements that can be allocated\\ from the statement pool at the same time, or zero for no\\ limit.\\ \\ NOTE \- Some drivers have limits on the number of open\\ statements, so make sure there are some resources left\\ for the other \(non\-prepared\) statements.\\ \\ Default value is _0_.||
+ | AccessToUnderlyingConnectionAllowed | If true the raw physical connection to the database can be\\ accessed using the following construct:\\{html} {html} Connection conn = ds.getConnection\(\);\\{html} {html} Connection rawConn = \(\(DelegatingConnection\) conn\).getInnermostDelegate\(\);\\{html} {html} ...\\{html} {html} conn.close\(\)\\ \\ Default is false, because misbehaving programs can do harmfull\\ things to the raw connection shuch as closing the raw\\ connection or continuing to use the raw connection after it\\ has been assigned to another logical connection.{html} {html}Be carefull\\ and only use when you need direct access to driver specific\\ extentions.\\ \\ NOTE: Do NOT close the underlying connection, only the\\ original logical connection wrapper.\\ \\ Default value is _false_.||
+
+{anchor:Default JMS Resource Adapter-resource}
+h3. Default JMS Resource Adapter
+ || Property Name || Description ||
+ | BrokerXmlConfig | Broker configuration\\ \\ Default value is _broker:\(tcp://localhost:61616\)\?useJmx=false_.||
+ | ServerUrl | Broker address\\ \\ Default value is _vm://localhost\?async=true_.||
+ | DataSource | DataSource for persistence messages\\ \\ Default value is _Default Unmanaged JDBC Database_.||
+ | ThreadPoolSize | Specifies the size of the thread pool available to AciveMQ.\\ \\ Default value is _30_.||
+
+{anchor:Default JMS Connection Factory-resource}
+h3. Default JMS Connection Factory
+ || Property Name || Description ||
+ | ResourceAdapter | Default value is _Default JMS Resource Adapter_.||
+ | TransactionSupport | Specifies if the connection is enrolled in global transaction\\ allowed values: xa, local or none\\ \\ Default value is _xa_.||
+ | PoolMaxSize | Maximum number of physical connection to the ActiveMQ broker\\ \\ Default value is _10_.||
+ | PoolMinSize | Minimum number of physical connection to the ActiveMQ broker\\ \\ Default value is _0_.||
+ | ConnectionMaxWaitMilliseconds | Maximum amount of time to wait for a connection\\ \\ Default value is _5000_.||
+ | ConnectionMaxIdleMinutes | Maximum amount of time a connection can be idle before being reclaimed\\ \\ Default value is _15_.||
+
+{anchor:Default Queue-resource}
+h3. Default Queue
+ || Property Name || Description ||
+ | destination | Specifies the name of the queue|
+
+{anchor:Default Topic-resource}
+h3. Default Topic
+ || Property Name || Description ||
+ | destination | Specifies the name of the topic|
+
+{anchor:Default ORB-resource}
+h3. Default ORB
+No properties.
+
+{anchor:Default Mail Session-resource}
+h3. Default Mail Session
+No properties.
+
Added: websites/staging/openejb/trunk/content/example-generated-documentation.html
==============================================================================
--- websites/staging/openejb/trunk/content/example-generated-documentation.html (added)
+++ websites/staging/openejb/trunk/content/example-generated-documentation.html Sun Jul 10 04:34:53 2011
@@ -0,0 +1,221 @@
+<!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>Example Generated Documentation</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>{anchor: containers}
+<a name="ExampleGeneratedDocumentation-Containers"></a></p>
+
+<h2>Containers</h2>
+
+<p>{anchor:Default CMP Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultCMPContainer"></a></p>
+
+<h3>Default CMP Container</h3>
+
+<pre><code>|| Property Name || Description ||
+| CmpEngineFactory | Default value is
+</code></pre>
+
+<p><em>org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory</em>.||</p>
+
+<p>{anchor:Default BMP Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultBMPContainer"></a></p>
+
+<h3>Default BMP Container</h3>
+
+<pre><code>|| Property Name || Description ||
+</code></pre>
+
+<p>{anchor:Default Stateless Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultStatelessContainer"></a></p>
+
+<h3>Default Stateless Container</h3>
+
+<pre><code>|| Property Name || Description ||
+</code></pre>
+
+<p>{anchor:Default Stateful Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultStatefulContainer"></a></p>
+
+<h3>Default Stateful Container</h3>
+
+<pre><code>|| Property Name || Description ||
+</code></pre>
+
+<p>{anchor:Default MDB Container-container}
+<a name="ExampleGeneratedDocumentation-DefaultMDBContainer"></a></p>
+
+<h3>Default MDB Container</h3>
+
+<pre><code>|| Property Name || Description ||
+</code></pre>
+
+<p>{anchor: resources}
+<a name="ExampleGeneratedDocumentation-Resources"></a></p>
+
+<h2>Resources</h2>
+
+<p>{anchor:Default JDBC Database-resource}
+<a name="ExampleGeneratedDocumentation-DefaultJDBCDatabase"></a></p>
+
+<h3>Default JDBC Database</h3>
+
+<pre><code>|| Property Name || Description ||
+
+
+
+
+
+
+
+
+| Password | Default password|
+</code></pre>
+
+<p>{anchor:Default Unmanaged JDBC Database-resource}
+<a name="ExampleGeneratedDocumentation-DefaultUnmanagedJDBCDatabase"></a></p>
+
+<h3>Default Unmanaged JDBC Database</h3>
+
+<pre><code>|| Property Name || Description ||
+| JtaManaged | Default value is _false_.||
+
+
+
+
+
+
+| Password | Default password|
+</code></pre>
+
+<p>{anchor:Default JMS Resource Adapter-resource}
+<a name="ExampleGeneratedDocumentation-DefaultJMSResourceAdapter"></a></p>
+
+<h3>Default JMS Resource Adapter</h3>
+
+<pre><code>|| Property Name || Description ||
+</code></pre>
+
+<p>{anchor:Default JMS Connection Factory-resource}
+<a name="ExampleGeneratedDocumentation-DefaultJMSConnectionFactory"></a></p>
+
+<h3>Default JMS Connection Factory</h3>
+
+<pre><code>|| Property Name || Description ||
+| ResourceAdapter | Default value is _Default JMS Resource Adapter_.||
+</code></pre>
+
+<p>{anchor:Default Queue-resource}
+<a name="ExampleGeneratedDocumentation-DefaultQueue"></a></p>
+
+<h3>Default Queue</h3>
+
+<pre><code>|| Property Name || Description ||
+| destination | Specifies the name of the queue|
+</code></pre>
+
+<p>{anchor:Default Topic-resource}
+<a name="ExampleGeneratedDocumentation-DefaultTopic"></a></p>
+
+<h3>Default Topic</h3>
+
+<pre><code>|| Property Name || Description ||
+| destination | Specifies the name of the topic|
+</code></pre>
+
+<p>{anchor:Default ORB-resource}
+<a name="ExampleGeneratedDocumentation-DefaultORB"></a></p>
+
+<h3>Default ORB</h3>
+
+<p>No properties.</p>
+
+<p>{anchor:Default Mail Session-resource}
+<a name="ExampleGeneratedDocumentation-DefaultMailSession"></a></p>
+
+<h3>Default Mail Session</h3>
+
+<p>No properties.</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/examples.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/examples.cwiki (added)
+++ websites/staging/openejb/trunk/content/examples.cwiki Sun Jul 10 04:34:53 2011
@@ -0,0 +1 @@
+{include:OPENEJBx30:Examples}
\ No newline at end of file
Added: websites/staging/openejb/trunk/content/examples.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples.html (added)
+++ websites/staging/openejb/trunk/content/examples.html Sun Jul 10 04:34:53 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>Examples</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>{include:OPENEJBx30:Examples}</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/executables.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/executables.cwiki (added)
+++ websites/staging/openejb/trunk/content/executables.cwiki Sun Jul 10 04:34:53 2011
@@ -0,0 +1,258 @@
+
+This doc describes the design-in-progress for revamping the command-line execution of openejb.
+
+Basic ideas:
+ * Commands can be added/removed (start, stop, test, validate, deploy)
+ * Adding/removing only requires adding/removing jars from the classpath
+
+We can stuff properties files into jars at:
+{code}META-INF/org.openejb.cli/{name}{code}
+
+The propeties file will contain a main.class property, maybe an optional main.method property, and a set of description properties.
+
+Here is an example of the start command:
+
+It would be located at
+{code}META-INF/org.openejb.cli/start{code}
+
+{code:title=start}
+main.class=org.openejb.server.Main
+description.en=Starts the Remote Server
+description.es=Ejecuta el Servidor Remoto
+{code}
+
+We would pull in all these files in the launcher's main method and parse them. If someone typed "openejb --help" then we would list the commands and descriptions.
+
+
+h1. Getting the properties files
+
+Hiram wrote some code like this for activeio
+
+{code:title=FactoryFinder.java}
+/**
+ *
+ */
+package org.activeio;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+
+public class FactoryFinder {
+
+ private final String path;
+ private final ConcurrentHashMap classMap = new ConcurrentHashMap();
+
+ public FactoryFinder(String path) {
+ this.path = path;
+ }
+
+ /**
+ * Creates a new instance of the given key
+ *
+ * @param key
+ * is the key to add to the path to find a text file
+ * containing the factory name
+ * @return a newly created instance
+ */
+ public Object newInstance(String key) throws IllegalAccessException, InstantiationException, IOException,
+ ClassNotFoundException {
+ return newInstance(key, null);
+ }
+
+ public Object newInstance(String key, String propertyPrefix) throws IllegalAccessException,
+ InstantiationException, IOException, ClassNotFoundException {
+ if (propertyPrefix == null)
+ propertyPrefix = "";
+
+ Class clazz = (Class) classMap.get(propertyPrefix+key);
+ if( clazz == null ) {
+ clazz = newInstance(doFindFactoryProperies(key), propertyPrefix);
+ }
+ return clazz.newInstance();
+ }
+
+ private Class newInstance(Properties properties, String propertyPrefix) throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException, IOException {
+
+ String className = properties.getProperty(propertyPrefix + "class");
+ if (className == null) {
+ throw new IOException("Expected property is missing: " + propertyPrefix + "class");
+ }
+ Class clazz;
+ try {
+ clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
+ } catch (ClassNotFoundException e) {
+ clazz = FactoryFinder.class.getClassLoader().loadClass(className);
+ }
+
+ return clazz;
+ }
+
+ private Properties doFindFactoryProperies(String key) throws IOException, ClassNotFoundException {
+ String uri = path + key;
+
+ // lets try the thread context class loader first
+ InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ in = FactoryFinder.class.getClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ throw new IOException("Could not find factory class for resource: " + uri);
+ }
+ }
+
+ // lets load the file
+ BufferedInputStream reader = null;
+ try {
+ reader = new BufferedInputStream(in);
+ Properties properties = new Properties();
+ properties.load(reader);
+ return properties;
+ } finally {
+ try {
+ reader.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+}
+{code}
+
+If we used a class similar to that, we could get the commands like such:
+
+{code:title=Main.java}
+FactoryFinder finder = new FactoryFinder("META-INF/org.openejb.cli/");
+Properties props = finder.doFindFactoryProperies("start")
+commands.put("start",props);
+// we should try and load them all into properties instances and map them in advance
+
+//.. later to list help
+String local = //get the i18n 2 character local (en, es, fr...)
+
+for each commands.entrySet() ... {
+ Map.Entry entry = commandEntries.next();
+ String command = entry.getKey();
+ Properties props = (Properties) entry.getValue();
+ String description = props.getProperty("description."+local, props.getProperty("description"));
+ System.out.print(" "+command+"\t"+description);
+}
+
+//.. later to execute a command
+Properties props = (Properties)commands.get("start");
+String mainClass = props.getProperty("main.class");
+
+Class clazz = getClassLoader().loadClass(mainClass);
+Method mainMethod = clazz.getMethod("main", new Class[]{String[].class});
+mainMethod.invoke(args); // obviously the "start" arg has been shaved off first
+{code}
+
+h1. Actual implementation
+I took a different approach. Since we won't use this class to actually return a class loaded from the properties file, I made minor changes. I also made the CommandFinder.java capable of finding all possible command homes so that others wouldn't have to implement it themselves. Also, the CommandFinder will automatically set the openejb.home. The idea is that we may be able to get rid of all of the scripts checking for OPENEJB_HOME for us. This is the initial concept so please make changes or suggestions.
+
+{code:title=CommandFinder.java}
+package org.openejb.cli;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+public class CommandFinder {
+ private String path;
+ private Map classMap = Collections.synchronizedMap(new HashMap());
+
+ public CommandFinder(String path) {
+ this.path = path;
+ }
+
+ public Properties doFindCommandProperies(String key) throws IOException {
+ String uri = path + key;
+
+ // lets try the thread context class loader first
+ InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ in = CommandFinder.class.getClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ throw new IOException("Could not find factory class for resource: " + uri);
+ }
+ }
+
+ // lets load the file
+ BufferedInputStream reader = null;
+ try {
+ reader = new BufferedInputStream(in);
+ Properties properties = new Properties();
+ properties.load(reader);
+
+ //All is well, set openejb.home
+ URL propsURL = Thread.currentThread().getContextClassLoader().getResource(uri);
+ String propsString = propsURL.getFile();
+ URL jarURL;
+ File jarFile;
+
+ propsString = propsString.substring(0, propsString.indexOf("!"));
+
+ jarURL = new URL(propsString);
+ jarFile = new File(jarURL.getFile());
+
+ if (jarFile.getName().indexOf("openejb-core") > -1) {
+ File lib = jarFile.getParentFile();
+ File home = lib.getParentFile();
+
+ System.setProperty("openejb.home", home.getAbsolutePath());
+ }
+
+ return properties;
+ } finally {
+ try {
+ reader.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ public Enumeration doFindCommands() throws IOException {
+ return Thread.currentThread().getContextClassLoader().getResources(path);
+ }
+}
+{code}
+
+h1. Current Implementation Usage
+The usage for this is the same as before but you would use the following approach to run instead of the OPENEJB_HOME/bin/openejb command:
+{code:title=Usage}
+java -jar OPENEJB_HOME/lib/openejb-core-<VERSION>.jar
+{code}
+Eventually, once David and I talk, we will wrap this in a script, like we do now. Right now, only the core commands are implemented:
+
+* deploy
+* help
+* start
+* stop
+* validate
+
+h1. Current Questions Before Integrating Into Mainstream
+* Classpath - Will the command implementors be responsible for managing their classpath?
+* Logging - Will we log errors in the CommandFinder.java or continue as-is outputting StackTrace and OpenEJB messages
+* Handling non-core command - We should have an OPENEJB_HOME/lib/etc where all 3rd party commands, like tests, can house their jars. We need a standard location so the code can just work without the user having to add things to the classpath manually
+* Wrapping in script - We will eventually wrap our executable jar in a script.
+
+h1. Help!
+
+openejb --help
+(list the commands and descriptions)
+
+This would be the job of the main class of the launcher. It would find all the commands in the system, and list their names and print their "description" property.
+
+openejb start --help
+(list the start help text)
+
+The main class of the launcher would do nothing with this. The start command would need to grab it's help text and print it to the system.out. Yes, this is extra work, but the various commands already support this. Also, at some point we won't have the help text as is and will use commons.cli to create the text.
Added: websites/staging/openejb/trunk/content/executables.html
==============================================================================
--- websites/staging/openejb/trunk/content/executables.html (added)
+++ websites/staging/openejb/trunk/content/executables.html Sun Jul 10 04:34:53 2011
@@ -0,0 +1,433 @@
+<!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>Executables</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>This doc describes the design-in-progress for revamping the command-line
+execution of openejb.</p>
+
+<p>Basic ideas:
+ * Commands can be added/removed (start, stop, test, validate, deploy)
+ * Adding/removing only requires adding/removing jars from the classpath</p>
+
+<p>We can stuff properties files into jars at:</p>
+
+<pre><code>The propeties file will contain a main.class property, maybe an optional
+</code></pre>
+
+<p>main.method property, and a set of description properties.</p>
+
+<pre><code>Here is an example of the start command:
+
+It would be located at
+</code></pre>
+
+<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>start</B></DIV><DIV class="codeContent panelContent">
+ main.class=org.openejb.server.Main
+ description.en=Starts the Remote Server
+ description.es=Ejecuta el Servidor Remoto</p>
+
+<p>We would pull in all these files in the launcher's main method and parse
+them. If someone typed "openejb --help" then we would list the commands
+and descriptions.</p>
+
+<p><a name="Executables-Gettingthepropertiesfiles"></a></p>
+
+<h1>Getting the properties files</h1>
+
+<p>Hiram wrote some code like this for activeio</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>FactoryFinder.java</B></DIV><DIV class="codeContent panelContent">
+ /**
+ *
+ */
+ package org.activeio;</p>
+
+<pre><code>import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+
+public class FactoryFinder {
+
+ private final String path;
+ private final ConcurrentHashMap classMap = new ConcurrentHashMap();
+
+ public FactoryFinder(String path) {
+ this.path = path;
+ }
+
+ /**
+ * Creates a new instance of the given key
+ *
+ * @param key
+ * is the key to add to the path to find a text file
+ * containing the factory name
+ * @return a newly created instance
+ */
+ public Object newInstance(String key) throws IllegalAccessException,
+</code></pre>
+
+<p>InstantiationException, IOException,
+ ClassNotFoundException {
+ return newInstance(key, null);
+ }</p>
+
+<pre><code> public Object newInstance(String key, String propertyPrefix) throws
+</code></pre>
+
+<p>IllegalAccessException,
+ InstantiationException, IOException, ClassNotFoundException {
+ if (propertyPrefix == null)
+ propertyPrefix = "";</p>
+
+<pre><code> Class clazz = (Class) classMap.get(propertyPrefix+key);
+ if( clazz == null ) {
+ clazz = newInstance(doFindFactoryProperies(key),
+</code></pre>
+
+<p>propertyPrefix);
+ }
+ return clazz.newInstance();
+ }</p>
+
+<pre><code> private Class newInstance(Properties properties, String propertyPrefix)
+</code></pre>
+
+<p>throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException, IOException {</p>
+
+<pre><code> String className = properties.getProperty(propertyPrefix +
+</code></pre>
+
+<p>"class");
+ if (className == null) {
+ throw new IOException("Expected property is missing: " +
+propertyPrefix + "class");
+ }
+ Class clazz;
+ try {
+ clazz =
+Thread.currentThread().getContextClassLoader().loadClass(className);
+ } catch (ClassNotFoundException e) {
+ clazz =
+FactoryFinder.class.getClassLoader().loadClass(className);
+ }</p>
+
+<pre><code> return clazz;
+ }
+
+ private Properties doFindFactoryProperies(String key) throws
+</code></pre>
+
+<p>IOException, ClassNotFoundException {
+ String uri = path + key;</p>
+
+<pre><code> // lets try the thread context class loader first
+ InputStream in =
+</code></pre>
+
+<p>Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ in =
+FactoryFinder.class.getClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ throw new IOException("Could not find factory class for
+resource: " + uri);
+ }
+ }</p>
+
+<pre><code> // lets load the file
+ BufferedInputStream reader = null;
+ try {
+ reader = new BufferedInputStream(in);
+ Properties properties = new Properties();
+ properties.load(reader);
+ return properties;
+ } finally {
+ try {
+ reader.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+}
+</code></pre>
+
+<p>If we used a class similar to that, we could get the commands like such:</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>Main.java</B></DIV><DIV class="codeContent panelContent">
+ FactoryFinder finder = new FactoryFinder("META-INF/org.openejb.cli/");
+ Properties props = finder.doFindFactoryProperies("start")
+ commands.put("start",props);
+ // we should try and load them all into properties instances and map them
+in advance</p>
+
+<pre><code>//.. later to list help
+String local = //get the i18n 2 character local (en, es, fr...)
+
+for each commands.entrySet() ... {
+ Map.Entry entry = commandEntries.next();
+ String command = entry.getKey();
+ Properties props = (Properties) entry.getValue();
+ String description = props.getProperty("description."+local,
+</code></pre>
+
+<p>props.getProperty("description"));
+ System.out.print(" "+command+"\t"+description);
+ }</p>
+
+<pre><code>//.. later to execute a command
+Properties props = (Properties)commands.get("start");
+String mainClass = props.getProperty("main.class");
+
+Class clazz = getClassLoader().loadClass(mainClass);
+Method mainMethod = clazz.getMethod("main", new Class[]
+</code></pre>
+
+<p>{String[].class});
+ mainMethod.invoke(args); // obviously the "start" arg has been shaved off
+first</p>
+
+<p><a name="Executables-Actualimplementation"></a></p>
+
+<h1>Actual implementation</h1>
+
+<p>I took a different approach. Since we won't use this class to actually
+return a class loaded from the properties file, I made minor changes. I
+also made the CommandFinder.java capable of finding all possible command
+homes so that others wouldn't have to implement it themselves. Also, the
+CommandFinder will automatically set the openejb.home. The idea is that we
+may be able to get rid of all of the scripts checking for OPENEJB_HOME for
+us. This is the initial concept so please make changes or suggestions.</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>CommandFinder.java</B></DIV><DIV class="codeContent panelContent">
+ package org.openejb.cli;</p>
+
+<pre><code>import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+public class CommandFinder {
+ private String path;
+ private Map classMap = Collections.synchronizedMap(new HashMap());
+
+ public CommandFinder(String path) {
+ this.path = path;
+ }
+
+ public Properties doFindCommandProperies(String key) throws IOException
+</code></pre>
+
+<p>{
+ String uri = path + key;</p>
+
+<pre><code> // lets try the thread context class loader first
+ InputStream in =
+</code></pre>
+
+<p>Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ in =
+CommandFinder.class.getClassLoader().getResourceAsStream(uri);
+ if (in == null) {
+ throw new IOException("Could not find factory class for
+resource: " + uri);
+ }
+ }</p>
+
+<pre><code> // lets load the file
+ BufferedInputStream reader = null;
+ try {
+ reader = new BufferedInputStream(in);
+ Properties properties = new Properties();
+ properties.load(reader);
+
+ //All is well, set openejb.home
+ URL propsURL =
+</code></pre>
+
+<p>Thread.currentThread().getContextClassLoader().getResource(uri);
+ String propsString = propsURL.getFile();
+ URL jarURL;
+ File jarFile;</p>
+
+<pre><code> propsString = propsString.substring(0,
+</code></pre>
+
+<p>propsString.indexOf("!"));</p>
+
+<pre><code> jarURL = new URL(propsString);
+ jarFile = new File(jarURL.getFile());
+
+ if (jarFile.getName().indexOf("openejb-core") > -1) {
+ File lib = jarFile.getParentFile();
+ File home = lib.getParentFile();
+
+ System.setProperty("openejb.home", home.getAbsolutePath());
+ }
+
+ return properties;
+ } finally {
+ try {
+ reader.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ public Enumeration doFindCommands() throws IOException {
+ return
+</code></pre>
+
+<p>Thread.currentThread().getContextClassLoader().getResources(path);
+ }
+ }</p>
+
+<p><a name="Executables-CurrentImplementationUsage"></a></p>
+
+<h1>Current Implementation Usage</h1>
+
+<p>The usage for this is the same as before but you would use the following
+approach to run instead of the OPENEJB_HOME/bin/openejb command:
+<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>Usage</B></DIV><DIV class="codeContent panelContent">
+ java -jar OPENEJB_HOME/lib/openejb-core-<VERSION>.jar</p>
+
+<p>Eventually, once David and I talk, we will wrap this in a script, like we
+do now. Right now, only the core commands are implemented:</p>
+
+<ul>
+<li>deploy</li>
+<li>help</li>
+<li>start</li>
+<li>stop</li>
+<li>validate</li>
+</ul>
+
+<p><a name="Executables-CurrentQuestionsBeforeIntegratingIntoMainstream"></a></p>
+
+<h1>Current Questions Before Integrating Into Mainstream</h1>
+
+<ul>
+<li>Classpath - Will the command implementors be responsible for managing
+their classpath?</li>
+<li>Logging - Will we log errors in the CommandFinder.java or continue as-is
+outputting StackTrace and OpenEJB messages</li>
+<li>Handling non-core command - We should have an OPENEJB_HOME/lib/etc where
+all 3rd party commands, like tests, can house their jars. We need a
+standard location so the code can just work without the user having to add
+things to the classpath manually</li>
+<li>Wrapping in script - We will eventually wrap our executable jar in a
+script.</li>
+</ul>
+
+<p><a name="Executables-Help!"></a></p>
+
+<h1>Help!</h1>
+
+<p>openejb --help
+(list the commands and descriptions)</p>
+
+<p>This would be the job of the main class of the launcher. It would find all
+the commands in the system, and list their names and print their
+"description" property.</p>
+
+<p>openejb start --help
+(list the start help text)</p>
+
+<p>The main class of the launcher would do nothing with this. The start
+command would need to grab it's help text and print it to the system.out.
+Yes, this is extra work, but the various commands already support this.
+Also, at some point we won't have the help text as is and will use
+commons.cli to create the text.</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/faq.cwiki
==============================================================================
--- websites/staging/openejb/trunk/content/faq.cwiki (added)
+++ websites/staging/openejb/trunk/content/faq.cwiki Sun Jul 10 04:34:53 2011
@@ -0,0 +1,55 @@
+h2. General
+
+
+
+h3. What spec version does OpenEJB support?
+
+OpenEJB supports the Enterprise JavaBeans 3.0 specification and previous versions 2.1, 2.0 and 1.1.
+
+h3. I don't plan to use EJBs, so why would I embed OpenEJB into Tomcat.
+
+Adding OpenEJB to Tomcat gives servlets several new Java EE 5 capabilities such as JPA, JAX-WS, JMS, J2EE Connectors, transactions, and more as well as enhancing the injection features of Tomcat 6 to now support injection of JavaEE objects like Topics, Queues, EntityManagers, JMS ConnectionFactories, JavaMail Sessions, as well as simpler data types such as Dates, Classes, URI, URL, List, Map, Set, Properties, and more. In the case of Tomcat 5.5 which doesn't support dependency injection at all, even more is gained.
+
+h3. Can I run OpenEJB with a JVM for any vendor?
+
+The Sun, Mac, and IBM vms are regularly tested, however any vm should work.
+
+h3. Which version of Java is required to run OpenEJB?
+
+Java versions 5 or 6, aka Java 1.5 or 1.6.
+
+h3. Do I need Apache Maven to work with OpenEJB?
+
+Definitely not. Most of the examples include both Maven and Ant build files. OpenEJB is usable as a plain library, much like an embedded database like Derby, so it is usable in any application regardless if that application is run via Maven, Ant, Intellij, Eclipse, NetBeans, JUnit, TestNG, etc.
+
+h3. Can I start and stop OpenEJB from an IDE? If yes, which IDE is supported by OpenEJB?
+
+The short answer is yes. The basic approach for all embedding scenarios is to 1) add OpenEJB to your classpath, and 2) construct your InitialContext using org.apache.openejb.client.LocalInitialContextFactory. The LocalInitialContextFactory will boot OpenEJB in your vm and all ejb applications visible in the classpath will be deployed. See http://openejb.apache.org/embedding-openejb.html for details on how to embed openejb in your application and IDE. See [Application discovery via the classpath|OPENEJBx30:Application discovery via the classpath] for various ways to have your applications discovered.
+
+
+h3. During embedded testing, how can I externalize all my DataSource configuration?
+
+Create an openejb.xml file in any directory that gets added to your test classpath. For maven, something that winds up directly under "target/classes/" or "target/test-classes/" will work just fine. Then in your test case do this:
+{code}
+ protected void setUp() throws Exception {
+ Properties properties = new Properties();
+ properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+
+ URL config = this.getClass().getClassLoader().getResource("openejb.xml");
+ properties.setProperty("openejb.configuration", config.toExternalForm());
+
+ initialContext = new InitialContext(properties);
+ }
+{code}
+The file itself doesn't have to be called "openejb.xml", you could have a few different files like that for different testing scenarios each with a name that describes the basic setup.
+
+h2. Container-Managed Persistence
+
+h3. What engine does OpenEJB use for CMP?
+
+The CMP engine is written as a layer over JPA with OpenJPA doing the persistence work.
+
+h3. What is the format for the CMP mapping files?
+
+The standard JPA mapping file and annotations are also used for CMP mappings.
+