|
|  |
The Resin-CMP EJB Server is implemented as a JNDI resource. Like any
other resource, it is to be set up in resin.conf or web.xml.
The following stripped-down web.xml sets up Resin-CMP
so local clients can use java:comp/env/cmp to find the home
interfaces.
Because the EJB server is a JNDI resource, it can be placed in any
JNDI resource context: <web-app>, <host>, or <http-server>.
An EJBServer in the <host> context, for example, will be shared
across all applications for that host.
The following is a sample web.xml configuration. More
details are available in:
EJBServer will automatically read the *.ejb files in WEB-INF and
load their defined beans.
web.xml
<web-app>
<!-- Database configuration -->
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.XADataSource</res-type>
<init-param driver-name="com.caucho.jdbc.mysql.Driver"/>
<init-param url="jdbc:mysql-caucho://localhost:3306/test"/>
</resource-ref>
<!-- Resin-CMP server configuration -->
<resource-ref>
<res-ref-name id="java:comp/env/cmp"/>
<class-name id='com.caucho.ejb.EJBServer'/>
<init-param data-source='java:comp/env/jdbc/test'/>
</resource-ref>
</web-app>
|
EJBServer init-parameters
| Parameter | Meaning | Default
|
| auto-compile | If true, automatically generate the persistence and EJB code | true
|
| create-database-schema | If the entity beans do not yet exist in the data-source, create the tables | false
|
| data-source | The database's JNDI name | java:comp/env/jdbc/test
|
| distributed | Set true for multiple parallel servers | false
|
| ejb-config-dir | Directory to search for *.ejb files | WEB-INF
|
| entity-cache-size | How many entity beans are cached | 8192
|
| entity-cache-timeout | How long a loaded CMP bean can be cached before reloading | Infinity
|
| resin-isolation | Whether updates should use row-locking (FOR UPDATE) or rely on the database's isolation database | database
|
| jdbc-isolation | Selects the JDBC isolation for an update transaction | the database's default
|
| transaction-timeout | How long a transaction should wait before timing out (in seconds) | 60
|
| queue-connection-factory | Sets the JNDI name for the QueueConnectionFactory | none
|
| topic-connection-factory | Sets the JNDI name for the TopicConnectionFactory | none
|
| validate-database-schema | If true, automatically validate against the database using JDBC | false
|
External protocols are generally implemented as servlets.
Only applications which expose an external interface will have
protocol servlets.
Burlap
<!-- Burlap protocol configuration -->
<servlet-mapping>
<url-pattern id='/burlap/*'/>
<servlet-name id='com.caucho.burlap.EJBServlet'/>
</servlet-mapping>
|
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark,
and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc. | ![]() |
|