hstaudacher / osgi-jax-rs-connector

An OSGi - JAX-RS 2.0 Connector, software repository available on the link below
http://hstaudacher.github.io/osgi-jax-rs-connector
Other
190 stars 98 forks source link

Bundles don't start #21

Closed codescale closed 10 years ago

codescale commented 10 years ago

Hello,

in the bundles com.eclipsesource.jaxrs.consumer, com.eclipsesource.jaxrs.provider.gson and com.eclipsesource.jaxrs.publisher the Manifest-Header 'Bundle-ActivationPolicy' is set to 'lazy'. As a consumer of these bundles I neither use a class nor a service of these bundles. And because of that they will never get started.

If I remove the lazy flag everything is all right :) Alternatively I could write a bundle to start them...but I think this is less beautiful. Is there a reason why the 'lazy' flag is needed?

(I'm using them in Felix with the help of bndtools)

hstaudacher commented 10 years ago

Hmm, I think starting bundles is a configuration topic. I mean setting start levels or autostart should not be part of an application. This would mean that the bundles will never get started if you not explicitly set it to autostart, right?

With the lazy policy we can at least ensure that the bundle will be started when a class was loaded.

But on the other hand you will never call a class from the connector or provider bundles.

I can't make up my mind here right now. Maybe @BryanHunt has an opinion here?

BryanHunt commented 10 years ago

Using lazy start is considered best practice for Eclipse, but worst practice for Bndtools. If you use bundles with lazy activation with Bndtools, you need something like Neil's caffeine bundle to get those bundles started. I believe Neil has a good argument (somewhere) for not using lazy activation. The flip-side is that using bundles without lazy activation and an Eclipse launcher, you have to know to set auto-start to true.

My personal preference would be to not use lazy activation since this project would typically be consumed by those developing server side software and always wanting their bundles to start.

codescale commented 10 years ago

@BryanHunt :+1: agree :)

hstaudacher commented 10 years ago

Alright, I don;t have any strong opinion here. @codescale would you mind to open a pull request containing the changes for all bundles?

codescale commented 10 years ago

@hstaudacher sure. I 'll open a pull request as soon as possible...(can't access the repository currently)

BryanHunt commented 10 years ago

@hstaudacher Should we enable the Wiki so that we can document stuff like this?

hstaudacher commented 10 years ago

@BryanHunt very good Idea. I have enabled it and created a FAQ Page. Would you add more? I'll created a separate issue #23 for this and will close this one.