Add LifecycleMonitor annotation
This commit is contained in:
parent
43a28fe596
commit
1842870e69
@ -14,6 +14,8 @@ lifecycle:
|
||||
base-package: com.knecon.fforesight
|
||||
```
|
||||
|
||||
You also need to enable aspectj in your application main class via the annotation `@EnableAspectJAutoProxy`
|
||||
|
||||
The code will scan all requests from methods that are inside the specified package and that are annotated with one of the annotations present in the `LifecycleAspect` class.
|
||||
|
||||
```
|
||||
|
||||
@ -21,6 +21,7 @@ public class LifecycleAspect {
|
||||
|
||||
|
||||
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener) || "
|
||||
+ "@annotation(com.knecon.fforesight.lifecyclecommons.LifecycleMonitor) || "
|
||||
+ "@annotation(org.springframework.web.bind.annotation.GetMapping) || "
|
||||
+ "@annotation(org.springframework.web.bind.annotation.PostMapping) || "
|
||||
+ "@annotation(org.springframework.web.bind.annotation.PutMapping) || "
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package com.knecon.fforesight.lifecyclecommons;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface LifecycleMonitor {
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user