The question your question raised with me what is the use case to stop? In true 
OSGi sense you should just wait until your dependencies are found instead of 
quitting. This allows the deployer to add the additional dependencies instead 
of having to start over. I always find this approach rather brittle, though 
pervasive in the enterprise world.

There are cases where the approach to abort is needed but those are rather rare 
imho.

Kind regards,

        Peter Kriens


On 9 mrt 2011, at 16:21, Andrea Zoppello wrote:

> Hi all,
> 
> Is it possible to stop the framework inside a bundle activator start method?
> 
> I'm asking this, because i need to have a bundle ( that i configure to start 
> ) with startup
> level lower than other that need to do some configuration steps ( setting 
> properties, prepare resources
> and so on )
> 
> My need is to stop the framework and exit if something goes wrong in this so 
> called start-up bundle.
> 
> 1) I've try to do get a reference to the system bundle and to stop by doing 
> this:
> 
> Bundle mainBundle = context.getBundleContext().getBundle(0);
> mainBundle.stop();
> 
> but this seem don't work ( i seeequinox simple configurator continue to 
> process the bundle list ).
> 
> 2) Another thing i try is to call the System.exit(0), it works but i don't 
> know if it's correct...
> 
> Which is the cleanest and right way to proceed in that case??
> 
> Andrea
> 
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to