Home » Eclipse Projects » Equinox » [DS] Why is it necessary to activate bundles offering services?
| |
Re: [DS] Why is it necessary to activate bundles offering services? [message #127953 is a reply to message #127934] |
Thu, 26 March 2009 15:38 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Chris,
thanks for your feedback. From intuition I thought DS register something
like a "proxy" to a service, so as soon the service is demanded, the
bundle gets activated and the proxy is resolved. I read the OSGi spec
for DS but couldn't clarify this issue. Only when I looked at the code
and saw (if bundle.getState() == Bundle.ACTIVE)...
I guess the implementation of R4.2 is not included in latest (HEAD)
org.eclipse.equinox.ds, right?
Cheers
Víctor.
Chris Aniszczyk escribió:
> Víctor Roldán Betancort wrote:
>> Hi everyone,
>>
>> I've been lately experimenting with Declarative Services and faced and
>> issue I don't quite understand. Apparently, we need to activate
>> bundles offering services if we want org.eclipse.equinox.ds to
>> register it to the service registry. I don't exactly see the point of
>> this. Wasn't declarative services all about lazy registration? What's
>> the concept of delayed service for then? Am I missing something here?
>
> The lifecycle of the service registry and the extension registry are
> different. Services are only available when the bundle is in the ACTIVE
> state. Extensions are available in the RESOLVED state.
>
> In the R4.2 version of DS, DS allows to look for bundles in the STARTING
> state (lazy activation). Therefore, you can add:
> Bundle-ActivationPolicy: lazy
>
> Once you do that, DS should be able to work the way you expect it... as
> long as DS is started of course!
>
> Cheers,
>
> Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
> http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
Re: [DS] Why is it necessary to activate bundles offering services? [message #128065 is a reply to message #127920] |
Mon, 30 March 2009 02:50 |
|
Hi Vik,
Note also that a classloader is not created immediately on activation of
a bundle if that bundle does not declare an activator and all offered
services are lazy (default).
Cheers
/Eike
----
http://thegordian.blogspot.com
Víctor Roldán Betancort schrieb:
> Hi everyone,
>
> I've been lately experimenting with Declarative Services and faced and
> issue I don't quite understand. Apparently, we need to activate
> bundles offering services if we want org.eclipse.equinox.ds to
> register it to the service registry. I don't exactly see the point of
> this. Wasn't declarative services all about lazy registration? What's
> the concept of delayed service for then? Am I missing something here?
>
> Doesn't Eclipse's Extension Point work that in such a lazy way?
>
> Thanks in advance,
> Víctor.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [DS] Why is it necessary to activate bundles offering services? [message #128078 is a reply to message #127953] |
Mon, 30 March 2009 09:05 |
Stefan Messages: 316 Registered: July 2009 |
Senior Member |
|
|
Victor,
AFAIK, DS doesn't use proxies (in contrast to Spring DM). Parts of R4.2
should be in CVS HEAD, too.
I found the slides in [1] very helpful.
Regards,
Stefan.
[1]
https://www.gpublication.com/eclipse/#requestedContent=conte ntID://EclipseConferences/EC2009/245
Víctor Roldán Betancort schrieb:
> Chris,
>
> thanks for your feedback. From intuition I thought DS register something
> like a "proxy" to a service, so as soon the service is demanded, the
> bundle gets activated and the proxy is resolved. I read the OSGi spec
> for DS but couldn't clarify this issue. Only when I looked at the code
> and saw (if bundle.getState() == Bundle.ACTIVE)...
>
> I guess the implementation of R4.2 is not included in latest (HEAD)
> org.eclipse.equinox.ds, right?
>
> Cheers
> Víctor.
>
> Chris Aniszczyk escribió:
>> Víctor Roldán Betancort wrote:
>>> Hi everyone,
>>>
>>> I've been lately experimenting with Declarative Services and faced
>>> and issue I don't quite understand. Apparently, we need to activate
>>> bundles offering services if we want org.eclipse.equinox.ds to
>>> register it to the service registry. I don't exactly see the point of
>>> this. Wasn't declarative services all about lazy registration? What's
>>> the concept of delayed service for then? Am I missing something here?
>>
>> The lifecycle of the service registry and the extension registry are
>> different. Services are only available when the bundle is in the
>> ACTIVE state. Extensions are available in the RESOLVED state.
>>
>> In the R4.2 version of DS, DS allows to look for bundles in the
>> STARTING state (lazy activation). Therefore, you can add:
>> Bundle-ActivationPolicy: lazy
>>
>> Once you do that, DS should be able to work the way you expect it...
>> as long as DS is started of course!
>>
>> Cheers,
>>
>> Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
>> http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
Re: [DS] Why is it necessary to activate bundles offering services? [message #128176 is a reply to message #128078] |
Tue, 31 March 2009 11:05 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Stefan,
thanks for the hint. I'm using ganymede, so HEAD is not an option :(
I already created a special bundle that analyzes all registered bundles
and activates them if they define services component. Is not the best
solution, but at least is better than setting all service-providing
bundles to start at eclipe's startup!
Thanks for the slides, quite interesting!
Cheers,
ViK
Stefan Roeck escribió:
> Victor,
>
> AFAIK, DS doesn't use proxies (in contrast to Spring DM). Parts of R4.2
> should be in CVS HEAD, too.
>
> I found the slides in [1] very helpful.
>
> Regards,
> Stefan.
>
> [1]
> https://www.gpublication.com/eclipse/#requestedContent=conte ntID://EclipseConferences/EC2009/245
>
>
>
> Víctor Roldán Betancort schrieb:
>> Chris,
>>
>> thanks for your feedback. From intuition I thought DS register
>> something like a "proxy" to a service, so as soon the service is
>> demanded, the bundle gets activated and the proxy is resolved. I read
>> the OSGi spec for DS but couldn't clarify this issue. Only when I
>> looked at the code and saw (if bundle.getState() == Bundle.ACTIVE)...
>>
>> I guess the implementation of R4.2 is not included in latest (HEAD)
>> org.eclipse.equinox.ds, right?
>>
>> Cheers
>> Víctor.
>>
>> Chris Aniszczyk escribió:
>>> Víctor Roldán Betancort wrote:
>>>> Hi everyone,
>>>>
>>>> I've been lately experimenting with Declarative Services and faced
>>>> and issue I don't quite understand. Apparently, we need to activate
>>>> bundles offering services if we want org.eclipse.equinox.ds to
>>>> register it to the service registry. I don't exactly see the point
>>>> of this. Wasn't declarative services all about lazy registration?
>>>> What's the concept of delayed service for then? Am I missing
>>>> something here?
>>>
>>> The lifecycle of the service registry and the extension registry are
>>> different. Services are only available when the bundle is in the
>>> ACTIVE state. Extensions are available in the RESOLVED state.
>>>
>>> In the R4.2 version of DS, DS allows to look for bundles in the
>>> STARTING state (lazy activation). Therefore, you can add:
>>> Bundle-ActivationPolicy: lazy
>>>
>>> Once you do that, DS should be able to work the way you expect it...
>>> as long as DS is started of course!
>>>
>>> Cheers,
>>>
>>> Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
>>> http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
Re: [DS] Why is it necessary to activate bundles offering services? [message #128188 is a reply to message #128065] |
Tue, 31 March 2009 14:47 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Eike,
thanks for comment. This is indeed quite interesting: it would imply
that, if properly defined, eager start of our bundles won't cost that
much :D (I didn't know, but it seems, according to the slides Stefan
pointed out, creating the classloader is a bit expensive).
Cheers,
ViK.
Eike Stepper escribió:
> Hi Vik,
>
> Note also that a classloader is not created immediately on activation of
> a bundle if that bundle does not declare an activator and all offered
> services are lazy (default).
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> Víctor Roldán Betancort schrieb:
>> Hi everyone,
>>
>> I've been lately experimenting with Declarative Services and faced and
>> issue I don't quite understand. Apparently, we need to activate
>> bundles offering services if we want org.eclipse.equinox.ds to
>> register it to the service registry. I don't exactly see the point of
>> this. Wasn't declarative services all about lazy registration? What's
>> the concept of delayed service for then? Am I missing something here?
>>
>> Doesn't Eclipse's Extension Point work that in such a lazy way?
>>
>> Thanks in advance,
>> Víctor.
|
|
|
Goto Forum:
Current Time: Sun Oct 06 10:24:45 GMT 2024
Powered by FUDForum. Page generated in 0.04563 seconds
|