checkstyle FinalClassCheck
fixes fixModifiers after fixFinal Revert CachingSessionFactory Class is spied in tests. checkstyle - Import Rules checkstyle InterfaceIsType checkstyle InnerTypeLast checkstyle OneStatementPerLine CovariantEquals OneTopLevelClass * Revert `'\n'` -> `System.lineSeparator()` in the Gradle scripts to meet Git `autocrlf = true` on Windows * Fix timing issue with the `LastModifiedFileListFilterTests`, when the `age = 1` might not be enough for the file object when we have some delay before checking
This commit is contained in:
committed by
Artem Bilan
parent
43af472c3a
commit
4ac3a79df7
@@ -454,7 +454,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
|
||||
* @since 2.2
|
||||
*
|
||||
*/
|
||||
private class IntegrationMimeMessage extends MimeMessage {
|
||||
private final class IntegrationMimeMessage extends MimeMessage {
|
||||
|
||||
private final MimeMessage source;
|
||||
|
||||
|
||||
@@ -182,6 +182,54 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
|
||||
}
|
||||
}
|
||||
|
||||
private Runnable createMessageSendingTask(final Message mailMessage){
|
||||
Runnable sendingTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
org.springframework.messaging.Message<?> message =
|
||||
ImapIdleChannelAdapter.this.getMessageBuilderFactory().withPayload(mailMessage).build();
|
||||
|
||||
if (TransactionSynchronizationManager.isActualTransactionActive()) {
|
||||
if (ImapIdleChannelAdapter.this.transactionSynchronizationFactory != null){
|
||||
TransactionSynchronization synchronization =
|
||||
ImapIdleChannelAdapter.this.transactionSynchronizationFactory
|
||||
.create(ImapIdleChannelAdapter.this);
|
||||
TransactionSynchronizationManager.registerSynchronization(synchronization);
|
||||
if (synchronization instanceof IntegrationResourceHolderSynchronization) {
|
||||
IntegrationResourceHolder holder =
|
||||
((IntegrationResourceHolderSynchronization) synchronization).getResourceHolder();
|
||||
holder.setMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
sendMessage(message);
|
||||
}
|
||||
};
|
||||
|
||||
// wrap in the TX proxy if necessary
|
||||
if (!CollectionUtils.isEmpty(this.adviceChain)) {
|
||||
ProxyFactory proxyFactory = new ProxyFactory(sendingTask);
|
||||
if (!CollectionUtils.isEmpty(this.adviceChain)) {
|
||||
for (Advice advice : this.adviceChain) {
|
||||
proxyFactory.addAdvice(advice);
|
||||
}
|
||||
}
|
||||
sendingTask = (Runnable) proxyFactory.getProxy(this.classLoader);
|
||||
}
|
||||
return sendingTask;
|
||||
}
|
||||
|
||||
private void publishException(Exception e) {
|
||||
if (this.applicationEventPublisher != null) {
|
||||
this.applicationEventPublisher.publishEvent(new ImapIdleExceptionEvent(e));
|
||||
}
|
||||
else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No application event publisher for exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class ReceivingTask implements Runnable {
|
||||
@Override
|
||||
@@ -247,54 +295,6 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
|
||||
}
|
||||
}
|
||||
|
||||
private Runnable createMessageSendingTask(final Message mailMessage){
|
||||
Runnable sendingTask = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
org.springframework.messaging.Message<?> message =
|
||||
ImapIdleChannelAdapter.this.getMessageBuilderFactory().withPayload(mailMessage).build();
|
||||
|
||||
if (TransactionSynchronizationManager.isActualTransactionActive()) {
|
||||
if (ImapIdleChannelAdapter.this.transactionSynchronizationFactory != null){
|
||||
TransactionSynchronization synchronization =
|
||||
ImapIdleChannelAdapter.this.transactionSynchronizationFactory
|
||||
.create(ImapIdleChannelAdapter.this);
|
||||
TransactionSynchronizationManager.registerSynchronization(synchronization);
|
||||
if (synchronization instanceof IntegrationResourceHolderSynchronization) {
|
||||
IntegrationResourceHolder holder =
|
||||
((IntegrationResourceHolderSynchronization) synchronization).getResourceHolder();
|
||||
holder.setMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
sendMessage(message);
|
||||
}
|
||||
};
|
||||
|
||||
// wrap in the TX proxy if necessary
|
||||
if (!CollectionUtils.isEmpty(this.adviceChain)) {
|
||||
ProxyFactory proxyFactory = new ProxyFactory(sendingTask);
|
||||
if (!CollectionUtils.isEmpty(this.adviceChain)) {
|
||||
for (Advice advice : this.adviceChain) {
|
||||
proxyFactory.addAdvice(advice);
|
||||
}
|
||||
}
|
||||
sendingTask = (Runnable) proxyFactory.getProxy(this.classLoader);
|
||||
}
|
||||
return sendingTask;
|
||||
}
|
||||
|
||||
private void publishException(Exception e) {
|
||||
if (this.applicationEventPublisher != null) {
|
||||
this.applicationEventPublisher.publishEvent(new ImapIdleExceptionEvent(e));
|
||||
}
|
||||
else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("No application event publisher for exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ExceptionAwarePeriodicTrigger implements Trigger {
|
||||
|
||||
private volatile boolean delayNextExecution;
|
||||
|
||||
Reference in New Issue
Block a user