Make IOS.setTaskScheduler() as public (#2725)
* Make IOS.setTaskScheduler() as public * Make `IntegrationObjectSupport.setTaskScheduler()` as `public` and remove all the overrides for visibility * Fix Sonar smells for all the affected classes * * Fix `throws Exception` for affected classes to avoid compilation errors * * Fix "merely rethrow" smell * Revert `throws Exception` for `AbstractEndpoint.destroy()` * * Catch a couple exceptions from `destroy()`
This commit is contained in:
committed by
Gary Russell
parent
7980afef9b
commit
020ea76d59
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
* Copyright 2016-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -99,9 +99,14 @@ public class JmsInboundGateway extends MessagingGatewaySupport implements Dispos
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
public void destroy() {
|
||||
this.endpoint.destroy();
|
||||
super.destroy();
|
||||
try {
|
||||
super.destroy();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,8 @@ import org.springframework.util.Assert;
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class JmsMessageDrivenEndpoint extends MessageProducerSupport implements DisposableBean, OrderlyShutdownCapable {
|
||||
public class JmsMessageDrivenEndpoint extends MessageProducerSupport
|
||||
implements DisposableBean, OrderlyShutdownCapable {
|
||||
|
||||
private final AbstractMessageListenerContainer listenerContainer;
|
||||
|
||||
@@ -73,7 +74,7 @@ public class JmsMessageDrivenEndpoint extends MessageProducerSupport implements
|
||||
ChannelPublishingJmsMessageListener listener, boolean externalContainer) {
|
||||
Assert.notNull(listenerContainer, "listener container must not be null");
|
||||
Assert.notNull(listener, "listener must not be null");
|
||||
if (logger.isWarnEnabled() && listenerContainer.getMessageListener() != null) {
|
||||
if (listenerContainer.getMessageListener() != null) {
|
||||
logger.warn("The provided listener container already has a MessageListener implementation, " +
|
||||
"but it will be overridden by the provided ChannelPublishingJmsMessageListener.");
|
||||
}
|
||||
@@ -212,12 +213,17 @@ public class JmsMessageDrivenEndpoint extends MessageProducerSupport implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
public void destroy() {
|
||||
if (this.isRunning()) {
|
||||
this.stop();
|
||||
}
|
||||
this.listenerContainer.destroy();
|
||||
super.destroy();
|
||||
try {
|
||||
super.destroy();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user