Some Fixes and Improvements

* Fix several typos in log messages. And some test on the matter as well
* Add comment to `AbstractPersistentAcceptOnceFileListFilter.rollback()` to clarify the reason of `rollingBack` variable
* Make `RemoteFileTemplate.StreamHolder` as `static` to avoid extra internal variable to outer class instance
* Replace `MessagingException` with `AbstractInboundFileSynchronizingMessageSource` in `init()` method of some components. It isn't Messaging yet in that phase
* Fix `SubscribableRedisChannel.MessageListenerDelegate` to handle `Object` not `String`, because with the `serializer` injection there is no guaranty that incoming is always `String`
* Move `JSch.setLogger(new JschLogger());` in the `DefaultSftpSessionFactory` to `static` block. It really should be done only once
* Remove `Assert.isTrue(this.port >= 0)` from the `DefaultSftpSessionFactory`. The subsequant `initJschSession()` convert it to default `22` port
* Change in the `JschProxyFactoryBean` `UnsupportedOperationException` to `IllegalArgumentException`. Wrong enum is wrong argument. That isn't a problem of operation
* Simplify `stop()` in the `CuratorFrameworkFactoryBean` and mark it as a `this.running = false`. Otherwise it wasn't able to be restarted
* Expose `leaderEventPublisher` in the `LeaderInitiatorFactoryBean`  and fix `stop(Runnable callback)` with propagation `callback` to delegate.

Fix `SubscribableRedisChannelTests` for new `handleMessage(Object)` signature
This commit is contained in:
Artem Bilan
2016-08-10 13:24:49 -04:00
committed by Gary Russell
parent 28216013dd
commit 7124136091
16 changed files with 91 additions and 64 deletions

View File

@@ -98,7 +98,7 @@ public class RegexTestXPathMessageSelector extends AbstractXPathMessageSelector
public boolean accept(Message<?> message) {
Node nodeToTest = getConverter().convertToNode(message.getPayload());
String xPathResult = getXPathExpresion().evaluateAsString(nodeToTest);
return StringUtils.hasText(xPathResult) ? xPathResult.matches(this.regex) : false;
return StringUtils.hasText(xPathResult) && xPathResult.matches(this.regex);
}
}

View File

@@ -133,9 +133,7 @@ public class XmlValidatingMessageSelector implements MessageSelector {
new AggregatedXmlMessageValidationException(
Arrays.<Throwable>asList(validationExceptions)));
}
if (this.logger.isDebugEnabled()) {
this.logger.debug("Message was rejected due to XML Validation errors");
}
this.logger.debug("Message was rejected due to XML Validation errors");
}
return validationSuccess;
}