Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » registering services
registering services [message #82332] Wed, 31 January 2007 22:13 Go to next message
Paul Gardiner is currently offline Paul GardinerFriend
Messages: 94
Registered: July 2009
Member
I have a couple of questions regarding services and bundles:

First question. Bundle A contains an extension point. Bundles B,C . . .
have extensions from the extension point in bundle A. I want bundles
B,C,... to be registered as services, but I don't want the implementors of
the extensions to have to worry about service registration, so I want all of
them to be registered from bundle A. My current approach is to get the
implementation class from the plugin configuration through the bundle
registry, and then register it as a service. However, this seems rather
round about, and I am sure this is a common problem. Is there
another/better way to do this? Is this something that declarative services
will resolve?

Second question: What is the bundle activation order? In the scenario
above, in bundle A's Activator, I need to register any started bundles, and
then register other bundles as they are started. Not a big deal, but I
thought I would be able to predict the load order, and just do everything
from a bundle listener.
Re: registering services [message #82878 is a reply to message #82332] Mon, 05 February 2007 21:44 Go to previous message
Paul Gardiner is currently offline Paul GardinerFriend
Messages: 94
Registered: July 2009
Member
I got everything working, but I needed to work around one element for now.
I worked around the bundle load order by just calling the same code on all
bundles already loaded. As for the other problem, I restructured a bit:

- implementation - has the extensions
- base - has the extension-points
- manager - finds the extensions, and registers the underlying classes as
services

Everything works great, except for one thing. The manager's class loader
can't see the implementation classloader. I can think of some work arounds,
but they are kind of offensive, so I just imported the implementation
bundles in the manager's manifest. That definitely won't fly, but at least
I can test out everything else.

"Paul Gardiner" <pgardiner@syntellect.com> wrote in message
news:epr48s$i4h$1@utils.eclipse.org...
>I have a couple of questions regarding services and bundles:
>
> First question. Bundle A contains an extension point. Bundles B,C . . .
> have extensions from the extension point in bundle A. I want bundles
> B,C,... to be registered as services, but I don't want the implementors of
> the extensions to have to worry about service registration, so I want all
> of them to be registered from bundle A. My current approach is to get the
> implementation class from the plugin configuration through the bundle
> registry, and then register it as a service. However, this seems rather
> round about, and I am sure this is a common problem. Is there
> another/better way to do this? Is this something that declarative
> services will resolve?
>
> Second question: What is the bundle activation order? In the scenario
> above, in bundle A's Activator, I need to register any started bundles,
> and then register other bundles as they are started. Not a big deal, but
> I thought I would be able to predict the load order, and just do
> everything from a bundle listener.
>
Previous Topic:Exercising the framework
Next Topic:remote services
Goto Forum:
  


Current Time: Sat Apr 27 03:55:22 GMT 2024

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

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

Back to the top