Java 类org.springframework.scheduling.annotation.AsyncConfigurer 实例源码

项目:java-spring-cloud    文件:CustomAsyncConfigurerAutoConfiguration.java   
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
  if (bean instanceof AsyncConfigurer) {
    AsyncConfigurer configurer = (AsyncConfigurer) bean;
    return new TracedAsyncConfigurer(tracer, configurer);
  }
  return bean;
}
项目:java-spring-cloud    文件:CustomAsyncConfigurerAutoConfigurationTest.java   
@Test
public void should_return_async_configurer_when_bean_instance_of_it() {
  CustomAsyncConfigurerAutoConfiguration configuration = new CustomAsyncConfigurerAutoConfiguration();
  Object bean = configuration
      .postProcessAfterInitialization(mock(AsyncConfigurer.class), "myAsync");
  then(bean).isInstanceOf(TracedAsyncConfigurer.class);
}
项目:Zipkin    文件:AsyncCustomAutoConfiguration.java   
@Override
public Object postProcessAfterInitialization(Object bean, String beanName)
        throws BeansException {
    if (bean instanceof AsyncConfigurer) {
        AsyncConfigurer configurer = (AsyncConfigurer) bean;
        return new LazyTraceAsyncCustomizer(this.beanFactory, configurer);
    }
    return bean;
}
项目:Zipkin    文件:AsyncCustomAutoConfigurationTest.java   
@Test
public void should_return_lazy_async_configurer_when_bean_is_async_configurer() throws Exception {
    AsyncCustomAutoConfiguration configuration = new AsyncCustomAutoConfiguration();

    Object bean = configuration
            .postProcessAfterInitialization(mock(AsyncConfigurer.class), "someName");

    then(bean).isInstanceOf(LazyTraceAsyncCustomizer.class);
}
项目:spring-cloud-sleuth    文件:AsyncCustomAutoConfiguration.java   
@Override
public Object postProcessAfterInitialization(Object bean, String beanName)
        throws BeansException {
    if (bean instanceof AsyncConfigurer) {
        AsyncConfigurer configurer = (AsyncConfigurer) bean;
        return new LazyTraceAsyncCustomizer(this.beanFactory, configurer);
    }
    return bean;
}
项目:spring-cloud-sleuth    文件:AsyncCustomAutoConfigurationTest.java   
@Test
public void should_return_lazy_async_configurer_when_bean_is_async_configurer() throws Exception {
    AsyncCustomAutoConfiguration configuration = new AsyncCustomAutoConfiguration();

    Object bean = configuration
            .postProcessAfterInitialization(mock(AsyncConfigurer.class), "someName");

    then(bean).isInstanceOf(LazyTraceAsyncCustomizer.class);
}
项目:java-spring-cloud    文件:TracedAsyncConfigurer.java   
public TracedAsyncConfigurer(Tracer tracer, AsyncConfigurer delegate) {
  this.tracer = tracer;
  this.delegate = delegate;
}
项目:Zipkin    文件:LazyTraceAsyncCustomizer.java   
public LazyTraceAsyncCustomizer(BeanFactory beanFactory, AsyncConfigurer delegate) {
    this.beanFactory = beanFactory;
    this.delegate = delegate;
}
项目:spring-cloud-sleuth    文件:LazyTraceAsyncCustomizer.java   
public LazyTraceAsyncCustomizer(BeanFactory beanFactory, AsyncConfigurer delegate) {
    this.beanFactory = beanFactory;
    this.delegate = delegate;
}