[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Working with ConfigAdmin service
- From: Simon J Archer <sarcher@xxxxxxxxxx>
- Date: Tue, 29 Sep 2009 09:10:42 -0500
- Delivered-to: email@example.com
I think the problem you're having is
one of ordering. If your bundle starts before the ConfigurationAdmin
service is registered then you're not going to find it. This is not a problem
and is part of how OSGi works. There are a number of solutions:
1. Use Declarative Services (DS). This
is by far the easiest approach since it removes the ordering problem entirely.
I strongly recommend that you use DS.
2. Use the ServiceTracker to track the
ConfigurationAdmin service. This works in theory, but in practice
is way harder to get right than you might imagine.
3. Register a ServiceListener to track
the ConfigurationAdmin service. This also works in theory, but in practice
is more work that you'd care to do. It's debatable whether this is
easier or harder than using the ServiceTracker.
See the attached zip that shows how
to use DS to acquire a ConfigurationAdmin service.
I hope this helps,
||Ali Naddaf <ali@xxxxxxxxxx>
||Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
||09/28/2009 07:41 PM
||[equinox-dev] Working with ConfigAdmin
I am trying to write a few simple examples with ConfigurationAdmin
service to familiarize myself with it but have a difficulty obtaining a
pointer to the service. I am running Equinox 3.5 and have deployed
org.eclipse.equinox.cm_1.0.100 bundle in my framework but still when I
try to get a reference to the ConfiguartionAdmin (via
context.getServiceReference(ConfigurationAdmin.class.getName()) ), I get
a null pointer. Do I need to set any particular security settings?
equinox-dev mailing list
Description: Zip archive