자바 프로그램에 의해 호출 된 메소드의 이름을 인쇄 할 수있는 간단한 Java 에이전트를 작성하려고합니다.Java 메소드를 구현하는 방법은 무엇입니까?
예를 들어, 내가 악기로 원하는 내 자바 프로그램은 다음과 같습니다
public class TestInstr {
public static void sayHello() {
System.out.println("Hello !");
}
public static void main(String args[]) {
sayHello();
sayHello();
sayHello();
}
}
I는 다음과 같이 표시 할 것이다 : 당신의 도움에 대한
method sayHello has been called
Hello !
method sayHello has been called
Hello !
method sayHello has been called
Hello !
감사합니다!
http://stackoverflow.com/questions/10562769/record-every-method-execution –