So this is done. Cristiano, appreciate if you could try it in your environment. 
An example of how to use Cayenne with OSGi is available on GitHub [1]. Here is 
how you bootstrap it in your own module:

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

As you see, no need to enumerate your classes. Also I suspect instead of 
binding the driver, in a real OSGi environment Cayenne stack will need to refer 
to some OSGi service that encapsulates the DataSource. We can provide 
integrations for that too. And don’t forget to stop it when you your bundle is 
stopped, as you don’t want to keep Cayenne threads and other resources hanging 
around, eventually killing your container:

  cayenneRuntime.shutdown();

Cheers,
Andrus


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

Reply via email to