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 2011/07/10 07:36:21 UTC

svn commit: r1144778 [9/13] - /openejb/site/trunk/content/

Added: openejb/site/trunk/content/persistence-unit-ref.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/persistence-unit-ref.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/persistence-unit-ref.cwiki (added)
+++ openejb/site/trunk/content/persistence-unit-ref.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,82 @@
+Both lookup and injection of an EntityManagerFactory can be configured via the @PersistenceUnit annotation or <persistence-unit-ref> in xml.  Annotations and xml have equal function in both lookup and injection.
+
+h1.  Injection and Lookup
+
+h2.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz;
+
+import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
+import javax.ejb.Stateless;
+import javax.naming.InitialUnit;
+
+@Stateless
+public class MyBean implements MyInterface {
+
+    @PersistenceUnit(unitName = "bar-unit")
+    private EntityManagerFactory myBarEntityManagerFactory;
+
+    public void someBusinessMethod() throws Exception {
+        if (myBarEntityManagerFactory == null) throw new NullPointerException("myBarEntityManagerFactory not injected");
+
+        // Both can be looked up from JNDI as well
+        InitialContext unit = new InitialContext();
+        EntityManagerFactory barEntityManagerFactory = (EntityManagerFactory) context.lookup("java:comp/env/org.superbiz.MyBean/myBarEntityManagerFactory");
+    }
+}
+{code}
+
+h2. Via xml
+
+The above @PersistenceUnit annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref>
+    <persistence-unit-ref-name>org.superbiz.calculator.MyBean/myBarEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>bar-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+    <injection-target>
+        <injection-target-class>org.superbiz.calculator.MyBean</injection-target-class>
+        <injection-target-name>myBarEntityManagerFactory</injection-target-name>
+    </injection-target>
+</persistence-unit-ref>
+{code}
+
+
+h1. Lookup only
+
+h2.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz;
+
+import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
+import javax.ejb.Stateless;
+import javax.naming.InitialUnit;
+
+@Stateless
+@PersistenceUnit(name = "myFooEntityManagerFactory", unitName = "foo-unit")
+public class MyBean implements MyInterface {
+
+    public void someBusinessMethod() throws Exception {
+        InitialContext context = new InitialContext();
+        EntityManagerFactory fooEntityManagerFactory = (EntityManagerFactory) context.lookup("java:comp/env/myFooEntityManagerFactory");
+    }
+}
+{code}
+
+h1. Via xml
+
+The above @PersistenceUnit annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref>
+    <persistence-unit-ref-name>myFooEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>foo-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+</persistence-unit-ref>
+{code}
+

Propchange: openejb/site/trunk/content/persistence-unit-ref.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/persistence-unit-ref.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/persistence-unit-ref.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/persistence-unit-ref.mdtext (added)
+++ openejb/site/trunk/content/persistence-unit-ref.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,100 @@
+Title: persistence-unit-ref
+Both lookup and injection of an EntityManagerFactory can be configured via
+the @PersistenceUnit annotation or <persistence-unit-ref> in xml. 
+Annotations and xml have equal function in both lookup and injection.
+
+<a name="persistence-unit-ref-InjectionandLookup"></a>
+#  Injection and Lookup
+
+<a name="persistence-unit-ref-Viaannotation"></a>
+##  Via annotation
+
+<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>Usable by EJB, Interceptor, Servlet, Filter, or Listener</B></DIV><DIV class="codeContent panelContent">
+    package org.superbiz;
+    
+    import javax.persistence.PersistenceUnit;
+    import javax.persistence.EntityManagerFactory;
+    import javax.ejb.Stateless;
+    import javax.naming.InitialUnit;
+    
+    @Stateless
+    public class MyBean implements MyInterface {
+    
+        @PersistenceUnit(unitName = "bar-unit")
+        private EntityManagerFactory myBarEntityManagerFactory;
+    
+        public void someBusinessMethod() throws Exception {
+    	if (myBarEntityManagerFactory == null) throw new
+NullPointerException("myBarEntityManagerFactory not injected");
+    
+    	// Both can be looked up from JNDI as well
+    	InitialContext unit = new InitialContext();
+    	EntityManagerFactory barEntityManagerFactory =
+(EntityManagerFactory)
+context.lookup("java:comp/env/org.superbiz.MyBean/myBarEntityManagerFactory");
+        }
+    }
+
+
+<a name="persistence-unit-ref-Viaxml"></a>
+## Via xml
+
+The above @PersistenceUnit annotation usage is 100% equivalent to the
+following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref>
+   
+<persistence-unit-ref-name>org.superbiz.calculator.MyBean/myBarEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>bar-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+    <injection-target>
+       
+<injection-target-class>org.superbiz.calculator.MyBean</injection-target-class>
+       
+<injection-target-name>myBarEntityManagerFactory</injection-target-name>
+    </injection-target>
+</persistence-unit-ref>
+
+    
+    
+    h1. Lookup only
+    
+    h2.  Via annotation
+    
+    {code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+    package org.superbiz;
+    
+    import javax.persistence.PersistenceUnit;
+    import javax.persistence.EntityManagerFactory;
+    import javax.ejb.Stateless;
+    import javax.naming.InitialUnit;
+    
+    @Stateless
+    @PersistenceUnit(name = "myFooEntityManagerFactory", unitName = "foo-unit")
+    public class MyBean implements MyInterface {
+    
+        public void someBusinessMethod() throws Exception {
+    	InitialContext context = new InitialContext();
+    	EntityManagerFactory fooEntityManagerFactory =
+(EntityManagerFactory)
+context.lookup("java:comp/env/myFooEntityManagerFactory");
+        }
+    }
+
+
+<a name="persistence-unit-ref-Viaxml"></a>
+# Via xml
+
+The above @PersistenceUnit annotation usage is 100% equivalent to the
+following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<persistence-unit-ref>
+   
+<persistence-unit-ref-name>myFooEntityManagerFactory</persistence-unit-ref-name>
+    <persistence-unit-name>foo-unit</persistence-unit-name>
+    <persistence-unit-type>Transaction</persistence-unit-type>
+</persistence-unit-ref>
+
+    

Added: openejb/site/trunk/content/properties-tool.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/properties-tool.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/properties-tool.cwiki (added)
+++ openejb/site/trunk/content/properties-tool.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,194 @@
+h1. Properties Command line Tool
+
+To see all configurable properties in use by OpenEJB, using the following tool against a running server:
+
+{quote}
+./bin/openejb properties
+{quote}
+
+The output of this tool takes all overrideable components OpenEJB sees and outputs their properties along with the current value.  This allows you to easily see what is running in your system, what properties are available for overriding, and what exact values are for each component.  OpenEJB has a number of flags that can be passed to it not associated with any particular component, these are output as well.
+
+Content from this file can be safely copied as-is into the conf/system.properties file or sent to the users list with bug reports.  These properties may also be applied back into the openejb.xml file by pasting the properties without the "<id>." prefix into the respective component declarations.  The only warning is that any properties of type "<id>.password" will have their values masked, so make sure you edit them if you reapply them back into conf/openejb.xml or conf/system.properties.
+
+h1. Property Overriding
+
+Any component configured in OpenEJB via the openejb.xml (and some that aren't) can be overridden using system properties.  The format is:
+
+<id>.<property-name>=<property-value>
+
+And this can be done on the command line as follows:
+
+./bin/openejb -D<id>.<property-name>=<property-value> ...
+
+Or by adding the property to the conf/system.properties file.  Note that command line overrides win over overrides in the
+conf/system.properties file.
+
+In an embedded environment, the properties can be added to the Hashtable passed into the javax.naming.InitialContext when using the LocalInitialContextFactory or also to the System.getProperties() object before OpenEJB is embedded (which will be when the first InitialContext is created).
+
+At startup, OpenEJB will find the component with the given id and apply the new property value before constructing the individual component.
+
+h1. Example output
+
+{code:none}
+# Container(id=Default CMP Container)
+# className: org.apache.openejb.core.cmp.CmpContainer
+# 
+Default\ CMP\ Container.CmpEngineFactory=org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+Default\ CMP\ Container.Engine=instantdb
+Default\ CMP\ Container.ConnectorName=Default JDBC Database
+
+# Container(id=Default BMP Container)
+# className: org.apache.openejb.core.entity.EntityContainer
+# 
+Default\ BMP\ Container.PoolSize=10
+
+# Container(id=Default Stateful Container)
+# className: org.apache.openejb.core.stateful.StatefulContainer
+# 
+Default\ Stateful\ Container.BulkPassivate=50
+Default\ Stateful\ Container.Passivator=org.apache.openejb.core.stateful.SimplePassivater
+Default\ Stateful\ Container.TimeOut=20
+Default\ Stateful\ Container.PoolSize=500
+
+# Container(id=Default Stateless Container)
+# className: org.apache.openejb.core.stateless.StatelessContainer
+# 
+Default\ Stateless\ Container.PoolSize=10
+Default\ Stateless\ Container.StrictPooling=true
+Default\ Stateless\ Container.TimeOut=0
+
+# Container(id=Default MDB Container)
+# className: org.apache.openejb.core.mdb.MdbContainer
+# 
+Default\ MDB\ Container.ResourceAdapter=Default JMS Resource Adapter
+Default\ MDB\ Container.InstanceLimit=10
+Default\ MDB\ Container.MessageListenerInterface=javax.jms.MessageListener
+Default\ MDB\ Container.ActivationSpecClass=org.apache.activemq.ra.ActiveMQActivationSpec
+
+# ConnectionManager(id=Default Local TX ConnectionManager)
+# className: org.apache.openejb.resource.SharedLocalConnectionManager
+# 
+
+# Resource(id=Default JMS Resource Adapter)
+# className: org.apache.activemq.ra.ActiveMQResourceAdapter
+# 
+Default\ JMS\ Resource\ Adapter.ServerUrl=vm\://localhost?async\=true
+Default\ JMS\ Resource\ Adapter.BrokerXmlConfig=broker\:(tcp\://localhost\:61616)
+Default\ JMS\ Resource\ Adapter.ThreadPoolSize=30
+
+# Resource(id=Default JDBC Database)
+# className: org.apache.openejb.resource.jdbc.BasicManagedDataSource
+# 
+Default\ JDBC\ Database.MinIdle=0
+Default\ JDBC\ Database.Password=xxxx
+Default\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ JDBC\ Database.MaxIdle=20
+Default\ JDBC\ Database.ConnectionProperties=
+Default\ JDBC\ Database.MaxWait=-1
+Default\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ JDBC\ Database.MaxActive=20
+Default\ JDBC\ Database.DefaultAutoCommit=true
+Default\ JDBC\ Database.AccessToUnderlyingConnectionAllowed=false
+Default\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ JDBC\ Database.TestWhileIdle=false
+Default\ JDBC\ Database.UserName=sa
+Default\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ JDBC\ Database.TestOnBorrow=true
+Default\ JDBC\ Database.PoolPreparedStatements=false
+Default\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ JDBC\ Database.TestOnReturn=false
+Default\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ JDBC\ Database.InitialSize=0
+
+# Resource(id=Default Unmanaged JDBC Database)
+# className: org.apache.openejb.resource.jdbc.BasicDataSource
+# 
+Default\ Unmanaged\ JDBC\ Database.MaxWait=-1
+Default\ Unmanaged\ JDBC\ Database.InitialSize=0
+Default\ Unmanaged\ JDBC\ Database.DefaultAutoCommit=true
+Default\ Unmanaged\ JDBC\ Database.ConnectionProperties=
+Default\ Unmanaged\ JDBC\ Database.MaxActive=10
+Default\ Unmanaged\ JDBC\ Database.TestOnBorrow=true
+Default\ Unmanaged\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ Unmanaged\ JDBC\ Database.TestOnReturn=false
+Default\ Unmanaged\ JDBC\ Database.AccessToUnderlyingConnectionAllowed=false
+Default\ Unmanaged\ JDBC\ Database.Password=xxxx
+Default\ Unmanaged\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ Unmanaged\ JDBC\ Database.PoolPreparedStatements=false
+Default\ Unmanaged\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ Unmanaged\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ Unmanaged\ JDBC\ Database.MinIdle=0
+Default\ Unmanaged\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ Unmanaged\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ Unmanaged\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ Unmanaged\ JDBC\ Database.UserName=sa
+Default\ Unmanaged\ JDBC\ Database.MaxIdle=10
+Default\ Unmanaged\ JDBC\ Database.TestWhileIdle=false
+
+# Resource(id=Default JMS Connection Factory)
+# className: org.apache.activemq.ra.ActiveMQManagedConnectionFactory
+# 
+Default\ JMS\ Connection\ Factory.ConnectionInterface=javax.jms.ConnectionFactory, \
+javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory
+Default\ JMS\ Connection\ Factory.ResourceAdapter=Default JMS Resource Adapter
+
+# SecurityService(id=Default Security Service)
+# className: org.apache.openejb.core.security.SecurityServiceImpl
+# 
+
+# TransactionManager(id=Default Transaction Manager)
+# className: org.apache.geronimo.transaction.manager.GeronimoTransactionManager
+# 
+
+# ServerService(id=httpejbd)
+# className: org.apache.openejb.server.httpd.HttpEjbServer
+# 
+httpejbd.port=4204
+httpejbd.name=httpejbd
+httpejbd.disabled=false
+httpejbd.server=org.apache.openejb.server.httpd.HttpEjbServer
+httpejbd.threads=200
+httpejbd.bind=127.0.0.1
+
+# ServerService(id=telnet)
+# className: org.apache.openejb.server.telnet.TelnetServer
+# 
+telnet.port=4202
+telnet.name=telnet
+telnet.disabled=false
+telnet.bind=127.0.0.1
+telnet.threads=5
+telnet.server=org.apache.openejb.server.telnet.TelnetServer
+
+# ServerService(id=ejbd)
+# className: org.apache.openejb.server.ejbd.EjbServer
+# 
+ejbd.disabled=false
+ejbd.bind=127.0.0.1
+ejbd.server=org.apache.openejb.server.ejbd.EjbServer
+ejbd.port=4201
+ejbd.name=ejbd
+ejbd.threads=200
+
+# ServerService(id=hsql)
+# className: org.apache.openejb.server.hsql.HsqlService
+# 
+hsql.port=9001
+hsql.name=hsql
+hsql.disabled=false
+hsql.server=org.apache.openejb.server.hsql.HsqlService
+hsql.bind=127.0.0.1
+
+# ServerService(id=admin)
+# className: org.apache.openejb.server.admin.AdminDaemon
+# 
+admin.disabled=false
+admin.bind=127.0.0.1
+admin.only_from=localhost
+admin.port=4200
+admin.threads=1
+admin.name=admin
+admin.server=org.apache.openejb.server.admin.AdminDaemon
+{code}
+

Propchange: openejb/site/trunk/content/properties-tool.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/properties-tool.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/properties-tool.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/properties-tool.mdtext (added)
+++ openejb/site/trunk/content/properties-tool.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,208 @@
+Title: Properties Tool
+<a name="PropertiesTool-PropertiesCommandlineTool"></a>
+# Properties Command line Tool
+
+To see all configurable properties in use by OpenEJB, using the following
+tool against a running server:
+
+{quote}
+./bin/openejb properties
+{quote}
+
+The output of this tool takes all overrideable components OpenEJB sees and
+outputs their properties along with the current value.	This allows you to
+easily see what is running in your system, what properties are available
+for overriding, and what exact values are for each component.  OpenEJB has
+a number of flags that can be passed to it not associated with any
+particular component, these are output as well.
+
+Content from this file can be safely copied as-is into the
+conf/system.properties file or sent to the users list with bug reports. 
+These properties may also be applied back into the openejb.xml file by
+pasting the properties without the "<id>." prefix into the respective
+component declarations.  The only warning is that any properties of type
+"<id>.password" will have their values masked, so make sure you edit them
+if you reapply them back into conf/openejb.xml or conf/system.properties.
+
+<a name="PropertiesTool-PropertyOverriding"></a>
+# Property Overriding
+
+Any component configured in OpenEJB via the openejb.xml (and some that
+aren't) can be overridden using system properties.  The format is:
+
+<id>.<property-name>=<property-value>
+
+And this can be done on the command line as follows:
+
+./bin/openejb -D<id>.<property-name>=<property-value> ...
+
+Or by adding the property to the conf/system.properties file.  Note that
+command line overrides win over overrides in the
+conf/system.properties file.
+
+In an embedded environment, the properties can be added to the Hashtable
+passed into the javax.naming.InitialContext when using the
+LocalInitialContextFactory or also to the System.getProperties() object
+before OpenEJB is embedded (which will be when the first InitialContext is
+created).
+
+At startup, OpenEJB will find the component with the given id and apply the
+new property value before constructing the individual component.
+
+<a name="PropertiesTool-Exampleoutput"></a>
+# Example output
+
+{code:none}
+1. Container(id=Default CMP Container)
+1. className: org.apache.openejb.core.cmp.CmpContainer
+1. Default\ CMP\
+Container.CmpEngineFactory=org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+Default\ CMP\ Container.Engine=instantdb
+Default\ CMP\ Container.ConnectorName=Default JDBC Database
+
+1. Container(id=Default BMP Container)
+1. className: org.apache.openejb.core.entity.EntityContainer
+1. Default\ BMP\ Container.PoolSize=10
+
+1. Container(id=Default Stateful Container)
+1. className: org.apache.openejb.core.stateful.StatefulContainer
+1. Default\ Stateful\ Container.BulkPassivate=50
+Default\ Stateful\
+Container.Passivator=org.apache.openejb.core.stateful.SimplePassivater
+Default\ Stateful\ Container.TimeOut=20
+Default\ Stateful\ Container.PoolSize=500
+
+1. Container(id=Default Stateless Container)
+1. className: org.apache.openejb.core.stateless.StatelessContainer
+1. Default\ Stateless\ Container.PoolSize=10
+Default\ Stateless\ Container.StrictPooling=true
+Default\ Stateless\ Container.TimeOut=0
+
+1. Container(id=Default MDB Container)
+1. className: org.apache.openejb.core.mdb.MdbContainer
+1. Default\ MDB\ Container.ResourceAdapter=Default JMS Resource Adapter
+Default\ MDB\ Container.InstanceLimit=10
+Default\ MDB\ Container.MessageListenerInterface=javax.jms.MessageListener
+Default\ MDB\
+Container.ActivationSpecClass=org.apache.activemq.ra.ActiveMQActivationSpec
+
+1. ConnectionManager(id=Default Local TX ConnectionManager)
+1. className: org.apache.openejb.resource.SharedLocalConnectionManager
+1. 
+1. Resource(id=Default JMS Resource Adapter)
+1. className: org.apache.activemq.ra.ActiveMQResourceAdapter
+1. Default\ JMS\ Resource\ Adapter.ServerUrl=vm\://localhost?async\=true
+Default\ JMS\ Resource\
+Adapter.BrokerXmlConfig=broker\:(tcp\://localhost\:61616)
+Default\ JMS\ Resource\ Adapter.ThreadPoolSize=30
+
+1. Resource(id=Default JDBC Database)
+1. className: org.apache.openejb.resource.jdbc.BasicManagedDataSource
+1. Default\ JDBC\ Database.MinIdle=0
+Default\ JDBC\ Database.Password=xxxx
+Default\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ JDBC\ Database.MaxIdle=20
+Default\ JDBC\ Database.ConnectionProperties=
+Default\ JDBC\ Database.MaxWait=-1
+Default\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ JDBC\ Database.MaxActive=20
+Default\ JDBC\ Database.DefaultAutoCommit=true
+Default\ JDBC\ Database.AccessToUnderlyingConnectionAllowed=false
+Default\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ JDBC\ Database.TestWhileIdle=false
+Default\ JDBC\ Database.UserName=sa
+Default\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ JDBC\ Database.TestOnBorrow=true
+Default\ JDBC\ Database.PoolPreparedStatements=false
+Default\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ JDBC\ Database.TestOnReturn=false
+Default\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ JDBC\ Database.InitialSize=0
+
+1. Resource(id=Default Unmanaged JDBC Database)
+1. className: org.apache.openejb.resource.jdbc.BasicDataSource
+1. Default\ Unmanaged\ JDBC\ Database.MaxWait=-1
+Default\ Unmanaged\ JDBC\ Database.InitialSize=0
+Default\ Unmanaged\ JDBC\ Database.DefaultAutoCommit=true
+Default\ Unmanaged\ JDBC\ Database.ConnectionProperties=
+Default\ Unmanaged\ JDBC\ Database.MaxActive=10
+Default\ Unmanaged\ JDBC\ Database.TestOnBorrow=true
+Default\ Unmanaged\ JDBC\ Database.JdbcUrl=jdbc\:hsqldb\:file\:hsqldb
+Default\ Unmanaged\ JDBC\ Database.TestOnReturn=false
+Default\ Unmanaged\ JDBC\
+Database.AccessToUnderlyingConnectionAllowed=false
+Default\ Unmanaged\ JDBC\ Database.Password=xxxx
+Default\ Unmanaged\ JDBC\ Database.MinEvictableIdleTimeMillis=1800000
+Default\ Unmanaged\ JDBC\ Database.PoolPreparedStatements=false
+Default\ Unmanaged\ JDBC\ Database.MaxOpenPreparedStatements=0
+Default\ Unmanaged\ JDBC\ Database.ConnectionInterface=javax.sql.DataSource
+Default\ Unmanaged\ JDBC\ Database.MinIdle=0
+Default\ Unmanaged\ JDBC\ Database.NumTestsPerEvictionRun=3
+Default\ Unmanaged\ JDBC\ Database.TimeBetweenEvictionRunsMillis=-1
+Default\ Unmanaged\ JDBC\ Database.JdbcDriver=org.hsqldb.jdbcDriver
+Default\ Unmanaged\ JDBC\ Database.UserName=sa
+Default\ Unmanaged\ JDBC\ Database.MaxIdle=10
+Default\ Unmanaged\ JDBC\ Database.TestWhileIdle=false
+
+1. Resource(id=Default JMS Connection Factory)
+1. className: org.apache.activemq.ra.ActiveMQManagedConnectionFactory
+1. Default\ JMS\ Connection\
+Factory.ConnectionInterface=javax.jms.ConnectionFactory, \
+javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory
+Default\ JMS\ Connection\ Factory.ResourceAdapter=Default JMS Resource
+Adapter
+
+1. SecurityService(id=Default Security Service)
+1. className: org.apache.openejb.core.security.SecurityServiceImpl
+1. 
+1. TransactionManager(id=Default Transaction Manager)
+1. className:
+org.apache.geronimo.transaction.manager.GeronimoTransactionManager
+1. 
+1. ServerService(id=httpejbd)
+1. className: org.apache.openejb.server.httpd.HttpEjbServer
+1. httpejbd.port=4204
+httpejbd.name=httpejbd
+httpejbd.disabled=false
+httpejbd.server=org.apache.openejb.server.httpd.HttpEjbServer
+httpejbd.threads=200
+httpejbd.bind=127.0.0.1
+
+1. ServerService(id=telnet)
+1. className: org.apache.openejb.server.telnet.TelnetServer
+1. telnet.port=4202
+telnet.name=telnet
+telnet.disabled=false
+telnet.bind=127.0.0.1
+telnet.threads=5
+telnet.server=org.apache.openejb.server.telnet.TelnetServer
+
+1. ServerService(id=ejbd)
+1. className: org.apache.openejb.server.ejbd.EjbServer
+1. ejbd.disabled=false
+ejbd.bind=127.0.0.1
+ejbd.server=org.apache.openejb.server.ejbd.EjbServer
+ejbd.port=4201
+ejbd.name=ejbd
+ejbd.threads=200
+
+1. ServerService(id=hsql)
+1. className: org.apache.openejb.server.hsql.HsqlService
+1. hsql.port=9001
+hsql.name=hsql
+hsql.disabled=false
+hsql.server=org.apache.openejb.server.hsql.HsqlService
+hsql.bind=127.0.0.1
+
+1. ServerService(id=admin)
+1. className: org.apache.openejb.server.admin.AdminDaemon
+1. admin.disabled=false
+admin.bind=127.0.0.1
+admin.only_from=localhost
+admin.port=4200
+admin.threads=1
+admin.name=admin
+admin.server=org.apache.openejb.server.admin.AdminDaemon
+
+    

Added: openejb/site/trunk/content/property-overriding.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/property-overriding.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/property-overriding.cwiki (added)
+++ openejb/site/trunk/content/property-overriding.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,29 @@
+OpenEJB consists of several components (containers, resource adapters, security services, etc.) all of which are pluggable and have their own unique set of configurable properties.  These components are required to specify their default property values in their service-jar.xml file.  This means that at a minimum you as a user only need to specify what you'd like to be different.  You specify the property name and the new value and the default value will be overwritten before the component is created.
+
+We call this overriding and there are several ways to do it.
+
+h1.  The openejb.xml
+
+The default openejb.xml file has most of the useful properties for each component explicitly listed with default values for documentation purposes.  It is safe to delete them and be assured that no behavior will change if a smaller config file is desired.
+
+
+Overriding can also be done via the command line or plain Java system properties.  See [System Properties] for details.
+
+h2. What properties are available?
+    
+To know what properties can be overriden the './bin/openejb properties' command is very useful: see [Properties Tool]
+    
+It's function is to connect to a running server and print a canonical list of all properties OpenEJB can see via the various means of configuration.  When sending requests for help to the users list or jira, it is highly encouraged to send the output of this tool with your message.
+
+h2. Not configurable via openejb.xml
+    
+The only thing not yet configurable via this file are ServerServices due to OpenEJB's embeddable nature and resulting long standing tradition of keeping the container system separate from the server layer.  This may change someday, but untill then ServerServices are configurable via conf/<service-id>.properties files such as conf/ejbd.properties to configure the main protocol that services EJB client requests.
+
+The format those properties files is greatly adapted from the xinet.d style of configuration and even shares similar functionality and properties such as host-based authorization (HBA) via the 'only_from' property.
+
+h2. Restoring openejb.xml to the defaults
+
+To restore this file to its original default state, you can simply delete it or rename it and OpenEJB will see it's missing and unpack another openejb.xml into the conf/ directory when it starts.
+
+This is not only handy for recovering from a non-functional config, but also for upgrading as OpenEJB will not overwrite your existing configuration file should you choose to unpack an new distro over the top of an old one -- this style of upgrade is safe provided you move your old lib/ directory first.
+

Propchange: openejb/site/trunk/content/property-overriding.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/property-overriding.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/property-overriding.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/property-overriding.mdtext (added)
+++ openejb/site/trunk/content/property-overriding.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,62 @@
+Title: Property Overriding
+OpenEJB consists of several components (containers, resource adapters,
+security services, etc.) all of which are pluggable and have their own
+unique set of configurable properties.	These components are required to
+specify their default property values in their service-jar.xml file.  This
+means that at a minimum you as a user only need to specify what you'd like
+to be different.  You specify the property name and the new value and the
+default value will be overwritten before the component is created.
+
+We call this overriding and there are several ways to do it.
+
+<a name="PropertyOverriding-Theopenejb.xml"></a>
+#  The openejb.xml
+
+The default openejb.xml file has most of the useful properties for each
+component explicitly listed with default values for documentation purposes.
+ It is safe to delete them and be assured that no behavior will change if a
+smaller config file is desired.
+
+
+Overriding can also be done via the command line or plain Java system
+properties.  See [System Properties](system-properties.html)
+ for details.
+
+<a name="PropertyOverriding-Whatpropertiesareavailable?"></a>
+## What properties are available?
+    
+To know what properties can be overriden the './bin/openejb properties'
+command is very useful: see [Properties Tool](properties-tool.html)
+    
+It's function is to connect to a running server and print a canonical list
+of all properties OpenEJB can see via the various means of configuration. 
+When sending requests for help to the users list or jira, it is highly
+encouraged to send the output of this tool with your message.
+
+<a name="PropertyOverriding-Notconfigurableviaopenejb.xml"></a>
+## Not configurable via openejb.xml
+    
+The only thing not yet configurable via this file are ServerServices due to
+OpenEJB's embeddable nature and resulting long standing tradition of
+keeping the container system separate from the server layer.  This may
+change someday, but untill then ServerServices are configurable via
+conf/<service-id>.properties files such as conf/ejbd.properties to
+configure the main protocol that services EJB client requests.
+
+The format those properties files is greatly adapted from the xinet.d style
+of configuration and even shares similar functionality and properties such
+as host-based authorization (HBA) via the 'only_from' property.
+
+<a name="PropertyOverriding-Restoringopenejb.xmltothedefaults"></a>
+## Restoring openejb.xml to the defaults
+
+To restore this file to its original default state, you can simply delete
+it or rename it and OpenEJB will see it's missing and unpack another
+openejb.xml into the conf/ directory when it starts.
+
+This is not only handy for recovering from a non-functional config, but
+also for upgrading as OpenEJB will not overwrite your existing
+configuration file should you choose to unpack an new distro over the top
+of an old one -- this style of upgrade is safe provided you move your old
+lib/ directory first.
+

Modified: openejb/site/trunk/content/quicklinks.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/quicklinks.cwiki?rev=1144778&r1=1144777&r2=1144778&view=diff
==============================================================================
--- openejb/site/trunk/content/quicklinks.cwiki (original)
+++ openejb/site/trunk/content/quicklinks.cwiki Sun Jul 10 05:36:12 2011
@@ -1 +1 @@
-[Home|Index] | [News] | [FAQ] | [Download] | [Lists|Mailing Lists] | {link:Issues|http://issues.apache.org/jira/browse/OPENEJB}
\ No newline at end of file
+[Home|OPENEJB:Index] | [Download|OPENEJB:Download] | [Lists|OPENEJB:Mailing Lists] | {link:Issues|http://issues.apache.org/jira/browse/OPENEJB}
\ No newline at end of file

Modified: openejb/site/trunk/content/quicklinks.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/quicklinks.mdtext?rev=1144778&r1=1144777&r2=1144778&view=diff
==============================================================================
--- openejb/site/trunk/content/quicklinks.mdtext (original)
+++ openejb/site/trunk/content/quicklinks.mdtext Sun Jul 10 05:36:12 2011
@@ -1,7 +1,5 @@
 Title: QuickLinks
-[Home](index.html)
- | [News]
- | [FAQ]
- | [Download]
- | [Lists|Mailing Lists]
+[Home](openejb:index.html)
+ | [Download|OPENEJB:Download]
+ | [Lists|OPENEJB:Mailing Lists]
  | {link:Issues|http://issues.apache.org/jira/browse/OPENEJB}

Added: openejb/site/trunk/content/resource-injection.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/resource-injection.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/resource-injection.cwiki (added)
+++ openejb/site/trunk/content/resource-injection.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,157 @@
+h1. Overview
+
+This example demonstrates the use of the injection of environment entries using *@Resource* annotation.
+
+The EJB 3.0 specification (*EJB Core Contracts and Requirements*) section 16.2.2 reads:
+
+_A field or method of a bean class may be annotated to request that an entry from the bean's environment be injected. Any of the types of resources or other environment entries[88] described in this chapter may be injected. Injection may also be requested using entries in the deployment descriptor corresponding to each of these resource types._
+
+_Environment entries may also be injected into the bean through bean methods that follow the naming conventions for JavaBeans properties. The annotation is applied to the set method for the property, which is the method that is called to inject the environment entry. The JavaBeans property name (not the method name) is used as the default JNDI name._
+
+The *PurchaseOrderBean* class shows use of field-level *@Resource* annotation.
+
+The *InvoiceBean* class shows the use of method-level *@Resource* annotation.
+
+The source for this example can be checked out from svn:
+
+ $ svn co http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/injection-of-env-entry
+
+To run it change your working directory to the directory *injection-of-env-entry* and run the following maven2 commands:
+
+$ cd injection-of-env-entry
+
+$ mvn clean install
+
+h1. The Code
+
+h2. Injection through field (field-level injection)
+
+The *maxLineItem* field in *PurchaseOrderBean* class is annotated with *@Resource* annotation to inform the EJB container _the place_ where in the code the injection of a simple environment entry should take place. The default value of 10 is assigned. Deployer can modify the value of the environment entries at deployment time using deployment descriptor (ejb-jar.xml).
+
+h4. @Resource annotation of a field
+
+{code}
+@Resource
+int maxLineItems = 10;
+{code}
+
+h2. Injection through a setter method (method-level injection)
+
+The *setMaxLineItem* method in *InvoiceBean* class is annotated with *@Resource* annotation to inject the simple environment entry. Only setters can be used as a way to inject environment entry values. 
+
+You could look up the env-entry using JNDI lookup() method and the following name:
+
+ * java:comp/env/org.apache.openejb.examples.resource.InvoiceBean/maxLineItems
+
+The pattern is to combine the fully-qualified class name and the name of a instance field (or a name of the setter method without _set_ prefix and the first letter lowercased).
+
+h4. @Resource annotation of a setter method
+
+{code} 
+@Resource
+public void setMaxLineItems(int maxLineItems) {
+    this.maxLineItems = maxLineItems;
+}
+{code} 
+
+h4. env-entry in ejb-jar.xml
+{code:xml}
+<env-entry>
+     <description>The maximum number of line items per invoice.</description>
+     <env-entry-name>org.apache.openejb.examples.injection.InvoiceBean/maxLineItems</env-entry-name>
+     <env-entry-type>java.lang.Integer</env-entry-type>
+     <env-entry-value>15</env-entry-value>
+</env-entry>
+{code}
+
+h4. Using @Resource annotated env-entry
+
+{tip:title=Using @Resource annotated env-entry}
+*maxLineItems* variable is injected by the *setMaxLine* method above. See also how env-entry is defined in ejb-jar.xml
+{tip}
+{code}
+public void addLineItem(LineItem item) throws TooManyItemsException {
+   if (item == null) {
+      throw new IllegalArgumentException("Line item must not be null");
+   }
+
+   if (itemCount <= maxLineItems) {
+      items.add(item);
+      itemCount++;
+   } else {
+      throw new TooManyItemsException("Number of items exceeded the maximum limit");
+   }
+}
+{code}
+
+h1. JUnit Test
+
+Writing an JUnit test for this example is quite simple. We need just to write a setup method to create and initialize the InitialContext, and then write our test methods.
+
+h4. Test fixture
+
+{code}
+protected void setUp() throws Exception {
+    Properties properties = new Properties();
+    properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
+    properties.setProperty("openejb.deployments.classpath.include", ".*resource-injection.*");
+    initialContext = new InitialContext(properties);
+}
+{code}
+
+h4. Test methods
+{code}
+public void testAddLineItem() throws Exception {
+    Invoice order = (Invoice) initialContext.lookup("InvoiceBeanBusinessRemote");
+    assertNotNull(order);
+    LineItem item = new LineItem("ABC-1", "Test Item");
+
+    try {
+        order.addLineItem(item);
+    } catch (TooManyItemsException tmie) {
+        fail("Test failed due to: " + tmie.getMessage());
+    }
+}
+{code}
+
+h1. Running
+
+Running the example is fairly simple. Just execute the following commands:
+
+$ cd injection-of-env-entry
+$ mvn clean test
+
+{noformat}
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running org.superbiz.injection.PurchaseOrderBeanTest
+Apache OpenEJB 3.0.0-SNAPSHOT    build: 20071218-01:41
+http://openejb.apache.org/
+INFO - openejb.home = c:\oss\openejb3\examples\injection-of-env-entry
+INFO - openejb.base = c:\oss\openejb3\examples\injection-of-env-entry
+WARN - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+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: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Configuring app: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container)
+INFO - Auto-creating a container for bean InvoiceBean: Container(type=STATEFUL, id=Default Stateful Container)
+INFO - Loaded Module: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Assembling app: c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+INFO - Jndi(name=InvoiceBeanRemote) --> Ejb(deployment-id=InvoiceBean)
+INFO - Jndi(name=PurchaseOrderBeanRemote) --> Ejb(deployment-id=PurchaseOrderBean)
+INFO - Created Ejb(deployment-id=InvoiceBean, ejb-name=InvoiceBean, container=Default Stateful Container)
+INFO - Created Ejb(deployment-id=PurchaseOrderBean, ejb-name=PurchaseOrderBean, container=Default Stateful Container)
+INFO - Deployed Application(path=c:\oss\openejb3\examples\injection-of-env-entry\target\classes)
+INFO - OpenEJB ready.
+OpenEJB ready.
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.859 sec
+Running org.superbiz.injection.InvoiceBeanTest
+Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
+
+Results :
+
+Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
+{noformat}

Propchange: openejb/site/trunk/content/resource-injection.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/resource-injection.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/resource-injection.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/resource-injection.mdtext (added)
+++ openejb/site/trunk/content/resource-injection.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,217 @@
+Title: Resource Injection
+<a name="ResourceInjection-Overview"></a>
+# Overview
+
+This example demonstrates the use of the injection of environment entries
+using *@Resource* annotation.
+
+The EJB 3.0 specification (*EJB Core Contracts and Requirements*) section
+16.2.2 reads:
+
+_A field or method of a bean class may be annotated to request that an entry from the bean's environment be injected. Any of the types of resources or other environment entries[88](88.html)
+ described in this chapter may be injected. Injection may also be requested
+using entries in the deployment descriptor corresponding to each of these
+resource types._
+
+_Environment entries may also be injected into the bean through bean
+methods that follow the naming conventions for JavaBeans properties. The
+annotation is applied to the set method for the property, which is the
+method that is called to inject the environment entry. The JavaBeans
+property name (not the method name) is used as the default JNDI name._
+
+The *PurchaseOrderBean* class shows use of field-level *@Resource*
+annotation.
+
+The *InvoiceBean* class shows the use of method-level *@Resource*
+annotation.
+
+The source for this example can be checked out from svn:
+
+ $ svn co
+http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/injection-of-env-entry
+
+To run it change your working directory to the directory
+*injection-of-env-entry* and run the following maven2 commands:
+
+$ cd injection-of-env-entry
+
+$ mvn clean install
+
+<a name="ResourceInjection-TheCode"></a>
+# The Code
+
+<a name="ResourceInjection-Injectionthroughfield(field-levelinjection)"></a>
+## Injection through field (field-level injection)
+
+The *maxLineItem* field in *PurchaseOrderBean* class is annotated with
+*@Resource* annotation to inform the EJB container _the place_ where in the
+code the injection of a simple environment entry should take place. The
+default value of 10 is assigned. Deployer can modify the value of the
+environment entries at deployment time using deployment descriptor
+(ejb-jar.xml).
+
+<a name="ResourceInjection-@Resourceannotationofafield"></a>
+#### @Resource annotation of a field
+
+
+    @Resource
+    int maxLineItems = 10;
+
+
+<a name="ResourceInjection-Injectionthroughasettermethod(method-levelinjection)"></a>
+## Injection through a setter method (method-level injection)
+
+The *setMaxLineItem* method in *InvoiceBean* class is annotated with
+*@Resource* annotation to inject the simple environment entry. Only setters
+can be used as a way to inject environment entry values. 
+
+You could look up the env-entry using JNDI lookup() method and the
+following name:
+
+ *
+java:comp/env/org.apache.openejb.examples.resource.InvoiceBean/maxLineItems
+
+The pattern is to combine the fully-qualified class name and the name of a
+instance field (or a name of the setter method without _set_ prefix and the
+first letter lowercased).
+
+<a name="ResourceInjection-@Resourceannotationofasettermethod"></a>
+#### @Resource annotation of a setter method
+
+
+    @Resource
+    public void setMaxLineItems(int maxLineItems) {
+        this.maxLineItems = maxLineItems;
+    }
+
+
+<a name="ResourceInjection-env-entryinejb-jar.xml"></a>
+#### env-entry in ejb-jar.xml
+
+    <env-entry>
+         <description>The maximum number of line items per
+invoice.</description>
+        
+<env-entry-name>org.apache.openejb.examples.injection.InvoiceBean/maxLineItems</env-entry-name>
+         <env-entry-type>java.lang.Integer</env-entry-type>
+         <env-entry-value>15</env-entry-value>
+    </env-entry>
+
+
+<a name="ResourceInjection-Using@Resourceannotatedenv-entry"></a>
+#### Using @Resource annotated env-entry
+
+{tip:title=Using @Resource annotated env-entry}
+*maxLineItems* variable is injected by the *setMaxLine* method above. See
+also how env-entry is defined in ejb-jar.xml
+{tip}
+
+    public void addLineItem(LineItem item) throws TooManyItemsException {
+       if (item == null) {
+          throw new IllegalArgumentException("Line item must not be null");
+       }
+    
+       if (itemCount <= maxLineItems) {
+          items.add(item);
+          itemCount++;
+       } else {
+          throw new TooManyItemsException("Number of items exceeded the maximum
+limit");
+       }
+    }
+
+
+<a name="ResourceInjection-JUnitTest"></a>
+# JUnit Test
+
+Writing an JUnit test for this example is quite simple. We need just to
+write a setup method to create and initialize the InitialContext, and then
+write our test methods.
+
+<a name="ResourceInjection-Testfixture"></a>
+#### Test fixture
+
+
+    protected void setUp() throws Exception {
+        Properties properties = new Properties();
+        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+"org.apache.openejb.client.LocalInitialContextFactory");
+        properties.setProperty("openejb.deployments.classpath.include",
+".*resource-injection.*");
+        initialContext = new InitialContext(properties);
+    }
+
+
+<a name="ResourceInjection-Testmethods"></a>
+#### Test methods
+
+    public void testAddLineItem() throws Exception {
+        Invoice order = (Invoice)
+initialContext.lookup("InvoiceBeanBusinessRemote");
+        assertNotNull(order);
+        LineItem item = new LineItem("ABC-1", "Test Item");
+    
+        try {
+    	order.addLineItem(item);
+        } catch (TooManyItemsException tmie) {
+    	fail("Test failed due to: " + tmie.getMessage());
+        }
+    }
+
+
+<a name="ResourceInjection-Running"></a>
+# Running
+
+Running the example is fairly simple. Just execute the following commands:
+
+$ cd injection-of-env-entry
+$ mvn clean test
+
+
+    -------------------------------------------------------
+     T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.injection.PurchaseOrderBeanTest
+    Apache OpenEJB 3.0.0-SNAPSHOT	 build: 20071218-01:41
+    http://openejb.apache.org/
+    INFO - openejb.home = c:\oss\openejb3\examples\injection-of-env-entry
+    INFO - openejb.base = c:\oss\openejb3\examples\injection-of-env-entry
+    WARN - Cannot find the configuration file [conf/openejb.xml]
+.  Will attempt to create one for the beans deployed.
+    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:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Configuring app:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Configuring Service(id=Default Stateful Container, type=Container,
+provider-id=Default Stateful Container)
+    INFO - Auto-creating a container for bean InvoiceBean:
+Container(type=STATEFUL, id=Default Stateful Container)
+    INFO - Loaded Module:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Assembling app:
+c:\oss\openejb3\examples\injection-of-env-entry\target\classes
+    INFO - Jndi(name=InvoiceBeanRemote) --> Ejb(deployment-id=InvoiceBean)
+    INFO - Jndi(name=PurchaseOrderBeanRemote) -->
+Ejb(deployment-id=PurchaseOrderBean)
+    INFO - Created Ejb(deployment-id=InvoiceBean, ejb-name=InvoiceBean,
+container=Default Stateful Container)
+    INFO - Created Ejb(deployment-id=PurchaseOrderBean,
+ejb-name=PurchaseOrderBean, container=Default Stateful Container)
+    INFO - Deployed
+Application(path=c:\oss\openejb3\examples\injection-of-env-entry\target\classes)
+    INFO - OpenEJB ready.
+    OpenEJB ready.
+    Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.859 sec
+    Running org.superbiz.injection.InvoiceBeanTest
+    Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
+    
+    Results :
+    
+    Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
+

Added: openejb/site/trunk/content/resource-ref-for-datasource.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/resource-ref-for-datasource.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/resource-ref-for-datasource.cwiki (added)
+++ openejb/site/trunk/content/resource-ref-for-datasource.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,46 @@
+h1.  Via annotation
+
+{code:title=Usable by EJB, Interceptor, Servlet, Filter, or Listener}
+package org.superbiz.refs;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+@Stateless
+@Resource(name = "myFooDataSource", type = DataSource.class)
+public class MyDataSourceRefBean implements MyBeanInterface {
+
+    @Resource
+    private DataSource myBarDataSource;
+
+    public void someBusinessMethod() throws Exception {
+        if (myBarDataSource == null) throw new NullPointerException("myBarDataSource not injected");
+
+        // Both can be looked up from JNDI as well
+        InitialContext context = new InitialContext();
+        DataSource fooDataSource = (DataSource) context.lookup("java:comp/env/myFooDataSource");
+        DataSource barDataSource = (DataSource) context.lookup("java:comp/env/org.superbiz.refs.MyDataSourceRefBean/myBarDataSource");
+    }
+}
+{code}
+
+h1. Via xml
+
+The above @Resource annotation usage is 100% equivalent to the following xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<resource-ref>
+    <res-ref-name>myFooDataSource</res-ref-name>
+    <res-type>javax.sql.DataSource</res-type>
+</resource-ref>
+<resource-ref>
+    <res-ref-name>org.superbiz.refs.MyDataSourceRefBean/myBarDataSource</res-ref-name>
+    <res-type>javax.sql.DataSource</res-type>
+    <injection-target>
+        <injection-target-class>org.superbiz.refs.MyDataSourceRefBean</injection-target-class>
+        <injection-target-name>myBarDataSource</injection-target-name>
+    </injection-target>
+</resource-ref>
+{code}
\ No newline at end of file

Propchange: openejb/site/trunk/content/resource-ref-for-datasource.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/resource-ref-for-datasource.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/resource-ref-for-datasource.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/resource-ref-for-datasource.mdtext (added)
+++ openejb/site/trunk/content/resource-ref-for-datasource.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,55 @@
+Title: resource-ref for DataSource
+<a name="resource-refforDataSource-Viaannotation"></a>
+#  Via annotation
+
+<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>Usable by EJB, Interceptor, Servlet, Filter, or Listener</B></DIV><DIV class="codeContent panelContent">
+    package org.superbiz.refs;
+    
+    import javax.annotation.Resource;
+    import javax.ejb.Stateless;
+    import javax.naming.InitialContext;
+    import javax.sql.DataSource;
+    
+    @Stateless
+    @Resource(name = "myFooDataSource", type = DataSource.class)
+    public class MyDataSourceRefBean implements MyBeanInterface {
+    
+        @Resource
+        private DataSource myBarDataSource;
+    
+        public void someBusinessMethod() throws Exception {
+    	if (myBarDataSource == null) throw new
+NullPointerException("myBarDataSource not injected");
+    
+    	// Both can be looked up from JNDI as well
+    	InitialContext context = new InitialContext();
+    	DataSource fooDataSource = (DataSource)
+context.lookup("java:comp/env/myFooDataSource");
+    	DataSource barDataSource = (DataSource)
+context.lookup("java:comp/env/org.superbiz.refs.MyDataSourceRefBean/myBarDataSource");
+        }
+    }
+
+
+<a name="resource-refforDataSource-Viaxml"></a>
+# Via xml
+
+The above @Resource annotation usage is 100% equivalent to the following
+xml.
+
+{code:xml|title=ejb-jar.xml or web.xml}
+<resource-ref>
+    <res-ref-name>myFooDataSource</res-ref-name>
+    <res-type>javax.sql.DataSource</res-type>
+</resource-ref>
+<resource-ref>
+   
+<res-ref-name>org.superbiz.refs.MyDataSourceRefBean/myBarDataSource</res-ref-name>
+    <res-type>javax.sql.DataSource</res-type>
+    <injection-target>
+       
+<injection-target-class>org.superbiz.refs.MyDataSourceRefBean</injection-target-class>
+	<injection-target-name>myBarDataSource</injection-target-name>
+    </injection-target>
+</resource-ref>
+

Added: openejb/site/trunk/content/security-annotations.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/security-annotations.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/security-annotations.cwiki (added)
+++ openejb/site/trunk/content/security-annotations.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,265 @@
+This page shows the correct usage of the security related annotations:
+
+ - javax.annotation.security.RolesAllowed
+ - javax.annotation.security.PermitAll
+ - javax.annotation.security.DenyAll
+ - javax.annotation.security.RunAs
+ - javax.annotation.security.DeclareRoles
+
+h2. Basic idea
+
+- By default all methods of a business interface are accessible, logged in or not
+- The annotations go on the bean class, not the business interface
+- Security annotations can be applied to entire class and/or individual methods
+- The names of any security roles used must be declared via @DeclareRoles
+
+h2. No restrictions
+
+Allow anyone logged in or not to invoke 'svnCheckout'.
+
+These three examples are all equivalent.
+
+{code}
+@Stateless
+public class OpenSourceProjectBean implements Project {
+
+    public String svnCheckout(String s) {
+        return s;
+    }
+}
+{code}
+{code}
+@Stateless
+@PermitAll
+public class OpenSourceProjectBean implements Project {
+
+    public String svnCheckout(String s) {
+        return s;
+    }
+}
+{code}
+{code}
+@Stateless
+public class OpenSourceProjectBean implements Project {
+
+    @PermitAll
+    public String svnCheckout(String s) {
+        return s;
+    }
+}
+{code}
+
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+
+h2. Restricting a Method
+
+Restrict the 'svnCommit' method to only individuals logged in and part of the "committer" role.  Note that more than one role can be listed.
+
+{code}
+@Stateless
+@DeclareRoles({"committer"})
+public class OpenSourceProjectBean implements Project {
+
+    @RolesAllowed({"committer"})
+    public String svnCommit(String s) {
+        return s;
+    }
+
+    public String svnCheckout(String s) {
+        return s;
+    }
+}
+{code}
+
+ - Allow only logged in users in the "committer" role to invoke 'svnCommit'.
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+
+
+h2. DeclareRoles
+
+You need to update the @DeclareRoles when referencing roles via isCallerInRole(roleName).
+
+{code}
+@Stateless
+@DeclareRoles({"committer", "contributor"})
+public class OpenSourceProjectBean implements Project {
+
+    @Resource SessionContext ctx;
+
+    @RolesAllowed({"committer"})
+    public String svnCommit(String s) {
+        ctx.isCallerInRole("committer"); // Referencing a Role
+        return s;
+    }
+
+    @RolesAllowed({"contributor"})
+    public String submitPatch(String s) {
+        return s;
+    }
+}
+{code}
+
+h2.  Restricting all methods in a class
+
+Placing the annotation at the class level changes the default of PermitAll
+
+{code}
+@Stateless
+@DeclareRoles({"committer"})
+@RolesAllowed({"committer"})
+public class OpenSourceProjectBean implements Project {
+
+    public String svnCommit(String s) {
+        return s;
+    }
+
+    public String svnCheckout(String s) {
+        return s;
+    }
+
+    public String submitPatch(String s) {
+        return s;
+    }
+}
+{code}
+
+- Allow only logged in users in the "committer" role to invoke 'svnCommit', 'svnCheckout' or 'submitPatch'.
+
+h2.  Mixing class and method level restrictions
+
+Security annotations can be used at the class level and method level at the same time.  These rules do not stack, so marking 'submitPatch' overrides the default of "committers".
+
+{code}
+@Stateless
+@DeclareRoles({"committer", "contributor"})
+@RolesAllowed({"committer"})
+public class OpenSourceProjectBean implements Project {
+
+    public String svnCommit(String s) {
+        return s;
+    }
+
+    public String svnCheckout(String s) {
+        return s;
+    }
+
+    @RolesAllowed({"contributor"})
+    public String submitPatch(String s) {
+        return s;
+    }
+}
+{code}
+
+ - Allow only logged in users in the "committer" role to invoke 'svnCommit' or 'svnCheckout'
+ - Allow only logged in users in the "contributor" role to invoke 'submitPatch'.  
+
+h2.  PermitAll
+
+When annotating a bean class with @RolesAllowed, the @PermitAll annotation becomes very useful on individual methods to open them back up again.
+
+{code}
+@Stateless
+@DeclareRoles({"committer", "contributor"})
+@RolesAllowed({"committer"})
+public class OpenSourceProjectBean implements Project {
+
+    public String svnCommit(String s) {
+        return s;
+    }
+
+    @PermitAll
+    public String svnCheckout(String s) {
+        return s;
+    }
+
+    @RolesAllowed({"contributor"})
+    public String submitPatch(String s) {
+        return s;
+    }
+}
+{code}
+
+ - Allow only logged in users in the "committer" role to invoke 'svnCommit'.
+ - Allow only logged in users in the "contributor" role to invoke 'submitPatch'.
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+
+
+h2.  DenyAll
+
+The @DenyAll annotation can be used to restrict business interface access from anyone, logged in or not.  The method is still invokable from within the bean class itself.
+
+{code}
+@Stateless
+@DeclareRoles({"committer", "contributor"})
+@RolesAllowed({"committer"})
+public class OpenSourceProjectBean implements Project {
+
+    public String svnCommit(String s) {
+        return s;
+    }
+
+    @PermitAll
+    public String svnCheckout(String s) {
+        return s;
+    }
+
+    @RolesAllowed({"contributor"})
+    public String submitPatch(String s) {
+        return s;
+    }
+
+    @DenyAll
+    public String deleteProject(String s) {
+        return s;
+    }
+}
+{code}
+
+ - Allow only logged in users in the "committer" role to invoke 'svnCommit'.
+ - Allow only logged in users in the "contributor" role to invoke 'submitPatch'.
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+ - Allow *no one* logged in or not to invoke 'deleteProject'.
+
+h1.  Illegal Usage
+
+Generally, security restrictions cannot be made on AroundInvoke methods and most callbacks.
+
+The following usages of @RolesAllowed have no effect.
+
+{code}
+@Stateful
+@DecalredRoles({"committer"})
+public class MyStatefulBean implements  MyBusinessInterface  {
+
+    @PostConstruct
+    @RolesAllowed({"committer"})
+    public void constructed(){
+
+    }
+
+    @PreDestroy
+    @RolesAllowed({"committer"})
+    public void destroy(){
+
+    }
+
+    @AroundInvoke
+    @RolesAllowed({"committer"})
+    public Object invoke(InvocationContext invocationContext) throws Exception {
+        return invocationContext.proceed();
+    }
+
+    @PostActivate
+    @RolesAllowed({"committer"})
+    public void activated(){
+
+    }
+
+    @PrePassivate
+    @RolesAllowed({"committer"})
+    public void passivate(){
+
+    }
+}
+{code}
+

Propchange: openejb/site/trunk/content/security-annotations.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/security-annotations.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/security-annotations.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/security-annotations.mdtext (added)
+++ openejb/site/trunk/content/security-annotations.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,294 @@
+Title: Security Annotations
+This page shows the correct usage of the security related annotations:
+
+ - javax.annotation.security.RolesAllowed
+ - javax.annotation.security.PermitAll
+ - javax.annotation.security.DenyAll
+ - javax.annotation.security.RunAs
+ - javax.annotation.security.DeclareRoles
+
+<a name="SecurityAnnotations-Basicidea"></a>
+## Basic idea
+
+- By default all methods of a business interface are accessible, logged in
+or not
+- The annotations go on the bean class, not the business interface
+- Security annotations can be applied to entire class and/or individual
+methods
+- The names of any security roles used must be declared via @DeclareRoles
+
+<a name="SecurityAnnotations-Norestrictions"></a>
+## No restrictions
+
+Allow anyone logged in or not to invoke 'svnCheckout'.
+
+These three examples are all equivalent.
+
+
+    @Stateless
+    public class OpenSourceProjectBean implements Project {
+    
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    }
+
+
+    @Stateless
+    @PermitAll
+    public class OpenSourceProjectBean implements Project {
+    
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    }
+
+
+    @Stateless
+    public class OpenSourceProjectBean implements Project {
+    
+        @PermitAll
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    }
+
+
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+
+<a name="SecurityAnnotations-RestrictingaMethod"></a>
+## Restricting a Method
+
+Restrict the 'svnCommit' method to only individuals logged in and part of
+the "committer" role.  Note that more than one role can be listed.
+
+
+    @Stateless
+    @DeclareRoles({"committer"})
+    public class OpenSourceProjectBean implements Project {
+    
+        @RolesAllowed({"committer"})
+        public String svnCommit(String s) {
+    	return s;
+        }
+    
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    }
+
+
+ - Allow only logged in users in the "committer" role to invoke
+'svnCommit'.
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+
+
+<a name="SecurityAnnotations-DeclareRoles"></a>
+## DeclareRoles
+
+You need to update the @DeclareRoles when referencing roles via
+isCallerInRole(roleName).
+
+
+    @Stateless
+    @DeclareRoles({"committer", "contributor"})
+    public class OpenSourceProjectBean implements Project {
+    
+        @Resource SessionContext ctx;
+    
+        @RolesAllowed({"committer"})
+        public String svnCommit(String s) {
+    	ctx.isCallerInRole("committer"); // Referencing a Role
+    	return s;
+        }
+    
+        @RolesAllowed({"contributor"})
+        public String submitPatch(String s) {
+    	return s;
+        }
+    }
+
+
+<a name="SecurityAnnotations-Restrictingallmethodsinaclass"></a>
+##  Restricting all methods in a class
+
+Placing the annotation at the class level changes the default of PermitAll
+
+
+    @Stateless
+    @DeclareRoles({"committer"})
+    @RolesAllowed({"committer"})
+    public class OpenSourceProjectBean implements Project {
+    
+        public String svnCommit(String s) {
+    	return s;
+        }
+    
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    
+        public String submitPatch(String s) {
+    	return s;
+        }
+    }
+
+
+- Allow only logged in users in the "committer" role to invoke 'svnCommit',
+'svnCheckout' or 'submitPatch'.
+
+<a name="SecurityAnnotations-Mixingclassandmethodlevelrestrictions"></a>
+##  Mixing class and method level restrictions
+
+Security annotations can be used at the class level and method level at the
+same time.  These rules do not stack, so marking 'submitPatch' overrides
+the default of "committers".
+
+
+    @Stateless
+    @DeclareRoles({"committer", "contributor"})
+    @RolesAllowed({"committer"})
+    public class OpenSourceProjectBean implements Project {
+    
+        public String svnCommit(String s) {
+    	return s;
+        }
+    
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    
+        @RolesAllowed({"contributor"})
+        public String submitPatch(String s) {
+    	return s;
+        }
+    }
+
+
+ - Allow only logged in users in the "committer" role to invoke 'svnCommit'
+or 'svnCheckout'
+ - Allow only logged in users in the "contributor" role to invoke
+'submitPatch'.	
+
+<a name="SecurityAnnotations-PermitAll"></a>
+##  PermitAll
+
+When annotating a bean class with @RolesAllowed, the @PermitAll annotation
+becomes very useful on individual methods to open them back up again.
+
+
+    @Stateless
+    @DeclareRoles({"committer", "contributor"})
+    @RolesAllowed({"committer"})
+    public class OpenSourceProjectBean implements Project {
+    
+        public String svnCommit(String s) {
+    	return s;
+        }
+    
+        @PermitAll
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    
+        @RolesAllowed({"contributor"})
+        public String submitPatch(String s) {
+    	return s;
+        }
+    }
+
+
+ - Allow only logged in users in the "committer" role to invoke
+'svnCommit'.
+ - Allow only logged in users in the "contributor" role to invoke
+'submitPatch'.
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+
+
+<a name="SecurityAnnotations-DenyAll"></a>
+##  DenyAll
+
+The @DenyAll annotation can be used to restrict business interface access
+from anyone, logged in or not.	The method is still invokable from within
+the bean class itself.
+
+
+    @Stateless
+    @DeclareRoles({"committer", "contributor"})
+    @RolesAllowed({"committer"})
+    public class OpenSourceProjectBean implements Project {
+    
+        public String svnCommit(String s) {
+    	return s;
+        }
+    
+        @PermitAll
+        public String svnCheckout(String s) {
+    	return s;
+        }
+    
+        @RolesAllowed({"contributor"})
+        public String submitPatch(String s) {
+    	return s;
+        }
+    
+        @DenyAll
+        public String deleteProject(String s) {
+    	return s;
+        }
+    }
+
+
+ - Allow only logged in users in the "committer" role to invoke
+'svnCommit'.
+ - Allow only logged in users in the "contributor" role to invoke
+'submitPatch'.
+ - Allow anyone logged in or not to invoke 'svnCheckout'.
+ - Allow *no one* logged in or not to invoke 'deleteProject'.
+
+<a name="SecurityAnnotations-IllegalUsage"></a>
+#  Illegal Usage
+
+Generally, security restrictions cannot be made on AroundInvoke methods and
+most callbacks.
+
+The following usages of @RolesAllowed have no effect.
+
+
+    @Stateful
+    @DecalredRoles({"committer"})
+    public class MyStatefulBean implements	MyBusinessInterface  {
+    
+        @PostConstruct
+        @RolesAllowed({"committer"})
+        public void constructed(){
+    
+        }
+    
+        @PreDestroy
+        @RolesAllowed({"committer"})
+        public void destroy(){
+    
+        }
+    
+        @AroundInvoke
+        @RolesAllowed({"committer"})
+        public Object invoke(InvocationContext invocationContext) throws
+Exception {
+    	return invocationContext.proceed();
+        }
+    
+        @PostActivate
+        @RolesAllowed({"committer"})
+        public void activated(){
+    
+        }
+    
+        @PrePassivate
+        @RolesAllowed({"committer"})
+        public void passivate(){
+    
+        }
+    }
+
+

Added: openejb/site/trunk/content/security.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/security.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/security.cwiki (added)
+++ openejb/site/trunk/content/security.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,72 @@
+h1. Security - How To.
+
+We currently have two authentication mechanisms to choose from:
+* {{PropertiesLoginModule}} (a basic text file based login that looks up users and groups from the specified properties files)
+* {{SQLLoginModule}} (database based login that looks up users and groups in a database through SQL queries)
+
+To make your program authenticate itself to the server, simply construct your InitialContext with the standard javax.naming.Context properties for user/pass info, which is:
+{code}
+Properties props = new Properties();
+props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+props.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
+props.setProperty(Context.SECURITY_PRINCIPAL, "someuser");
+props.setProperty(Context.SECURITY_CREDENTIALS, "thepass");
+props.setProperty("openejb.authentication.realmName", "PropertiesLogin"); // optional
+InitialContext ctx = new InitialContext(props);
+ctx.lookup(...);
+{code}
+That will get you logged in and all your calls from that context should execute as you.
+
+{{$\{openejb.base\}/conf/login.config}} is a standard JAAS config file. Here, you can configure any number of security realms to authenticate against.
+To specify which of the realms you want to authenticate against, you can set the {{openejb.authentication.realmName}} property to any of the configured realm names in {{login.config}}.
+If you don't speficy a realm name, the default (currently {{PropertiesLogin}}) is used.
+For examples and more information on JAAS configuration, see the [JAAS Reference Guide|http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html].
+
+h2. PropertiesLoginModule
+
+Supported options:
+||Option||Description||Required||
+|UsersFile|name of the properties file that contains the users and their passwords|*yes*|
+|GroupsFile|name of the properties file that contains the groups and their member lists|*yes*|
+
+{{UsersFile}} and {{GroupsFile}} are read in on every login, so +you can update them+ on a running system and those users will "show up" immediately +without the need for a restart+ of any kind.
+
+h2. SQLLoginModule
+
+You can either use a data source or configure the JDBC URL through which the user/group lookups will be made.
+
+If you use a {{DataSource}}, you must specify its JNDI name with the {{dataSourceName}} option.
+
+If you use JDBC directly, you have to specify at least the JDBC URL of the database.
+The driver should be autodetected (provided the appropriate jar is on your classpath), but if that fails for some reason, you can force a specific driver using the {{jdbcDriver}} option.
+For more information on JDBC URLs, see the [JDBC Guide|http://java.sun.com/javase/6/docs/technotes/guides/jdbc/]
+
+The {{userSelect}} query must return a two-column list of user names (column 1) and passwords (column 2). This query should normally return a single row, which can be achieved by the use of a query parameter placeholder "?".
+Any such placeholders in both queries will be filled in with the username that the client is trying to log in with.
+The {{groupSelect}} query must return a two-column list of user names and their groups (or "roles" in the EJB world).
+
+Supported options:
+||Option||Description||Required||
+|dataSourceName|the name of a data source|*yes* (alternative 1)|
+|jdbcURL|a standard JDBC URL|*yes* (alternative 2)|
+|jdbcDriver|the fully qualified class name of the database driver|no|
+|jdbcUser|the user name for accessing the database|no|
+|jdbcPassword|the password for accessing the database|no|
+|userSelect|the SQL query that returns a list of users and their passwords|*yes*
+|groupSelect|the SQL query that returns a list of users and groups (roles)|*yes*
+|digest|the name of the digest algorithm (e.g. "MD5" or "SHA") for digest authentication|no|
+|encoding|the digest encoding, can be "hex" or "base64"|no|
+
+h1. PLUG POINTS
+
+There are four-five different plug points where you could customize the functionality.  From largest to smallest:
+- *The SecurityService interface*:  As before all security work (authentication and authorization) is behind this interface, only the methods on it have been updated.  If you want to do something really "out there" or need total control, this is where you go. Plugging in your own SecurityService should really be a last resort. We still have our "do nothing" SecurityService implementation just as before, but it is no longer the default. +You can add a new SecurityService impl by creating a service-jar.xml and packing it in your jar+.  You can configure OpenEJB to use a different SecurityService via the openejb.xml.
+
+- *JaccProvider super class*:  If you want to plug in your own JACC implementation to perform custom authorization (maybe do some fancy auditing), this is one way to do it without really having to understand JACC too much.  We will plug your provider in to all the places required by JACC if you simply +set the system property+ "*org.apache.openejb.core.security.JaccProvider*" with the name of your JaccProvider impl.
+
+- *Regular JACC*.  The JaccProvider is simply a wrapper around the many things you have to do to create and plugin a JACC provider, but you can still plugin a JACC provider in the standard ways.  Read the JACC spec for that info.
+
+- *JAAS LoginModule*.  You can setup a different JAAS LoginModule to do all your authentication by simply editing the conf/login.config file which is a plain JAAS config file.  At the moment we only support username/password based login modules.  At some point it would be nice to support any kind of input for a JAAS LoginModule, but username/password at least covers the majority.  It actually *is* possible to support any LoginModule, but you would have to supply your clients with your own way to authenticate to it and write a strategy for telling the OpenEJB client what data to send to the server with each invocation request. See the [JAAS LoginModule Developer's Guide|http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASLMDevGuide.html] for more information.
+
+- *Client IdentityResolver*.  This is the just mentioned interface you would have to implement to supply the OpenEJB client with alternate data to send to the server with each invocation request. If you're plugging in a new version of this it is likely that you may also want to plugin in your own SecurityService implementation. Reason being, the object returned from IdentiyResolve.getIdentity() is sent across the wire and straight in to the
+SecurityService.associate(Object) method.
\ No newline at end of file

Propchange: openejb/site/trunk/content/security.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openejb/site/trunk/content/security.mdtext
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/security.mdtext?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/security.mdtext (added)
+++ openejb/site/trunk/content/security.mdtext Sun Jul 10 05:36:12 2011
@@ -0,0 +1,145 @@
+Title: Security
+<a name="Security-Security-HowTo."></a>
+# Security - How To.
+
+We currently have two authentication mechanisms to choose from:
+* *PropertiesLoginModule* (a basic text file based login that looks up
+users and groups from the specified properties files)
+* *SQLLoginModule* (database based login that looks up users and groups
+in a database through SQL queries)
+
+To make your program authenticate itself to the server, simply construct
+your InitialContext with the standard javax.naming.Context properties for
+user/pass info, which is:
+
+    Properties props = new Properties();
+    props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+"org.apache.openejb.client.RemoteInitialContextFactory");
+    props.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
+    props.setProperty(Context.SECURITY_PRINCIPAL, "someuser");
+    props.setProperty(Context.SECURITY_CREDENTIALS, "thepass");
+    props.setProperty("openejb.authentication.realmName", "PropertiesLogin");
+// optional
+    InitialContext ctx = new InitialContext(props);
+    ctx.lookup(...);
+
+That will get you logged in and all your calls from that context should
+execute as you.
+
+*$\{openejb.base\}/conf/login.config* is a standard JAAS config file.
+Here, you can configure any number of security realms to authenticate
+against.
+To specify which of the realms you want to authenticate against, you can
+set the *openejb.authentication.realmName* property to any of the
+configured realm names in *login.config*.
+If you don't speficy a realm name, the default (currently
+*PropertiesLogin*) is used.
+For examples and more information on JAAS configuration, see the [JAAS Reference Guide](http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html)
+.
+
+<a name="Security-PropertiesLoginModule"></a>
+## PropertiesLoginModule
+
+Supported options:
+<table>
+<tr><th>Option</th><th>Description</th><th>Required</th></tr>
+<tr><td>UsersFile</td><td>name of the properties file that contains the users and their
+passwords</td><td>*yes*</td></tr>
+<tr><td>GroupsFile</td><td>name of the properties file that contains the groups and their
+member lists</td><td>*yes*</td></tr>
+</table>
+
+*UsersFile* and *GroupsFile* are read in on every login, so +you can
+update them+ on a running system and those users will "show up" immediately
++without the need for a restart+ of any kind.
+
+<a name="Security-SQLLoginModule"></a>
+## SQLLoginModule
+
+You can either use a data source or configure the JDBC URL through which
+the user/group lookups will be made.
+
+If you use a *DataSource*, you must specify its JNDI name with the
+*dataSourceName* option.
+
+If you use JDBC directly, you have to specify at least the JDBC URL of the
+database.
+The driver should be autodetected (provided the appropriate jar is on your
+classpath), but if that fails for some reason, you can force a specific
+driver using the *jdbcDriver* option.
+For more information on JDBC URLs, see the [JDBC Guide](http://java.sun.com/javase/6/docs/technotes/guides/jdbc/)
+
+The *userSelect* query must return a two-column list of user names
+(column 1) and passwords (column 2). This query should normally return a
+single row, which can be achieved by the use of a query parameter
+placeholder "?".
+Any such placeholders in both queries will be filled in with the username
+that the client is trying to log in with.
+The *groupSelect* query must return a two-column list of user names and
+their groups (or "roles" in the EJB world).
+
+Supported options:
+<table>
+<tr><th>Option</th><th>Description</th><th>Required</th></tr>
+<tr><td>dataSourceName</td><td>the name of a data source</td><td>*yes* (alternative 1)</td></tr>
+<tr><td>jdbcURL</td><td>a standard JDBC URL</td><td>*yes* (alternative 2)</td></tr>
+<tr><td>jdbcDriver</td><td>the fully qualified class name of the database driver</td><td>no</td></tr>
+<tr><td>jdbcUser</td><td>the user name for accessing the database</td><td>no</td></tr>
+<tr><td>jdbcPassword</td><td>the password for accessing the database</td><td>no</td></tr>
+<tr><td>userSelect</td><td>the SQL query that returns a list of users and their
+passwords</td><td>*yes*
+</tr>
+<tr><td>groupSelect</td><td>the SQL query that returns a list of users and groups
+(roles)</td><td>*yes*
+</tr>
+<tr><td>digest</td><td>the name of the digest algorithm (e.g. "MD5" or "SHA") for digest
+authentication</td><td>no</td></tr>
+<tr><td>encoding</td><td>the digest encoding, can be "hex" or "base64"</td><td>no</td></tr>
+</table>
+
+<a name="Security-PLUGPOINTS"></a>
+# PLUG POINTS
+
+There are four-five different plug points where you could customize the
+functionality.	From largest to smallest:
+- *The SecurityService interface*:  As before all security work
+(authentication and authorization) is behind this interface, only the
+methods on it have been updated.  If you want to do something really "out
+there" or need total control, this is where you go. Plugging in your own
+SecurityService should really be a last resort. We still have our "do
+nothing" SecurityService implementation just as before, but it is no longer
+the default. +You can add a new SecurityService impl by creating a
+service-jar.xml and packing it in your jar+.  You can configure OpenEJB to
+use a different SecurityService via the openejb.xml.
+
+- *JaccProvider super class*:  If you want to plug in your own JACC
+implementation to perform custom authorization (maybe do some fancy
+auditing), this is one way to do it without really having to understand
+JACC too much.	We will plug your provider in to all the places required by
+JACC if you simply +set the system property+
+"*org.apache.openejb.core.security.JaccProvider*" with the name of your
+JaccProvider impl.
+
+- *Regular JACC*.  The JaccProvider is simply a wrapper around the many
+things you have to do to create and plugin a JACC provider, but you can
+still plugin a JACC provider in the standard ways.  Read the JACC spec for
+that info.
+
+- *JAAS LoginModule*.  You can setup a different JAAS LoginModule to do all
+your authentication by simply editing the conf/login.config file which is a
+plain JAAS config file.  At the moment we only support username/password
+based login modules.  At some point it would be nice to support any kind of
+input for a JAAS LoginModule, but username/password at least covers the
+majority.  It actually *is* possible to support any LoginModule, but you
+would have to supply your clients with your own way to authenticate to it
+and write a strategy for telling the OpenEJB client what data to send to
+the server with each invocation request. See the [JAAS LoginModule Developer's Guide](http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASLMDevGuide.html)
+ for more information.
+
+- *Client IdentityResolver*.  This is the just mentioned interface you
+would have to implement to supply the OpenEJB client with alternate data to
+send to the server with each invocation request. If you're plugging in a
+new version of this it is likely that you may also want to plugin in your
+own SecurityService implementation. Reason being, the object returned from
+IdentiyResolve.getIdentity() is sent across the wire and straight in to the
+SecurityService.associate(Object) method.

Added: openejb/site/trunk/content/service-locator.cwiki
URL: http://svn.apache.org/viewvc/openejb/site/trunk/content/service-locator.cwiki?rev=1144778&view=auto
==============================================================================
--- openejb/site/trunk/content/service-locator.cwiki (added)
+++ openejb/site/trunk/content/service-locator.cwiki Sun Jul 10 05:36:12 2011
@@ -0,0 +1,148 @@
+The functionality of the [openejb.jndiname.format|JNDI Names] allows for writing some really fun service locator code.  Creating the exact layout you want using the exact data you want means you can create robust libraries for pulling things out of JNDI.
+
+h1. Lookup examples
+
+To get the creative juices flowing here are a few examples of lookup methods you could create for your service locator, the jndi name formats that would work with those lookups, and examples of client code using the service locator.  For simplicity, we'll assume all the lookup examples start with this basic class that has a built-in lookup allowing for a common prefix to be optionally applied to the beginning of all lookup strings.
+
+{code:title=MyLocator.java}
+public class MyLocator {
+    private final Context context;
+
+    public MyLocator() throws NamingException {
+        this(null);
+    }
+
+    public MyLocator(String commonPrefix) throws NamingException {
+        Properties properties = new Properties();
+        properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+        properties.put(Context.PROVIDER_URL, "ejbd://localhost:4201/");
+        this.context = new InitialContext(properties);
+    }
+
+    public Object lookup(String name) {
+        try {
+            if (commonPrefix != null) name = commonPrefix + "/" +name;
+            return context.lookup(name);
+        } catch (NamingException e) {
+            throw new IllegalArgumentException(e);
+        }
+    }
+}
+{code}
+
+h2.  Just the interface
+Usable with JNDI name formats ending in the full class name of the interface such as:
+ - \{interfaceClass}
+
+{code}
+public <T> T lookup(Class<T> type) {
+    return (T) lookup(type.getName());
+}
+{code}
+
+{code}
+MyLocator locator = new MyLocator();
+Widget widget = locator.lookup(Widget.class);   
+{code}
+
+Or with a common prefix or with a common prefix supplied in constructor such as:
+ - \{moduleId}/\{interfaceClass}
+ - ejb/\{moduleId}/\{interfaceClass}
+
+{code}
+MyLocator locator = new MyLocator("ejb/superbiz");
+Widget widget = locator.lookup(Widget.class);   
+Store store = locator.lookup(Store.class);
+{code}
+
+
+h2.  Interface class and a prefix
+
+Usable with JNDI name formats including a varying prefix such as ejbName or deploymentID
+and ending in the full class name of the interface
+
+ - \{ejbName}/\{interfaceClass}
+ - \{deploymentId}/\{interfaceClass}
+
+{code}
+public <T> T lookup(String prefix, Class<T> type) {
+    return (T) lookup(prefix + "/" + type.getName());
+}
+{code}
+
+{code}
+MyLocator locator = new MyLocator();
+Widget redWidget = locator.lookup("RedWidgetBean", Widget.class);   
+Widget blueWidget = locator.lookup("BlueWidgetBean", Widget.class);   
+{code}
+
+Or with a common prefix or with a common prefix supplied in constructor such as:
+ - \{moduleId}/\{ejbName}/\{interfaceClass}
+ - ejb/\{moduleId}/\{deploymentId}/\{interfaceClass}
+
+{code}
+MyLocator locator = new MyLocator("accountingApp");
+Widget widget = locator.lookup("RedWidgetBean", Widget.class);   
+Store store = locator.lookup("StoreBean", Store.class);
+{code}
+
+h2.  Interface class and ejb class
+
+Usable with JNDI name formats comprised of the interfaceClass and ejbClass
+
+For variation, the interface class is the prefix and the ejb class is the
+suffix.  This is neat as the the prefix (the interface class name) becomes
+a jndi context with one binding in it for each implementing ejb class.
+
+Works with:
+ - \{interfaceClass}/\{ejbClass}
+
+{code}
+public <T> T lookup(Class<T> type, Class ejbClass) {
+    return (T) lookup(type.getName() + "/" + ejbClass.getName());
+}
+{code}
+
+{code}
+MyLocator locator = new MyLocator();
+Widget widget = locator.lookup(Widget.class, BlueWidgetBean.class);   
+{code}
+
+Or with a common prefix or with a common prefix supplied in constructor such as:
+ - \{moduleId}/\{interfaceClass}/\{ejbClass}
+ - ejb/\{moduleId}/\{interfaceClass}/\{ejbClass}
+
+{code}
+MyLocator locator = new MyLocator("ejb/purchasingApp");
+Widget widget = locator.lookup(Widget.class, RedWidgetBean.class);
+Store store = locator.lookup(Store.class, StoreBean.class);
+{code}
+
+
+h2. Interface class and ejb class with simple names
+
+Similar to the above example but using the simple name of the classes resulting
+in a JNDI tree that's a bit more human readable.
+ - \{ejbClass.simpleName}/\{interfaceClass.simpleName}
+
+{code}
+public <T> T lookup(Class ejbClass, Class<T> type) {
+    return (T) lookup(ejbClass.getSimpleName() + "" + type.getSimpleName());
+}
+{code}
+
+{code}
+MyLocator locator = new MyLocator();
+Widget widget = locator.lookup(RedWidgetBean.class, Widget.class);   
+{code}
+
+Or with a common prefix or with a common prefix supplied in constructor such as:
+ - \{moduleId}/\{ejbClass.simpleName}/\{interfaceClass.simpleName}
+ - ejb/\{moduleId}/\{ejbClass.simpleName}/\{interfaceClass.simpleName}
+
+{code}
+MyLocator locator = new MyLocator("shippingApp");
+Widget widget = locator.lookup(GreenWidgetBean.class, Widget.class);   
+Store store = locator.lookup(SuperStoreBean.class, Store.class);
+{code}
+

Propchange: openejb/site/trunk/content/service-locator.cwiki
------------------------------------------------------------------------------
    svn:eol-style = native