|
Re: Eclipse Service with DI [message #1010484 is a reply to message #1009790] |
Sun, 17 February 2013 07:47   |
Eclipse User |
|
|
|
If your bakery service is independent of the UI, but is not intended to be instantiated on a 1-1 basis with thr UI, then I'd recommend configuring it as an OSGi service, and post your events directly to the EventAdmin service instead. If you do want to use the IEventBroker for posting, do it from an addon that is introduced by a model processor -- the model processors originally had a very limited lifetime, created and then torn down, and something changed. Addons are part of the model, on the other hand, and have the same lifetime as the model itself.
Brian,
|
|
|
Re: Eclipse Service with DI [message #1010497 is a reply to message #1010484] |
Sun, 17 February 2013 08:35   |
Eclipse User |
|
|
|
Another way if you need access to the IEventBroker (=you can't simply
contribute as an OSGi-Service) is to register an IContextFunction
providing the service interface through DS.
In 4.3 we are registering our E4Workbench as an OSGi-Application which
allows you to get access to the MApplication which allows you to get
access to the IEclipseContext which allows you to access IEventBroker
even from OSGi.
Tom
Am 17.02.13 13:47, schrieb Brian de Alwis:
> If your bakery service is independent of the UI, but is not intended to
> be instantiated on a 1-1 basis with thr UI, then I'd recommend
> configuring it as an OSGi service, and post your events directly to the
> EventAdmin service instead. If you do want to use the IEventBroker for
> posting, do it from an addon that is introduced by a model processor --
> the model processors originally had a very limited lifetime, created
> and then torn down, and something changed. Addons are part of the model,
> on the other hand, and have the same lifetime as the model itself.
>
> Brian,
|
|
|
|
Powered by
FUDForum. Page generated in 0.09179 seconds