Richard,

Thanks for the response.  Yes I have read the document listed below and
it has been of great value in getting us going.  

I did not think it would be possible to get the service up front, but
figured it was worth inquiring.  I thought about using the
ServiceListener as that is how I see the Logger implemented it in the
org.apache.felix.framework package.  But, after re-reading the section
on "Using Services Provided by Bundles", I guess that is a better
approach.  If there are multiple loggers and I implemented it using the
ServiceListener then I would potentially only get the last provider of
the service.  Not necessarily the desired result. 

Not sure just how best to address this since I would ideally like a
common logger out of the gate.  Oh well I will give it some thought.

As always, thanks for the assistance.

Regards,
Todd


-----Original Message-----
From: Richard S. Hall [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 10, 2007 4:20 PM
To: [email protected]
Subject: Re: Embedding Felix - Log Service

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