why is jboss-logging a bundle anyway

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

why is jboss-logging a bundle anyway

Thomas Diesler
Hi David,

why is jboss-logging a bundle anyway?

I thought due to its tight integration with the JDK logging system it needs to be on the boot class path.
How is the jboss-logging bundle lifecycle install/start/stop/update/uninstall supposed to work?

Would it not be better to ship it as a library if it can't work properly as bundle, or can it?

cheers
--thomas
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx




_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: why is jboss-logging a bundle anyway

James Perkins
While it's commonly confused, jboss-logging is different than
jboss-logmanager. JBoss Logging is just a logging facade akin to slf4j.
JBoss Log Manager is an extension of JUL.

I don't know much about the OSGi lifecycle so I can't speak much to
that. That said I don't know of a reason it can't be a bundle.


On 03/19/2013 07:49 AM, Thomas Diesler wrote:

> Hi David,
>
> why is jboss-logging a bundle anyway?
>
> I thought due to its tight integration with the JDK logging system it needs to be on the boot class path.
> How is the jboss-logging bundle lifecycle install/start/stop/update/uninstall supposed to work?
>
> Would it not be better to ship it as a library if it can't work properly as bundle, or can it?
>
> cheers
> --thomas
> xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thomas Diesler
> JBoss OSGi Lead
> JBoss, a division of Red Hat
> xxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

--
James R. Perkins
JBoss by Red Hat

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: why is jboss-logging a bundle anyway

Philippe Marschall
In reply to this post by Thomas Diesler
 > why is jboss-logging a bundle anyway?

Because people want to use libraries that use jboss-logging in OSGi
environments other than JBoss OSGi.

 > I thought due to its tight integration with the JDK logging system it
needs to be on the boot class path.

See answer from James Perkins.

 > How is the jboss-logging bundle lifecycle
install/start/stop/update/uninstall supposed to work?

1. code has a dependency on jboss-logging, either through Import-Package
or Require-Bundle
2. the OSGi resolver makes sure this code isn't run before the
dependency on jboss-logging is met
3. at the latest when the code that required jboss-logging does
Logger.getLogger the jboss-logging bundle gets activated,
LoggerProviders gets initialized and a look up of the LoggerProvider
implementation class happens.
4. A new version of jboss-logging can be installed at any time, it will
just do the look up of the LoggerProvider implementation class again.
Standard OSGi rules will apply which bundles the the new version of
jboss-logging. Since jboss-logging is not an actual logging
implementation loading multiple versions of it is fine. This isn't the
case for implementations like Logback. If you have two versions of
Logback installed that want to log into the same file this may cause a
problem. Therefore only actual log implementations should be marked as
singleton bundles, not jboss-logging itself.
5. As with any OSGi bundle jboss-logging should not be stopped until all
bundles that depend on it transitively are stopped. Otherwise you have
code that references objects and classes in a stopped bundle. Once they
all have been stopped jboss-logging can be restared, uninstalled or updated.

 > Would it not be better to ship it as a library if it can't work
properly as bundle, or can it?

It works fine. I have code here that runs it in Equinox and it runs fine.

Cheers
Philippe
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev