[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Eclipse ViewPart and OSGI Declarative Servicesproblem
- From: "O'Flynn, Dennis" <Dennis.OFlynn@xxxxxxxxxxxxx>
- Date: Tue, 2 Nov 2010 08:34:28 -0400
- Delivered-to: email@example.com
- Thread-index: Act6frKeXmt/f9JiT6SpyRYaAAJunwAC2sSw
- Thread-topic: [equinox-dev] Eclipse ViewPart and OSGI Declarative Servicesproblem
Another dependency-injection approach is Spring. Martin Libbert provided a way to bridge extension points w/ spring beans. See his blog at:
From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Neil Bartlett
Sent: Tuesday, November 02, 2010 7:11 AM
To: Equinox development mailing list
Subject: Re: [equinox-dev] Eclipse ViewPart and OSGI Declarative Servicesproblem
This is a rather challenging area, because the lifecycles of services
and extensions are completely unrelated. As you've noticed, creating a
component with DS does not mean it will be used by the extension
registry. Indeed it cannot be, because the extension registry is more
like a factory where new instances are created each time they are
I created a small framework to help with this kind of thing:
http://github.com/njbartlett/extensions2services. Please be sure to
read the manual (in PDF), because it helps to describe the background
of the problem, even if you decide not to adopt my solution.
Other possible solutions, which all use or include a
dependency-injection approach, are as follows:
1) Eclipse Riena -- however Riena does a lot of other stuff that I
don't really understand
2) Peaberry is based on Guice
3) Eclipse 4.0 ("e4") uses dependency injection everywhere, but this
is not much use to you if you are using 3.x.
On Mon, Nov 1, 2010 at 9:17 PM, Richard Catlin
> I have a ViewPart which depends on an OSGI Declarative Service.
> I have it configured properly so that the service is injected into the
> ViewPart via a bind method.Â I can debug and see that this is working.
> The problem I am having is that a new instance of the ViewPart is being
> instantiated for viewing and that the instance that was injected is not
> being used.
> Any help is appreciated.
> Richard Catlin
> equinox-dev mailing list
equinox-dev mailing list