We looking for a solution to track the state of a client POJO instance in a performant manner. What we expect is: every time a change is made on a POJO this state is made by using setters. We created an OGNL-based watching / event-bus and when change is made we will send proper OgnlChangeEvent
to our event-bus.
So far we looked into AspectJ / cglib / object graph Diff solution but they all occupied too much CPU time. Our current solution is based on Spring MethodInterceptor
and we are creating a new Proxy
instance every time a Getter method is invoked.
At this point we are starting to look at code generation solutions and we stumbled on Byte Buddy. Is this direction is the right way to do so? Can we generate a new Class
that will extend our client POJO State and notify about its OGNL prefix until setter method is invoked?