Steven E. Harris wrote:
"Richard S. Hall" <[EMAIL PROTECTED]> writes:

You should NOT add the log bundle's activator to your start
method. Just let it be a normal bundle.

I'm curious why I need to load it as a bundle at all, if the classes
are already being loaded by the main program. I was following your
discussion all the way up to this point.

If the main program has access to the bundle content on the class
path, and it exports the packages offered by the bundle, then what
does having Felix load the actual bundle achieve, save for running the
bundle's activator in a more obvious way?

That is the misunderstanding. You do not need the entire bundle on the class path, you only need the org.osgi.service.log package on the class path. The bundle impl should not be on the class path. Of course, you can do it that way if you want, but that would be bad in my eyes, because then you wouldn't be able to deploy new versions of the log service without restarting your program and installing the log bundle manually.

The log bundle is a fairly simple example. In thruth, my main
application may also need access to parts of the compendium
bundle. The Export-Package header there is much more baroque and makes
me even more apprehensive to be hard-coding that header into the
org.osgi.framework.system.packages property.

Still, you should only be adding service interfaces to the class path, not implementations...unless, of course, your main program is the one doing the implementing.

-> richard

Reply via email to