0

In Java, I'd like to monitor state of annotated fields and method's return values. How do I execute a callback on an annotated field value / method return values.

What I'm trying to do : Creating a custom debugger of a sort which would execute some validations on runtime.

Ex:

@ObservableMethod
CashFlowSet getCashFlows() {
      @ObservableField
      CashFlowSet set = generateFlows();
}

During runtime, I'd like to have a callback on every time the value of set changes and every time getCashFlows() exit the call stack.

Cybermonk
  • 514
  • 1
  • 6
  • 28
  • 2
    You can use interceptors or other forms of AOP... But inspecting local variables seems like a long shot... – ernest_k Jun 18 '19 at 07:32
  • Could you elaborate on interceptors / AOP frameworks. Are there any which I can use to annotate my code and request callback? – Cybermonk Jun 18 '19 at 09:03

0 Answers0