Reputation: 901
I have an RCP application that has several plugins defined in it for data and functional seperation.
I need all of the plugins to activate when the application starts (a couple of them need to register for network events). I have the "Activate this plug-in when one of it's classes is loaded" box unchecked, from looking at the xml when this box is checked and unchecked it appears that this is actually a lazy loading indicator.
If I add the plugins to the configuration page in the .product I get ClassNotFoundExceptions for each of the activators.
What is the best way to get a plugin to start automatically when an RCP application starts?
Upvotes: 0
Views: 124
Reputation: 3621
I'd rather that plugin have minimal knowledge of the other plugins
In that case you can do what Eclipse does: define an extension point in launcher and let all plugins that need to be started extend that extension point.
Upvotes: 1
Reputation: 19443
I would turn on the "Activate... when one of it's classes are loaded" and then just make sure you touch all of the classes you need at startup time (which you will have to do anyways to get your code going). I think there are some deprecated methods of forcing plugin activation at startup, but you should not need to go there. In general, just calling a class in the plugin will cause it to be loaded and started if everything is set up right, you should not need to do anything special.
Your app presumably has one of the classes called by the Eclipse boot (like WindowWorkbenchAdvisor
or something like that (there are many hooks in the boot), just pick the one that makes sense and call your code.
Upvotes: 0