use of org.springframework.integration.transaction.PassThroughTransactionSynchronizationFactory in project spring-integration by spring-projects.
the class AbstractPollingEndpoint method onInit.
@Override
protected void onInit() {
synchronized (this.initializationMonitor) {
if (this.initialized) {
return;
}
Assert.notNull(this.trigger, "Trigger is required");
if (this.taskExecutor != null) {
if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor)) {
if (this.errorHandler == null) {
Assert.notNull(this.getBeanFactory(), "BeanFactory is required");
this.errorHandler = new MessagePublishingErrorHandler(new BeanFactoryChannelResolver(getBeanFactory()));
this.errorHandlerIsDefault = true;
}
this.taskExecutor = new ErrorHandlingTaskExecutor(this.taskExecutor, this.errorHandler);
}
}
if (this.transactionSynchronizationFactory == null && this.adviceChain != null) {
if (this.adviceChain.stream().anyMatch(TransactionInterceptor.class::isInstance)) {
this.transactionSynchronizationFactory = new PassThroughTransactionSynchronizationFactory();
}
}
this.initialized = true;
}
try {
super.onInit();
} catch (Exception e) {
throw new BeanInitializationException("Cannot initialize: " + this, e);
}
}
Aggregations