[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.equinox] Programmatically restarting a bundle

Hi,
I already posted a message on this argument, where I notified an exception that I was getting when trying to programmatically re-start a bundle when it was stopped, eventually due to an exception (ref. msg on the 23rd August).


I implemented a bundle listener, and on the "BundleEvent.STOPPED" type of event being fired for the requested bundle I invoked its "start()" method in order to restarting it. There I got an error message:
"
org.osgi.framework.BundleException: State change in progress for bundle "file:/C:/LocalRepository/equinox/Ese1/criticalBundle.jar" by thread "OSGi Console".
..
"


After some testing I discovered that invoking the "start()" metod of such bundle in a separate thread makes the system working as I was initially expecting, so now my question is:
is this the way I should follow or I just got a "nice side effect" that is not my definitive solution?


Any hint will be appreciated very much.
Kind regards.
Maurizio