FAQ
Hi everyone,

There were a number of requests to support OSGi deployment of Cayenne over the last couple of years. Finally there is something to show in this area. With the encouragement from cghersi and using his custom-built Cayenne bundle as a prototype, I added OSGi support to 3.2 (SVN trunk). It was a two-part thing - (1) creating Cayenne jars with the right metadata, and (2) providing a seamless bootstrap mechanism for Cayenne class loading. Both of which are present now.

An example of how to write an app with it is on GitHub [1] (of course until we have 3.2.M2, the first prerequisite is to build Cayenne trunk from source). Here is how you start Cayenne in your app:

   Module osgiModule = OsgiModuleBuilder.forProject(Activator.class).withDriver(Driver.class).module();
   ServerRuntime r = new ServerRuntime("cayenne-osgi-example.xml", osgiModule);

Interation can certainly be expanded. E.g. instead of binding the driver, Cayenne might need to refer to an OSGi service that encapsulates the DataSource in the container. But this shouldn’t be too hard to add.

I would appreciate feedback from the community on this, including success/error reports and new feature suggestions.

Cheers,
Andrus


[1] https://github.com/andrus/cayenne-osgi-example

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 26, '13 at 1:50p
activeNov 26, '13 at 1:50p
posts1
users1
websitecayenne.apache.org

1 user in discussion

Andrus Adamchik: 1 post

People

Translate

site design / logo © 2022 Grokbase