Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auditing method parameter values at runtime

Status
Not open for further replies.

semasoztutar

Programmer
Nov 28, 2002
1
TR
Hi,

I have a method like this ;

a(int x){
z();
}

and another method z() which is called from a();

z(){
// I want to access the value of x.
}

When I call x(5) I want to access the value 5 in z(). But as you can see I don't want to give x to z() as an argument. So I want the method
z() to be generic.

I've been looking JVM instructions and java.lang.Runtime methods. But I couldn't find a solution.
I looked Proxy class in the reflection package, but if I use that I will have to use interfaces so I will have to write interfaces for all my classes.

It seems that I have to get JVM stack and read the parameter
values from the stack. In that case, I should use a method like fillInStackTrace() which is in the Throwable class and native. I can't find the source code of this native method.

I'm waiting for your replies. Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top