Aspect weaving at runtime

后端 未结 3 764
旧时难觅i
旧时难觅i 2021-02-15 12:21

I\'m looking for a Java solution that would allow me to use AOP to weave new code on top of already running code at runtime. The key is not to require the restart of the JVM. Al

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-15 13:12

    You can Implement an ASM solution that would allow to weave new code on top of already running code at runtime (with no downtime)

    • ASM can retransform already loaded classes it basically reads the class on the file and retransform the loaded class in Memory
    • Manipulation with ASM (https://www.baeldung.com/java-asm)

    You might can use the same solution to remove the woven at runtime

    • the loaded class remains on the file system that might can be reload.

提交回复
热议问题