cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <>
Subject Re: best practices to use cayenne (3.0M6) under OSGI
Date Sun, 09 Aug 2009 07:23:39 GMT
see my post from a few weeks ago:

I've simply modified the Cayenne JAR adding the OSGi metadata. It is now
deployed separately as a bundle. Then, I have another bundle which
contains the domain classes and some code for loading the configuration
and setting the context class loader (Thread.setContextClassLoader())
whenever I call a Cayenne function from within my persistence bundle.
That way Cayenne can load my domain classes.

Maybe that helps you along a bit. I'm extremely busy at the moment and
haven't had time to produce a patch to make Cayenne more or less work
out of the box in an OSGi environment but this is definitely still on my
task list.

What I think needs doing in Cayenne at some point is:
- Change the Cayenne POM to generate OSGi metadata (currently I'm still
using my own unpublished tool (not Maven-based) but it should be
possible to do this with [1], too)
- An idea I've had is to figure out a way to improve domain class
loading in Cayenne so you can mark a bundle containing Cayenne domain
classes and use the extender model to give Cayenne access to the bundle.
That way, it can use the right class loader to load these classes
without you having to fiddle with the context class loader.

But right now, I'm afraid, I can't promise anything when exactly I get
to this. I hope sometime next month.

Good luck!


On 04.08.2009 13:38:15 Pazzo Da Legare wrote:
> Dear all,
> Thank you in advance for your time.
> I would like to use Cayenne in OSG, could your opinion and best
> practices to do it?
> Should Cayenne be wrapped in a service bundle? Or could I use it as "a
> library" of shared code between bundles?
> I'm looking forward to hearing from you,
> p

Jeremias Maerki

View raw message