Defines runtime properties for a single enterprise bean within the application. The subelements listed below apply to particular enterprise beans as follows:
All types of beans: ejb-name, ejb-ref, resource-ref, resource-env-ref, ior-security-config, gen-classes, jndi-name, use-thread-pool-id, message-destination-ref, pass-by-reference, service-ref
Stateless session beans: bean-pool, webservice-endpoint
Stateful session beans: bean-cache, webservice-endpoint, checkpoint-at-end-of-method
Entity beans: commit-option, bean-cache, bean-pool, cmp, is-read-only-bean, refresh-period-in-seconds, flush-at-end-of-method
Message-driven beans: mdb-resource-adapter, mdb-connection-factory, jms-durable-subscription-name, jms-max-messages-load, bean-pool
enterprise-beans (sun-ejb-jar.xml)
The following table describes subelements for the ejb element.
Table A–42 ejb Subelements
Element |
Required |
Description |
---|---|---|
only one |
Matches the ejb-name in the corresponding ejb-jar.xml file. |
|
zero or more |
Specifies the absolute jndi-name. |
|
zero or more |
Maps the absolute JNDI name to the ejb-ref element in the corresponding Java EE XML file. |
|
zero or more |
Maps the absolute JNDI name to the resource-ref in the corresponding Java EE XML file. |
|
zero or more |
Maps the absolute JNDI name to the resource-env-ref in the corresponding Java EE XML file. |
|
zero or more |
Specifies runtime settings for a web service reference. |
|
zero or more |
Specifies the name of a physical message destination. |
|
zero or one |
Specifies the passing method used by an enterprise bean calling a remote interface method in another bean that is colocated within the same process. |
|
zero or one |
Specifies runtime information for a container-managed persistence (CMP) entity bean for EJB 1.1 and EJB 2.1 beans. |
|
zero or one |
Specifies the principal (user) name in an enterprise bean that has the run-as role specified. |
|
zero or one |
Specifies the connection factory associated with a message-driven bean. |
|
zero or one |
Specifies the durable subscription associated with a message-driven bean. |
|
zero or one |
Specifies the maximum number of messages to load into a Java Message Service session at one time for a message-driven bean to serve. The default is 1. |
|
zero or one |
Specifies the security information for the IOR. |
|
zero or one |
Specifies that this entity bean is read-only. |
|
zero or one |
Specifies the rate at which a read-only-bean must be refreshed from the data source. |
|
zero or one |
Has valid values of B or C. Default value is B. |
|
zero or one |
Overrides the Transaction Timeout setting of the Transaction Service for an individual bean. |
|
zero or one |
Specifies the thread pool from which threads are selected for remote invocations of this bean. |
|
zero or one |
Specifies all the generated class names for a bean. |
|
zero or one |
Specifies the bean pool properties. Used for stateless session beans, entity beans, and message-driven beans. |
|
zero or one |
Specifies the bean cache properties. Used only for stateful session beans and entity beans. |
|
zero or one |
Specifies runtime configuration information for a message-driven bean. |
|
zero or more |
Specifies information about a web service endpoint. |
|
zero or one |
Specifies the methods that force a database flush after execution. Used for entity beans. |
|
zero or one |
Deprecated. Supported for backward compatibility. Use checkpoint-at-end-of-method instead. |
|
zero or one |
Specifies that the stateful session bean state is checkpointed, or persisted, after the specified methods are executed. The availability-enabled attribute must be set to true. |
The following table describes attributes for the ejb element.
Table A–43 ejb Attributes
Attribute |
Default |
Description |
---|---|---|
false |
(optional)If set to true, and if availability is enabled in the EJB container, high-availability features apply to this bean if it is a stateful session bean. |
<ejb> <ejb-name>CustomerEJB</ejb-name> <jndi-name>customer</jndi-name> <resource-ref> <res-ref-name>jdbc/SimpleBank</res-ref-name> <jndi-name>jdbc/__default</jndi-name> </resource-ref> <is-read-only-bean>false</is-read-only-bean> <commit-option>B</commit-option> <bean-pool> <steady-pool-size>10</steady-pool-size> <resize-quantity>10</resize-quantity> <max-pool-size>100</max-pool-size> <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds> </bean-pool> <bean-cache> <max-cache-size>100</max-cache-size> <resize-quantity>10</resize-quantity> <removal-timeout-in-seconds>3600</removal-timeout-in-seconds> <victim-selection-policy>LRU</victim-selection-policy> </bean-cache> </ejb>