[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] question regarding .class files protected by license w.r.t. AspectJ.....
|
Hi All!
I'm new to AOP and AspectJ so this question is a little naive, nevertheless
I think its important for me to ask it.
In the "Frequently Asked Questions about AspectJ" documentation, within Question
"4 What about load-time weaving? Can I weave aspects at runtime? " it is
stated:
"And just to state the obvious: do not use bytecode weaving, at load-time
or otherwise, to modify .class files protected by license, without permission
from the licensor."
Now, what I want to do is to capture all calls made to java.sql.Statement.executeQuery(String)
from within our application code using the following pointcut/advice combination:
aspect JdbcLogger
{
pointcut bootstrapTwo(Statement stmt, String sql): call(ResultSet Statement.executeQuery(String))
&& target(stmt) && args(sql);
before (Statement stmt, String sql): bootstrapTwo(stmt, sql)
{
System.out.println();
System.out.println("invoking: " + thisJoinPoint);
System.out.println("argument: " + sql);
System.err.println("invoker : " + thisJoinPointStaticPart.getSourceLocation());
}
}
The issue is that our application currently uses a commercially available,
third-party JDBC driver to access the RDBMS. Here are my questions:
Using the above aspect, which code gets weaved? It is the application code
that invokes Statement.executeQuery() or is it the third-party driver class
file that implements the java.sql.Statement interface? If it's the latter,
then I guess I need to get permission form the JDBC driver vendor to do it,
right?
Notice I'm using the
call predicate. If I were using the
execution
predicate would this change things any?
thanks in advance
- Garry