Add LifecycleMonitor annotation
This commit is contained in:
parent
6ec5ccaeb4
commit
4733e53789
@ -6,13 +6,11 @@ import org.aspectj.lang.annotation.Aspect;
|
||||
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class LifecycleAspect {
|
||||
|
||||
private final LifecycleManager lifecycleManager;
|
||||
@ -20,6 +18,14 @@ public class LifecycleAspect {
|
||||
private final LifecycleProperties lifecycleProperties;
|
||||
|
||||
|
||||
public LifecycleAspect(LifecycleManager lifecycleManager, LifecycleProperties lifecycleProperties) {
|
||||
|
||||
this.lifecycleManager = lifecycleManager;
|
||||
this.lifecycleProperties = lifecycleProperties;
|
||||
log.info("Initializing LifecycleAspect with basePackage: {}", lifecycleProperties.getBasePackage());
|
||||
}
|
||||
|
||||
|
||||
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener) || "
|
||||
+ "@annotation(com.knecon.fforesight.lifecyclecommons.LifecycleMonitor) || "
|
||||
+ "@annotation(org.springframework.web.bind.annotation.GetMapping) || "
|
||||
|
||||
@ -6,10 +6,18 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
|
||||
@EnableConfigurationProperties(LifecycleProperties.class)
|
||||
@ComponentScan(basePackageClasses = {LifecycleManager.class, LifecycleAspect.class})
|
||||
@Slf4j
|
||||
public class LifecycleAutoconfiguration {
|
||||
|
||||
public LifecycleAutoconfiguration() {
|
||||
|
||||
log.info("Initializing LifecycleAutoConfiguration");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user