[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[aspectj-users] How to get the exception obj from call to printStackTrace
|
- From: "Michelle Xue" <mxue@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Mar 2006 10:49:21 -0800
- Delivered-to: aspectj-users@eclipse.org
- Thread-index: AcZSmFMuJKtRfu/2TMC/aZRv33H8rw==
- Thread-topic: How to get the exception obj from call to printStackTrace
Hi,
I want to
write a pointcut that whenever this is a call to Throwable.printStackTrace,
I want to get the throwable and do something with it. So I need to do
something like this:
pointcut
printStackTracePrintStream(PrintStream s, Throwable
myObject):
execution(void Throwable.printStackTrace(PrintStream))
&& args(s) && this(myObject);
This won't work
because I think it only weaves at the definition of printStackTrace, which
is in JAVA codes, but I am only running ajc on my codes. If I replace
"execution" with "call", my codes will get weaved, but the object I get is the
class that's calling printStackTrace, but the throwable object. Can anyone
help me? Thanks!
Michelle