If you haven't done so already, check out this document:

   http://cwiki.apache.org/FELIX/launching-and-embedding-apache-felix.html

This shows you how to go about getting services. There is no way to get a service "up front" since there is not necessarily a service there to get. If you want to make sure you have a log service before any other bundle starts, you can deploy the log service into a lower start level than every other bundle...

Also, since you likely don't want to include the log service interfaces on your class path, you might want to investigate using reflection to access the log service.

-> richard

Todd Nist wrote:
When embedding Felix what is the best way to get hold of the Log
Service?  I have included
org.apache.felix.log-0.9.0-incubator-SNAPSHOT.jar as one of the bundles
to be deployed, and that is happening just fine.  Is the simplest
approach to implement ServiceListener on my embedded felix instance and
then add a listener with a filter of
"(objectClass=org.osgi.service.log.LogService)" and then issue a set or
if it is going away and unbind?

Is there anyway to get it right up front so that I have the logger
available out of the gate?  I don't think it is, but I figure it can't
hurt to ask.

Thanks in advance.

Regards,

Todd


Reply via email to