You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2018/11/30 23:04:31 UTC

[16/20] tomee git commit: Docs old and new

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/configuring-datasources-in-tests.mdtext
----------------------------------------------------------------------
diff --git a/docs/configuring-datasources-in-tests.mdtext b/docs/configuring-datasources-in-tests.mdtext
new file mode 100644
index 0000000..d2fa362
--- /dev/null
+++ b/docs/configuring-datasources-in-tests.mdtext
@@ -0,0 +1,56 @@
+Title: Configuring DataSources in Tests
+<a name="ConfiguringDataSourcesinTests-InitialContextproperties"></a>
+# InitialContext properties
+
+You can configure data sources from within your test case (avoiding the
+need for an `openejb.xml` entirely) like so:
+
+
+    Properties p = new Properties();
+    p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+    
+    p.put("myDataSource", "new://Resource?type=DataSource");
+    p.put("myDataSource.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+    p.put("myDataSource.JdbcUrl", "jdbc:derby:derbyDB;create=true");
+    p.put("myDataSource.JtaManaged", "true");
+    
+    Context context = new InitialContext(p);
+
+Under certain circumstances it may be necessary to load two versions of the same driver.
+This is possible by definition of a classpath for the resource which points to the
+specific driver files required for the DataSource:
+
+    p.put("myDataSourceOne", "new://Resource?type=DataSource&classpath=/path/to/driverVersionOne.jar");
+    p.put("myDataSourceOne.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+    p.put("myDataSource.JdbcUrl", "jdbc:derby:myDatabaseOne;create=true");
+    ....
+    p.put("myDataSourceTwo", "new://Resource?type=DataSource&classpath=/path/to/driverVersionTwo.jar");
+    p.put("myDataSourceTwo.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
+    p.put("myDataSource.JdbcUrl", "jdbc:derby:myDatabaseTwo;create=true");
+
+This will allow an application to communicate through legacy drivers to the same JDBC provider.
+
+See [Embedded Configuration](embedded-configuration.html)
+ for further details on properties and overrides.
+
+See [Containers and Resources](containers-and-resources.html)
+ for a full list of supported Resource types and their properties.
+
+<a name="ConfiguringDataSourcesinTests-Noteon<jta-data-source>and<non-jta-data-source>"></a>
+## Note on &lt;jta-data-source> and &lt;non-jta-data-source>
+
+When configuring DataSources to be used by persistence.xml files, the
+DataSource supplied for `<jta-data-source>` is typically identical to the
+`<non-jta-data-source>`, but with the `JtaManaged` property set differently.
+Keeping with our philosophy to free you up from redundant configuration, we
+will happily auto-create a missing jta-data-source or non-jta-data-source
+based upon the supplied DataSource.
+
+In the example above, a new DataSource would be generated as an exact copy
+but with the name "myDataSourceUnmanaged" and its `JtaManaged` flag set to
+`false`.	If the supplied DataSource was not `JtaManaged`, then the generated
+DataSource would be called "myDataSourceJta" and have its `JtaManaged` flag
+set to `true`.
+
+When relying on this functionality it is not necessary to specify the name
+of the generated DataSource in the `persistence.xml` file.

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/configuring-datasources.mdtext
----------------------------------------------------------------------
diff --git a/docs/configuring-datasources.mdtext b/docs/configuring-datasources.mdtext
new file mode 100644
index 0000000..90da5e7
--- /dev/null
+++ b/docs/configuring-datasources.mdtext
@@ -0,0 +1,167 @@
+Title: Configuring DataSources in tomee.xml
+
+<a name="ConfiguringDataSources-ConfiguringDataSourcesinopenejb.xml"></a>
+
+
+The *<Resource>* element is used to configure a *javax.sql.DataSource*. It
+is also used to configure other resources like Timers, Topics, Queues.	We
+will see some examples of using <Resource> to configure a DataSource.
+
+The <Resource> element is designed after @Resource annotation and has
+similar attributes.
+
+For example, this annotation in your bean:
+
+    @Resource(name = "myDerbyDatasource", type = javax.sql.DataSource.class)
+
+
+Would map to a Resource declared in your openejb.xml as follows:
+
+    <Resource id="myDerbyDatasource" type="javax.sql.DataSource">
+     . . . .
+    <Resource>
+
+
+Note that in the xml element, the _type_ value of _javax.sql.DataSource_
+can abbreviated to just _DataSource_ as follows:
+
+    <Resource id="myDerbyDatasource" type="DataSource">
+     . . . .
+    <Resource>
+	
+It is also possible to specify the path to the driver jar file using a classpath attribute like so:	
+
+	<Resource id="myDerbyDatasource" type="DataSource" classpath="/path/to/driver.jar">
+     . . . .
+    <Resource>
+
+...Or in a [Maven](http://maven.apache.org/) environment like so:
+
+	<Resource id="myDerbyDatasource" type="DataSource" classpath="mvn:org.apache.derby:derby:10.10.1.1">
+     . . . .
+    <Resource>	
+
+See [Containers and Resources](containers-and-resources.html)
+ for a complete list of supported DataSource properties.
+
+See [DataSource Password Encryption](datasource-password-encryption.html)
+ for information on specifying non-plain-text database passwords in your openejb.xml file.
+
+See [Common DataSource Configurations](common-datasource-configurations.html)
+ for a list of the commonly used databases and their driver configurations.
+ 
+See [DataSource Configuration by Creator](datasource-configuration-by-creator.html)
+ for a list of the different properties supported for each data source creator.
+
+You may also need data partitioning per customer or depending on any other
+business criteria. That's also an available feature. See [Dynamic Datasource](dynamic-datasource.html) for more details.
+
+<a name="ConfiguringDataSources-JNDInamesforconfiguredDataSources"></a>
+## JNDI names for configured DataSources
+
+<a name="ConfiguringDataSources-Example1"></a>
+### Example 1
+
+
+    <Resource id="Default JDBC Database" type="DataSource">
+       . . . . .
+    </Resource>
+
+The global jndi name would be *java:openejb/Resource/Default JDBC Database*
+
+<a name="ConfiguringDataSources-Example2"></a>
+### Example 2
+
+
+    <Resource id="Derby Database"  type="DataSource">
+      . . . . .
+    </Resource>
+
+The global jndi name would be *java:openejb/Resource/Derby Database*
+
+<a name="ConfiguringDataSources-ObtainingaDataSource"></a>
+## Obtaining a DataSource
+
+DataSource references in your ejb should get automatically mapped to the
+Resource you declare.  The shortest and easiest rule is that *if your
+reference name matches a Resource in your openejb.xml, that's the one you
+get*.&nbsp; Essentially, the rules for mapping are as follows.
+
+1. Name Attribute Match - @Resource with a name attribute matching the
+resource name gets that resource injected
+1. Injected Name Match - variable name matching the resource name gets that 
+resource injected
+1. No Match - nothing matches a resource name, so the first resource
+available gets injected
+
+
+There are various ways one could obtain a DataSource now.  Lets take an
+example of Derby.
+
+With a Resource declaration in your openejb.xml like this:
+
+
+    <Resource id="myDerbyDatabase"	type="DataSource">
+      . . . . .
+    </Resource>
+
+There are several possible ways to refer to it, as follows.
+
+
+*BY matching variable name to resource name*
+
+    @Stateless
+    public class FooBean {
+        @Resource DataSource myDerbyDatabase;
+    }
+
+    
+*OR BY matching name*
+    
+    @Stateless
+    public class FooBean {
+        @Resource(name="myDerbyDatabase")
+        DataSource dataSource;
+    }
+
+
+*OR BY JNDI lookup*
+
+    @Resource(name="myDerbyDatabase", type=javax.sql.DataSource.class)
+    @Stateless
+    public class FooBean {
+
+        public void setSessionContext(SessionContext sessionContext) {
+            DataSource dataSource = (DataSource)
+            sessionContext.lookup("myDerbyDatabase");
+        }
+
+        public void someOtherMethod() throws Exception {
+            InitialContext initialContext = new InitialContext();
+            DataSource dataSource = (DataSource)
+            initialContext.lookup("java:comp/env/myDerbyDatabase");
+        }
+    }
+
+*OR*
+
+    <resource-ref>
+      <res-ref-name>myDerbyDatabase</res-ref-name>
+      <res-type>javax.sql.DataSource</res-type>
+    </resource-ref>
+
+*OR*
+
+    <resource-ref>
+       <res-ref-name>jdbc/myDerbyDatabase</res-ref-name>
+       <res-type>javax.sql.DataSource</res-type>
+    </resource-ref>
+
+*OR*
+
+    <resource-ref>
+       <res-ref-name>someOtherName</res-ref-name>
+       <res-type>javax.sql.DataSource</res-type>
+       <mapped-name>myDerbyDatabase</mapped-name>
+    </resource-ref>
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/configuring-durations.mdtext
----------------------------------------------------------------------
diff --git a/docs/configuring-durations.mdtext b/docs/configuring-durations.mdtext
new file mode 100644
index 0000000..9b35bce
--- /dev/null
+++ b/docs/configuring-durations.mdtext
@@ -0,0 +1,64 @@
+Title: Configuring Durations
+The time based configuration properties of containers and beans support
+plain english, such as:
+
+ - "1 hour" 
+ - "27 minutes"
+ - "10 seconds"
+
+For convenience it is possible to specify a _compound_ form, such as:
+
+ - "3 days and 2 hours"
+ - "1 hour, 45 minutes"
+ - "15 minutes, 23 seconds, and 10 milliseconds"
+
+Spaces are also optional between the number and the time unit, which can be nice when using the abbreviated forms:
+
+ - "1hr" 
+ - "27m"
+ - "10s"
+ - "3d and 2hr"
+ - "1hr, 45min"
+ - "15m, 23s, and 10ms"
+
+
+Abbreviations are accepted as follows:
+
+
+      if (u.equalsIgnoreCase("NANOSECONDS")) return TimeUnit.NANOSECONDS;
+      if (u.equalsIgnoreCase("NANOSECOND")) return TimeUnit.NANOSECONDS;
+      if (u.equalsIgnoreCase("NANOS")) return TimeUnit.NANOSECONDS;
+      if (u.equalsIgnoreCase("NANO")) return TimeUnit.NANOSECONDS;
+      if (u.equalsIgnoreCase("NS")) return TimeUnit.NANOSECONDS;
+    
+      if (u.equalsIgnoreCase("MICROSECONDS")) return TimeUnit.MICROSECONDS;
+      if (u.equalsIgnoreCase("MICROSECOND")) return TimeUnit.MICROSECONDS;
+      if (u.equalsIgnoreCase("MICROS")) return TimeUnit.MICROSECONDS;
+      if (u.equalsIgnoreCase("MICRO")) return TimeUnit.MICROSECONDS;
+    
+      if (u.equalsIgnoreCase("MILLISECONDS")) return TimeUnit.MILLISECONDS;
+      if (u.equalsIgnoreCase("MILLISECOND")) return TimeUnit.MILLISECONDS;
+      if (u.equalsIgnoreCase("MILLIS")) return TimeUnit.MILLISECONDS;
+      if (u.equalsIgnoreCase("MILLI")) return TimeUnit.MILLISECONDS;
+      if (u.equalsIgnoreCase("MS")) return TimeUnit.MILLISECONDS;
+    
+      if (u.equalsIgnoreCase("SECONDS")) return TimeUnit.SECONDS;
+      if (u.equalsIgnoreCase("SECOND")) return TimeUnit.SECONDS;
+      if (u.equalsIgnoreCase("SEC")) return TimeUnit.SECONDS;
+      if (u.equalsIgnoreCase("S")) return TimeUnit.SECONDS;
+    
+      if (u.equalsIgnoreCase("MINUTES")) return TimeUnit.MINUTES;
+      if (u.equalsIgnoreCase("MINUTE")) return TimeUnit.MINUTES;
+      if (u.equalsIgnoreCase("MIN")) return TimeUnit.MINUTES;
+      if (u.equalsIgnoreCase("M")) return TimeUnit.MINUTES;
+    
+      if (u.equalsIgnoreCase("HOURS")) return TimeUnit.HOURS;
+      if (u.equalsIgnoreCase("HOUR")) return TimeUnit.HOURS;
+      if (u.equalsIgnoreCase("HRS")) return TimeUnit.HOURS;
+      if (u.equalsIgnoreCase("HR")) return TimeUnit.HOURS;
+      if (u.equalsIgnoreCase("H")) return TimeUnit.HOURS;
+    
+      if (u.equalsIgnoreCase("DAYS")) return TimeUnit.DAYS;
+      if (u.equalsIgnoreCase("DAY")) return TimeUnit.DAYS;
+      if (u.equalsIgnoreCase("D")) return TimeUnit.DAYS;
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/configuring-javamail.mdtext
----------------------------------------------------------------------
diff --git a/docs/configuring-javamail.mdtext b/docs/configuring-javamail.mdtext
new file mode 100644
index 0000000..cb6fbb0
--- /dev/null
+++ b/docs/configuring-javamail.mdtext
@@ -0,0 +1,37 @@
+Title: Configuring JavaMail
+<a name="ConfiguringJavaMail-DeclaringaJavaMailResource"></a>
+#  Declaring a JavaMail Resource
+
+The basics are that any properties listed in the <Resource> element are
+given directly to the javamail provider via
+javax.mail.Session.getDefaultInstance(Properties props).
+
+Here might be some example properties.
+
+    <Resource id="SuperbizMail" type="javax.mail.Session">
+       mail.smtp.host=mail.superbiz.org
+       mail.smtp.port=25
+       mail.transport.protocol=smtp
+       mail.smtp.auth=true
+       mail.smtp.user=someuser
+       password=mypassword
+    </Resource>
+
+    
+You can create as many <Resource> entries like this as you wish, they just
+have to have a unique 'id'.
+    
+Careful not to add whitespace at the end of your property values.  A
+java.util.Properties object will leave those in the property values and
+they will be passed to the JavaMail provider with the whitespace on the end
+which may cause issues if the provider does not actively trim the values
+before attempting to use them.
+ 
+# Overriding
+    
+If you wanted to do a System property or InitialContext property override
+of the above example mail session, you could do so like this:
+    
+    java ... -DSuperbizMail.mail.smtp.host=localhost
+    
+    

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/configuring-logging-in-tests.mdtext
----------------------------------------------------------------------
diff --git a/docs/configuring-logging-in-tests.mdtext b/docs/configuring-logging-in-tests.mdtext
new file mode 100644
index 0000000..3797b3d
--- /dev/null
+++ b/docs/configuring-logging-in-tests.mdtext
@@ -0,0 +1,114 @@
+Title: Configuring Logging in Tests
+<a name="ConfiguringLogginginTests-embedded.logging.properties"></a>
+# embedded.logging.properties
+
+When in embedded mode OpenEJB uses an embedded.logging.properties file
+packed in our openejb-core jar which use to configure the logging.  This
+logging configuration is a bit lighter than the conf/logging.properties
+file created in a full standalone OpenEJB setup.
+
+When searching for any config file in the classpath, multiple files with
+the same name may exist.  OpenEJB will always attempt to favor the one
+closest to the openejb.base variable.  This variable is set by default to
+the current directory where your vm is executing, which is more than likely
+the directory of your current module.  So simply adding a file named
+embedded.logging.properties to your module may be all that you need to
+specify a new logging configuration for your tests.
+
+Alternatively, you can set "openejb.logger.external" to "true" as a system
+property (will not work as an InitialContext property).  Then OpenEJB will
+not attempt to configure logging at all and you can configure logging with
+Log4j directly using any of its APIs; xml, properties, or code.
+
+There are a couple good reasons for *not* replacing the
+embedded.logging.properties file.
+
+1. If you want to just change 5% of the logging settings, why take control
+over the other 95% as well.
+1. We do occasionally add new logging categories.  If you are not replacing
+the embedded.logging.properties you will pick these up automatically when
+you upgrade.
+
+<a name="ConfiguringLogginginTests-Overriding(recommended)"></a>
+# Overriding (recommended)
+
+As mentioned in [Embedded Configuration](embedded-configuration.html)
+ much can be done with simple overriding.  The default
+embedded.logging.properties is quite good and there is really no need to
+replace it completely if all you want to do is tweak a few values. 
+
+You can also put logging tweaks right in your InitialContext properties
+like so:
+
+
+    Properties p = new Properties();
+    p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+    
+    p.put("log4j.rootLogger", "fatal,C");
+    p.put("log4j.category.OpenEJB", "warn");
+    p.put("log4j.category.OpenEJB.options", "info");
+    p.put("log4j.category.OpenEJB.server", "info");
+    p.put("log4j.category.OpenEJB.startup", "info");
+    p.put("log4j.category.OpenEJB.startup.service", "warn");
+    p.put("log4j.category.OpenEJB.startup.config", "info");
+    p.put("log4j.category.OpenEJB.hsql", "info");
+    p.put("log4j.category.CORBA-Adapter", "info");
+    p.put("log4j.category.Transaction", "warn");
+    p.put("log4j.category.org.apache.activemq", "error");
+    p.put("log4j.category.org.apache.geronimo", "error");
+    p.put("log4j.category.openjpa", "error");
+    p.put("log4j.appender.C", "org.apache.log4j.ConsoleAppender");
+    p.put("log4j.appender.C.layout", "org.apache.log4j.SimpleLayout");
+    
+    Context context = new InitialContext(p);
+
+
+Essentially, everything starting with "log4j." gets applied as overrides on
+top of the embedded.logging.properties we find in the classpath.  This
+makes it possible to easily tweak the log levels while debugging a
+particular test.
+
+Note, that InitialContext properties can also be supplied in a
+jndi.properties file in the classpath or via system properties. The
+overriding order is as follows: 1 = highest, 4 = lowest.
+
+1. InitialContext properties
+1. jndi.properties in classpath
+1. system propertes
+1. embedded.logging.properties in classpath
+
+By default there are no logging settings in 1-3, so #4 is the only source
+of logging information.
+
+<a name="ConfiguringLogginginTests-Defaultembedded.logging.propertiescontents"></a>
+# Default embedded.logging.properties contents
+
+For your purposes, here are the contents of the default
+embedded.logging.properties file contained in OpenEJB 3.1.1
+
+
+    log4j.rootLogger		   = fatal,C
+    log4j.category.OpenEJB		   = warn
+    log4j.category.OpenEJB.server	   = info
+    log4j.category.OpenEJB.startup	   = info
+    log4j.category.OpenEJB.startup.service = warn
+    log4j.category.OpenEJB.startup.config = info
+    log4j.category.OpenEJB.hsql	   = info
+    log4j.category.CORBA-Adapter	   = info
+    log4j.category.Transaction	   = warn
+    log4j.category.org.apache.activemq = error
+    log4j.category.org.apache.geronimo = error
+    log4j.category.openjpa		   = error
+    
+    log4j.appender.C		   = org.apache.log4j.ConsoleAppender
+    log4j.appender.C.layout 	   = org.apache.log4j.SimpleLayout
+
+
+Here is that file's location in svn as well as all of the previous
+versions.  Future versions will follow the same pattern.
+
+- [http://svn.apache.org/repos/asf/openejb/tags/openejb-3.1.1/container/openejb-core/src/main/resources/embedded.logging.properties](http://svn.apache.org/repos/asf/openejb/tags/openejb-3.1.1/container/openejb-core/src/main/resources/embedded.logging.properties)
+- [http://svn.apache.org/repos/asf/openejb/tags/openejb-3.1/container/openejb-core/src/main/resources/embedded.logging.properties](http://svn.apache.org/repos/asf/openejb/tags/openejb-3.1/container/openejb-core/src/main/resources/embedded.logging.properties)
+- [http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0/container/openejb-core/src/main/resources/embedded.logging.properties](http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0/container/openejb-core/src/main/resources/embedded.logging.properties)
+- [http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0-beta-2/container/openejb-core/src/main/resources/embedded.logging.properties](http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0-beta-2/container/openejb-core/src/main/resources/embedded.logging.properties)
+- [http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0-beta-1/container/openejb-core/src/main/resources/embedded.logging.properties](http://svn.apache.org/repos/asf/openejb/tags/openejb-3.0-beta-1/container/openejb-core/src/main/resources/embedded.logging.properties)

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/configuring-persistenceunits-in-tests.mdtext
----------------------------------------------------------------------
diff --git a/docs/configuring-persistenceunits-in-tests.mdtext b/docs/configuring-persistenceunits-in-tests.mdtext
new file mode 100644
index 0000000..c27aa49
--- /dev/null
+++ b/docs/configuring-persistenceunits-in-tests.mdtext
@@ -0,0 +1,141 @@
+Title: Configuring PersistenceUnits in Tests
+<a name="ConfiguringPersistenceUnitsinTests-Overridingthepersistence.xml"></a>
+# Overriding the persistence.xml
+
+The most common situation in EJB related testing by far is the need to
+alter your persistence.xml for a test environment.
+
+<a name="ConfiguringPersistenceUnitsinTests-Overridingthe<jta-data-source>and<non-jta-data-source>"></a>
+## Overriding the jta-data-source and non-jta-data-source
+
+OpenEJB will automatically use the DataSources you have setup in your test
+environment, we're pretty good at guessing the right DataSources you intend
+even if the names don't match exactly -- or in some cases at all.  If there
+is only one DataSource configured, it's very easy for us to guess the
+DataSource to use.
+
+This allows you to keep your persistence.xml configured for your production
+environment and helps eliminate the need for a "test" persistence.xml
+(though we do have that functionality).  A log line will be printed saying
+if we had to adjust the DataSources of your persistence.xml.
+
+<a name="ConfiguringPersistenceUnitsinTests-Overridingthepersistence-unit<properties>"></a>
+##  Overriding the persistence-unit properties
+
+You can override any property in your test setup via either system
+properties or the initial context properties.  The format is:
+
+`<unit-name>.<property>=<value>`
+
+So for example with the following persistence.xml:
+
+    <persistence>
+      <persistence-unit name="movie-unit">
+        <provider>org.hibernate.ejb.HibernatePersistence</provider>
+        <jta-data-source>movieDatabase</jta-data-source>
+        <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source>
+        <properties>
+          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+          <property name="hibernate.max_fetch_depth" value="3"/>
+        </properties>
+      </persistence-unit>
+    </persistence>
+
+    
+You can override and add persistence unit properties in your test case.
+There are currently no facilities for removing them (if you have a need for
+that let us know -- it hasn't really come up so far).
+
+    Properties p = new Properties();
+    p.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.LocalInitialContextFactory");
+
+    p.put("movie-unit.hibernate.hbm2ddl.auto", "update");
+    p.put("movie-unit.hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
+
+    context = new InitialContext(p);
+
+The overriding order is as follows: 1 = highest, 4 = lowest.
+    
+1. InitialContext properties
+1. jndi.properties from the classpath
+1. System properties
+1. persistence.xml properties
+     
+By default there are no overrides in 1-3, so #4 is the only source of
+information.  
+    
+In the above example there would be exactly three properties for the "movie-unit" persistence unit:
+
+  - hibernate.hbm2ddl.auto = update
+  - hibernate.max_fetch_depth = 3
+  - hibernate.dialect = org.hibernate.dialect.HSQLDialect
+    
+These properties would be passed by OpenEJB directly to the persistence
+provider (in this case Hibernate).  With one exception OpenEJB does not
+understand or modify these properties.	Details on that one exception
+below.
+
+### Common mistakes
+
+Note that you **must** use the **unit name** as the prefix.  This will not work:
+
+        Properties p = new Properties();
+        p.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.LocalInitialContextFactory");
+
+        p.put("hibernate.hbm2ddl.auto", "update");
+        p.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
+
+        context = new InitialContext(p);
+
+Currently, only properties that start with the unit name are search and applied.
+
+###  No need to specify a "transaction lookup" property
+
+All vendors have such a property for getting a reference to the container's
+TransactionManager and nothing works if this is not set correctly to the
+OpenEJB specific class.  To make the lives of users easier, OpenEJB will
+take the liberty of setting it for you.
+
+Here are the persistence provider classes we understand and the defaults we
+will set for you:
+
+#### Provider org.hibernate.ejb.HibernatePersistence
+
+When using this provider, the *hibernate.transaction.manager_lookup_class*
+will be automatically set by OpenEJB to
+_org.apache.openejb.hibernate.TransactionManagerLookup_.  If the property
+is already set in the persistence unit it will be overwritten if it starts
+with the standard "org.hibernate.transaction." prefix.	
+
+Custom lookup implementations will never be overwritten automatically.
+
+#### Provider oracle.toplink.essentials.PersistenceProvider
+
+Or _oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider_.
+
+When using this provider, the *toplink.target-server* will be automatically
+set by OpenEJB to _org.apache.openejb.toplink.JTATransactionController_. 
+If the property is already set in the persistence unit it will be
+overwritten if it starts with the standard "oracle.toplink.transaction."
+prefix.  
+
+Custom transaction controller implementations will never be overwritten automatically.
+
+#### Provider org.eclipse.persistence.jpa.PersistenceProvider
+
+Or _org.eclipse.persistence.jpa.osgi.PersistenceProvider_.
+
+When using this provider, the *eclipselink.target-server* will be
+automatically set by OpenEJB to
+_org.apache.openejb.eclipselink.JTATransactionController_.  If the property
+is already set in the persistence unit it will be overwritten if it starts
+with the standard "org.eclipse.persistence.transaction." prefix.  
+
+Custom transaction controller implementations will never be overwritten automatically.
+
+#### Provider org.apache.openjpa.persistence.PersistenceProviderImpl
+
+OpenJPA is capable of discovering the correct method for locating the
+TransactionManager without the need for users to specify the specific
+strategy.  Therefore no specific "magic" is required.
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/constructor-injection.mdtext
----------------------------------------------------------------------
diff --git a/docs/constructor-injection.mdtext b/docs/constructor-injection.mdtext
new file mode 100644
index 0000000..071594d
--- /dev/null
+++ b/docs/constructor-injection.mdtext
@@ -0,0 +1,95 @@
+Title: Constructor Injection
+For those of you who would like to use final fields, wish to avoid numerous
+setters, or dislike private field injection and would like nothing more
+than to just use plan old java constructors, your wish has come true.  This
+is a feature we intended to add to OpenEJB 3.0 but didn't have time for. 
+We're happy to bring it to the OpenEJB 3.1 release and with a bit of luck
+and support from people like yourself, we'll see this as an EJB 3.1 feature
+as well.
+
+
+    @Stateless
+    public class WidgetBean implements Widget {
+    
+        @EJB(beanName = "FooBean")
+        private final Foo foo;
+    
+        @Resource(name = "count")
+        private final int count;
+    
+        @Resource
+        private final DataSource ds;
+    
+        public WidgetBean(Integer count, Foo foo, DataSource ds) {
+    	this.count = count;
+    	this.foo = foo;
+    	this.ds = ds;
+        }
+    
+        public int getCount() {
+    	return count;
+        }
+    
+        public Foo getFoo() {
+    	return foo;
+        }
+    }
+
+
+The @EJB, @Resource, @PersistenceUnit, and @PersistenceContext annotations
+can be placed at the class-level instead such as:
+
+
+    @Stateless
+    @EJB(name = "foo", beanInterface = Foo.class, beanName = "FooBean")
+    @Resource(name = "count", type = int.class)
+    @Resource(name = "ds", type = DataSource.class)
+    public class WidgetBean implements Widget {
+    
+        public WidgetBean(Integer count, Foo foo, DataSource ds) {
+           // do something
+        }
+    
+        public int getCount() {
+    	return count;
+        }
+    
+        public Foo getFoo() {
+    	return foo;
+        }
+    }
+
+
+
+Currently this functionality relies on classes being compiled with debug
+symbols (the default compile setting for javac) as we use the debug table
+in the byte code to discover the constructor arg names.  Additionally, you
+must not have a no-arg constructor.  If a no-arg constructor is present,
+that constructor will be used instead.
+
+Ideally, we would like the annotations to be used on the parameters
+directly as shown below.  Unfortunately, this does not work as the Java EE
+annotation classes do not permit usage on parameters.  If you'd like to see
+that change as much as we do, definitely voice your support by sending note
+to [jsr-316-comments@jcp.org](mailto:jsr-316-comments@jcp.org.html)
+
+
+Not yet possible
+
+    @Stateless
+
+    public class WidgetBean implements Widget {
+
+        public WidgetBean(@Resource(name = "count") Integer count, @EJB Foo foo, @Resource DataSource ds) {
+           // do something
+        }
+
+        public int getCount() {
+            return count;
+        }
+
+        public Foo getFoo() {
+            return foo;
+        }
+    }
+

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/containers-and-resources.mdtext
----------------------------------------------------------------------
diff --git a/docs/containers-and-resources.mdtext b/docs/containers-and-resources.mdtext
new file mode 100644
index 0000000..dba4c00
--- /dev/null
+++ b/docs/containers-and-resources.mdtext
@@ -0,0 +1,479 @@
+Title: Containers and Resources
+
+<div id="PageContent">
+              <p><a name="ContainersandResources-containers"></a></p>
+<p><a name="ContainersandResources-DefaultCMPContainercontainer"></a></p>
+<h2><a name="ContainersandResources-CMPENTITY"></a>CMP_ENTITY</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Container id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"CMP_ENTITY"</span>&gt;</span>
+<span class="code-tag">&lt;/Container&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Container?type=CMP_ENTITY</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > CmpEngineFactory </td>
+<td > Default value is <em>org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+<p><a name="ContainersandResources-TransactionManager"></a></p>
+<h2><a name="ContainersandResources-TxMgr"></a>TransactionManager</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;TransactionManager type=<span class="code-quote">"javax.transaction.TransactionManager"</span>&gt;</span>
+<span class="code-tag">&lt;/TransactionManager&gt;</span>
+</pre>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > defaultTransactionTimeoutSeconds </td>
+<td > Default value is <em>10 minutes</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultBMPContainercontainer"></a></p>
+<h2><a name="ContainersandResources-BMPENTITY"></a>BMP_ENTITY</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Container id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"BMP_ENTITY"</span>&gt;</span>
+<span class="code-tag">&lt;/Container&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Container?type=BMP_ENTITY</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > PoolSize </td>
+<td > Specifies the size of the bean pools for this<br class="atl-forced-newline"> bmp entity container.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>10</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultStatelessContainercontainer"></a></p>
+<h2><a name="ContainersandResources-STATELESS"></a>STATELESS</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Container id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"STATELESS"</span>&gt;</span>
+<span class="code-tag">&lt;/Container&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Container?type=STATELESS</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > TimeOut </td>
+<td > Specifies the time to wait between invocations. This<br class="atl-forced-newline"> value is measured in milliseconds. A value of 5 would<br class="atl-forced-newline"> result in a time-out of 5 milliseconds between invocations.<br class="atl-forced-newline"> A value of zero would mean no timeout.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>0</em>.</td>
+</tr>
+<tr>
+<td > PoolSize </td>
+<td > Specifies the size of the bean pools for this<br class="atl-forced-newline"> stateless SessionBean container.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>10</em>.</td>
+</tr>
+<tr>
+<td > StrictPooling </td>
+<td > StrictPooling tells the container what to do when the pool<br class="atl-forced-newline"> reaches it's maximum size and there are incoming requests<br class="atl-forced-newline"> that need instances.<br class="atl-forced-newline"> <br class="atl-forced-newline"> With strict pooling, requests will have to wait for instances<br class="atl-forced-newline"> to become available. The pool size will never grow beyond the<br class="atl-forced-newline"> the set PoolSize value.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Without strict pooling, the container will create temporary<br class="atl-forced-newline"> instances to meet demand. The instances will last for just one<br class="atl-forced-newline"> method invocation and then are removed.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>true</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultStatefulContainercontainer"></a></p>
+<h2><a name="ContainersandResources-STATEFUL"></a>STATEFUL</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Container id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"STATEFUL"</span>&gt;</span>
+<span class="code-tag">&lt;/Container&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Container?type=STATEFUL</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > Passivator </td>
+<td > The passivator is responsible for writing beans to disk<br class="atl-forced-newline"> at passivation time. Different passivators can be used<br class="atl-forced-newline"> by setting this property to the fully qualified class name<br class="atl-forced-newline"> of the PassivationStrategy implementation. The passivator<br class="atl-forced-newline"> is not responsible for invoking any callbacks or other<br class="atl-forced-newline"> processing, its only responsibly is to write the bean state<br class="atl-forced-newline"> to disk.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Known implementations:<br class="atl-forced-newline"> org.apache.openejb.core.stateful.RAFPassivater<br class="atl-forced-newline"> org.apache.openejb.core.stateful.SimplePassivater<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>org.apache.openejb.core.stateful.SimplePassivater</em>.</td>
+</tr>
+<tr>
+<td > TimeOut </td>
+<td > Specifies the time to wait between invocations. This<br class="atl-forced-newline"> value is measured in minutes. A value of 5 would<br class="atl-forced-newline"> result in a time-out of 5 minutes between invocations.<br class="atl-forced-newline"> A value of zero would mean no timeout.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>20</em>.</td>
+</tr>
+<tr>
+<td > PoolSize </td>
+<td > Specifies the size of the bean pools for this<br class="atl-forced-newline"> stateful SessionBean container.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>1000</em>.</td>
+</tr>
+<tr>
+<td > BulkPassivate </td>
+<td > Property name that specifies the number of instances<br class="atl-forced-newline"> to passivate at one time when doing bulk passivation.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>100</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultMDBContainercontainer"></a></p>
+<h2><a name="ContainersandResources-MESSAGE"></a>MESSAGE</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Container id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"MESSAGE"</span>&gt;</span>
+<span class="code-tag">&lt;/Container&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Container?type=MESSAGE</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > ResourceAdapter </td>
+<td > The resource adapter delivers messages to the container<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>Default JMS Resource Adapter</em>.</td>
+</tr>
+<tr>
+<td > MessageListenerInterface </td>
+<td > Specifies the message listener interface handled by this container<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>javax.jms.MessageListener</em>.</td>
+</tr>
+<tr>
+<td > ActivationSpecClass </td>
+<td > Specifies the activation spec class<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>org.apache.activemq.ra.ActiveMQActivationSpec</em>.</td>
+</tr>
+<tr>
+<td > InstanceLimit </td>
+<td > Specifies the maximum number of bean instances that are<br class="atl-forced-newline"> allowed to exist for each MDB deployment.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>10</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+
+<p><a name="ContainersandResources-resources"></a></p>
+<h1><a name="ContainersandResources-Resources"></a>Resources</h1>
+<p><a name="ContainersandResources-DefaultJDBCDatabaseresource"></a></p>
+<h2><a name="ContainersandResources-javax.sql.DataSource"></a>javax.sql.DataSource</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"javax.sql.DataSource"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=javax.sql.DataSource</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > JtaManaged </td>
+<td > Determines wether or not this data source should be JTA managed<br class="atl-forced-newline"> or user managed.&nbsp;&nbsp;If set to 'true' it will automatically be enrolled<br class="atl-forced-newline"> in any ongoing transactions.&nbsp;&nbsp;Calling begin/commit/rollback or setAutoCommit<br class="atl-forced-newline"> on the datasource or connection will not be allowed.&nbsp;&nbsp;If you need to perform<br class="atl-forced-newline"> these functions yourself, set JtaManaged to 'false'<br class="atl-forced-newline"> <br class="atl-forced-newline"> In terms of JPA persistence.xml:<br class="atl-forced-newline"> "JtaManaged=true" can be used as a 'jta-data-source'<br class="atl-forced-newline"> "JtaManaged=false" can be used as a 'non-jta-data-source'<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>true</em>.</td>
+</tr>
+<tr>
+<td > JdbcDriver </td>
+<td > Driver class name<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>org.hsqldb.jdbcDriver</em>.</td>
+</tr>
+<tr>
+<td > JdbcUrl </td>
+<td > Url for creating connections<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>jdbc:hsqldb:file:data/hsqldb/hsqldb</em>.</td>
+</tr>
+<tr>
+<td > UserName </td>
+<td > Default user name<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>sa</em>.</td>
+</tr>
+<tr>
+<td > Password </td>
+<td > Default password</td>
+</tr>
+<tr>
+<td > ConnectionProperties </td>
+<td > The connection properties that will be sent to the JDBC<br class="atl-forced-newline"> driver when establishing new connections<br class="atl-forced-newline"> <br class="atl-forced-newline"> Format of the string must be [propertyName=property;]*<br class="atl-forced-newline"> <br class="atl-forced-newline"> NOTE - The "user" and "password" properties will be passed<br class="atl-forced-newline"> explicitly, so they do not need to be included here.</td>
+</tr>
+<tr>
+<td > DefaultAutoCommit </td>
+<td > The default auto-commit state of new connections<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>true</em>.</td>
+</tr>
+<tr>
+<td > DefaultReadOnly </td>
+<td > The default read-only state of new connections<br class="atl-forced-newline"> If not set then the setReadOnly method will not be called.<br class="atl-forced-newline"> (Some drivers don't support read only mode, ex: Informix)</td>
+</tr>
+<tr>
+<td > DefaultTransactionIsolation </td>
+<td > The default TransactionIsolation state of new connections<br class="atl-forced-newline"> If not set then the setTransactionIsolation method will not<br class="atl-forced-newline"> be called. The allowed values for this property are:<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; NONE<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; READ_COMMITTED<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; READ_UNCOMMITTED<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; REPEATABLE_READ<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; SERIALIZABLE<br class="atl-forced-newline"> <br class="atl-forced-newline"> Note: Most JDBC drivers do not support all isolation levels</td>
+</tr>
+<tr>
+<td > InitialSize </td>
+<td > The initial number of connections that are created when the<br class="atl-forced-newline"> pool is started<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>0</em>.</td>
+</tr>
+<tr>
+<td > MaxActive </td>
+<td > The maximum number of active connections that can be<br class="atl-forced-newline"> allocated from this pool at the same time, or a negative<br class="atl-forced-newline"> number for no limit.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>20</em>.</td>
+</tr>
+<tr>
+<td > MaxIdle </td>
+<td > The maximum number of connections that can remain idle in<br class="atl-forced-newline"> the pool, without extra ones being released, or a negative<br class="atl-forced-newline"> number for no limit.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>20</em>.</td>
+</tr>
+<tr>
+<td > MinIdle </td>
+<td > The minimum number of connections that can remain idle in<br class="atl-forced-newline"> the pool, without extra ones being created, or zero to<br class="atl-forced-newline"> create none.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>0</em>.</td>
+</tr>
+<tr>
+<td > MaxWait </td>
+<td > The maximum number of milliseconds that the pool will wait<br class="atl-forced-newline"> (when there are no available connections) for a connection<br class="atl-forced-newline"> to be returned before throwing an exception, or -1 to wait<br class="atl-forced-newline"> indefinitely.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>-1</em>.</td>
+</tr>
+<tr>
+<td > ValidationQuery </td>
+<td > The SQL query that will be used to validate connections from<br class="atl-forced-newline"> this pool before returning them to the caller. If specified,<br class="atl-forced-newline"> this query MUST be an SQL SELECT statement that returns at<br class="atl-forced-newline"> least one row.</td>
+</tr>
+<tr>
+<td > TestOnBorrow </td>
+<td > If true connections will be validated before being borrowed<br class="atl-forced-newline"> from the pool. If the validation fails, the connection is<br class="atl-forced-newline"> destroyed, and a new conection will be retrieved from the<br class="atl-forced-newline"> pool (and validated).<br class="atl-forced-newline"> <br class="atl-forced-newline"> NOTE - for a true value to have any effect, the<br class="atl-forced-newline"> ValidationQuery parameter must be set.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>true</em>.</td>
+</tr>
+<tr>
+<td > TestOnReturn </td>
+<td > If true connections will be validated before being returned<br class="atl-forced-newline"> to the pool.&nbsp;&nbsp;If the validation fails, the connection is<br class="atl-forced-newline"> destroyed instead of being returned to the pool.<br class="atl-forced-newline"> <br class="atl-forced-newline"> NOTE - for a true value to have any effect, the<br class="atl-forced-newline"> ValidationQuery parameter must be set.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>false</em>.</td>
+</tr>
+<tr>
+<td > TestWhileIdle </td>
+<td > If true connections will be validated by the idle connection<br class="atl-forced-newline"> evictor (if any). If the validation fails, the connection is<br class="atl-forced-newline"> destroyed and removed from the pool<br class="atl-forced-newline"> <br class="atl-forced-newline"> NOTE - for a true value to have any effect, the<br class="atl-forced-newline"> timeBetweenEvictionRunsMillis property must be a positive<br class="atl-forced-newline"> number and the ValidationQuery parameter must be set.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>false</em>.</td>
+</tr>
+<tr>
+<td > TimeBetweenEvictionRunsMillis </td>
+<td > The number of milliseconds to sleep between runs of the idle<br class="atl-forced-newline"> connection evictor thread. When set to a negative number, no<br class="atl-forced-newline"> idle connection evictor thread will be run.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>-1</em>.</td>
+</tr>
+<tr>
+<td > NumTestsPerEvictionRun </td>
+<td > The number of connectionss to examine during each run of the<br class="atl-forced-newline"> idle connection evictor thread (if any).<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>3</em>.</td>
+</tr>
+<tr>
+<td > MinEvictableIdleTimeMillis </td>
+<td > The minimum amount of time a connection may sit idle in the<br class="atl-forced-newline"> pool before it is eligable for eviction by the idle<br class="atl-forced-newline"> connection evictor (if any).<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>1800000</em>.</td>
+</tr>
+<tr>
+<td > PoolPreparedStatements </td>
+<td > If true, a statement pool is created for each Connection and<br class="atl-forced-newline"> PreparedStatements created by one of the following methods are<br class="atl-forced-newline"> pooled:<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp;public PreparedStatement prepareStatement(String sql);<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp;public PreparedStatement prepareStatement(String sql,<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int resultSetType,<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int resultSetConcurrency)<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>false</em>.</td>
+</tr>
+<tr>
+<td > MaxOpenPreparedStatements </td>
+<td > The maximum number of open statements that can be allocated<br class="atl-forced-newline"> from the statement pool at the same time, or zero for no<br class="atl-forced-newline"> limit.<br class="atl-forced-newline"> <br class="atl-forced-newline"> NOTE - Some drivers have limits on the number of open<br class="atl-forced-newline"> statements, so make sure there are some resources left<br class="atl-forced-newline"> for the other (non-prepared) statements.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>0</em>.</td>
+</tr>
+<tr>
+<td > AccessToUnderlyingConnectionAllowed </td>
+<td > If true the raw physical connection to the database can be<br class="atl-forced-newline"> accessed using the following construct:<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; Connection conn = ds.getConnection();<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; Connection rawConn = ((DelegatingConnection) conn).getInnermostDelegate();<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; ...<br class="atl-forced-newline">&nbsp;&nbsp;&nbsp;&nbsp; conn.close()<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default is false, because misbehaving programs can do harmfull<br class="atl-forced-newline"> things to the raw connection shuch as closing the raw<br class="atl-forced-newline"> connection or continuing to use the raw connection after it<br class="atl-forced-newline"> has been assigned to another logical connection.&nbsp;&nbsp;Be carefull<br class="atl-forced-newline"> and only use when you need direct access to driver specific<br class="atl-f
 orced-newline"> extentions.<br class="atl-forced-newline"> <br class="atl-forced-newline"> NOTE: Do NOT close the underlying connection, only the<br class="atl-forced-newline"> original logical connection wrapper.<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>false</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultJMSResourceAdapterresource"></a></p>
+<h2><a name="ContainersandResources-ActiveMQResourceAdapter"></a>ActiveMQResourceAdapter</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"ActiveMQResourceAdapter"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=ActiveMQResourceAdapter</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > BrokerXmlConfig </td>
+<td > Broker configuration<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>broker:(tcp://localhost:61616)?useJmx=false</em>.</td>
+</tr>
+<tr>
+<td > ServerUrl </td>
+<td > Broker address<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>vm://localhost?async=true</em>.</td>
+</tr>
+<tr>
+<td > DataSource </td>
+<td > DataSource for persistence messages<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>Default Unmanaged JDBC Database</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultJMSConnectionFactoryresource"></a></p>
+<h2><a name="ContainersandResources-javax.jms.ConnectionFactory"></a>javax.jms.ConnectionFactory</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"javax.jms.ConnectionFactory"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=javax.jms.ConnectionFactory</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > ResourceAdapter </td>
+<td > Default value is <em>Default JMS Resource Adapter</em>.</td>
+</tr>
+<tr>
+<td > TransactionSupport </td>
+<td > Specifies if the connection is enrolled in global transaction<br class="atl-forced-newline"> allowed values: xa, local or none<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>xa</em>.</td>
+</tr>
+<tr>
+<td > PoolMaxSize </td>
+<td > Maximum number of physical connection to the ActiveMQ broker<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>10</em>.</td>
+</tr>
+<tr>
+<td > PoolMinSize </td>
+<td > Minimum number of physical connection to the ActiveMQ broker<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>0</em>.</td>
+</tr>
+<tr>
+<td > ConnectionMaxWaitMilliseconds </td>
+<td > Maximum amount of time to wait for a connection<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>5000</em>.</td>
+</tr>
+<tr>
+<td > ConnectionMaxIdleMinutes </td>
+<td > Maximum amount of time a connection can be idle before being reclaimed<br class="atl-forced-newline"> <br class="atl-forced-newline"> Default value is <em>15</em>.</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultQueueresource"></a></p>
+<h2><a name="ContainersandResources-javax.jms.Queue"></a>javax.jms.Queue</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"javax.jms.Queue"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=javax.jms.Queue</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > destination </td>
+<td > Specifies the name of the queue</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultTopicresource"></a></p>
+<h2><a name="ContainersandResources-javax.jms.Topic"></a>javax.jms.Topic</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"javax.jms.Topic"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=javax.jms.Topic</p>
+</div></div>
+<p>Supports the following properties</p>
+<div class="table-wrap">
+<table class="confluenceTable"><tbody>
+<tr>
+<th > Property Name </th>
+<th > Description </th>
+</tr>
+<tr>
+<td > destination </td>
+<td > Specifies the name of the topic</td>
+</tr>
+</tbody></table>
+</div>
+
+
+<p><a name="ContainersandResources-DefaultORBresource"></a></p>
+<h2><a name="ContainersandResources-org.omg.CORBA.ORB"></a>org.omg.CORBA.ORB</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"org.omg.CORBA.ORB"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=org.omg.CORBA.ORB</p>
+</div></div>
+<p>No properties.</p>
+
+<p><a name="ContainersandResources-DefaultMailSessionresource"></a></p>
+<h2><a name="ContainersandResources-javax.mail.Session"></a>javax.mail.Session</h2>
+<p>Declarable in tomee.xml via</p>
+<div style="border-width: 1px;" class="code panel"><div class="codeContent panelContent">
+<pre class="code-xml"><span class="code-tag">&lt;Resource id=<span class="code-quote">"Foo"</span> type=<span class="code-quote">"javax.mail.Session"</span>&gt;</span>
+<span class="code-tag">&lt;/Resource&gt;</span>
+</pre>
+</div></div>
+<p>Declarable in properties via</p>
+<div style="border-width: 1px;" class="panel"><div class="panelContent">
+<p>Foo = new://Resource?type=javax.mail.Session</p>
+</div></div>
+<p>No properties.</p>
+            
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/.DS_Store
----------------------------------------------------------------------
diff --git a/docs/contrib/.DS_Store b/docs/contrib/.DS_Store
new file mode 100644
index 0000000..e6a912a
Binary files /dev/null and b/docs/contrib/.DS_Store differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/debug-intellij.mdtext
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/debug-intellij.mdtext b/docs/contrib/debug/debug-intellij.mdtext
new file mode 100644
index 0000000..d2729a8
--- /dev/null
+++ b/docs/contrib/debug/debug-intellij.mdtext
@@ -0,0 +1,129 @@
+<a name='DEBUGIDE'></a>
+#Debugging an Apache TomEE App in Intellij IDEA
+
+Stepping through the [TomEE](http://tomee.apache.org/apache-tomee.html) source code is a must-to-follow step if you want to understand how TomEE works and later contribute. This is a guide to quickly start your debugging session with TomEE as a TomEE developer.
+
+This guide assumes that:
+
+ - Linux is the OS
+ - IntelliJ IDEA 13.1.3 is the IDE
+ - Maven 3.0.5 or better is installed 
+
+
+###Download the Source Code
+
+For beginners it is recommended not to start with the trunk, because it is common to have some blockers or non-stable functionality which could bring your learning to a halt. So first start with the latest stable released source code. Move to trunk once you are ready to do some code modification on TomEE.
+
+[Click here to download TomEE 1.7.1 Source code](http://www.apache.org/dyn/closer.cgi/tomee/tomee-1.7.1/openejb-4.7.1-source-release.zip)
+
+###Build the Source Code 
+
+First extract the zip file named **openejb-4.7.1-source-release.zip** to any location. Lets assume it is your home folder.
+
+> unzip openejb-4.7.1-source-release -d ~
+
+The above command will create the **openejb-4.7.1** directory in your home directory.
+
+Even though you can do a full build, We will run the following command to do a quick build so that you can have your meal before your hunger kills you.
+
+> mvn -Pquick -Dsurefire.useFile=false -DdisableXmlReport=true -DuniqueVersion=false -ff -Dassemble -DskipTests -DfailIfNoTests=false clean install
+
+More details about building the product from the source can be found [here](http://tomee.apache.org/dev/source-code.html).
+
+###Deploy TomEE 
+
+The TomEE build builds several distributions (zip &amp; war files) to cater the different needs of different users. Here we discuss about the tomee plus distribution &amp; TomEE war distribution only. TomEE+ is the full feature packed distribution from TomEE.
+
+TomEE+ zip location:
+
+> ~/openejb-4.7.1/tomee/apache-tomee/target/apache-tomee-plus-1.7.1.zip
+
+Unzip the zip into your home directory (or any other location)
+
+> unzip ~/openejb-4.7.1/tomee/apache-tomee/target/apache-tomee-plus-1.7.1.zip -d ~
+
+You will find the directory **apache-tomee-plus-1.7.1** in your home folder. Lets run the TomEE.
+
+> cd ~/apache-tomee-plus-1.7.1/bin <br />
+> ./catalina.sh run <br />
+
+"INFO: Server startup in xxxx ms" is the Green light!
+
+###Prepare your IDE
+
+Lets prepare our IntelliJ IDEA for the debugging session.
+
+Start IntelliJ IDEA and Click the Import Project link
+
+![](idea1.png)
+
+Select the ~/openejb-4.7.1 directory and press OK
+
+Select import project from external model &amp; Maven as the external model.
+
+![](idea3.png)
+
+Press Next on this screen.
+
+![](idea4.png)
+
+Select the main profile.
+
+![](idea6.png)
+
+Select the org.apache.openejb:openejb:4.7.1
+
+![](idea7.png)
+
+Select the JDK you want to use with.
+
+![](idea8.png)
+
+Give the project a name and press Finish.
+
+![](idea9.png)
+
+Now your IDE will load the project.
+
+###First Breakpoint
+
+Next step is to put a breakpoint at the place where the code is triggered. Lets understand how the code is triggered.
+
+TomEE+ is created on top of Tomcat. TomEE registers a Tomcat Lifecycle Listener **"org.apache.tomee.catalina.ServerListener"** on **server.xml** file.
+
+All the Tomcat lifecycle events i.e. before_init, after_init, start, before_stop etc... are received by the **lifecycleEvent** method of the ServerListener.
+
+The execution of TomEE code starts in this lifecycleEvent method. So the first breakpoint should be on the lifecycleEvent method.
+
+###Run TomEE+ in debug mode
+
+If you simply run **catalina.sh jpda run** in the bin folder of tomee deployment, the server starts in the debug mode but it will quckly pass your breakpoint before you attach your IDE to the server process.
+
+So we set** JPDA_SUSPEND="y"** before we start our debugging. This will tell the server "Do not proceed until the Debugger tool is attached to the process"
+
+The convenient way of doing this is adding this line to catalina.sh file right after the #!/bin/sh line. 
+
+> \#!/bin/sh
+> JPDA_SUSPEND="y"
+> 
+Now to time to run TomEE+ on debug mode.
+
+> ~/apache-tomee-plus-1.7.1/bin/catalina.sh jpda run 
+
+The terminal should hang with the message **"Listening for transport dt_socket at address: 8000"**
+
+###Attach IntelliJ IDEA debugger
+
+*   Menu Bar &gt; Run &gt; Edit Configurations
+*   Press the "**+**" button on the top left corner to get the Add new configuration menu
+*   Select "Remote" from the Add new configuration menu
+*   Give a name (I gave "TomEE DEBUG") to this new configuration and set the Port to 8000
+*   Click OK.
+
+![](idea10.png)</div>
+
+To start debugging your TomEE+
+
+Main Menu &gt; Run &gt; Debug TomEE DEBUG
+
+Congratulations! You hit the break point you put at the startup of the TomEE code. Carry on with your debugging session to learn more.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea1.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea1.png b/docs/contrib/debug/idea1.png
new file mode 100644
index 0000000..fb08bce
Binary files /dev/null and b/docs/contrib/debug/idea1.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea10.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea10.png b/docs/contrib/debug/idea10.png
new file mode 100644
index 0000000..e69f3b8
Binary files /dev/null and b/docs/contrib/debug/idea10.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea2.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea2.png b/docs/contrib/debug/idea2.png
new file mode 100644
index 0000000..32cc8c3
Binary files /dev/null and b/docs/contrib/debug/idea2.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea3.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea3.png b/docs/contrib/debug/idea3.png
new file mode 100644
index 0000000..def1687
Binary files /dev/null and b/docs/contrib/debug/idea3.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea4.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea4.png b/docs/contrib/debug/idea4.png
new file mode 100644
index 0000000..5c46256
Binary files /dev/null and b/docs/contrib/debug/idea4.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea6.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea6.png b/docs/contrib/debug/idea6.png
new file mode 100644
index 0000000..87dff02
Binary files /dev/null and b/docs/contrib/debug/idea6.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea7.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea7.png b/docs/contrib/debug/idea7.png
new file mode 100644
index 0000000..1fb877a
Binary files /dev/null and b/docs/contrib/debug/idea7.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea8.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea8.png b/docs/contrib/debug/idea8.png
new file mode 100644
index 0000000..1b9d64c
Binary files /dev/null and b/docs/contrib/debug/idea8.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/contrib/debug/idea9.png
----------------------------------------------------------------------
diff --git a/docs/contrib/debug/idea9.png b/docs/contrib/debug/idea9.png
new file mode 100644
index 0000000..a7e6cd5
Binary files /dev/null and b/docs/contrib/debug/idea9.png differ

http://git-wip-us.apache.org/repos/asf/tomee/blob/f779264f/docs/custom-injection.mdtext
----------------------------------------------------------------------
diff --git a/docs/custom-injection.mdtext b/docs/custom-injection.mdtext
new file mode 100644
index 0000000..968f846
--- /dev/null
+++ b/docs/custom-injection.mdtext
@@ -0,0 +1,192 @@
+Title: Custom Injection
+# Overview
+
+As noted in the [Injection of env-entry Example](injection-of-env-entry-example.html)
+, the EJB 3.0 supported env-entry types are fairly limited.  Also the use
+of several <env-entry> tags in an ejb-jar.xml can get a bit verbose.
+
+OpenEJB does not restrict you to just these data types or require you to
+use an ejb-jar.xml to declare them.
+
+ - `@Resource` can be used on any type for which there is
+`java.beans.PropertyEditor`
+ - You may `install your own` PropertyEditors and package them with your
+app.
+ - Java Generics are supported (e.g. List<URI> myURIs)
+ - You may use a `META-INF/env-entries.properties` file as an alternative
+to an ejb-jar.xml
+
+See [Built-in Type Converters](built-in-type-converters.html)
+for a full list of supported env-entry types.
+
+The source for this example is the "custom-injection" directory located in
+the [openejb-examples.zip](downloads.html)
+available on the [download page](http://tomee.apache.org/downloads.html).
+
+<a name="CustomInjection-TheCode"></a>
+# The Code
+
+<a name="CustomInjection-BeanClass"></a>
+## Bean Class
+
+    @Stateless
+    public class Stratocaster {
+    
+        @Resource(name = "pickups")
+        private List<Pickup> pickups;
+    
+        @Resource(name = "style")
+        private Style style;
+    
+        @Resource(name = "dateCreated")
+        private Date dateCreated;
+    
+        @Resource(name = "guitarStringGuages")
+        private Map<String, Float> guitarStringGuages;
+    
+        @Resource(name = "certificateOfAuthenticity")
+        private File certificateOfAuthenticity;
+    
+        public Date getDateCreated() {
+            return dateCreated;
+        }
+    
+        /**
+         * Gets the guage of the electric guitar strings
+         * used in this guitar.
+         *
+         * @param string
+         * @return
+         */
+        public float getStringGuage(String string) {
+            return guitarStringGuages.get(string);
+        }
+    
+        public List<Pickup> getPickups() {
+            return pickups;
+        }
+    
+        public Style getStyle() {
+            return style;
+        }
+    
+        public File getCertificateOfAuthenticity() {
+            return certificateOfAuthenticity;
+        }
+    }
+
+<a name="CustomInjection-TheMETA-INF/env-entries.propertiesfile"></a>
+## The META-INF/env-entries.properties file
+
+    guitarStringGuages=E1=0.052\nA=0.042\nD=0.030\nG=0.017\nB=0.013\nE=0.010
+    certificateOfAuthenticity=/tmp/strat-certificate.txt
+    dateCreated=1962-03-01
+    pickups=S,S,S
+    style=VINTAGE
+
+<a name="CustomInjection-TheCustomTypeandEditor"></a>
+## The Custom Type and Editor
+
+Support for java.lang.Enum types is already built-in, but we've decided
+we'd like to allow abbreviated versions of the enum constants to be usable.
+ We do this by creating a custom PropertyEditor for our Pickup enum like
+so:
+
+    public class PickupEditor extends java.beans.PropertyEditorSupport {
+        public void setAsText(String text) throws IllegalArgumentException {
+            text = text.trim();
+    
+            if (text.equalsIgnoreCase("H")) setValue(Pickup.HUMBUCKER);
+            else if (text.equalsIgnoreCase("S")) setValue(Pickup.SINGLE_COIL);
+            else throw new IllegalStateException("H and S are the only supported Pickup aliases");
+        }
+    }
+
+We cleverly install this PropertyEditor in a static block in the Pickup
+class that will be executed should someone actually reference the Pickup
+type.
+
+    public enum Pickup {
+    
+        HUMBUCKER,
+        SINGLE_COIL;
+    
+        // Here's the little magic where we register the PickupEditor
+        // which knows how to create this object from a string.
+        // You can add any of your own Property Editors in the same way.
+        static {
+            PropertyEditorManager.registerEditor(Pickup.class, PickupEditor.class);
+        }
+    }
+
+<a name="CustomInjection-TestCase"></a>
+# Test Case
+
+    public class StratocasterTest extends TestCase {
+    
+        @EJB
+        private Stratocaster strat;
+    
+        public void test() throws Exception {
+            EJBContainer.createEJBContainer().getContext().bind("inject", this);
+    
+            Date date = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.US).parse("Mar 1, 1962");
+            assertEquals("Strat.getDateCreated()", date, strat.getDateCreated());
+    
+            List<Pickup> pickups = asList(Pickup.SINGLE_COIL, Pickup.SINGLE_COIL, Pickup.SINGLE_COIL);
+            assertEquals("Strat.getPickups()", pickups, strat.getPickups());
+    
+            assertEquals("Strat.getStyle()", Style.VINTAGE, strat.getStyle());
+    
+            assertEquals("Strat.getStringGuage(\"E1\")", 0.052F, strat.getStringGuage("E1"));
+            assertEquals("Strat.getStringGuage(\"A\")", 0.042F, strat.getStringGuage("A"));
+            assertEquals("Strat.getStringGuage(\"D\")", 0.030F, strat.getStringGuage("D"));
+            assertEquals("Strat.getStringGuage(\"G\")", 0.017F, strat.getStringGuage("G"));
+            assertEquals("Strat.getStringGuage(\"B\")", 0.013F, strat.getStringGuage("B"));
+            assertEquals("Strat.getStringGuage(\"E\")", 0.010F, strat.getStringGuage("E"));
+    
+            File file = new File("/tmp/strat-certificate.txt");
+            assertEquals("Strat.getCertificateOfAuthenticity()", file,strat.getCertificateOfAuthenticity());
+    
+    
+        }
+    }
+
+<a name="CustomInjection-Runningit"></a>
+# Running it
+
+Running the example is fairly simple.  In the "custom-injection" directory of the [examples zip](openejb:download.html), just run:
+
+> $ mvn clean install
+
+Which should create output like the following.
+
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.enventries.StratocasterTest
+    Apache OpenEJB 3.1-SNAPSHOT    build: 20080409-12:05
+    http://tomee.apache.org/
+    INFO - openejb.home = /Users/dblevins/work/openejb3/examples/custom-injection
+    INFO - openejb.base = /Users/dblevins/work/openejb3/examples/custom-injection
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory, type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
+    INFO - Found EjbModule in classpath: /Users/dblevins/work/openejb3/examples/custom-injection/target/classes
+    INFO - Configuring app: /Users/dblevins/work/openejb3/examples/custom-injection/target/classes
+    INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
+    INFO - Auto-creating a container for bean StratocasterImpl: Container(type=STATELESS, id=Default Stateless Container)
+    INFO - Loaded Module: /Users/dblevins/work/openejb3/examples/custom-injection/target/classes
+    INFO - Assembling app: /Users/dblevins/work/openejb3/examples/custom-injection/target/classes
+    INFO - Jndi(name=StratocasterImplLocal) --> Ejb(deployment-id=StratocasterImpl)
+    INFO - Created Ejb(deployment-id=StratocasterImpl, ejb-name=StratocasterImpl, container=Default Stateless Container)
+    INFO - Deployed Application(path=/Users/dblevins/work/openejb3/examples/custom-injection/target/classes)
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.705 sec
+    
+    Results :
+    
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+
+