-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathSentryCheckInAdviceConfiguration.java
More file actions
33 lines (29 loc) · 1.21 KB
/
SentryCheckInAdviceConfiguration.java
File metadata and controls
33 lines (29 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package io.sentry.spring.checkin;
import com.jakewharton.nopen.annotation.Open;
import org.aopalliance.aop.Advice;
import org.jetbrains.annotations.NotNull;
import org.springframework.aop.Advisor;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;
@Configuration(proxyBeanMethods = false)
@Open
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class SentryCheckInAdviceConfiguration {
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public @NotNull Advice sentryCheckInAdvice() {
return new SentryCheckInAdvice();
}
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public @NotNull Advisor sentryCheckInAdvisor(
final @NotNull @Qualifier("sentryCheckInPointcut") Pointcut sentryCheckInPointcut,
final @NotNull @Qualifier("sentryCheckInAdvice") Advice sentryCheckInAdvice) {
return new DefaultPointcutAdvisor(sentryCheckInPointcut, sentryCheckInAdvice);
}
}