registering services [message #82332] |
Wed, 31 January 2007 22:13 |
Paul Gardiner 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 |
Paul Gardiner 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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03275 seconds