geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Configuring EJB Containers
Date Wed, 26 Jan 2011 06:36:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+EJB+Containers">Configuring
EJB Containers</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (13)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-changed-lines" >{excerpt}An Enterprise JavaBeans(EJB)
container is used to provide a <span class="diff-changed-words">run<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">-</span>time</span>
environment for enterprise beans within the application server. The container handles operation
of EJBs and also <span class="diff-changed-words">act<span class="diff-added-chars"style="background-color:
#dfd;">s</span></span> as an intermediary between <span class="diff-added-words"style="background-color:
#dfd;">the</span> business logic layer and the rest of the Java EE environment.{excerpt}
In Geronimo, [OpenEJB|http://openejb.apache.org/] is included as a plugin to manage EJBs.
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">In
Geronimo you only have a single container each for Stateless and Stateful session beans and
in OpenEJB the pool size is set per container. You can set only a pool size for all stateless
beans and another for all stateful beans.  <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">In
Geronimo, stateless and stateful session beans have only one container each. In OpenEJB, the
pool size is set per container. Therefore, you can set only one pool size for all stateless
beans and one for all stateful beans.  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">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 using the Console, you can restart
OpenEJB module on-the-fly. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">To
configure the default properties of each container, you can either use the administration
console or edit 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 using the administration
console, you can restart OpenEJB module on-the-fly. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{toc} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h1. Understanding the configuration
<br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">We&#39;ll
take the EJB container *DefaultStatefulContainer* as an example here. By looking into {{config.xml}},
we can see the container is defined as followed: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Take
the EJB container *DefaultStatefulContainer* as an example. By looking into {{config.xml}},
you can see the container is defined as follows: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:xml|title=config.xml}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Which
means if</span> <span class="diff-added-words"style="background-color: #dfd;">If</span>
you want to configure any of <span class="diff-added-words"style="background-color: #dfd;">the</span>
properties, change the numbers in {{config-substitutions.properties}} or update {{config.xml}}
after the server is stopped. Here is an example <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">by
updating</span> <span class="diff-added-words"style="background-color: #dfd;">that
updates</span> {{config.xml}} directly: <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:xml|title=config.xml}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">And
then restart</span> <span class="diff-added-words"style="background-color: #dfd;">Restart</span>
the Geronimo to make the changes take effect. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Configuring the value
from console <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >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 <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">hand</span>
side. You will <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">be</span>
also <span class="diff-added-words"style="background-color: #dfd;">be</span> presented
with all the EJBs that the container is holding. The following figures illustrate the portlet
layout. <br></td></tr>
            <tr><td class="diff-unchanged" >\\ <br>!EJB Container.jpeg!
<br>\\ <br>\\ <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Expand
the tree and find the container you want to configure, input the value and click *Update*
. After that, the Console will prompt: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Expand
the tree and find the container that you want to configure. Input the value and click *Update*
. After that, the administration console will prompt the following message: <br></td></tr>
            <tr><td class="diff-unchanged" >{{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.}} <br>\\ <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >\\ <br>\\ <br></td></tr>
            <tr><td class="diff-changed-lines" >To restart the openejb module
on-the-fly, click *Application*-&gt;*System Modules* on the left panel and <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">check</span>
<span class="diff-added-words"style="background-color: #dfd;">select the</span>
*Expert <span class="diff-changed-words">Mode*<span class="diff-added-chars"style="background-color:
#dfd;"> check box</span>.</span> Then find {{org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/car}}
and click *Restart* to make your changes take effect. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>!RestartinExpertMode.png!
<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>An Enterprise JavaBeans(EJB) container is used to provide a runtime environment
for enterprise beans within the application server. The container handles operation of EJBs
and also acts as an intermediary between the business logic layer and the rest of the Java
EE environment. In Geronimo, <a href="http://openejb.apache.org/" class="external-link"
rel="nofollow">OpenEJB</a> is included as a plugin to manage EJBs.</p>

<p>In Geronimo, stateless and stateful session beans have only one container each. In
OpenEJB, the pool size is set per container. Therefore, you can set only one pool size for
all stateless beans and one for all stateful beans. </p>

<p>To configure the default properties of each container, you can either use the administration
console or edit the <tt>config.xml</tt> file manually. The only difference is
that you must stop the server first if you choose to update <tt>config.xml</tt>
manually; while using the administration console, you can restart OpenEJB module on-the-fly.</p>

<div>
<ul>
    <li><a href='#ConfiguringEJBContainers-Understandingtheconfiguration'>Understanding
the configuration</a></li>
    <li><a href='#ConfiguringEJBContainers-Configuringthevaluefromconsole'>Configuring
the value from console</a></li>
</ul></div>

<h1><a name="ConfiguringEJBContainers-Understandingtheconfiguration"></a>Understanding
the configuration</h1>

<p>Take the EJB container <b>DefaultStatefulContainer</b> as an example.
By looking into <tt>config.xml</tt>, you can see the container is defined as follows:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>config.xml</b></div><div class="codeContent
panelContent">
<pre class="code-xml">
    ...  
      <span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultStatefulContainer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"timeout"</span>&gt;</span>${StatefulTimeout}<span
class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"capacity"</span>&gt;</span>${Capacity}<span
class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"bulkPassivate"</span>&gt;</span>${BulkPassivate}<span
class="code-tag">&lt;/attribute&gt;</span>
       <span class="code-tag">&lt;/gbean&gt;</span>
...
</pre>
</div></div>

<p>All these values are set as system variables in <tt>config-substitutions.properties</tt>
file under the same directory as <tt>config.xml</tt>.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>config-substitutions.properties</b></div><div
class="codeContent panelContent">
<pre class="code-xml">
    ...  
      Capacity=1000
      StatefulTimeout=20
      BulkPassivate=100
 ...
</pre>
</div></div>

<p>If you want to configure any of the properties, change the numbers in <tt>config-substitutions.properties</tt>
or update <tt>config.xml</tt> after the server is stopped. Here is an example
that updates <tt>config.xml</tt> directly:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>config.xml</b></div><div class="codeContent
panelContent">
<pre class="code-xml">
    ...  
      <span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultStatefulContainer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"timeout"</span>&gt;</span>${StatefulTimeout}<span
class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"capacity"</span>&gt;</span>500<span
class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"bulkPassivate"</span>&gt;</span>${BulkPassivate}<span
class="code-tag">&lt;/attribute&gt;</span>
       <span class="code-tag">&lt;/gbean&gt;</span>
 ...
</pre>
</div></div>

<p>Restart the Geronimo to make the changes take effect.</p>

<h1><a name="ConfiguringEJBContainers-Configuringthevaluefromconsole"></a>Configuring
the value from console</h1>

<p>The <b>EJB Server</b> portlet that displays the EJB containers available
in the server and their status is available by selecting <b>EJB Server</b> on
the <b>Console</b> Navigation menu on the left side. You will also be presented
with all the EJBs that the container is holding. The following figures illustrate the portlet
layout.
<br class="atl-forced-newline" />
<span class="image-wrap" style=""><img src="/confluence/download/attachments/20645313/EJB+container.jpeg?version=1&amp;modificationDate=1242695388000"
style="border: 0px solid black" /></span>
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
Expand the tree and find the container that you want to configure. Input the value and click
<b>Update</b> . After that, the administration console will prompt the following
message:<br/>
<tt>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.</tt>
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
<span class="image-wrap" style=""><img src="/confluence/download/attachments/20645313/ConfigureEJBcontainers.png?version=1&amp;modificationDate=1244079998000"
style="border: 0px solid black" /></span>
<br class="atl-forced-newline" />
<br class="atl-forced-newline" />
To restart the openejb module on-the-fly, click <b>Application</b>-&gt;<b>System
Modules</b> on the left panel and select the <b>Expert Mode</b> check box.
Then find <tt>org.apache.geronimo.configs/openejb/2.2-SNAPSHOT/car</tt> and click
<b>Restart</b> to make your changes take effect.</p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/20645313/RestartinExpertMode.png?version=1&amp;modificationDate=1244080004000"
style="border: 0px solid black" /></span></p>






    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+EJB+Containers">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645313&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+EJB+Containers?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message