Refine search
@EnableAspectJAutoProxy @Configuration @EnableAutoConfiguration @EnableTransactionManagement @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, PortalApplication.class, PortalOpenApiConfig.class}) public class PortalApplication { public static void main(String[] args) throws Exception { SpringApplication.run(PortalApplication.class, args); } }
@SpringBootApplication @EnableAspectJAutoProxy public class ApplicationConfiguration { public @Bean CustomizableTraceInterceptor interceptor() { CustomizableTraceInterceptor interceptor = new CustomizableTraceInterceptor(); interceptor.setEnterMessage("Entering $[methodName]($[arguments])."); interceptor.setExitMessage("Leaving $[methodName](..) with return value $[returnValue], took $[invocationTime]ms."); return interceptor; } public @Bean Advisor traceAdvisor() { AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut(); pointcut.setExpression("execution(public * org.springframework.data.repository.Repository+.*(..))"); return new DefaultPointcutAdvisor(pointcut, interceptor()); } }
@ComponentScan("example.scannable") @EnableAspectJAutoProxy static class ConfigWithJdkProxy { }
@EnableAspectJAutoProxy @EnableEurekaClient @Configuration @PropertySource(value = {"classpath:adminservice.properties"}) @EnableAutoConfiguration @EnableTransactionManagement @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, ApolloBizConfig.class, AdminServiceApplication.class}) public class AdminServiceApplication { public static void main(String[] args) { SpringApplication.run(AdminServiceApplication.class, args); } }
@ComponentScan("example.scannable") @EnableAspectJAutoProxy(proxyTargetClass = true) static class ConfigWithCglibProxy { }
@Configuration @EnableAspectJAutoProxy(proxyTargetClass = true) public class AopConfig { }
@ComponentScan("example.scannable") @EnableAspectJAutoProxy(exposeProxy = true) static class ConfigWithExposedProxy { @Bean public FooService fooServiceImpl(final ApplicationContext context) { return new FooServiceImpl() { @Override public String foo(int id) { assertNotNull(AopContext.currentProxy()); return super.foo(id); } @Override protected FooDao fooDao() { return context.getBean(FooDao.class); } }; } }
/** * Spring boot application entry point * * @author Jason Song(song_s@ctrip.com) */ @EnableEurekaServer @EnableAspectJAutoProxy @EnableAutoConfiguration // (exclude = EurekaClientConfigBean.class) @Configuration @EnableTransactionManagement @PropertySource(value = {"classpath:configservice.properties"}) @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, ApolloBizConfig.class, ConfigServiceApplication.class, ApolloMetaServiceConfig.class}) public class ConfigServiceApplication { public static void main(String[] args) throws Exception { SpringApplication.run(ConfigServiceApplication.class, args); } }
@ImportResource({ "classpath:bytetcc-disable-tx-advice.xml", "classpath:bytetcc-supports-dubbo-secondary.xml" }) @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableTransactionManagement public class DubboSecondaryConfiguration implements TransactionManagementConfigurer, ApplicationContextAware,
@Configuration @EnableAspectJAutoProxy public static class Application { @Bean Runnable fromInnerClass() { return new Runnable() { @Override public void run() { } }; } @Bean Runnable fromLambdaExpression() { return () -> { }; } }
@ImportResource({ "classpath:bytetcc-supports-dubbo.xml" }) @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableTransactionManagement public class DubboSupportConfiguration
/** * Registers beans related to task scheduling. * * @author Michal Chmielarz, 4financeIT * @author Spencer Gibb * @since 1.0.0 * @see TraceSchedulingAspect */ @Configuration @EnableAspectJAutoProxy @ConditionalOnProperty(value = "spring.sleuth.scheduled.enabled", matchIfMissing = true) @ConditionalOnBean(Tracing.class) @AutoConfigureAfter(TraceAutoConfiguration.class) @EnableConfigurationProperties(SleuthSchedulingProperties.class) public class TraceSchedulingAutoConfiguration { @Bean @ConditionalOnClass(name = "org.aspectj.lang.ProceedingJoinPoint") public TraceSchedulingAspect traceSchedulingAspect(Tracer tracer, SleuthSchedulingProperties sleuthSchedulingProperties) { return new TraceSchedulingAspect(tracer, Pattern.compile(sleuthSchedulingProperties.getSkipPattern())); } }
@ImportResource({ "classpath:bytetcc-disable-tx-advice.xml", "classpath:bytetcc-supports-springboot-secondary.xml" }) @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableTransactionManagement public class SpringBootSecondaryConfiguration
@Configuration @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableConfigurationProperties @ComponentScan(basePackages = {"org.dromara.hmily"})
@ImportResource({ "classpath:bytetcc-supports-springboot.xml" }) @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableTransactionManagement public class SpringBootConfiguration implements TransactionManagementConfigurer, WebMvcConfigurer, InitializingBean,
@Configuration @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableConfigurationProperties @ComponentScan(basePackages = {"org.dromara.myth"})
@Configurable @Import(SpringApplicationContext.class) @EnableAspectJAutoProxy(proxyTargetClass = true) public class AopCglibConfig { }
@Configuration @EnableAspectJAutoProxy(proxyTargetClass = true) @EnableConfigurationProperties @ComponentScan(basePackages = { "org.dromara.raincat.*" })
@Configurable @Import(SpringApplicationContext.class) @EnableAspectJAutoProxy public class AopJdkConfig { }
@Configuration @EnableAspectJAutoProxy class ZipkinSpanAspectConfig { @Bean ZipkinSpanAspect zipkinSpanAspect(Tracing tracing) { return new ZipkinSpanAspect(tracing); } }