You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jacek Laskowski <ja...@laskowski.net.pl> on 2011/01/02 11:47:50 UTC

Where's javax.ejb.embeddable.EJBContainer's discovery protocol described?

Hi,

I first thought to have sent the email to openejb mailing list, but
since the specs are maintained here, so did the email go.

I'm looking for information about javax.ejb.embeddable.EJBContainer's
discovery protocol. I could find javadoc and the ejb31 spec itself and
no information about how the implementation is to be found. Geronimo
relies on osgi registry as well as the classpath scanning
(META-INF/services). I can't find it in the spec/javadoc that this is
the way it should be. How did we find it out?

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://jaceklaskowski.pl

Re: Where's javax.ejb.embeddable.EJBContainer's discovery protocol described?

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Mon, Jan 3, 2011 at 10:21 PM, David Jencks <da...@yahoo.com> wrote:

> Thats the java SE ServiceLocator which is what the ejb spec says to use.
...
> hope this clarifies something :-)

Quite a lot! Thanks for your time and patience. Sorry to say so, but I
must admit that when you mentioned about the spec and servicelocator I
searched the doc and found 22.3.3 Embeddable Container Bootstrapping:

The Container Provider supplies the provider configuration file by
creating a text file named javax.ejb.spi.EJBContainerProvider and
placing it in the META-INF/servicesdirectory of one of its JAR files.
The contents of the file should be the name of the embeddable
container provider implementation class of the
javax.ejb.spi.EJBContainerProvider interface.

I meant to have read it, but...well...didn't and hence asked these
questions. What a shame! Thanks again. It's clear now and am going to
pursue more tests for my self-learning.

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://jaceklaskowski.pl

Re: Where's javax.ejb.embeddable.EJBContainer's discovery protocol described?

Posted by David Jencks <da...@yahoo.com>.
On Jan 3, 2011, at 1:00 PM, Jacek Laskowski wrote:

> On Sun, Jan 2, 2011 at 7:31 PM, David Jencks <da...@yahoo.com> wrote:
> 
>> IIRC all the EJBContainer code is in openejb.  Geronimo doesn't modify this standalone ejb container in any way, and it doesn't relate to osgi in any way either.
> 
> I don't think so and that's why I asked here. The code for the
> embeddable EJB is in geronimo spec repo -
> https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-ejb_3.1_spec.
> Take a look at src/main/java/javax/ejb/embeddable/EJBContainer.java in
> which you can find the method createEJBContainer which uses
> ProviderLocator.getServices (from
> geronimo-osgi-support/geronimo-osgi-locator) which in turn uses OSGi
> Service Registry. If OSGi doesn't provide anything useful, the method
> EJBContainer.createEJBContainer searches the classpath for
> META-INF/services. That's what bothers me, although it seems as a
> well-thought-out solution. How did we know META-INF/services should've
> been used? Where's it described? Is it described in the spec at all or
> is it something implementors can do what they think is reasonable?

Thats the java SE ServiceLocator which is what the ejb spec says to use.  ServiceLocator doesn't work in an osgi environment which is why we've enhanced the specs that use it (or simliar ideas) to use our provider locator code

For specs that use the SE service locator directly, like this ejb feature, that we want to use in osgi,  it would be better to just replace the SE ServiceLocator implementation that comes with java.  Rick has some experimental code (that AFAIK works completely) that does this but we got all the specs out before we realized that this was also a plausible solution.

Anyway, IIRC openejb fits into this scheme by providing an appropriate file in META-INF/services that says where the Openejb standalone container is.

hope this clarifies something :-)

david jencks

> 
> Jacek
> 
> -- 
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://jaceklaskowski.pl


Re: Where's javax.ejb.embeddable.EJBContainer's discovery protocol described?

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Sun, Jan 2, 2011 at 7:31 PM, David Jencks <da...@yahoo.com> wrote:

> IIRC all the EJBContainer code is in openejb.  Geronimo doesn't modify this standalone ejb container in any way, and it doesn't relate to osgi in any way either.

I don't think so and that's why I asked here. The code for the
embeddable EJB is in geronimo spec repo -
https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-ejb_3.1_spec.
Take a look at src/main/java/javax/ejb/embeddable/EJBContainer.java in
which you can find the method createEJBContainer which uses
ProviderLocator.getServices (from
geronimo-osgi-support/geronimo-osgi-locator) which in turn uses OSGi
Service Registry. If OSGi doesn't provide anything useful, the method
EJBContainer.createEJBContainer searches the classpath for
META-INF/services. That's what bothers me, although it seems as a
well-thought-out solution. How did we know META-INF/services should've
been used? Where's it described? Is it described in the spec at all or
is it something implementors can do what they think is reasonable?

Jacek

-- 
Jacek Laskowski
Notatnik Projektanta Java EE - http://jaceklaskowski.pl

Re: Where's javax.ejb.embeddable.EJBContainer's discovery protocol described?

Posted by David Jencks <da...@yahoo.com>.
Hi Jacek,

IIRC all the EJBContainer code is in openejb.  Geronimo doesn't modify this standalone ejb container in any way, and it doesn't relate to osgi in any way either.

Geronimo does not use the EJBContainer for wars that include ejbs: I have the impression that the openejb tomcat implementation might do something like this, but I'm not sure I think the result will be web-profile-compliant.

thanks
david jencks

On Jan 2, 2011, at 2:47 AM, Jacek Laskowski wrote:

> Hi,
> 
> I first thought to have sent the email to openejb mailing list, but
> since the specs are maintained here, so did the email go.
> 
> I'm looking for information about javax.ejb.embeddable.EJBContainer's
> discovery protocol. I could find javadoc and the ejb31 spec itself and
> no information about how the implementation is to be found. Geronimo
> relies on osgi registry as well as the classpath scanning
> (META-INF/services). I can't find it in the spec/javadoc that this is
> the way it should be. How did we find it out?
> 
> Jacek
> 
> -- 
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://jaceklaskowski.pl