tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] OpenEJB 3.0.x documentation > App Clients and JNDI
Date Fri, 10 Jun 2011 20:13:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=OPENEJBx30&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/OPENEJBx30/App+Clients+and+JNDI">App
Clients and JNDI</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~karan_malhi">Karan
Singh Malhi</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The &#39;openejb/local&#39;
section is for &quot;pretty&quot; names looked up via the LocalInitialContextFactory.
<br> <br></td></tr>
            <tr><td class="diff-changed-lines" >The &quot;pretty&quot;
names are defined by the openejb.jndiname.format and since the user has control of that formatting
it&#39;s possible that not all proxies can be bound. &amp;nbsp;Say the bean has both
a local and remote interface and the user has just <span class="diff-changed-words">&quot;<span
class="diff-added-chars"style="background-color: #dfd;">\</span>{deploymentId<span
class="diff-added-chars"style="background-color: #dfd;">\</span>}&quot;</span>
or <span class="diff-changed-words">&quot;<span class="diff-added-chars"style="background-color:
#dfd;">\</span>{ejbName<span class="diff-added-chars"style="background-color:
#dfd;">\</span>}&quot;</span> as the format. &amp;nbsp;Hence those
bind calls use the &quot;optional&quot; set of binding methods. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>The format of the internal
names bound into openejb/Deployment is guaranteed to be unique. &amp;nbsp;It&#39;s
not pretty to look at obviously, but every possible proxy will be bound there guaranteed.
&amp;nbsp;For binding into &#39;openejb/Deployment&#39; we don&#39;t use the
&quot;optional&quot; set of binding methods. &amp;nbsp;If something can&#39;t
be bound it&#39;s a deployment issue. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>There are some slight differences between the way OpenEJB does app clients
and the way Geronimo does app clients</p>


<p>Neither uses the names created via the openejb.jndiname.format. &nbsp;So changing
that will (should) have no affect. &nbsp;The idea is that users should be able to set
it to be whatever they want it to be and that should not break the App Client code. &nbsp;The
openejb.jndiname.format is specifically for "plain" clients and allows them to get the names
as they want them.</p>

<p>Internally, we bind each EJB proxy under essentially a hardcoded and predictable
format and then again using the user supplied format. &nbsp;So there are at minimum two
JNDI trees with every EJB proxy. &nbsp;It used to be two at least. &nbsp;Now we have
quite a few because of Java EE 6 global JNDI and the support we added for @LocalClient and
allowing the same interface to be used as both @Local and @Remote.</p>

<p>Basically we have:</p>

<p>&nbsp;openejb/Deployment/&lt;hardcoded internal format&gt;<br/>
&nbsp;openejb/local/&lt;strategy format&gt;<br/>
&nbsp;openejb/remote/&lt;strategy format&gt;</p>

<p>The 'openejb/Deployment' section is the non-changing fully qualified name for use
internally and by app clients.</p>

<p>The 'openejb/remote' section is for "pretty" names looked up via plain clients using
the RemoteInitialContextFactory. &nbsp;The protocol can tell the difference between app
clients and plain clients and knows which area to look in.</p>

<p>The 'openejb/local' section is for "pretty" names looked up via the LocalInitialContextFactory.</p>

<p>The "pretty" names are defined by the openejb.jndiname.format and since the user
has control of that formatting it's possible that not all proxies can be bound. &nbsp;Say
the bean has both a local and remote interface and the user has just "{deploymentId}" or "{ejbName}"
as the format. &nbsp;Hence those bind calls use the "optional" set of binding methods.</p>

<p>The format of the internal names bound into openejb/Deployment is guaranteed to be
unique. &nbsp;It's not pretty to look at obviously, but every possible proxy will be bound
there guaranteed. &nbsp;For binding into 'openejb/Deployment' we don't use the "optional"
set of binding methods. &nbsp;If something can't be bound it's a deployment issue.</p>

<p>The home interface is bound, but with the name of the corresponding business interface
rather than the home interface. &nbsp;</p>

<p>To be a little bit more clear - &nbsp;Both OpenEJB and Geronimo build their own
JNDI trees for the App Client. &nbsp;Geronimo prefers to have its own JNDI tree for the
App Client as there are other things in it that are not EJB related. &nbsp;Either way
the OpenEJB EJBd protocol can carry the "id" of the App Client and both Geronimo and OpenEJB
rely on that.</p>

<p>In Geronimo App Clients the id is set to "Deployments" and that tells OpenEJB not
to look in the "openejb/remote" section of JNDI as it normally would. &nbsp;It will instead
use the "openejb/Deployments" section of JNDI were the names follow a predictable and unchanging
format.</p>

<p>In OpenEJB App Clients the id is set to the name of the App Client and we instead
look in "openejb/client/&lt;id&gt;/" where names are formatted by the user via the
application-client.xml.</p>

<p>When calls are made from client to server and the App Client module id is not present,
we look in openejb/remote/ where names are formatted using the openejb.jndi.format</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/OPENEJBx30/App+Clients+and+JNDI">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=26805338&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/OPENEJBx30/App+Clients+and+JNDI?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message