本文整理匯總了Java中org.springframework.scheduling.annotation.AsyncConfigurer類的典型用法代碼示例。如果您正苦於以下問題:Java AsyncConfigurer類的具體用法?Java AsyncConfigurer怎麽用?Java AsyncConfigurer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AsyncConfigurer類屬於org.springframework.scheduling.annotation包,在下文中一共展示了AsyncConfigurer類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: postProcessAfterInitialization
import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
@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;
}
開發者ID:opentracing-contrib,項目名稱:java-spring-cloud,代碼行數:9,代碼來源:CustomAsyncConfigurerAutoConfiguration.java
示例2: should_return_async_configurer_when_bean_instance_of_it
import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
@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);
}
開發者ID:opentracing-contrib,項目名稱:java-spring-cloud,代碼行數:8,代碼來源:CustomAsyncConfigurerAutoConfigurationTest.java
示例3: postProcessAfterInitialization
import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
@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;
}
示例4: should_return_lazy_async_configurer_when_bean_is_async_configurer
import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
@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);
}
示例5: TracedAsyncConfigurer
import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
public TracedAsyncConfigurer(Tracer tracer, AsyncConfigurer delegate) {
this.tracer = tracer;
this.delegate = delegate;
}
示例6: LazyTraceAsyncCustomizer
import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
public LazyTraceAsyncCustomizer(BeanFactory beanFactory, AsyncConfigurer delegate) {
this.beanFactory = beanFactory;
this.delegate = delegate;
}