public class LoggingAspect
extends java.lang.Object
LogExecution
, recompile and voilĂ ! The log output will contain
the method execution, together with the target instance toString() and all the parameters and return value.Modifier and Type | Field and Description |
---|---|
private static java.util.concurrent.atomic.AtomicLong |
execId
Exec id to pair method entry with return log entries
|
Constructor and Description |
---|
LoggingAspect() |
Modifier and Type | Method and Description |
---|---|
void |
annotationPointcut(LogExecution logAnnotation)
Annotation pointcut.
|
void |
execPointcut()
Execution pointcut.
|
java.lang.Object |
logExec(org.aspectj.lang.ProceedingJoinPoint joinPoint,
LogExecution logAnnotation)
Logs method execution.
|
private void |
preventAdviceDidNotMatch()
A no-op method to prevent ajc warning adviceDidNotMatch.
|
private static java.util.concurrent.atomic.AtomicLong execId
public void annotationPointcut(LogExecution logAnnotation)
logAnnotation
- Target annotation.public void execPointcut()
public java.lang.Object logExec(org.aspectj.lang.ProceedingJoinPoint joinPoint, LogExecution logAnnotation) throws java.lang.Throwable
joinPoint
- The join point.logAnnotation
- The target annotation.java.lang.Throwable
- Any throwable raised by the join point.private void preventAdviceDidNotMatch()