I want to write a simple java agent which can print the name of a method called by the java program instrumented.
For example, my java program I want to instrument
If your need is simply to record a method was called or not, then aspect-oriented programming is exact what you need, no matter AspectJ(static) or Spring AOP(dynamic), both provide powerful capability to do that. However you may need some instrument libraries in case you want to do more instrument stuff, such like track the execution time, calling track. Hope it helps.