On Jan 3, 2011, at 1:00 PM, Jacek Laskowski wrote:

> On Sun, Jan 2, 2011 at 7:31 PM, David Jencks <[email protected]> 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

Reply via email to