You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Dain Sundstrom <ds...@gluecode.com> on 2004/10/01 00:42:50 UTC

Re: [jira] Created: (GERONIMO-340) Add support for ejb-ref resolution by matching on the ejb interfaces

On Sep 30, 2004, at 3:31 PM, karan singh malhi wrote:

> Some applications assume that ejb-refs can be resolved by matching on
> interface types.
>
> What does this mean?

Some applications like Petstore (at least the version Rajesh used) 
don't have ejb-links so you have to resolve the reference by hand (a 
total PITA).  As a last resort the deployment code can search the ear 
for an ejb with a matching home and remote interface.  Assuming we only 
find one matching ejb, we will use that one for the ref.  If we find 
two or more matches, you would get an AmbiguousEJBRefException, and if 
we find none you would get a DeploymentException.

-dain


Re: [jira] Created: (GERONIMO-340) Add support for ejb-ref resolution by matching on the ejb interfaces

Posted by Dain Sundstrom <ds...@gluecode.com>.
On Sep 30, 2004, at 6:24 PM, karan singh malhi wrote:

>  Assuming we only
>> find one matching ejb, we will use that one for the ref.  If we find
>> two or more matches, you would get an AmbiguousEJBRefException, and if
>> we find none you would get a DeploymentException.
>>
> if the ejb-ref maps to the home and remote interface, what would be a 
> scenario where we could have amibuity?
> Right now , i cant think of a situation where we could have two 
> different matches for an ejb-ref. Could you
> please clarify that?

EJB allows for several EJBs to have the same home an remote interface.  
Actually you can have several EJBs with the same interfaces and 
implementations.  I have seen this used in applications where the same 
EJB is deployed multiple times (under different names) with different 
locking policies.

-dain


Re: [jira] Created: (GERONIMO-340) Add support for ejb-ref resolution by matching on the ejb interfaces

Posted by karan singh malhi <ka...@verizon.net>.
 Assuming we only 
> find one matching ejb, we will use that one for the ref.  If we find 
> two or more matches, you would get an AmbiguousEJBRefException, and if 
> we find none you would get a DeploymentException.
> 
if the ejb-ref maps to the home and remote interface, what would be a scenario where we could have amibuity? 
Right now , i cant think of a situation where we could have two different matches for an ejb-ref. Could you 
please clarify that?

On Thu, 2004-09-30 at 18:42, Dain Sundstrom wrote:
> On Sep 30, 2004, at 3:31 PM, karan singh malhi wrote:
> 
> > Some applications assume that ejb-refs can be resolved by matching on
> > interface types.
> >
> > What does this mean?
> 
> Some applications like Petstore (at least the version Rajesh used) 
> don't have ejb-links so you have to resolve the reference by hand (a 
> total PITA).  As a last resort the deployment code can search the ear 
> for an ejb with a matching home and remote interface.  Assuming we only 
> find one matching ejb, we will use that one for the ref.  If we find 
> two or more matches, you would get an AmbiguousEJBRefException, and if 
> we find none you would get a DeploymentException.
> 
> -dain
> 


Re: [jira] Created: (GERONIMO-340) Add support for ejb-ref resolution by matching on the ejb interfaces

Posted by Dain Sundstrom <ds...@gluecode.com>.
On Sep 30, 2004, at 3:51 PM, karan singh malhi wrote:

> Thanks Dain,
>
> How will the match be determined? is the ejb-ref name going to match 
> the
> home interface name?

No, and ejb-ref contains the name of the home interface and remote 
interface (or local and local-home).  Here is an example from one of my 
files:

     <ejb-ref>
         <ejb-ref-name>foo</ejb-ref-name>
         <ejb-ref-type>Session</ejb-ref-type>
         <home>org.acme.FooHome</home>
         <remote>org.acme.FooRemote</remote>
     </ejb-ref>

So we match using the two interfaces

> Is it possible that to remove ambiguity, we could make an entry into 
> the
> geronimo dd where we could map the ejb-ref with a fully qualified name
> of the home interface.

The goal is to not have geronimo dd for simple cases.  If you had a 
geronimo dd, you could either us the target-name (JSR 77 object name of 
the ejb) or an ejb-link.

-dain


Re: [jira] Created: (GERONIMO-340) Add support for ejb-ref resolution by matching on the ejb interfaces

Posted by karan singh malhi <ka...@verizon.net>.
Thanks Dain,

How will the match be determined? is the ejb-ref name going to match the
home interface name? 

Is it possible that to remove ambiguity, we could make an entry into the
geronimo dd where we could map the ejb-ref with a fully qualified name
of the home interface. 

On Thu, 2004-09-30 at 18:42, Dain Sundstrom wrote:
> On Sep 30, 2004, at 3:31 PM, karan singh malhi wrote:
> 
> > Some applications assume that ejb-refs can be resolved by matching on
> > interface types.
> >
> > What does this mean?
> 
> Some applications like Petstore (at least the version Rajesh used) 
> don't have ejb-links so you have to resolve the reference by hand (a 
> total PITA).  As a last resort the deployment code can search the ear 
> for an ejb with a matching home and remote interface.  Assuming we only 
> find one matching ejb, we will use that one for the ref.  If we find 
> two or more matches, you would get an AmbiguousEJBRefException, and if 
> we find none you would get a DeploymentException.
> 
> -dain
>