Hi Richard Thank you for your answer. However, is there any chance to touch bundleA only once?
For example I have a running osgi framework with two bundles: bundleA and bundleB which jars are in JARS folder. BundleB depends on BundleA. Now I replace bundleA jar in JARS folder. Is there any way to refresh framework (there is new version of bundleA in JARS folder) and not to start/stop bundleA twice? Best regards, Alex >Среда, 10 мая 2017, 16:55 +03:00 от "Richard S. Hall" <he...@ungoverned.org>: > >On 5/10/17 08:16 , Alex Sviridov wrote: >> Hi all >> >> I use Apache Felix 5.4.0 and I have two bundles: bundleA and bundleB. >> BundleB depends on bundleA. >> >> I update bundleA and after that run the following code to do osgi refresh: >> >> Bundle systemBundle = bcx . getBundle ( 0 ); >> FrameworkWiring frameworkWiring = systemBundle . adapt ( FrameworkWiring . >> class ); >> frameworkWiring . refreshBundles ( null ); >> (from here http://stackoverflow.com/a/23361835/5057736 ) >> >> This code does the following: it stops and starts bundleA and stops and >> starts bundleB. >> >> But why bundleA? I am asking because in result bundleA is two times updated. >> Is this a bug or what? > >The first stop/start is when you do the update, the second is when you >do the refresh. The former is historical, since that is the way update() >was defined in the first version of the spec (I believe). Later versions >of the spec where refreshing was introduced didn't change this behavior >for backward compatibility reasons. > >If refresh were there from the beginning, then it would have likely been >better to have update() simply prepare the updated version and refresh >enact it. > >-> richard > >> >> Best regards, Alex > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: users-unsubscr...@felix.apache.org >For additional commands, e-mail: users-h...@felix.apache.org > -- Alex Sviridov