Excerpt |
---|
An Enterprise JavaBeans(EJB) container is used to provide a run-time environment for enterprise beans within the application server. The container handles operation of EJBs and also act as an intermediary between business logic layer and the rest of the Java EE environment. |
The EJB Server
portlet that displays the EJB containers available in the server and their status is available by selecting EJB Server on the Console Navigation menu on the left hand side. You will be also presented with all the EJBs that the container is holding. The following figures illustrate the portlet layout.
Stateful Container
Configuring
To configure the default properties of each container, you can do it either from Console or by editing the config.xml
file manually. The only difference is that you must stop the server first if you choose to update config.xml
manually, while by using the Console, you can restart openEJB module on-the-fly.
Table of Contents |
---|
Understand the configuration
We'll take the DefaultStatefulContainer EJB container as an example here. By looking into config.xml
, we can see the container is defined as followedIn the the config.xml, find the "EJBNetworkService" gbean and add this gbean next to it:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
... <gbean name="DefaultStatefulContainer"> <attribute name="properties">timeout">${StatefulTimeout}</attribute> TimeOut=20 <attribute PoolSize=1000 name="capacity">${Capacity}</attribute> BulkPassivate=100 <attribute name="bulkPassivate">${BulkPassivate}</attribute> </gbean> |
Properties
Each property is as follows:
...
Property Name
...
Description
...
TimeOut
...
PoolSize
...
|
All these values are set as system variables in config-substitutions.properties
file under the same directory as config.xml
.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
...
Capacity=1000
StatefulTimeout=20
BulkPassivate=100
...
|
Which means if you want to configure any of properties, change the numbers in config-substitutions.properties
or update config.xml
after the server is stopped. Here is an example by updating config.xml
directly
...
BulkPassivate
...
Stateless Container
Configuring
In the the config.xml, find the "EJBNetworkService" gbean and add this gbean next to it:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
... <gbean name="DefaultStatelessContainerDefaultStatefulContainer"> <attribute name="properties">timeout">${StatefulTimeout}</attribute> TimeOut=0 <attribute PoolSize=10name="capacity">500</attribute> StrictPooling=true <attribute name="bulkPassivate">${BulkPassivate}</attribute> </gbean> |
Properties
Each property is as follows:
...
Property Name
...
Description
...
TimeOut
...
|
And then restart the Geronimo to make the changes take effect.
Configure the value from console
The EJB Server
portlet that displays the EJB containers available in the server and their status is available by selecting EJB Server on the Console Navigation menu on the left hand side. You will be also presented with all the EJBs that the container is holding. The following figures illustrate the portlet layout.
Expand the tree and find the container you want to configure, input the value and click Update . After that, the Console will prompt that "The openejb configuration should be restarted for the changes that were made to the fields to take effect. The changed fields are now shown in red color."
To restart the openejb module on-the-fly, go to Application->System Modules on the left panel and check Expert Mode. Then find org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/car
and click Restart to make your changes take effect.
!RestartinExpertMode!
...
PoolSize
...
StrictPooling
...