How does OSGi bundle update work? -


when bundle updated (say fix bug), happens other bundles using 1 being updated?

say there 2 bundles service , dao. classes in service bundle using classes in dao bundle when issue command update dao layer. class in service layer using dao code exception?


thanks response.

i meant updated same version.

until bundle refresh occurs includes dependent bundle.

bundle refresh operation invoked user updating bundle, right? when user invokes refresh update dao bundle, class in bundle service invoked method on class in dao layer... happens in scenario?

i found blog post helpful: http://solutionsfit.com/blog/2008/08/27/osgi-what-modularity-can-do-for-you-part-1/

from post:

if replace bundle bundle includes fix, container unregister old bundle , register new bundle. proxy can handle reference shuffling , resume service invocation. interaction instantaneous. customers oblivious has happened , saved company substantial amount of money (do hear bonus?).

in blog post, call authorizepayment() put on hold until updated bundle available. happens if control within authorizepayment() method when bundle refresh happens?

bundles have 2 kind of dependencies:

  • services, and
  • connections between class loaders, keyed package names. connections called wires.

services easy withdraw because intrinsic design. wires harder because intricately woven in objects , objects not aware of dynamics. when install new bundle, old bundles stay are, objects not updated , updated bundle still provides wires zombie.

when call refreshpackages framework looks @ dependencies , finds bundles refer zombies. every zombie stopped. contract bundle should cleanup. bundle doing lot of cleanup you, things bad, e.g. storing references in statics of other bundles or forgetting stop threads started. other bundles depend in other ways on bundles notified of bundle stopping can clean references. after bundles stopped, bundles unresolved , resolved again against new bundles.

for real osgi bundles cleaning natural , not visible in code (as should be). supported tools declarative services, ipojo, dependency manager, spring, blueprint, etc. magic focus on µservices model , not dong class loading hacks.

why not refreshing automatically? well, once did refreshing disruptive. in many cases need update multiple bundles. having disruption after each update unnecessary painful. is, after install or update should refresh can bracket number of installs/updates.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -