[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] JoinPoint SourceLocation vs. Stack Trace Interigation
|
Prior to JoinPoint, I was unaware of any other Java mechanism to
obtain file location information beyond the stack trace.
The stack trace gets the file location information from attributes in
the .class file put there by ... the compiler. The source location
is generated staticly by the compiler at compile-time so there is *no*
cost to generate it at run time.
I knew that, but I don't know how to obtain that information out
the .class file other than using the very expensive (as Eric AND I
made point of) stack trace. And I still don't know how
JoinPoint.StaticPart populates its data... But I think you are
inferring is that whatever AspectJ is doing to obtain the
JoinPoint.StaticPart data, they are not using a stack trace to obtain
that data. Cool. Is my assumption correct that the
JoinPoint.StaticPart is populated whether I use it in the advice or
not? [I have looked at the source in CVS online and have only
ferreted out JoinPoint interfaces, not the implementations...]
As for generating stack traces, Eric Bodden already stated that it
was one of the most expensive operations in Java (no less so of late),
as you can imagine if you think about it.
I know its expensive. I promise I won't use it. I will use
JoinPoint.Static. How does JoinPoint.StaticPart extricate the class
data to populate it?
Sorry if I am over obsessing on this but, asking helps me learn AND
move on... :-}
Two (very smart) people replied with the answer to your original
question
within 45 minutes (I love this list...).
That was indeed impressive.
But then it seems you didn't try or
research their answers to validate them for yourself. Their
answers were terse
because this question is one that one can teach oneself by reading the
documentation (I hate this list...).
I have poured over the documentation. All I can say at this point is
that it is a slog. I finally came up with a crosscutting problem to
solve as a conduit to learning and appreciating AOP. So, I am doing
this without an AOP course or having purchased the dated AspectJ in
Action. I am starting from the premise that annotation style using
the LTW will work best for me to debug with while using a non-Eclipse
IDE to learn/develop. So, non-annotations references that may better
elucidate fundamental AOP principles make the mapping to annotations
a challenge.
I'm glad to see folks using annotation style. I realize the docs
and the
implementation aren't entirely tailored for that style, so any
feedback
you have there can help us make it easier for folks who come after
you.
If Ramnivas L. is the be-end-all of writing for the beginner, light a
fire under he and his publisher to update ApectJ in Action using
annotations. In lieu of that happening soonish, the only document
that I can find that is annotations specific quick5.pdf that is
included in the download jar. Any recommendation on a more pervasive
reference, please offer. Google is only coming up with small one
time examples showing the "possibilities" and http://www.eclipse.org/
aspectj/doc/released/adk15notebook/ doesn't do it for me...
Their answers were terse because this question is one that one can
teach oneself
by reading the documentation (I hate this list...).
...
I'm glad to see folks using annotation style. I realize the docs
and the
implementation aren't entirely tailored for that style,
Tough list. :-\
Thanks -
Wes