Update Java code during runtime

后端 未结 3 425
死守一世寂寞
死守一世寂寞 2021-01-04 23:08

about a year ago I stumbled across a nice feature in Java that I cannot for the life of me find again.

Through some magic interface it was apparently possible to dec

3条回答
  •  悲哀的现实
    2021-01-04 23:56

    This is typically the kind of functionality I gladly leave to infrastructure as it is difficult to get right and easy to get wrong. As Jon mentioned above, most applications do not need it and for those that need it infrastructure is available.

    Most application servers allow hot deployment nowadays, and equally most application servers are embeddable and allow them to be stripped down to remove features you do not need.

    If it mainly for development, you should look a JRebel which provides this functionality transparently. I've heard they are working on a runtime solution, but I do not know if it is ready for primetime yet.

    If you are really motivated to get this to work, then consider using OSGi. It has a steep learning curve, but once you grok it, it does most things right and works very well. I found the pax tools a good starting point but the eclipse toolchain also has good support for it.

提交回复
热议问题