Lest's suppose we have two osgi bundles: bundleA and bundleB. In bundleB we have some texts.properties
. So, in bundleA we do
ResourceBundle rb=
ResourceBundle.getBundle("com/foo/texts",locale, classFromBundleB.getClassLoader());
Now, we update bunldeB or totally remove it and install and start new version of bundleB that contains new version of texts.properties
. And two questions :
rb
new version of texts.properties
? Or we need to do additional actions for this? Since bundleA has a reference to classFromBundleB, unless bundleA is refreshed, it will continue to maintain the classFromBundleB from the original bundleB. And since ResourceBundle maintains a cache, you will keep getting the same rb. So after updating bundleB, you will need to refresh the bundles which depend upon the classes from bundleB.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.