开发者

Monitoring Changes of a Bean to build deltas?

I have several Beans in my Application which getting updated regularly by the usual setter methods. I want to synchroniz开发者_开发知识库e these beans with a remote application which has the same bean classes. In my case, bandwidth matters, so i have to keep the amount of transferred bytes as low as possible. My idea was to create deltas of the state changes and transfer them instead of the whole Objects. Currently, I want to write the protocol to transfer those changes by myself but I'm not bound to it and would prefer an existing solution.

Is there already a solution for this Problem out there? And if not, how could I easily monitor those state changes in an generalized way? AOP?

Edit: This problem is not caching related even it may first seem so. The data must be replicated from a central server to several clients (about 4 to 10) over the internet. The client is a standalone desktop application.


This sounds remarkably similar to JBossCache running in POJO mode.

This is a distributed, delta-based cache that breaks down java objects into a tree structure, and only transmits changes to the bits of the tree that changes.

Should be a perfect fit for you.


I like your idea of creating deltas and sending them.

A simple Map could handle the delta for one object. Serialization could simply get you the effective message send.

To reduce the number of messages that would kill your performance, you should group your deltas for all objects and send them as a whole. So you could have others collections or maps to contain this.

To monitor all changes to many beans, AOP seem like a good solution.


EDIT : see Skaffmann's answer.

Using an existing cache technology could be better. Many problems could already have solutions implemented...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜