java - AspectJ Pointcut matching pattern -
i've written pointcut call around advice on execution of method.
however, i'd understand why final pattern used works, initial pattern didn't.
the initial pattern used (which didn't work) was:
pointcut timeit() : execution(* *.authfilter.filter(..));
the pattern works is:
pointcut timeit() : execution(* *..*.authfilter.filter(..));
trying google difference between *.
, *..*.
has proved challenging. if provide either explanation or resource explains difference grateful.
it explained documentation:
an embedded * in identifier matches sequence of characters, not match package (or inner-type) separator ".".
an embedded .. in identifier matches sequence of characters starts , ends package (or inner-type) separator ".".
basically, when used @ package level, ..
means sub-packages.
your first expression matches if authfilter
in second level, example, org.authfilter
, not match org.security.authfilter
, in case need *.*.authfilter
.
your second expression matching authfilter
wherever is. not matter package , sub package in.
Comments
Post a Comment