My mind is flooding with so much new information I can't make sense of
it yet. So this might not help you at all, in which case I apologize.

Either way, what you are trying to do seems very much like what
Geronimo does regarding GBeans. When the EJB is deployed, it's done
through the EjbDeploymentGBean, which creates a GBean data for the
EJB, for it to be exposed as/through a GBean. The last part I'm not
too sure off, but you could maybe take a look at the code in
geronimo's 2.2/branch. A stack trace of this is available through the
following 
{geronimo}/plugins/openejb/geronimo-openejb-builders/->org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.initContext().
At this point you can see the full strack trace of where things came
from deploying an EJB via a GBean.

Also have a look at plugins/openejb/geronimo-openejb ->
org.apache.geronimo.openejb.EjbDeploymentGBean and {x}DeploymentGBean,
and so on. I assume when doing it via OSGi you would need different
service implementations for the different beans, like it is currently
with the GBeans. In general these 2 geronimo-openejb projects have a
lot of what sounds like your requirements.

Hope it helps.

Quintin Beukes



On Wed, Oct 21, 2009 at 3:32 PM, Jacek Laskowski <[email protected]> wrote:
> Hi,
>
> I've lately been wondering about the other pieces for openejb
> osgi'fication and am stuck. I'll need your help or I won't do any
> further step as thinking has grabbed my free cycles completely.
>
> OSGi may seem as quite a different technology, but what it does with
> our development perspective is to think about classloaders and
> services. Everything in OSGi is just about classloaders/services and
> its implication to the app.
>
> There're the openejb bundles, but they're nothing more than just a
> collection of classes. If you run a osgi provider and staff it with
> these bundles, they're started, but it doesn't mean openejb is started
> itself. When a bundle is started, it just means that the
> imports/exports are resolved and available. OpenEJB could not be
> started yet. It's an activator (an instance of
> org.osgi.framework.BundleActivator) that's responsible for doing
> what's required to fully start the bundlized application (in our case
> - openejb). A bundle gives its classes/interfaces via exports or
> services. The exports are to let others compose their classloaders
> with necessary classes provided by other bundles. So, once the bundles
> are started, the activator kicks in and do the job of starting the
> app. That's where I'm stack. I need to create necessary openejb
> services (in OSGi terms). Can you point me to the simplest way to boot
> openejb? The about-to-be-created OSGi service for OpenEJB is just like
> LocalInitialContextFactory that boots openejb when a lookup is fired
> and holds a reference to it - exactly what the future osgi service
> will do.
>
> ...after a while...
>
> After a couple of minutes reading the email of mine over and over
> again, I think I'll figure out what I was after. I just need to copy
> what's in LocalInitialContextFactory! :) So, here goes another
> question - how do I deploy an ejb? A test case would be of much help.
> I need a way to get a reference to the just-deployed ejb, so I'll be
> able to expose it as a osgi service. It should work, doesn't it?
>
> Jacek
>
> --
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
>

Reply via email to