开发者

How to implement something like Terracota?

开发者 https://www.devze.com 2023-03-29 12:17 出处:网络
How Terracotta knows that object is changed inside one JVM to propagate this change to another JVM? I.e. how can I code similar behavior?

How Terracotta knows that object is changed inside one JVM to propagate this change to another JVM? I.e. how can I code similar behavior?

I want to b开发者_JAVA百科e able to watch changes in instances of some classes, without changing them at all.


It uses instrumentation. It's explained (in high level) in the terracotta wiki


Shouldn't a observer pattern help. If you implement your class as observable and have an oberver , the observer will be notified when ever the observable class goes through some change.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号