You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Giampaolo Tomassoni <g....@libero.it> on 2004/02/15 20:44:28 UTC

Limitations in EJBs Home interface handling by OpenENB

Dears,

it seems to me that both the 'standard' OpenEJB implementation (0.9.2) and the 
'nova' one (2.0a) don't allow using an arbitrary Home Business methods in 
deployed ejbs.

Since Home methods are the only way to remotely implement something close to 
regular java class's 'static' methods, I believe that it is important to 
support the availability of arbitrary home methods, i.e. something different 
from create<METHOD>, find<METHOD> and remove<METHOD>.

Looking at the 2.0a sources, the limitation seems related to the 
org.openejb.core.ivm.EjbHomeProxyHandler class, in which the method 
_invoke(...) seems to take into account the invocation of only the create<>, 
find<>, getEJBMetaData, getHomeHandle and remove<> method names.

It seems also that competing ejb container systems allow abstract home 
business methods, by looking for ejbHome<HOME_METHOD> in the EntityBean 
instance of the related home interface. I.e., a locateByName(...) in an Home 
interface would let the container to look for an ejbHomeLocateByName(...) 
method in the corresponding bean.

This limitation is particularly important when one tries, i.e., to overcame 
the intrinsic EJB limitation on beans inheritances by creating custom 
locate<METHOD> methods (see: http://www.onjava.com/lpt/a/2589/ ).

Also note point 9.5.4 of the ejb-2_1-fr-spec states that an ejb shall be 
allowed to implement an Home Business Bethod.

Please note I'm not an EJB expert, so maybe I'm missing some important point 
in implementing my own home business method... :)

I'm sending this note to the geronimo-dev list in the hope that somebody from 
the OpenEJB org can see it: I'm not shure whether or not the 
http://www.openejb.org site is still active.

Regards,

	Giampaolo Tomassoni


Re: Limitations in EJBs Home interface handling by OpenENB

Posted by da...@visi.com.
On Sun, Feb 15, 2004 at 08:44:28PM +0100, Giampaolo Tomassoni wrote:
>
> Looking at the 2.0a sources, the limitation seems related to the 
> org.openejb.core.ivm.EjbHomeProxyHandler class, in which the method 
> _invoke(...) seems to take into account the invocation of only the create<>, 
> find<>, getEJBMetaData, getHomeHandle and remove<> method names.

That is really not 2.0a code, just 0.9.x code left over from the time of branching.  That whole branch is a bit of a mess and will be killed in a couple days when we open up a new repository at codehaus.  I'll post to the openejb-dev list when things are ready to play with.

-- 
David Blevins

Re: Limitations in EJBs Home interface handling by OpenENB

Posted by Giampaolo Tomassoni <g....@eurosoft-italia.com>.
On Monday 16 February 2004 01:55, david.blevins@visi.com wrote:
>...omissis... If you ever have the urge to contribute
> code, I'll be happy to check it over.

Dear David and friends,

I had the impression that the problem was limited to the 
org.openejb.core.ivm.EjbHomeProxyHandler class only, so I tried to modify it 
to support the feature I need. At least, it should have been faster than 
downloading another EJB server, installing and configuring it, deploying my 
test app, ecc. ecc.

In effect, it seems that I was right at first: the 'patched' version of the 
class seems to work to me.

Whould you (and anybody else who may care) have a review at it?

I'm attaching it as a unified diff format. In both the OpenEJB revision 
threads the class is the same, so the patch should be appliable to both.

Regards,

	Giampaolo Tomassoni

PS: I'm sending this patch to the openejb-user thread too.

Re: Limitations in EJBs Home interface handling by OpenENB

Posted by Giampaolo Tomassoni <g....@libero.it>.
On Monday 16 February 2004 01:55, david.blevins@visi.com wrote:
>...omissis... If you ever have the urge to contribute
> code, I'll be happy to check it over.

Dear David and friends,

I had the impression that the problem was limited to the 
org.openejb.core.ivm.EjbHomeProxyHandler class only, so I tried to modify it 
to support the feature I need. At least, it should have been faster than 
downloading another EJB server, installing and configuring it, deploying my 
test app, ecc. ecc.

In effect, it seems that I was right at first: the 'patched' version of the 
class seems to work to me.

Whould you (and anybody else who may care) have a review at it?

I'm attaching it as a unified diff format. In both the OpenEJB revision 
threads the class is the same, so the patch should be appliable to both.

Regards,

        Giampaolo Tomassoni

PS: I'm sending this patch to the openejb-user thread too.

Re: Limitations in EJBs Home interface handling by OpenENB

Posted by Giampaolo Tomassoni <g....@eurosoft-italia.com>.
On Monday 16 February 2004 01:55, david.blevins@visi.com wrote:
> Good email, btw.  Very thorough.  If you ever have the urge to contribute
> code, I'll be happy to check it over.

Thank you David,

I don't have a patch ready for review and I'm actually working on an app, but 
contribute to an Open Software project is something I definitely want to do 
sometime in the future.

Regards,

	Giampaolo Tomassoni

Re: Limitations in EJBs Home interface handling by OpenENB

Posted by da...@visi.com.
Good email, btw.  Very thorough.  If you ever have the urge to contribute code, I'll be happy to check it over.

-- 
David Blevins

On Sun, Feb 15, 2004 at 08:44:28PM +0100, Giampaolo Tomassoni wrote:
> Dears,
> 
> it seems to me that both the 'standard' OpenEJB implementation (0.9.2) and the 
> 'nova' one (2.0a) don't allow using an arbitrary Home Business methods in 
> deployed ejbs.
> 
> Since Home methods are the only way to remotely implement something close to 
> regular java class's 'static' methods, I believe that it is important to 
> support the availability of arbitrary home methods, i.e. something different 
> from create<METHOD>, find<METHOD> and remove<METHOD>.
> 
> Looking at the 2.0a sources, the limitation seems related to the 
> org.openejb.core.ivm.EjbHomeProxyHandler class, in which the method 
> _invoke(...) seems to take into account the invocation of only the create<>, 
> find<>, getEJBMetaData, getHomeHandle and remove<> method names.
> 
> It seems also that competing ejb container systems allow abstract home 
> business methods, by looking for ejbHome<HOME_METHOD> in the EntityBean 
> instance of the related home interface. I.e., a locateByName(...) in an Home 
> interface would let the container to look for an ejbHomeLocateByName(...) 
> method in the corresponding bean.
> 
> This limitation is particularly important when one tries, i.e., to overcame 
> the intrinsic EJB limitation on beans inheritances by creating custom 
> locate<METHOD> methods (see: http://www.onjava.com/lpt/a/2589/ ).
> 
> Also note point 9.5.4 of the ejb-2_1-fr-spec states that an ejb shall be 
> allowed to implement an Home Business Bethod.
> 
> Please note I'm not an EJB expert, so maybe I'm missing some important point 
> in implementing my own home business method... :)
> 
> I'm sending this note to the geronimo-dev list in the hope that somebody from 
> the OpenEJB org can see it: I'm not shure whether or not the 
> http://www.openejb.org site is still active.
> 
> Regards,
> 
> 	Giampaolo Tomassoni