Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Use same Package/Class in System Classloader and Bundle Classloader(Getting the same class instance in all bundles)
Use same Package/Class in System Classloader and Bundle Classloader [message #1725792] Mon, 07 March 2016 16:54
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I'm using a custom logging Formatter (let say it is my.company.util.logging.MyLoggerFormatter) and because I need it before the FrameWork is completely loaded, we have added this to the Xbootclasspath.

The class is provided by the bundle "my.company.util", which is appended above as well as being defined in the config.ini.

The Formatter class has a ThreadLocal instance that allows me to track calls across the various layers but the ThreadLocal instance is different, as is the class, in the logger from the instances in the bundles are using to set the identifier.

So the main problem is that I have the same thread but different instances of the same class. How do I get/force the bundles to use the instance that was loaded from the Xbootclasspath ?

I have tried:

-Dorg.osgi.framework.system.packages=my.company.util
-Dorg.osgi.framework.system.packages.extra=my.company.util;version="1.2.3"
-Dorg.osgi.framework.system.packages.extra=my.company.util.logging
-Dorg.osgi.framework.system.packages.extra=my.company.util.logging;version="0.0.0"
-Dorg.osgi.framework.system.packages.extra=my.company.util.logging;version="1.2.3"

And nothing seems to change the value of "org.osgi.framework.system.packages" shown in "props".

Am I trying to do something that simply can't be done? Or is there a "special" option in equinox that is required before "org.osgi.framework.system.packages.extra" is used?
Previous Topic:What is a SSCCE using EclipseStarter to launch Equinox with a osgi.java.profile?
Next Topic:What JRE is considered the "Perfect Match" for OSGi 1.2
Goto Forum:
  


Current Time: Wed Oct 09 01:41:51 GMT 2024

Powered by FUDForum. Page generated in 0.03732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top