Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » [DS] Why is it necessary to activate bundles offering services?
[DS] Why is it necessary to activate bundles offering services? [message #127920] Wed, 25 March 2009 21:41 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
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.
Re: [DS] Why is it necessary to activate bundles offering services? [message #127934 is a reply to message #127920] Wed, 25 March 2009 23:12 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
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 #127953 is a reply to message #127934] Thu, 26 March 2009 15:38 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
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 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6690
Registered: July 2009
Senior Member
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.


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 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
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 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
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 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
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.
Previous Topic:equinox and p2 Aha! Moment Needed
Next Topic:any pointers on setting up a Tomcat/OSGI dev environemnt?
Goto Forum:
  


Current Time: Sun Oct 06 10:24:45 GMT 2024

Powered by FUDForum. Page generated in 0.04563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top