本文整理匯總了Java中org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler類的典型用法代碼示例。如果您正苦於以下問題:Java SimpleAsyncUncaughtExceptionHandler類的具體用法?Java SimpleAsyncUncaughtExceptionHandler怎麽用?Java SimpleAsyncUncaughtExceptionHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SimpleAsyncUncaughtExceptionHandler類屬於org.springframework.aop.interceptor包,在下文中一共展示了SimpleAsyncUncaughtExceptionHandler類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AsyncAnnotationAdvisor
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
/**
* Create a new {@code AsyncAnnotationAdvisor} for the given task executor.
* @param executor the task executor to use for asynchronous methods
* (can be {@code null} to trigger default executor resolution)
* @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use to
* handle unexpected exception thrown by asynchronous method executions
* @see AnnotationAsyncExecutionInterceptor#getDefaultExecutor(BeanFactory)
*/
@SuppressWarnings("unchecked")
public AsyncAnnotationAdvisor(Executor executor, AsyncUncaughtExceptionHandler exceptionHandler) {
Set<Class<? extends Annotation>> asyncAnnotationTypes = new LinkedHashSet<Class<? extends Annotation>>(2);
asyncAnnotationTypes.add(Async.class);
try {
asyncAnnotationTypes.add((Class<? extends Annotation>)
ClassUtils.forName("javax.ejb.Asynchronous", AsyncAnnotationAdvisor.class.getClassLoader()));
}
catch (ClassNotFoundException ex) {
// If EJB 3.1 API not present, simply ignore.
}
if (exceptionHandler != null) {
this.exceptionHandler = exceptionHandler;
}
else {
this.exceptionHandler = new SimpleAsyncUncaughtExceptionHandler();
}
this.advice = buildAdvice(executor, this.exceptionHandler);
this.pointcut = buildPointcut(asyncAnnotationTypes);
}
示例2: getAsyncUncaughtExceptionHandler
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler()
{
// In case any @Async methods return "void" and not a "Future", this exception handler will handle those cases since the caller has not way to access
// the exception without a "Future". Just use an out-of-the-box Spring handler that logs those exceptions.
return new SimpleAsyncUncaughtExceptionHandler();
}
示例3: verifyDefaultAsyncConfigurer
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
@Test
public void verifyDefaultAsyncConfigurer() {
assertEquals(SchedulerConfiguration.class, asyncConfigurer.getClass());
assertEquals(ThreadScopePropagatingScheduler.class, asyncConfigurer.getAsyncExecutor().getClass());
assertEquals(SimpleAsyncUncaughtExceptionHandler.class, asyncConfigurer.getAsyncUncaughtExceptionHandler()
.getClass());
}
示例4: getAsyncUncaughtExceptionHandler
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new SimpleAsyncUncaughtExceptionHandler();
}
示例5: getAsyncUncaughtExceptionHandler
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler () {
return new SimpleAsyncUncaughtExceptionHandler();
}
示例6: getAsyncUncaughtExceptionHandler
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler () {
return new SimpleAsyncUncaughtExceptionHandler();
}
示例7: getAsyncUncaughtExceptionHandler
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; //導入依賴的package包/類
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new SimpleAsyncUncaughtExceptionHandler();
}