felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven E. Harris" <...@panix.com>
Subject Re: When and how to adjust org.osgi.framework.system.packages
Date Fri, 08 Dec 2006 18:00:35 GMT
Felix Meschberger <Felix.Meschberger@day.com> writes:

> If I understand correctly, you want to use the same logging facility
> for your Felix-contained bundles as well as the rest of the
> application outside the framework ?

Yes. I want my bundles to push log messages into the logging facility,
and I want my main program to listen for and pull log messages out of
the logging facility, so it's a sink for all the bundle-produced log

> In this case, I suggest to have the org.osgi.services.log package
> containing the interfaces in some outer classloader and add the
> packeg to the system packages of felix. This way, the application
> and Felix are using the same interface class instances.

Got it. I tried that and it works, but it felt rickety enough to
warrant asking here.

> Then I would define a BundleActivator to be added to the
> Felix.startactivator list which listens for the LogService to be
> registered and make it available through some bridging to the rest
> of the application.

I did that too. Your advice confirms I wasn't crazy to have tried it.

> The bridging functionality could even contain some fallback
> mechanism in case the LogService would not be available.

That I had not yet considered, but it's a good idea.

> The Felix Log bundle should wire to the log API packages provided as
> a system package in this case. And you would need the log bundle jar
> only once: as a proper bundle.

And just like Richard's message, I'm confused right at the end. When
you say "only once", aren't we really using it twice?

  1. "Some outer class loader" (my main program)
  2. "as a proper bundle"

I can see how the first one is necessary for the main program to work
at all (Richard's reflection tactic notwithstanding), but I'm still
not sure why also loading the bundle is a good idea.

Steven E. Harris

View raw message