[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] finding a BundleContext
- From: Marcel Offermans <marcel.offermans@xxxxxxxxxx>
- Date: Sat, 23 Dec 2006 11:38:16 +0100
- Delivered-to: email@example.com
- User-agent: Thunderbird 220.127.116.11 (Windows/20061207)
Tom Huybrechts wrote:
For the registration of the services I use the BundleContext of the
bundle that declares the interface, so the lifecycle of the services
will be limited to that of their bundle.
The reason I don't register the services in their own bundle's
- I don't want to repeat this for every service bundle
- The bundle shouldn't care exactly how the connection to the remote
service is handled
I have this working now, but am open to suggestions for other ways to
I have a suggestion:
When you register a service, add a service property to indicate that
this is a remote service. Use a separate bundle (like you do now) to
listen to all services that are registered that have this service
property (use a ServiceTracker with ServiceTrackerCustomizer and you'll
get notified automatically). Have it register the remote services.
This way you're coupling the life-cycle of your remote services to the
life-cycle of your services (instead of that of your bundles).