Today I came across a situation when I updated bundle however the program continued working as there was no any changes in code. After some reading I understood that I have to do osgi refresh - the following code (found on SO):
Bundle systemBundle = bundleContext.getBundle(0);
FrameworkWiring frameworkWiring = systemBundle.adapt(FrameworkWiring.class);
frameworkWiring.refreshBundles(null);
So my question - when should I do osgi refresh? Only after update? After each bundle update or I can update N bundles and after that do refresh?