Community
Participate
Working Groups
In the Dart project we recently replaced a early startup with an OSGI service, see https://github.com/eclipse/dartboard/blob/master/org.eclipse.dartboard/src/org/eclipse/dartboard/ListenerService.java or https://github.com/eclipse/dartboard/commit/39b6e6f7c2ff7a2ac2ab7f27679c199894c02531 for the diff. The user can currently deactivate the early startups, using the service would ensure the DnD functionality is always available.
Is that the only benefit? Is there a problem with the IStartup implementation? Compare https://www.eclipsezone.com//articles/extensions-vs-services/ . We could replace it by a declarative service, but is there a compelling need to do so?
I thought that early startup is deprecated since a while, but I must have dreamed that, since I don't find any documentation saying so... The summary of your linked article says: Use extension points because otherwise the eclipse IDE will not listen to your services. While that is reasonable (and I therefore also prefer extension points generally), this argument doesn't matter for replacing the IStartup extension. It's a one-shot mechanism triggered by the E4 event with no need of communicating further with the host application. I've used the same refactoring approach right now at work in a big IDE based application and I like it.
(In reply to Michael Keppler from comment #2) > The summary of your linked article says: Use extension points because > otherwise the eclipse IDE will not listen to your services. While that is > reasonable (and I therefore also prefer extension points generally), this > argument doesn't matter for replacing the IStartup extension. It's a > one-shot mechanism triggered by the E4 event with no need of communicating > further with the host application. It is also possible to communicate with your services via a IEclipseContext.get(YourService.class) call. For example, you can use Workbench.getService to access your OSGi services.
How about a headless application? I presume the UIEvents.UILifeCycle.APP_STARTUP_COMPLETE just would never be fired, thus also side-stepping the problem that was mentioned in bug 542476?
(In reply to Thomas Wolf from comment #4) > How about a headless application? I presume the > UIEvents.UILifeCycle.APP_STARTUP_COMPLETE just would never be fired, thus > also side-stepping the problem that was mentioned in bug 542476? I had a brief look yesterday into the early startup extension and I think it only registers a DnD listener which IMHO should anyhow not registered in an headless environment. So the not being called in headless node would be a plus.
Yes, it should not be called. In fact, as I pointed out in bug 542476, calling an IStartup in a headless application is a bug in EASE.
(In reply to Thomas Wolf from comment #6) > Yes, it should not be called. In fact, as I pointed out in bug 542476, > calling an IStartup in a headless application is a bug in EASE. I think it depends which IApplication is used. AFAICS our platform code only sends it out in PartRenderingEngine, which "should" only be used if you renderer something.
Gerrit change https://git.eclipse.org/r/148958 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=b3116696697b28bef9710da28ed4af9441414f8f