| | |
| | | package de.gedoplan.seminar.sbt.di.exercise.aop; |
| | | |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Map; |
| | |
| | | import java.util.concurrent.atomic.LongAdder; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Aspect |
| | | @Component |
| | | public class MethodCounter { |
| | | |
| | |
| | | .collect(Collectors.toMap(Map.Entry::getKey,e -> e.getValue().longValue())); |
| | | |
| | | } |
| | | |
| | | @AfterReturning("@annotation(Counted)") |
| | | protected void count(JoinPoint joinPoint) { |
| | | increase(joinPoint.getSignature().getName()); |
| | | } |
| | | } |