What does OSGi solve?

前端 未结 15 2414
猫巷女王i
猫巷女王i 2020-11-27 08:41

I\'ve read on Wikipedia and other sites about OSGi, but I don\'t really see the big picture. It says that it\'s a component-based platform, and that you can reload modules a

相关标签:
15条回答
  • 2020-11-27 09:37

    A Few Things that drive me nuts on OSGi:

    1) The implentations and their context loaders have a lot of quirks to them, and can be somewhat async (We use felix inside of confluence). Compared to a pure spring (no DM) where [main] is pretty much running through everything sync.

    2)Classes are not equal after a hot load. Say, for instance you have a tangosol cache layer on hibernate. It is filled with Fork.class, outside of the OSGi scope. You hotload a new jar, and Fork has not changed. Class[Fork] != Class[Fork]. It also appears during serialization, for the same underlying causes.

    3)Clustering.

    You can work around these things, but it is a major major pain, and makes your architecture look flawed.

    And to those of you advertising the hotplugging.. OSGi's #1 Client? Eclipse. What does Eclipse do after loading the bundle?

    It restarts.

    0 讨论(0)
  • 2020-11-27 09:40

    At the very least, OSGi makes you THINK about modularity, code reuse, versioning and in general the plumbing of a project.

    0 讨论(0)
  • 2020-11-27 09:43

    The OSGi provides following benefit:

    ■ A portable and secure execution environment based on Java

    ■ A service management system, which can be used to register and share services across bundles and decouple service providers from service consumers

    ■ A dynamic module system, which can be used to dynamically install and uninstall Java modules, which OSGi calls bundles

    ■ A lightweight and scalable solution

    0 讨论(0)
提交回复
热议问题