Reputation:
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?Upvotes: 0
Views: 87
Reputation: 9384
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.
Upvotes: 0