[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [equinox-dev] When is DS done loading services?
- From: BJ Hargrave <hargrave@xxxxxxxxxx>
- Date: Wed, 3 Sep 2008 15:03:26 -0400
- Delivered-to: email@example.com
But even DS only knows about started
bundles. If a bundle is started after DS has processed some bundle, then
new services can be registered. There is no way for DS to know about all
possible services being ready since some may come from bundles yet to be
started. The best DS could tell you is that it is done processing services
from bundles that are currently started.
It is far better in the long run for
the application to handle dynamism. Anything you do today to try and enforce
some ordering will likely fail in the future when some thing changes about
the set of installed bundles.
||"Cortez, Otto" <OttoCortez@xxxxxxxxxxxxx>
||"Equinox development mailing list"
||2008/09/03 02:48 PM
||RE: [equinox-dev] When is DS done loading
It is more important for us
to know what functionality is installed and available before parts of the
application execute then it is for us to support dynamism. I would
like to keep the dynamism if we can, but to do that and provide reliable
execution I think the application would need to guarantee that all services
known through the bundle manifests will be initialized before we start
processing. I guess using extensions might be a better fit.
Iâm not sure if we need DS
to synchronously register services as much as some way to listen to DS
events or know its state, like is it just sitting around waiting for more
bundles to be activated or deactivated. I was focused on services
being managed by DS since I thought DS would know weather it was done initializing
all services listed in the active bundlesâ manifest files and then we
would be able to say to users which may supply functionality, well if you
use DS then we could guarantee that we wouldnât start until DS had initialized
On Behalf Of BJ Hargrave
Sent: Wednesday, September 03, 2008 7:22 AM
To: Equinox development mailing list
Subject: Re: [equinox-dev] When is DS done loading services?
The whole point of services is that the are dynamic. The fact the DS is
"processing" them on behalf of some bundle does not mean that
another bundle should know or observe that.
Bundles which depend upon a service need to deal with that service's dynamism.
You can't assume a bundle's activator or starting a bundle will synchronously
register some services. I would not support an option for DS to synchronously
register services during bundle start as this means people will improperly
You may also be seeing an impedance mismatch between the lifecycle of extensions
and services. Extensions become active when the bundle is resolved while
services become active only when the bundle is started. Switching to use
extensions will not allow for dynamism (unless you want to write all the
code to use the extension registry API to do so.)
You may be able to use startlevels to mitigate the issue (make sure all
bundles providing service B are started before bundles using B), but this
is also a hack. It would be better if service A dealt with the dynamics
of service B such that service A has a dynamic dependency on service B
and is able to accept B's being registered and unregistered at any time.
||Stoyan Boshev <s.boshev@xxxxxxxxxxx>
||Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
||2008/09/03 07:51 AM
||Re: [equinox-dev] When is DS done loading
I guess your problem is connected to the asynchronous processing of the
As far as I understand the situation is: your application bundles are
started, then your application is started but at this moment not all of
the DS services are inited yet because they are being asynchronously
Unfortunately currently there is no way to find out when DS completes
the DS services processing.
I think if there was an option that DS bundle process the DS services in
the started bundles synchronously, it would solve your problem. So I
will open bug(enhancement) about that and hopefully this will be
As a possible workaround you could observe the running threads and when
the thread with name "Component Resolve Thread" disappears this
mean that DS bundle has no more work to do and eventually all of your DS
services are processed. I realize this is not a clean solution (that's
why I call it workaround) but at this moment I cannot find out a more
appropriate working solution without modifications in the DS bundle.
Cortez, Otto wrote:
> I made a post to the Eclipse newcomers group a few weeks ago, but
> not get a response. I donât know if this is the appropriate
> this question, but hopefully someone can point me in the right direction.
> We are building a headless RCP application and we would like to use
> to make functionality available. The problem we are running
> that not all of the services we declared through DS get loaded and
> visible before our application executes.
> For example, I have a service A which needs 0..n instances of another
> service B. The issue I'm running into is that if the implementations
> service B are spread across several bundles, then the service A will
> have seen all instances of service B when it is called since the
> application starts (and sometimes ends) running before DS is done
> looking through all the bundles and registering all the services in
> active bundles.
> Is there a way to know when declarative services is done looking through
> the active bundles and loading the services found in them? Am
> It seems that using the plug-in registry may solve this issue. Is
> perhaps a better way to go?
> This email and any files transmitted with it are confidential, proprietary
> and intended solely for the individual or entity to whom they are
> If you have received this email in error please delete it immediately.
> equinox-dev mailing list
dipl. eng. Stoyan Boshev . Department manager
ProSyst Labs EOOD
1606 Sofia, Bulgaria . 48 Vladajska Str.
Tel. +359 2 953 05 88; Fax +359 2 953 26 17
Mobile: +359 88 898 29 17
stay in touch with your product
equinox-dev mailing list
This email and any files transmitted with it are confidential,
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.
equinox-dev mailing list