當前位置: 首頁>>代碼示例>>Java>>正文


Java AsyncConfigurer類代碼示例

本文整理匯總了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;
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:10,代碼來源:AsyncCustomAutoConfiguration.java

示例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);
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:10,代碼來源:AsyncCustomAutoConfigurationTest.java

示例5: TracedAsyncConfigurer

import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
public TracedAsyncConfigurer(Tracer tracer, AsyncConfigurer delegate) {
  this.tracer = tracer;
  this.delegate = delegate;
}
 
開發者ID:opentracing-contrib,項目名稱:java-spring-cloud,代碼行數:5,代碼來源:TracedAsyncConfigurer.java

示例6: LazyTraceAsyncCustomizer

import org.springframework.scheduling.annotation.AsyncConfigurer; //導入依賴的package包/類
public LazyTraceAsyncCustomizer(BeanFactory beanFactory, AsyncConfigurer delegate) {
	this.beanFactory = beanFactory;
	this.delegate = delegate;
}
 
開發者ID:reshmik,項目名稱:Zipkin,代碼行數:5,代碼來源:LazyTraceAsyncCustomizer.java


注:本文中的org.springframework.scheduling.annotation.AsyncConfigurer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。