Use same Package/Class in System Classloader and Bundle Classloader [message #1725792] |
Mon, 07 March 2016 16:54 |
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.03732 seconds