Sorry I didn't notice that before. It would have saved you some trouble ;)
Good luck! dean On Jan 24, 2008, at 12:55 PM, Parmar, Dipak (IS Consultant) wrote: I don’t remember as I have tried so many options. But you are right. I get an error when I use “within”. Doh! Of course! Did you get an error when you used "within"? It's supposed to just take a type _expression_. On Jan 24, 2008, at 12:36 PM, Parmar, Dipak (IS Consultant) wrote:
“withincode” make it work. Here is the working pointcut. @Pointcut("call(* java.sql.Statement+.execute*(..)) && withincode(@com.xyz.Profiling * *(..)) ") This will work if Profiling is a class level annotation. In my case, it’s a method level annotation. I can never remember the correct syntax, so I looked at one of my aspects that uses annotations ;) I think you want to remove the '@' from the "within", i.e., @Pointcut("call(* java.sql.Statement+.execute*(..)) && within(@com.xyz.Profiling * *(..)) ")
On Jan 23, 2008, at 3:11 PM, Parmar, Dipak (IS Consultant) wrote: I’m writing an aspect to major a performance of a stored-procedure call. I would like my aspect to get called when the method has “Profiling” aspect. I tried various approach but it can’t seem to make it work. Here is the snippet of code: public class JDBCProfilingAspect { public void makeProfileDataBaseCall() { CallableStatement statement = connection.prepareCall("{ call PACKAGE.PROCEDURE(?) }"); public void makeDataBaseCall() { CallableStatement statement = connection.prepareCall("{ call PACKAGE.PROCEDURE(?) }"); @Pointcut("call(* java.sql.Statement+.execute*(..)) && @within(@com.xyz.Profiling * *(..)) ") public void profileJDBCExecute() { @Pointcut("call(* java.sql.Statement+.execute*(..)) && @annotation(com.xyz.Profiling * *(..)) ") public void profileJDBCExecute() { _______________________________________________ aspectj-users mailing list aspectj-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/aspectj-users
Dean Wampler, Ph.D. dean at objectmentor.com See also:
|