From 113a371f2c08e8f85319e11a53579aa73f7a933e Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Fri, 21 Dec 2018 17:01:35 -0500 Subject: [PATCH] Remove Exception from IOS.onInit() --- .../amqp/channel/AbstractAmqpChannel.java | 5 +++-- .../channel/AbstractSubscribableAmqpChannel.java | 2 +- .../amqp/channel/PollableAmqpChannel.java | 2 +- .../integration/amqp/inbound/AmqpInboundGateway.java | 2 +- .../AbstractCorrelatingMessageHandler.java | 2 +- .../integration/channel/AbstractMessageChannel.java | 2 +- .../channel/DefaultHeaderChannelRegistry.java | 2 +- .../integration/channel/DirectChannel.java | 4 ++-- .../integration/channel/ExecutorChannel.java | 4 ++-- .../integration/channel/PublishSubscribeChannel.java | 3 +-- .../context/IntegrationObjectSupport.java | 3 +-- .../springframework/integration/dsl/RouterSpec.java | 3 ++- .../integration/endpoint/AbstractEndpoint.java | 2 +- .../endpoint/ReactiveStreamsConsumer.java | 8 ++++++-- .../integration/gateway/MessagingGatewaySupport.java | 2 +- .../integration/handler/AbstractMessageHandler.java | 2 +- .../handler/AbstractMessageProducingHandler.java | 2 +- .../AbstractReplyProducingMessageHandler.java | 2 +- .../handler/ExpressionEvaluatingMessageHandler.java | 4 ++-- .../integration/handler/LoggingHandler.java | 4 ++-- .../integration/handler/MessageHandlerChain.java | 4 ++-- .../ExpressionEvaluatingRequestHandlerAdvice.java | 4 ++-- .../handler/advice/RequestHandlerRetryAdvice.java | 4 ++-- .../router/AbstractMessageProcessingRouter.java | 4 ++-- .../integration/router/AbstractMessageRouter.java | 4 ++-- .../router/ErrorMessageExceptionTypeRouter.java | 2 +- .../integration/router/RecipientListRouter.java | 5 +++-- ...valuatingTransactionSynchronizationProcessor.java | 7 +++++-- .../integration/transformer/DecodingTransformer.java | 4 ++-- .../integration/transformer/HeaderEnricher.java | 2 +- .../integration/transformer/HeaderFilter.java | 4 ++-- .../PayloadTypeConvertingTransformer.java | 2 +- .../integration/file/remote/RemoteFileTemplate.java | 2 +- .../handler/FileTransferringMessageHandler.java | 4 ++-- .../gemfire/outbound/CacheWritingMessageHandler.java | 4 ++-- .../http/inbound/BaseHttpInboundEndpoint.java | 2 +- .../http/inbound/HttpRequestHandlingController.java | 2 +- .../inbound/HttpRequestHandlingEndpointSupport.java | 2 +- .../integration/ip/tcp/TcpInboundGateway.java | 4 ++-- .../integration/ip/tcp/TcpSendingMessageHandler.java | 4 ++-- .../ip/tcp/connection/AbstractConnectionFactory.java | 2 +- .../connection/FailoverClientConnectionFactory.java | 4 ++-- .../ip/udp/UnicastSendingMessageHandler.java | 2 +- .../integration/jdbc/JdbcMessageHandler.java | 2 +- .../integration/jms/JmsInboundGateway.java | 2 +- .../integration/jms/SubscribableJmsChannel.java | 2 +- .../jmx/NotificationPublishingMessageHandler.java | 4 ++-- .../integration/mail/AbstractMailReceiver.java | 2 +- .../integration/mail/ImapMailReceiver.java | 2 +- .../outbound/MongoDbStoringMessageHandler.java | 5 +++-- .../mqtt/outbound/AbstractMqttMessageHandler.java | 2 +- .../mqtt/outbound/MqttPahoMessageHandler.java | 2 +- .../redis/channel/SubscribableRedisChannel.java | 2 +- .../redis/inbound/RedisQueueInboundGateway.java | 2 +- .../outbound/RedisQueueOutboundChannelAdapter.java | 4 ++-- .../outbound/RedisStoreWritingMessageHandler.java | 2 +- .../integration/rmi/RmiInboundGateway.java | 11 +++++++++-- .../stomp/outbound/StompMessageHandler.java | 2 +- .../outbound/WebSocketOutboundMessageHandler.java | 2 +- .../ws/MarshallingWebServiceInboundGateway.java | 4 ++-- .../xml/transformer/AbstractXmlTransformer.java | 4 ++-- .../xml/transformer/XsltPayloadTransformer.java | 12 +++++++++--- .../AbstractXmppConnectionAwareMessageHandler.java | 6 ++++-- 63 files changed, 118 insertions(+), 94 deletions(-) diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractAmqpChannel.java index 2922040650..fb1f25a88f 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -35,6 +35,7 @@ import org.springframework.util.Assert; /** * @author Mark Fisher * @author Artem Bilan + * @author Gary Russell * * @since 2.1 */ @@ -207,7 +208,7 @@ public abstract class AbstractAmqpChannel extends AbstractMessageChannel } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (!this.initialized && this.rabbitTemplate != null) { if (this.connectionFactory != null) { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java index 41c35a51ae..6033c9f573 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/AbstractSubscribableAmqpChannel.java @@ -160,7 +160,7 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel } @Override - public void onInit() throws Exception { + public void onInit() { super.onInit(); this.dispatcher = this.createDispatcher(); if (this.maxSubscribers == null) { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java index 22332181d4..542ff2d72a 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PollableAmqpChannel.java @@ -138,7 +138,7 @@ public class PollableAmqpChannel extends AbstractAmqpChannel } @Override - protected void onInit() throws Exception { + protected void onInit() { AmqpTemplate amqpTemplate = getAmqpTemplate(); if (this.queue == null) { if (getAdmin() == null && amqpTemplate instanceof RabbitTemplate) { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java index dea1b508cb..680d2dc1e5 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/inbound/AmqpInboundGateway.java @@ -182,7 +182,7 @@ public class AmqpInboundGateway extends MessagingGatewaySupport { } @Override - protected void onInit() throws Exception { + protected void onInit() { if (this.retryTemplate != null) { Assert.state(getErrorChannel() == null, "Cannot have an 'errorChannel' property when a 'RetryTemplate' is " + "provided; use an 'ErrorMessageSendingRecoverer' in the 'recoveryCallback' property to " diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java index 1daadb72d4..e2dcca9e11 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java @@ -311,7 +311,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageP } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.state(!(this.discardChannelName != null && this.discardChannel != null), "'discardChannelName' and 'discardChannel' are mutually exclusive."); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java index d7721ef3f1..4d9ff4679f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractMessageChannel.java @@ -352,7 +352,7 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.messageConverter == null) { if (getBeanFactory() != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java index b655118251..cc4dec6a33 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java @@ -118,7 +118,7 @@ public class DefaultHeaderChannelRegistry extends IntegrationObjectSupport } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.notNull(getTaskScheduler(), "a task scheduler is required"); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java index 5b67dd34dd..073b432f31 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/DirectChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2018 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. @@ -82,7 +82,7 @@ public class DirectChannel extends AbstractSubscribableChannel { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.maxSubscribers == null) { Integer maxSubscribers = this.getIntegrationProperty(IntegrationProperties.CHANNELS_MAX_UNICAST_SUBSCRIBERS, Integer.class); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java index a58369b1ac..5286854fbb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/ExecutorChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -98,7 +98,7 @@ public class ExecutorChannel extends AbstractExecutorChannel { } @Override - public final void onInit() throws Exception { + public final void onInit() { Assert.state(getDispatcher().getHandlerCount() == 0, "You cannot subscribe() until the channel " + "bean is fully initialized by the framework. Do not subscribe in a @Bean definition"); super.onInit(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java index 495498efe9..4e238eaf07 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/PublishSubscribeChannel.java @@ -126,10 +126,9 @@ public class PublishSubscribeChannel extends AbstractExecutorChannel { /** * Callback method for initialization. - * @throws Exception the exception. */ @Override - public final void onInit() throws Exception { + public final void onInit() { super.onInit(); if (this.executor != null) { Assert.state(getDispatcher().getHandlerCount() == 0, diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java index d36c5952f1..13c291db30 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java @@ -194,9 +194,8 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo /** * Subclasses may implement this for initialization logic. - * @throws Exception Any exception. */ - protected void onInit() throws Exception { + protected void onInit() { } /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java index 496c27d46d..6fb51ca286 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/RouterSpec.java @@ -37,6 +37,7 @@ import org.springframework.util.StringUtils; * @param the {@link AbstractMappingMessageRouter} implementation type. * * @author Artem Bilan + * @author Gary Russell * * @since 5.0 */ @@ -198,7 +199,7 @@ public final class RouterSpec } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); ConversionService conversionService = getConversionService(); if (conversionService == null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractEndpoint.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractEndpoint.java index a98cfa6fe3..188a7d303e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractEndpoint.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractEndpoint.java @@ -95,7 +95,7 @@ public abstract class AbstractEndpoint extends IntegrationObjectSupport } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (!this.autoStartupSetExplicitly) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java index aeb2c8545f..ce24f5a702 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java @@ -121,7 +121,7 @@ public class ReactiveStreamsConsumer extends AbstractEndpoint implements Integra } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.errorHandler == null) { Assert.notNull(getBeanFactory(), "BeanFactory is required"); @@ -138,11 +138,13 @@ public class ReactiveStreamsConsumer extends AbstractEndpoint implements Integra private final Subscriber> delegate = ReactiveStreamsConsumer.this.subscriber; + @Override public void hookOnSubscribe(Subscription s) { this.delegate.onSubscribe(s); ReactiveStreamsConsumer.this.subscription = s; } + @Override public void hookOnNext(Message message) { try { this.delegate.onNext(message); @@ -153,10 +155,12 @@ public class ReactiveStreamsConsumer extends AbstractEndpoint implements Integra } } + @Override public void hookOnError(Throwable t) { this.delegate.onError(t); } + @Override public void hookOnComplete() { this.delegate.onComplete(); } @@ -182,7 +186,7 @@ public class ReactiveStreamsConsumer extends AbstractEndpoint implements Integra private Subscription subscription; - private MessageHandler messageHandler; + private final MessageHandler messageHandler; MessageHandlerSubscriber(MessageHandler messageHandler) { Assert.notNull(messageHandler, "'messageHandler' must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java index bb55ece8f7..8b793821cb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java @@ -330,7 +330,7 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint } @Override - protected void onInit() throws Exception { + protected void onInit() { Assert.state(!(this.requestChannelName != null && this.requestChannel != null), "'requestChannelName' and 'requestChannel' are mutually exclusive."); Assert.state(!(this.replyChannelName != null && this.replyChannel != null), diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandler.java index b7a12fe6fe..52e809ccd3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageHandler.java @@ -133,7 +133,7 @@ public abstract class AbstractMessageHandler extends IntegrationObjectSupport } @Override - protected void onInit() throws Exception { + protected void onInit() { if (this.statsEnabled) { this.handlerMetrics.setFullStatsEnabled(true); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java index 17c8fac401..36889cb71d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java @@ -192,7 +192,7 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.state(!(this.outputChannelName != null && this.outputChannel != null), //NOSONAR (inconsistent sync) "'outputChannelName' and 'outputChannel' are mutually exclusive."); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java index 431421448b..b5ff1d3187 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingMessageHandler.java @@ -88,7 +88,7 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa @Override - protected final void onInit() throws Exception { + protected final void onInit() { super.onInit(); initAdvisedRequestHandlerIfAny(); doInit(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java index 889ef630c2..d4d5ed9865 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -53,7 +53,7 @@ public class ExpressionEvaluatingMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { this.processor.setBeanFactory(getBeanFactory()); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java index fe673efffa..ecf8b434ce 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -164,7 +164,7 @@ public class LoggingHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java index 82f3fc8983..a06fc70946 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageHandlerChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -91,7 +91,7 @@ public class MessageHandlerChain extends AbstractMessageProducingHandler impleme } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); synchronized (this.initializationMonitor) { if (!this.initialized) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java index 350855fb32..a83818ea92 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -199,7 +199,7 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java index 195008a849..7d9860c33b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/RequestHandlerRetryAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -66,7 +66,7 @@ public class RequestHandlerRetryAdvice extends AbstractRequestHandlerAdvice } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.retryTemplate.registerListener(this); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java index ee2acfb795..2e5f975ba5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageProcessingRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -47,7 +47,7 @@ class AbstractMessageProcessingRouter extends AbstractMappingMessageRouter @Override - public final void onInit() throws Exception { + public final void onInit() { super.onInit(); if (this.messageProcessor instanceof AbstractMessageProcessor) { ConversionService conversionService = getConversionService(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java index 4acbcf1271..43523bfcd6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -147,7 +147,7 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler imple } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.state(!(this.defaultOutputChannelName != null && this.defaultOutputChannel != null), "'defaultOutputChannelName' and 'defaultOutputChannel' are mutually exclusive."); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/ErrorMessageExceptionTypeRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/ErrorMessageExceptionTypeRouter.java index f588bdc648..0a6fe20e42 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/ErrorMessageExceptionTypeRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/ErrorMessageExceptionTypeRouter.java @@ -105,7 +105,7 @@ public class ErrorMessageExceptionTypeRouter extends AbstractMappingMessageRoute } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); populateClassNameMapping(this.channelMappings.keySet()); this.initialized = true; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java index b9136fb3dc..83dd1cdf35 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/RecipientListRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -69,6 +69,7 @@ import org.springframework.util.StringUtils; * @author Oleg Zhurakousky * @author Artem Bilan * @author Liujiong + * @author Gary Russell */ public class RecipientListRouter extends AbstractMessageRouter implements InitializingBean, RecipientListRouterManagement { @@ -257,7 +258,7 @@ public class RecipientListRouter extends AbstractMessageRouter @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.recipients.forEach(recipient -> recipient.setChannelResolver(getChannelResolver())); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java index 7e6aa3b7ad..55055e8d99 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -107,21 +107,24 @@ public class ExpressionEvaluatingTransactionSynchronizationProcessor extends Int } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = createEvaluationContext(); } } + @Override public void processBeforeCommit(IntegrationResourceHolder holder) { doProcess(holder, this.beforeCommitExpression, this.beforeCommitChannel, "beforeCommit"); } + @Override public void processAfterCommit(IntegrationResourceHolder holder) { doProcess(holder, this.afterCommitExpression, this.afterCommitChannel, "afterCommit"); } + @Override public void processAfterRollback(IntegrationResourceHolder holder) { doProcess(holder, this.afterRollbackExpression, this.afterRollbackChannel, "afterRollback"); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java index 4420f71e3e..90da94bd71 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/DecodingTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2018 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. @@ -72,7 +72,7 @@ public class DecodingTransformer extends AbstractTransformer { } @Override - protected void onInit() throws Exception { + protected void onInit() { if (this.evaluationContext == null) { this.evaluationContext = IntegrationContextUtils.getEvaluationContext(getBeanFactory()); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderEnricher.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderEnricher.java index efaaa3e24b..5086a6bf8c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderEnricher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderEnricher.java @@ -160,7 +160,7 @@ public class HeaderEnricher extends IntegrationObjectSupport implements Transfor } @Override - public void onInit() throws Exception { + public void onInit() { boolean shouldOverwrite = this.defaultOverwrite; boolean checkReadOnlyHeaders = getMessageBuilderFactory() instanceof DefaultMessageBuilderFactory; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderFilter.java index 81d6ec12e4..e569a1c2a2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/HeaderFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -58,7 +58,7 @@ public class HeaderFilter extends IntegrationObjectSupport implements Transforme } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (getMessageBuilderFactory() instanceof DefaultMessageBuilderFactory) { for (String header : this.headersToRemove) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadTypeConvertingTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadTypeConvertingTransformer.java index 7b382196a8..1a049db90d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadTypeConvertingTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/PayloadTypeConvertingTransformer.java @@ -53,7 +53,7 @@ public class PayloadTypeConvertingTransformer extends AbstractPayloadTrans } @Override - protected void onInit() throws Exception { // NOSONAR thrown by super class + protected void onInit() { super.onInit(); Assert.notNull(this.converter, () -> getClass().getName() + " requires a Converter"); } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java index 2444d56c3f..e222b0ae67 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java @@ -238,7 +238,7 @@ public class RemoteFileTemplate implements RemoteFileOperations, Initializ } @Override - public void afterPropertiesSet() throws Exception { + public void afterPropertiesSet() { BeanFactory beanFactory = this.beanFactory; if (beanFactory != null) { if (this.directoryExpressionProcessor != null) { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java index 2645d32409..ce8d225d75 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -194,7 +194,7 @@ public class FileTransferringMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { this.remoteFileTemplate.setBeanFactory(this.getBeanFactory()); this.remoteFileTemplate.afterPropertiesSet(); } diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java index 5c623f6434..b9de15cd60 100644 --- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java +++ b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -69,7 +69,7 @@ public class CacheWritingMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.gemfireTemplate.afterPropertiesSet(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/BaseHttpInboundEndpoint.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/BaseHttpInboundEndpoint.java index 53fae51271..6d02a5508e 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/BaseHttpInboundEndpoint.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/BaseHttpInboundEndpoint.java @@ -256,7 +256,7 @@ public class BaseHttpInboundEndpoint extends MessagingGatewaySupport implements } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); validateSupportedMethods(); diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java index 07a51ae6dd..fd9840fe62 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingController.java @@ -141,7 +141,7 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.evaluationContext = this.createEvaluationContext(); } diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java index b9c8dbc19b..41c679ce6f 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java @@ -218,7 +218,7 @@ public abstract class HttpRequestHandlingEndpointSupport extends BaseHttpInbound * was called with true after the converters were set. */ @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); BeanFactory beanFactory = getBeanFactory(); if (this.multipartResolver == null && beanFactory != null) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpInboundGateway.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpInboundGateway.java index e7bdc26d67..70d2973654 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpInboundGateway.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -198,7 +198,7 @@ public class TcpInboundGateway extends MessagingGatewaySupport implements } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.isClientMode) { Assert.notNull(this.clientConnectionFactory, diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java index 5858fd310d..ec42b787b5 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -227,7 +227,7 @@ public class TcpSendingMessageHandler extends AbstractMessageHandler implements } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.isClientMode) { Assert.notNull(this.clientConnectionFactory, diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java index 6f2c79556c..8d8b9af388 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractConnectionFactory.java @@ -499,7 +499,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (!this.mapperSet) { this.mapper.setBeanFactory(this.getBeanFactory()); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java index 03642a2ea8..24afeac35f 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/FailoverClientConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -49,7 +49,7 @@ public class FailoverClientConnectionFactory extends AbstractClientConnectionFac } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); for (AbstractClientConnectionFactory factory : this.factories) { Assert.state(!(this.isSingleUse() ^ factory.isSingleUse()), diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java index 45154795ef..717ac24935 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastSendingMessageHandler.java @@ -480,7 +480,7 @@ public class UnicastSendingMessageHandler extends } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.mapper.setBeanFactory(getBeanFactory()); this.evaluationContext = IntegrationContextUtils.getEvaluationContext(getBeanFactory()); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java index 5e826f51fc..bc9493caa3 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageHandler.java @@ -156,7 +156,7 @@ public class JdbcMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.state(!(this.sqlParameterSourceFactory != null && this.preparedStatementSetter != null), "'sqlParameterSourceFactory' and 'preparedStatementSetter' are mutually exclusive."); diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsInboundGateway.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsInboundGateway.java index 69365af73f..a8c02f65dd 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsInboundGateway.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsInboundGateway.java @@ -80,7 +80,7 @@ public class JmsInboundGateway extends MessagingGatewaySupport implements Dispos } @Override - protected void onInit() throws Exception { + protected void onInit() { this.endpoint.afterPropertiesSet(); } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java index 20735b50dc..1e0a042e02 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/SubscribableJmsChannel.java @@ -89,7 +89,7 @@ public class SubscribableJmsChannel extends AbstractJmsChannel } @Override - public void onInit() throws Exception { + public void onInit() { if (this.initialized) { return; } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java index 57a432b567..9691bb08d5 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationPublishingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -106,7 +106,7 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler } @Override - public final void onInit() throws Exception { + public final void onInit() { Assert.isTrue(this.getBeanFactory() instanceof ListableBeanFactory, "A ListableBeanFactory is required."); Map exporters = BeanFactoryUtils.beansOfTypeIncludingAncestors( (ListableBeanFactory) this.getBeanFactory(), MBeanExporter.class); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java index 78481a7f2c..ae7df904d6 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/AbstractMailReceiver.java @@ -565,7 +565,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.folderOpenMode = Folder.READ_WRITE; this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java index d8ea530aa6..19c063aa4e 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapMailReceiver.java @@ -130,7 +130,7 @@ public class ImapMailReceiver extends AbstractMailReceiver { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.scheduler = getTaskScheduler(); if (this.scheduler == null) { diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandler.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandler.java index f33de79156..e9802f6f44 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandler.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbStoringMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2016 the original author or authors. + * Copyright 2007-2018 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. @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * * @author Amol Nayak * @author Oleg Zhurakousky + * @author Gary Russell * @since 2.2 * */ @@ -104,7 +105,7 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); if (this.mongoTemplate == null) { diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java index 22761c9f6d..5a853bfb08 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java @@ -213,7 +213,7 @@ public abstract class AbstractMqttMessageHandler extends AbstractMessageHandler } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.topicProcessor instanceof BeanFactoryAware && getBeanFactory() != null) { ((BeanFactoryAware) this.topicProcessor).setBeanFactory(getBeanFactory()); diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/MqttPahoMessageHandler.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/MqttPahoMessageHandler.java index a93c73cc2e..bfffcc5693 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/MqttPahoMessageHandler.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/MqttPahoMessageHandler.java @@ -133,7 +133,7 @@ public class MqttPahoMessageHandler extends AbstractMqttMessageHandler } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.state(getConverter() instanceof MqttMessageConverter, "MessageConverter must be an MqttMessageConverter"); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java index a80cc8794c..c5d513d06d 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/channel/SubscribableRedisChannel.java @@ -131,7 +131,7 @@ public class SubscribableRedisChannel extends AbstractMessageChannel } @Override - public void onInit() throws Exception { + public void onInit() { if (this.initialized) { return; } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java index 796632677c..10d5bdebdb 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java @@ -141,7 +141,7 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport implements } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (!this.extractPayload) { Assert.notNull(this.serializer, "'serializer' has to be provided where 'extractPayload == false'."); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapter.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapter.java index d9b84fbd93..97fa0c37a4 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapter.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2018 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,7 +99,7 @@ public class RedisQueueOutboundChannelAdapter extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java index 6f48cc3b81..29c673d73b 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java @@ -240,7 +240,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); Assert.state(!this.mapKeyExpressionExplicitlySet || diff --git a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java index b23dca37ca..48fb54cf87 100644 --- a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java +++ b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java @@ -16,6 +16,7 @@ package org.springframework.integration.rmi; +import java.rmi.RemoteException; import java.rmi.registry.Registry; import org.springframework.beans.factory.InitializingBean; @@ -35,6 +36,7 @@ import org.springframework.util.StringUtils; * * @author Mark Fisher * @author Artem Bilan + * @author Gary Russell */ public class RmiInboundGateway extends MessagingGatewaySupport implements RequestReplyExchanger, InitializingBean { @@ -102,7 +104,7 @@ public class RmiInboundGateway extends MessagingGatewaySupport } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.registryHost != null) { @@ -115,7 +117,12 @@ public class RmiInboundGateway extends MessagingGatewaySupport this.exporter.setService(this); this.exporter.setServiceInterface(RequestReplyExchanger.class); this.exporter.setServiceName(SERVICE_NAME_PREFIX + this.requestChannelName); - this.exporter.afterPropertiesSet(); + try { + this.exporter.afterPropertiesSet(); + } + catch (RemoteException e) { + throw new IllegalStateException(e); + } } @Override diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java index c4231381af..d48a4d6db5 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/outbound/StompMessageHandler.java @@ -120,7 +120,7 @@ public class StompMessageHandler extends AbstractMessageHandler implements Appli } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.evaluationContext == null) { diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java index f2ed18b6b7..7634ed4841 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/outbound/WebSocketOutboundMessageHandler.java @@ -116,7 +116,7 @@ public class WebSocketOutboundMessageHandler extends AbstractMessageHandler { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (!CollectionUtils.isEmpty(this.messageConverters)) { List converters = this.messageConverter.getConverters(); diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java index 82aea9a06d..146c48fc51 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceInboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -87,7 +87,7 @@ public class MarshallingWebServiceInboundGateway extends AbstractWebServiceInbou } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); Assert.notNull(this.marshaller, "This implementation requires Marshaller"); Assert.notNull(this.unmarshaller, "This implementation requires Unmarshaller"); diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java index f2cc7b97aa..24659e2daa 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/AbstractXmlTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -70,7 +70,7 @@ public abstract class AbstractXmlTransformer extends AbstractTransformer { } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); ResultFactory generatedResultFactory = configureResultFactory(this.resultType, this.resultFactoryName, this.getBeanFactory()); if (generatedResultFactory != null) { diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java index ac5ee40e8a..bfed8a66fa 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -25,6 +25,7 @@ import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Templates; import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMResult; @@ -213,7 +214,7 @@ public class XsltPayloadTransformer extends AbstractXmlTransformer implements Be } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); if (this.templates == null) { @@ -224,7 +225,12 @@ public class XsltPayloadTransformer extends AbstractXmlTransformer implements Be else { transformerFactory = TransformerFactory.newInstance(); } - this.templates = transformerFactory.newTemplates(createStreamSourceOnResource(this.xslResource)); + try { + this.templates = transformerFactory.newTemplates(createStreamSourceOnResource(this.xslResource)); + } + catch (TransformerConfigurationException | IOException e) { + throw new IllegalStateException(e); + } } } diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/AbstractXmppConnectionAwareMessageHandler.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/AbstractXmppConnectionAwareMessageHandler.java index 4491df504c..63b5805e93 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/AbstractXmppConnectionAwareMessageHandler.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/AbstractXmppConnectionAwareMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2018 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. @@ -25,6 +25,7 @@ import org.springframework.util.Assert; /** * @author Oleg Zhurakousky * @author Artem Bilan + * @author Gary Russell * @since 2.0 */ public abstract class AbstractXmppConnectionAwareMessageHandler extends AbstractMessageHandler { @@ -43,7 +44,8 @@ public abstract class AbstractXmppConnectionAwareMessageHandler extends Abstract } - protected void onInit() throws Exception { + @Override + protected void onInit() { BeanFactory beanFactory = this.getBeanFactory(); if (this.xmppConnection == null && beanFactory != null) { this.xmppConnection =