You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2010/08/09 21:33:09 UTC

svn commit: r983790 [2/2] - in /openejb/trunk/openejb3: assembly/openejb-jetty/openejb-jetty-common/ assembly/openejb-jetty/openejb-jetty-common/etc/ assembly/openejb-jetty/openejb-jetty-common/src/main/java/org/ assembly/openejb-jetty/openejb-jetty-co...

Added: openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/main/resources/META-INF/org.apache.openejb.jetty/service-jar.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/main/resources/META-INF/org.apache.openejb.jetty/service-jar.xml?rev=983790&view=auto
==============================================================================
--- openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/main/resources/META-INF/org.apache.openejb.jetty/service-jar.xml (added)
+++ openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/main/resources/META-INF/org.apache.openejb.jetty/service-jar.xml Mon Aug  9 19:33:08 2010
@@ -0,0 +1,987 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<ServiceJar>
+
+  <!--
+  #===================================================================#
+  #       D E F A U L T    O P E N E J B    S E R V I C E S           #
+  #===================================================================#
+  #
+  #
+  #  This file defines all the default configurations of containers,
+  #  factories, managers and services that come with OpenEJB.
+  #
+  #  Can contain numerous configurations of the standard services
+  #  making it easy for users to simply name the one they want in
+  #  their configuration files.
+  #
+  #  Over time this will be become a library of default
+  #  configurations
+  #
+  #
+  #  The Configuraitions in this file reference the following other
+  #  files:
+  #
+  #  conf/default.cmp_global_tx_database.xml
+  #  conf/default.cmp_local_tx_database.xml
+  #  conf/default.idb_database.conf
+  -->
+
+  <!--
+  # ==========================================================
+  # Default Container-Managed Persistence EntityBean Container
+  # ==========================================================
+  -->
+  <ServiceProvider id="Default CMP Container"
+                   service="Container"
+                   types="CMP_ENTITY"
+                   constructor="id, transactionManager, securityService, CmpEngineFactory"
+                   class-name="org.apache.openejb.core.cmp.CmpContainer">
+
+    CmpEngineFactory org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+  </ServiceProvider>
+
+  <!--
+  # ==========================================================
+  # Default Bean-Managed Persistence EntityBean Container
+  # ==========================================================
+  -->
+  <ServiceProvider
+          id="Default BMP Container"
+          service="Container"
+          types="BMP_ENTITY"
+          constructor="id, securityService, PoolSize"
+          class-name="org.apache.openejb.core.entity.EntityContainer">
+
+    # Specifies the size of the bean pools for this
+    # bmp entity container.
+
+    PoolSize 10
+
+</ServiceProvider>
+
+
+
+  <!--
+  # ==========================================================
+  # Default Stateless SessionBean Container
+  # ==========================================================
+  -->
+  <ServiceProvider
+          id="Default Stateless Container"
+          service="Container"
+          types="STATELESS"
+          factory-name="create"
+          class-name="org.apache.openejb.core.stateless.StatelessContainerFactory">
+
+    # Specifies the time an invokation should wait for an instance
+    # of the pool to become available.
+    #
+    # After the timeout is reached, if an instance in the pool cannot
+    # be obtained, the method invocation will fail.
+    #
+    # Usable time units: nanoseconds, microsecons, milliseconds,
+    # seconds, minutes, hours, days.  Or any combination such as
+    # "1 hour and 27 minutes and 10 seconds"
+
+    AccessTimeout = 0 milliseconds
+
+    # Specifies the size of the bean pools for this stateless
+    # SessionBean container.  If StrictPooling is not used, instances
+    # will still be created beyond this number if there is demand, but
+    # they will not be returned to the pool and instead will be
+    # immediately destroyed.
+
+    MaxSize = 10
+
+    # Specifies the minimum number of bean instances that should be in
+    # the pool for each bean.  Pools are prefilled to the minimum on
+    # startup.  Note this will create start order dependencies between
+    # other beans that also eagerly start, such as other @Stateless
+    # beans with a minimum or @Singleton beans using @Startup.  The
+    # @DependsOn annotation can be used to appropriately influence
+    # start order.
+    #
+    # The minimum pool size is rigidly maintained.  Instances in the
+    # minimum side of the pool are not eligible for IdleTimeout or
+    # GarbageCollection, but are subject to MaxAge and flushing.
+    #
+    # If the pool is flushed it is immediately refilled to the minimum
+    # size with MaxAgeOffset applied.  If an instance from the minimum
+    # side of the pool reaches its MaxAge, it is also immediately
+    # replaced.  Replacement is done in a background queue using the
+    # number of threads specified by CallbackThreads.
+
+    MinSize = 0
+
+    # StrictPooling tells the container what to do when the pool
+    # reaches it's maximum size and there are incoming requests that
+    # need instances.
+    #
+    # With strict pooling, requests will have to wait for instances to
+    # become available. The pool size will never grow beyond the the
+    # set PoolSize value.  The maximum amount of time a request should
+    # wait is specified via the AccessTimeout setting.
+    #
+    # Without strict pooling, the container will create temporary
+    # instances to meet demand. The instances will last for just one
+    # method invocation and then are removed.
+    #
+    # Setting StrictPooling to false and PoolSize to 0 will result in
+    # no pooling. Instead instances will be created on demand and live
+    # for exactly one method call before being removed.
+
+    StrictPooling = true
+
+    # Specifies the maximum time that an instance should live before
+    # it should be retired and removed from use.  This will happen
+    # gracefully.  Useful for situations where bean instances are
+    # designed to hold potentially expensive resources such as memory
+    # or file handles and need to be periodically cleared out.
+    #
+    # Usable time units: nanoseconds, microsecons, milliseconds,
+    # seconds, minutes, hours, days.  Or any combination such as
+    # "1 hour and 27 minutes and 10 seconds"
+
+    MaxAge = 0 hours
+
+    # When ReplaceAged is enabled, any instances in the pool that
+    # expire due to reaching their MaxAge will be replaced immediately
+    # so that the pool will remain at its current size.  Replacement
+    # is done in a background queue so that incoming threads will not
+    # have to wait for instance creation.
+    #
+    # The aim of his option is to prevent user requests from paying
+    # the instance creation cost as MaxAge is enforced, potentially
+    # while under heavy load at peak hours.
+    #
+    # Instances from the minimum side of the pool are always replaced
+    # when they reach their MaxAge, this setting dictates the
+    # treatment of non-minimum instances.
+
+    ReplaceAged = true
+
+    # When ReplaceFlushed is enabled, any instances in the pool that
+    # are flushed will be replaced immediately so that the pool will
+    # remain at its current size.  Replacement is done in a background
+    # queue so that incoming threads will not have to wait for
+    # instance creation.
+    #
+    # The aim of his option is to prevent user requests from paying
+    # the instance creation cost if a flush performed while under
+    # heavy load at peak hours.
+    #
+    # Instances from the minimum side of the pool are always replaced
+    # when they are flushed, this setting dictates the treatment of
+    # non-minimum instances.
+    #
+    # A bean may flush its pool by casting the SessionContext to
+    # Flushable and calling flush().  See SweepInterval for details on
+    # how flush is performed.
+    #
+    #   import javax.annotation.Resource;
+    #   import javax.ejb.SessionContext;
+    #   import javax.ejb.Stateless;
+    #   import java.io.Flushable;
+    #   import java.io.IOException;
+    #
+    #   @Stateless
+    #   public class MyBean {
+    #
+    #       @Resource
+    #       private SessionContext sessionContext;
+    #
+    #       public void flush() throws IOException {
+    #
+    #           ((Flushable) sessionContext).flush();
+    #       }
+    #   }
+
+    ReplaceFlushed = false
+
+    # Applies to MaxAge usage and would rarely be changed, but is a
+    # nice feature to understand.
+    #
+    # When the container first starts and the pool is filled to the
+    # minimum size, all those "minimum" instances will have the same
+    # creation time and therefore all expire at the same time dictated
+    # by the MaxAge setting.  To protect against this sudden drop
+    # scenario and provide a more gradual expiration from the start
+    # the container will spread out the age of the instances that fill
+    # the pool to the minimum using an offset.
+    #
+    # The MaxAgeOffset is not the final value of the offset, but
+    # rather it is used in creating the offset and allows the
+    # spreading to push the initial ages into the future or into the
+    # past.  The pool is filled at startup as follows:
+    #
+    #  for (int i = 0; i &lt; poolMin; i++) {
+    #    long ageOffset = (maxAge / poolMin * i * maxAgeOffset) % maxAge;
+    #    pool.add(new Bean(), ageOffset));
+    #  }
+    #
+    # The default MaxAgeOffset is -1 which causes the initial
+    # instances in the pool to live a bit longer before expiring.  As
+    # a concrete example, let's say the MinSize is 4 and the MaxAge is
+    # 100 years.  The generated offsets for the four instances created
+    # at startup would be 0, -25, -50, -75.  So the first instance
+    # would be "born" at age 0, die at 100, living 100 years.  The
+    # second instance would be born at -25, die at 100, living a total
+    # of 125 years.  The third would live 150 years.  The fourth 175
+    # years.
+    #
+    # A MaxAgeOffset of 1 would cause instances to be "born" older
+    # and therefore die sooner.  Using the same example MinSize of 4
+    # and MaxAge of 100 years, the life spans of these initial four
+    # instances would be 100, 75, 50, and 25 years respectively.
+    #
+    # A MaxAgeOffset of 0 will cause no "spreading" of the age of the
+    # first instances used to fill the pool to the minimum and these
+    # instances will of course reach their MaxAge at the same time.
+    # It is possible to set to decimal values such as -0.5, 0.5, -1.2,
+    # or 1.2.
+
+    MaxAgeOffset = -1
+
+    # Specifies the maximum time that an instance should be allowed to
+    # sit idly in the pool without use before it should be retired and
+    # removed.
+    #
+    # Usable time units: nanoseconds, microsecons, milliseconds,
+    # seconds, minutes, hours, days.  Or any combination such as
+    # "1 hour and 27 minutes and 10 seconds"
+
+    IdleTimeout = 0 minutes
+
+    # Allows Garbage Collection to be used as a mechanism for shrinking
+    # the pool.  When set to true all instances in the pool, excluding
+    # the minimum, are eligible for garbage collection by the virtual
+    # machine as per the rules of java.lang.ref.SoftReference and can be
+    # claimed by the JVM to free memory.  Instances garbage collected
+    # will have their @PreDestroy methods called during finalization.
+
+    GarbageCollection = true
+
+    # The frequency in which the container will sweep the pool and
+    # evict expired instances.  Eviction is how the IdleTimeout,
+    # MaxAge, and pool "flush" functionality is enforced.  Higher
+    # intervals are better.
+    #
+    # Instances in use are excluded from sweeping.  Should an instance
+    # expire while in use it will be evicted immediately upon return
+    # to the pool.  Effectively MaxAge and flushes will be enforced as
+    # a part of normal activity or sweeping, while IdleTimeout is only
+    # enforcable via sweeping.  This makes aggressive sweeping less
+    # important for a pool under moderate load.
+    #
+    # Usable time units: nanoseconds, microsecons, milliseconds,
+    # seconds, minutes, hours, days.  Or any combination such as
+    # "1 hour and 27 minutes and 10 seconds"
+
+    SweepInterval = 5 minutes
+
+    # When sweeping the pool for expired instances a thread pool is
+    # used to process calling @PreDestroy on expired instances as well
+    # as creating new instances as might be required to fill the pool
+    # to the minimum after a Flush or MaxAge expiration.  The
+    # CallbackThreads setting dictates the size of the thread pool and
+    # is shared by all beans deployed in the container.
+
+    CallbackThreads = 5
+
+    # PostConstruct methods are invoked on all instances in the pool
+    # when the bean is undeployed and its pool is closed.  The
+    # CloseTimeout specifies the maximum time to wait for the pool to
+    # close and PostConstruct methods to be invoked.
+    #
+    # Usable time units: nanoseconds, microsecons, milliseconds,
+    # seconds, minutes, hours, days.  Or any combination such as
+    # "1 hour and 27 minutes and 10 seconds"
+
+    CloseTimeout = 5 minutes
+
+  </ServiceProvider>
+
+
+  <!--
+  # ==========================================================
+  # Default Singleton SessionBean Container
+  # ==========================================================
+  -->
+  <ServiceProvider
+          id="Default Singleton Container"
+          service="Container"
+          types="SINGLETON"
+          constructor="id, securityService"
+          class-name="org.apache.openejb.core.singleton.SingletonContainer">
+
+    AccessTimeout = 30 seconds
+    
+  </ServiceProvider>
+
+
+  <!--
+  # ==========================================================
+  # Default Stateful SessionBean Container
+  # ==========================================================
+  -->
+  <ServiceProvider
+          id="Default Stateful Container"
+          service="Container"
+          types="STATEFUL"
+          factory-name="create"
+          class-name="org.apache.openejb.core.stateful.StatefulContainerFactory">
+
+    # Specifies the maximum time an invocation could wait for the
+    # stateful bean instance to become available before giving up.
+    #
+    # After the timeout is reached a javax.ejb.ConcurrentAccessTimeoutException
+    # will be thrown.
+    #
+    # Usable time units: nanoseconds, microsecons, milliseconds,
+    # seconds, minutes, hours, days.  Or any combination such as
+    # "1 hour and 27 minutes and 10 seconds"
+
+    AccessTimeout = 0 milliseconds
+
+    # The cache is responsible for managing stateful bean
+    # instances.  The cache can page instances to disk as memory
+    # is filled and can destroy abandoned instances.  A different
+    # cache implementation can be used by setting this property
+    # to the fully qualified class name of the Cache implementation.
+
+    Cache org.apache.openejb.core.stateful.SimpleCache
+
+    # The passivator is responsible for writing beans to disk
+    # at passivation time. Different passivators can be used
+    # by setting this property to the fully qualified class name
+    # of the PassivationStrategy implementation. The passivator
+    # is not responsible for invoking any callbacks or other
+    # processing, its only responsibly is to write the bean state
+    # to disk.
+    #
+    # Known implementations:
+    # org.apache.openejb.core.stateful.RAFPassivater
+    # org.apache.openejb.core.stateful.SimplePassivater
+
+    Passivator org.apache.openejb.core.stateful.SimplePassivater
+
+    # Specifies the time to wait between invocations. This
+    # value is measured in minutes. A value of 5 would
+    # result in a time-out of 5 minutes between invocations.
+
+    TimeOut 20
+
+    # Specifies the size of the bean pools for this
+    # stateful SessionBean container.
+
+    Capacity 1000
+
+    # Property name that specifies the number of instances
+    # to passivate at one time when doing bulk passivation.
+
+    BulkPassivate 100
+
+  </ServiceProvider>
+  
+  <!--
+  # ==========================================================
+  # Default Managed SessionBean Container
+  # ==========================================================
+  -->
+  <ServiceProvider
+          id="Default Managed Container"
+          service="Container"
+          types="MANAGED"
+          constructor="id, securityService"
+          class-name="org.apache.openejb.core.managed.ManagedContainer">
+
+  </ServiceProvider>
+
+  <!--
+  # ==========================================================
+  # Default Message Driven Container
+  # ==========================================================
+  -->
+  <ServiceProvider
+          id="Default MDB Container"
+          service="Container"
+          types="MESSAGE"
+          constructor="id, securityService, ResourceAdapter, MessageListenerInterface, ActivationSpecClass, InstanceLimit"
+          class-name="org.apache.openejb.core.mdb.MdbContainer">
+
+    # The resource adapter delivers messages to the container
+
+    ResourceAdapter Default JMS Resource Adapter
+
+    # Specifies the message listener interface handled by this container
+
+    MessageListenerInterface javax.jms.MessageListener
+
+    # Specifies the activation spec class
+
+    ActivationSpecClass org.apache.activemq.ra.ActiveMQActivationSpec
+
+    # Specifies the maximum number of bean instances that are
+    # allowed to exist for each MDB deployment.
+
+    InstanceLimit 10
+
+  </ServiceProvider>
+
+  <!--
+  # ================================================
+  # Default Proxy Factory implementation for JDK 1.3
+  # ================================================
+  -->
+  <ServiceProvider
+          id="Default JDK 1.3 ProxyFactory"
+          service="ProxyFactory"
+          types="ProxyFactory"
+          class-name="org.apache.openejb.util.proxy.Jdk13ProxyFactory"/>
+
+  <!--
+  # ================================================
+  # Default Security Service implementation
+  # ================================================
+  -->
+
+
+  <ServiceProvider
+          id="Jetty Security Service"
+          service="SecurityService"
+          types="SecurityService"
+          class-name="org.apache.openejb.jetty.common.JettySecurityService"/>
+
+
+
+  <!--
+  # ================================================
+  # Default Transaction Manager implementation
+  # ================================================
+  -->
+    <ServiceProvider
+            id="Default Transaction Manager"
+            service="TransactionManager"
+            types="TransactionManager"
+            factory-name="create"
+            constructor="defaultTransactionTimeoutSeconds, TxRecovery, tmId, bufferClassName, bufferSizeKb, checksumEnabled, adler32Checksum, flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile, maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold"
+            class-name="org.apache.openejb.resource.GeronimoTransactionManagerFactory">
+           defaultTransactionTimeoutSeconds 600
+           TxRecovery false
+           bufferSizeKb 32
+           checksumEnabled true
+           adler32Checksum true
+           flushSleepTimeMilliseconds 50
+           logFileDir txlog
+           logFileExt log
+           logFileName howl
+           maxBlocksPerFile -1
+           maxBuffers 0
+           maxLogFiles 2
+           minBuffers 4
+           threadsWaitingForceThreshold -1
+    </ServiceProvider>
+
+  <!--
+  # ================================================
+  # Default JCA ManagedConnectionFactory for JDBC
+  # ================================================
+  -->
+  <ServiceProvider
+          id="Default JDBC Database"
+          service="Resource"
+          types="javax.sql.DataSource, DataSource"
+          factory-name="create"
+          constructor="JtaManaged"
+          class-name="org.apache.openejb.resource.jdbc.DataSourceFactory">
+
+    # Determines wether or not this data source should be JTA managed
+    # or user managed.  If set to 'true' it will automatically be enrolled
+    # in any ongoing transactions.  Calling begin/commit/rollback or setAutoCommit
+    # on the datasource or connection will not be allowed.  If you need to perform
+    # these functions yourself, set JtaManaged to 'false'
+    #
+    # In terms of JPA persistence.xml:
+    # "JtaManaged=true" can be used as a 'jta-data-source'
+    # "JtaManaged=false" can be used as a 'non-jta-data-source'
+
+    JtaManaged = true
+
+    # Driver class name
+
+    JdbcDriver org.hsqldb.jdbcDriver
+
+    # Url for creating connections
+
+    JdbcUrl jdbc:hsqldb:file:data/hsqldb/hsqldb
+
+    # Default user name
+
+    UserName sa
+
+    # Default password
+
+    Password
+
+    PasswordCipher  PlainText
+
+    # The connection properties that will be sent to the JDBC
+    # driver when establishing new connections
+    #
+    # Format of the string must be [propertyName=property;]*
+    #
+    # NOTE - The "user" and "password" properties will be passed
+    # explicitly, so they do not need to be included here.
+
+    ConnectionProperties
+
+    # The default auto-commit state of new connections
+
+    DefaultAutoCommit true
+
+    # The default read-only state of new connections
+    # If not set then the setReadOnly method will not be called.
+    # (Some drivers don't support read only mode, ex: Informix)
+
+    # DefaultReadOnly
+
+
+    # The default TransactionIsolation state of new connections
+    # If not set then the setTransactionIsolation method will not
+    # be called. The allowed values for this property are:
+    #     NONE
+    #     READ_COMMITTED
+    #     READ_UNCOMMITTED
+    #     REPEATABLE_READ
+    #     SERIALIZABLE
+    #
+    # Note: Most JDBC drivers do not support all isolation levels
+
+    # DefaultTransactionIsolation
+
+
+    # The initial number of connections that are created when the
+    # pool is started
+
+    InitialSize	0
+
+    # The maximum number of active connections that can be
+    # allocated from this pool at the same time, or a negative
+    # number for no limit.
+
+    MaxActive	20
+
+    # The maximum number of connections that can remain idle in
+    # the pool, without extra ones being released, or a negative
+    # number for no limit.
+
+    MaxIdle	20
+
+    # The minimum number of connections that can remain idle in
+    # the pool, without extra ones being created, or zero to
+    # create none.
+
+    MinIdle	0
+
+    # The maximum number of milliseconds that the pool will wait
+    # (when there are no available connections) for a connection
+    # to be returned before throwing an exception, or -1 to wait
+    # indefinitely.
+
+    MaxWait	-1
+
+    # The SQL query that will be used to validate connections from
+    # this pool before returning them to the caller. If specified,
+    # this query MUST be an SQL SELECT statement that returns at
+    # least one row.
+
+    # ValidationQuery
+
+    # If true connections will be validated before being returned
+    # from the pool. If the validation fails, the connection is
+    # destroyed, and a new conection will be retrieved from the
+    # pool (and validated).
+    #
+    # NOTE - for a true value to have any effect, the
+    # ValidationQuery parameter must be set.
+
+    TestOnBorrow	true
+
+    # If true connections will be validated before being returned
+    # to the pool.  If the validation fails, the connection is
+    # destroyed instead of being returned to the pool.
+    #
+    # NOTE - for a true value to have any effect, the
+    # ValidationQuery parameter must be set.
+
+    TestOnReturn	false
+
+    # If true connections will be validated by the idle connection
+    # evictor (if any). If the validation fails, the connection is
+    # destroyed and removed from the pool
+    #
+    # NOTE - for a true value to have any effect, the
+    # timeBetweenEvictionRunsMillis property must be a positive
+    # number and the ValidationQuery parameter must be set.
+
+    TestWhileIdle	false
+
+    # The number of milliseconds to sleep between runs of the idle
+    # connection evictor thread. When set to a negative number, no
+    # idle connection evictor thread will be run.
+
+    TimeBetweenEvictionRunsMillis	-1
+
+    # The number of connectionss to examine during each run of the
+    # idle connection evictor thread (if any).
+
+    NumTestsPerEvictionRun	3
+
+    # The minimum amount of time a connection may sit idle in the
+    # pool before it is eligable for eviction by the idle
+    # connection evictor (if any).
+
+    MinEvictableIdleTimeMillis	1800000
+
+    # If true, a statement pool is created for each Connection and
+    # PreparedStatements created by one of the following methods are
+    # pooled:
+    #    public PreparedStatement prepareStatement(String sql);
+    #    public PreparedStatement prepareStatement(String sql,
+    #            int resultSetType,
+    #            int resultSetConcurrency)
+
+    PoolPreparedStatements false
+
+    # The maximum number of open statements that can be allocated
+    # from the statement pool at the same time, or zero for no
+    # limit.
+    #
+    # NOTE - Some drivers have limits on the number of open
+    # statements, so make sure there are some resources left
+    # for the other (non-prepared) statements.
+
+    MaxOpenPreparedStatements 0
+
+    # If true the raw physical connection to the database can be
+    # accessed using the following construct:
+    #     Connection conn = ds.getConnection();
+    #     Connection rawConn = ((DelegatingConnection) conn).getInnermostDelegate();
+    #     ...
+    #     conn.close()
+    #
+    # Default is false, because misbehaving programs can do harmfull
+    # things to the raw connection shuch as closing the raw
+    # connection or continuing to use the raw connection after it
+    # has been assigned to another logical connection.  Be carefull
+    # and only use when you need direct access to driver specific
+    # extentions.
+    #
+    # NOTE: Do NOT close the underlying connection, only the
+    # original logical connection wrapper.
+
+    AccessToUnderlyingConnectionAllowed	false
+  </ServiceProvider>
+
+  <ServiceProvider
+          id="Default Unmanaged JDBC Database"
+          service="Resource"
+          types="javax.sql.DataSource, DataSource"
+          factory-name="create"
+          constructor="JtaManaged"
+          class-name="org.apache.openejb.resource.jdbc.DataSourceFactory">
+
+    JtaManaged = false
+
+    # Driver class name
+
+    #JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
+    JdbcDriver org.hsqldb.jdbcDriver
+
+    # Url for creating connections
+
+    #JdbcUrl jdbc:derby:derbyDB;create=true
+    JdbcUrl jdbc:hsqldb:file:data/hsqldb/hsqldb
+
+    # Default user name
+
+    #UserName admin
+    UserName sa
+
+    # Default password
+
+    #Password pass
+    Password
+
+    PasswordCipher  PlainText
+
+    # The connection properties that will be sent to the JDBC
+    # driver when establishing new connections
+    #
+    # Format of the string must be [propertyName=property;]*
+    #
+    # NOTE - The "user" and "password" properties will be passed
+    # explicitly, so they do not need to be included here.
+
+    ConnectionProperties
+
+    # The default auto-commit state of new connections
+
+    DefaultAutoCommit true
+
+    # The default read-only state of new connections
+    # If not set then the setReadOnly method will not be called.
+    # (Some drivers don't support read only mode, ex: Informix)
+
+    # DefaultReadOnly
+
+
+    # The default TransactionIsolation state of new connections
+    # If not set then the setTransactionIsolation method will not
+    # be called. The allowed values for this property are:
+    #     NONE
+    #     READ_COMMITTED
+    #     READ_UNCOMMITTED
+    #     REPEATABLE_READ
+    #     SERIALIZABLE
+    #
+    # Note: Most JDBC drivers do not support all isolation levels
+
+    # DefaultTransactionIsolation
+
+
+    # The initial number of connections that are created when the
+    # pool is started
+
+    InitialSize	0
+
+    # The maximum number of active connections that can be
+    # allocated from this pool at the same time, or a negative
+    # number for no limit.
+
+    MaxActive	10
+
+    # The maximum number of connections that can remain idle in
+    # the pool, without extra ones being released, or a negative
+    # number for no limit.
+
+    MaxIdle	10
+
+    # The minimum number of connections that can remain idle in
+    # the pool, without extra ones being created, or zero to
+    # create none.
+
+    MinIdle	0
+
+    # The maximum number of milliseconds that the pool will wait
+    # (when there are no available connections) for a connection
+    # to be returned before throwing an exception, or -1 to wait
+    # indefinitely.
+
+    MaxWait	-1
+
+    # The SQL query that will be used to validate connections from
+    # this pool before returning them to the caller. If specified,
+    # this query MUST be an SQL SELECT statement that returns at
+    # least one row.
+
+    # ValidationQuery
+
+    # If true connections will be validated before being returned
+    # from the pool. If the validation fails, the connection is
+    # destroyed, and a new conection will be retrieved from the
+    # pool (and validated).
+    #
+    # NOTE - for a true value to have any effect, the
+    # ValidationQuery parameter must be set.
+
+    TestOnBorrow	true
+
+    # If true connections will be validated before being returned
+    # to the pool.  If the validation fails, the connection is
+    # destroyed instead of being returned to the pool.
+    #
+    # NOTE - for a true value to have any effect, the
+    # ValidationQuery parameter must be set.
+
+    TestOnReturn	false
+
+    # If true connections will be validated by the idle connection
+    # evictor (if any). If the validation fails, the connection is
+    # destroyed and removed from the pool
+    #
+    # NOTE - for a true value to have any effect, the
+    # timeBetweenEvictionRunsMillis property must be a positive
+    # number and the ValidationQuery parameter must be set.
+
+    TestWhileIdle	false
+
+    # The number of milliseconds to sleep between runs of the idle
+    # connection evictor thread. When set to a negative number, no
+    # idle connection evictor thread will be run.
+
+    TimeBetweenEvictionRunsMillis	-1
+
+    # The number of connectionss to examine during each run of the
+    # idle connection evictor thread (if any).
+
+    NumTestsPerEvictionRun	3
+
+    # The minimum amount of time a connection may sit idle in the
+    # pool before it is eligable for eviction by the idle
+    # connection evictor (if any).
+
+    MinEvictableIdleTimeMillis	1800000
+
+    # If true, a statement pool is created for each Connection and
+    # PreparedStatements created by one of the following methods are
+    # pooled:
+    #    public PreparedStatement prepareStatement(String sql);
+    #    public PreparedStatement prepareStatement(String sql,
+    #            int resultSetType,
+    #            int resultSetConcurrency)
+
+    PoolPreparedStatements false
+
+    # The maximum number of open statements that can be allocated
+    # from the statement pool at the same time, or zero for no
+    # limit.
+    #
+    # NOTE - Some drivers have limits on the number of open
+    # statements, so make sure there are some resources left
+    # for the other (non-prepared) statements.
+
+    MaxOpenPreparedStatements 0
+
+    # If true the raw physical connection to the database can be
+    # accessed using the following construct:
+    #     Connection conn = ds.getConnection();
+    #     Connection rawConn = ((DelegatingConnection) conn).getInnermostDelegate();
+    #     ...
+    #     conn.close()
+    #
+    # Default is false, because misbehaving programs can do harmfull
+    # things to the raw connection shuch as closing the raw
+    # connection or continuing to use the raw connection after it
+    # has been assigned to another logical connection.  Be carefull
+    # and only use when you need direct access to driver specific
+    # extentions.
+    #
+    # NOTE: Do NOT close the underlying connection, only the
+    # original logical connection wrapper.
+
+    AccessToUnderlyingConnectionAllowed	false
+  </ServiceProvider>
+
+  <!--
+  # ================================================
+  # Default JMS
+  # ================================================
+  -->
+  <ServiceProvider
+          id="Default JMS Resource Adapter"
+          service="Resource"
+          types="ActiveMQResourceAdapter"
+          class-name="org.apache.openejb.resource.activemq.ActiveMQResourceAdapter">
+
+    # Broker configuration
+    BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false
+
+    # Broker address
+    ServerUrl vm://localhost?async=true
+
+    # DataSource for persistence messages
+    DataSource Default Unmanaged JDBC Database
+
+  </ServiceProvider>
+
+  <ServiceProvider
+          id="Default JMS Connection Factory"
+          service="Resource"
+          types="javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory, QueueConnectionFactory, TopicConnectionFactory"
+          class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
+
+    ResourceAdapter Default JMS Resource Adapter
+
+    # Specifies if the connection is enrolled in global transaction
+    # allowed values: xa, local or none
+    TransactionSupport xa
+
+    # Maximum number of physical connection to the ActiveMQ broker
+    PoolMaxSize 10
+
+    # Minimum number of physical connection to the ActiveMQ broker
+    PoolMinSize 0
+
+    # Maximum amount of time to wait for a connection
+    ConnectionMaxWaitMilliseconds 5000
+
+    # Maximum amount of time a connection can be idle before being reclaimed
+    ConnectionMaxIdleMinutes 15
+  </ServiceProvider>
+
+  <ServiceProvider
+          id="Default Queue"
+          service="Resource"
+          types="javax.jms.Queue, Queue"
+          constructor="destination"
+          class-name="org.apache.activemq.command.ActiveMQQueue">
+
+  </ServiceProvider>
+
+  <ServiceProvider
+          id="Default Topic"
+          service="Resource"
+          types="javax.jms.Topic, Topic"
+          constructor="destination"
+          class-name="org.apache.activemq.command.ActiveMQTopic">
+
+  </ServiceProvider>
+
+  <!--
+  # ================================================
+  # Default ORB
+  # ================================================
+  -->
+  <ServiceProvider
+          id="Default ORB"
+          service="Resource"
+          types="org.omg.CORBA.ORB, ORB"
+          factory-name="create"
+          class-name="org.apache.openejb.core.OrbFactory">
+
+  </ServiceProvider>
+
+  <!--
+  # ================================================
+  # Default ORB
+  # ================================================
+  -->
+  <ServiceProvider
+          id="Default Mail Session"
+          service="Resource"
+          types="javax.mail.Session"
+          factory-name="create"
+          class-name="org.apache.openejb.core.MailSessionFactory">
+
+  </ServiceProvider>
+
+
+</ServiceJar>

Added: openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/test/java/org/apache/openejb/jetty/test/BootstrapTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/test/java/org/apache/openejb/jetty/test/BootstrapTest.java?rev=983790&view=auto
==============================================================================
--- openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/test/java/org/apache/openejb/jetty/test/BootstrapTest.java (added)
+++ openejb/trunk/openejb3/assembly/openejb-jetty/openejb-jetty-common/src/test/java/org/apache/openejb/jetty/test/BootstrapTest.java Mon Aug  9 19:33:08 2010
@@ -0,0 +1,118 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.jetty.test;
+
+import com.gargoylesoftware.htmlunit.TextPage;
+import com.gargoylesoftware.htmlunit.WebClient;
+import org.apache.openejb.OpenEJB;
+import org.apache.openejb.jetty.common.OpenEJBLifecycle;
+import org.eclipse.jetty.server.Server;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.naming.InitialContext;
+import java.io.IOException;
+
+public class BootstrapTest {
+    private Server server;
+
+    @Before
+    public void setup() throws Exception {
+        OpenEJBLifecycle ejbLifecycle = new OpenEJBLifecycle();
+        ejbLifecycle.addApplication("target/test/ejb-examples-1.1-SNAPSHOT.war");
+
+        server = new Server(9091);
+        server.addBean(ejbLifecycle);
+        ejbLifecycle.setServer(server);
+        server.start();
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        server.stop();
+        OpenEJB.destroy();
+        InitialContext context = new InitialContext();
+        context.unbind("java:openejb");
+    }
+
+    @Test
+    public void testShouldInjectEjbsIntoServlet() throws Exception {
+        String url = "http://localhost:9091/annotated";
+
+        String[] stringsToCheck = new String[] { "@EJB=proxy=org.superbiz.servlet.AnnotatedEJBLocal;deployment=AnnotatedEJB;pk=null",
+            "@EJB.getName()=foo",
+            "@EJB.getDs()=org.apache.openejb.resource.jdbc.BasicManagedDataSource",
+            "JNDI=proxy=org.superbiz.servlet.AnnotatedEJBLocal;deployment=AnnotatedEJB;pk=null",
+            "@EJB=proxy=org.superbiz.servlet.AnnotatedEJBRemote;deployment=AnnotatedEJB;pk=null",
+            "JNDI=proxy=org.superbiz.servlet.AnnotatedEJBRemote;deployment=AnnotatedEJB;pk=null",
+            "@Resource=org.apache.openejb.resource.jdbc.BasicManagedDataSource",
+            "JNDI=org.apache.openejb.resource.jdbc.BasicManagedDataSource" };
+
+        checkStringsAppearOnPage(url, stringsToCheck);
+    }
+
+    private void checkStringsAppearOnPage(String url, String[] stringsToCheck) throws IOException {
+        final WebClient client = new WebClient();
+        TextPage page = client.getPage(url);
+
+        for (String stringToCheck : stringsToCheck) {
+            Assert.assertTrue(page.getContent().contains(stringToCheck));
+        }
+    }
+
+    @Test
+    public void testShouldLoadPersistenceContext() throws Exception {
+        String url = "http://localhost:9091/jpa";
+
+        String[] stringsToCheck = new String[] { "@PersistenceUnit=org.apache.openjpa.persistence.EntityManagerFactoryImpl",
+            "Loaded [JpaBean id=",
+            "Removed [JpaBean id=" };
+
+        checkStringsAppearOnPage(url, stringsToCheck);
+    }
+
+    @Test
+    public void testShouldJndiTree() throws Exception {
+        String url = "http://localhost:9091/jndi";
+
+        String[] stringsToCheck = new String[] { "env=",
+            "env/__=",
+            "env/__/web.xml=",
+            "env/__/web.xml/env-entry=org.eclipse.jetty.plus.jndi.EnvEntry",
+            "env/jpa-example=org.apache.openjpa.persistence.EntityManagerFactoryImpl",
+            "env/org.superbiz.servlet.AnnotatedServlet=",
+            "env/org.superbiz.servlet.AnnotatedServlet/ds=org.apache.openejb.resource.jdbc.BasicManagedDataSource",
+            "env/org.superbiz.servlet.AnnotatedServlet/localEJB=proxy=org.superbiz.servlet.AnnotatedEJBLocal;deployment=AnnotatedEJB;pk=null",
+            "env/org.superbiz.servlet.AnnotatedServlet/remoteEJB=proxy=org.superbiz.servlet.AnnotatedEJBRemote;deployment=AnnotatedEJB;pk=null",
+            "env/org.superbiz.servlet.RunAsServlet=",
+            "env/org.superbiz.servlet.RunAsServlet/secureEJBLocal=proxy=org.superbiz.servlet.SecureEJBLocal;deployment=SecureEJB;pk=null",
+            "env/org.superbiz.servlet.SecureServlet=",
+            "env/org.superbiz.servlet.SecureServlet/secureEJBLocal=proxy=org.superbiz.servlet.SecureEJBLocal;deployment=SecureEJB;pk=null",
+            "env/web.xml=",
+            "env/web.xml/Data Source=org.apache.openejb.resource.jdbc.BasicManagedDataSource",
+            "env/web.xml/EjbRemote=proxy=org.superbiz.servlet.AnnotatedEJBRemote;deployment=AnnotatedEJB;pk=null",
+            "env/web.xml/EjLocal=proxy=org.superbiz.servlet.AnnotatedEJBLocal;deployment=AnnotatedEJB;pk=null",
+            "env/web.xml/env-entry=WebValue",
+            "env/web.xml/PersistenceContext=org.apache.openejb.persistence.JtaEntityManager",
+            "env/web.xml/PersistenceUnit=org.apache.openjpa.persistence.EntityManagerFactoryImpl",
+            "env/web.xml/Queue=queue://web.xml/Queue" };
+
+        checkStringsAppearOnPage(url, stringsToCheck);
+    }
+}

Added: openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/jetty-web.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/jetty-web.xml?rev=983790&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/jetty-web.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/jetty-web.xml Mon Aug  9 19:33:08 2010
@@ -0,0 +1,10 @@
+<Configure class="org.eclipse.jetty.webapp.WebAppContext">
+  <Get name="securityHandler">
+    <Set name="loginService">
+      <New class="org.eclipse.jetty.security.HashLoginService">
+            <Set name="name">Test Realm</Set>
+            <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
+      </New>
+    </Set>
+  </Get>
+</Configure>
\ No newline at end of file

Modified: openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/web.xml?rev=983790&r1=983789&r2=983790&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/web.xml (original)
+++ openejb/trunk/openejb3/examples/webapps/ejb-examples/src/main/webapp/WEB-INF/web.xml Mon Aug  9 19:33:08 2010
@@ -116,6 +116,14 @@
     <auth-method>BASIC</auth-method>
   </login-config>
 
+  <security-role>
+      <role-name>manager</role-name>
+  </security-role>
+    
+  <security-role>
+      <role-name>user</role-name>
+  </security-role>
+
   <env-entry>
     <env-entry-name>web.xml/env-entry</env-entry-name>
     <env-entry-type>java.lang.String</env-entry-type>