<dependency>
<groupId>com.nepxion</groupId>
<artifactId>matrix-aop-starter</artifactId>
<version>1.0.0</version>
</dependency>
@Service
@MatrixInvoker
public class UserService {
// ...
}
@MatrixInterceptor
public class LoggingInterceptor implements MethodInterceptor {
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
// ...
Object result = invocation.proceed();
// ...
return result;
}
}
@Configuration
public class MatrixConfig {
@Bean
@MatrixAop
public LoggingInterceptor loggingInterceptor() {
return new LoggingInterceptor();
}
}