openejb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <>
Subject openejb as a osgi service?
Date Wed, 21 Oct 2009 13:32:22 GMT

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 Laskowski
Notatnik Projektanta Java EE -

View raw message