Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为java中的每个方法保留观察者,即如果调用任何方法,我应该得到通知。或者如果任何成员变量被更新,我应该得到通知。有没有什么java框架可以做到这一点?
你应该看看AspectJ。该框架允许您为方法调用和字段更新添加挂钩。