[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: How do I disable my own plugin at start up time?

Well the OSGI spec says that startup shouldn't take too long. And I have seen warnings in Eclipse stating that Plugin XY took longer than xxx seconds to startup and that the framework will not wait for the plugin to start up and continue with its startup routine. Most of the time the mentioned plugin gets started eventually but it won't be in the proper sequence anymore so if you depend on other stuff happening this will break your code I assume. Maybe one of the Equinox/Eclipse experts on this group can provide more insisght since I believe it is up to the OSGI implementation how to deal with lengthy startups.

You could stop your plugin and restart it using OSGI this way only your plugin will be shutdown and any plugin depending on yours. To test what will happen you might want to start eclipse with the -console parameter and issue the stop and start bundle commands manually. But be aware that when you start a plugin manually Eclipse will start it eagerly the next time you fire up Eclipse.

Since the error condition is very seldom just provide an appropriate dialog telling the user to restart the workbench. You could even provide a button in the dialog that will do it if the user has no other data to save. This will leave control to the user.

Of course your views and perspectives will still have to deal with the error condition so putting in some error handling code for the error will be a must.

Regards
Stefan


Farokh Morshed schrieb:
Unfortunately, the error state is not recoverable. It is also rare that it could happen. User has killed a process vital to the plugin or uninstalled it in the middle of using the plugin.

Once the user hits this error, the plugin has to be "restarted" before it can be used again. Of course, one way is to just restart Eclipse.

It is probably acceptable for the user to restart Eclipse after saving away unsaved stuff in other plugins.

The issue is that time after user gets my popup message that the vital server process has disappeard and he needs to restart, and before user actually restarts. During this time, our perspective is the current, our menu buttons are everywhere, our views are open but not really functional. Come to think of it, I am not sure what Eclipse could do for me here. I suppose I could fire an event to all my views to shutdown.

Is there a public API for popping the current perspective? That would clean things up some.

As for your suggestion to move the lengthy task of launching this server process from start to first use of it, and that it could be skipped if it took too long, I don't see anything to suggest that there is some time limit for start. Is there? I need this server process during method start under certain conditions!
Thank you.