From c45b708341457ef9ea5e61c38b2a897a119e8b2a Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Wed, 15 Jan 2014 19:14:53 +0200 Subject: [PATCH] INT-3262 JDK8 Javadoc Commit Increase receive timeout for `Jsr223TransformerTests#testInt3162ScriptExecutorThreadSafety`. JIRA: https://jira.springsource.org/browse/INT-3262 JIRA: https://jira.springsource.org/browse/INT-3263 --- .../amqp/channel/AbstractAmqpChannel.java | 8 +- .../AbstractSubscribableAmqpChannel.java | 14 +++- .../PointToPointSubscribableAmqpChannel.java | 4 +- .../amqp/channel/PollableAmqpChannel.java | 14 +++- .../channel/PublishSubscribeAmqpChannel.java | 4 +- .../amqp/config/AmqpChannelFactoryBean.java | 8 +- .../integration/MessageRejectedException.java | 1 + ...tractAggregatingMessageGroupProcessor.java | 7 +- .../AbstractCorrelatingMessageHandler.java | 9 +-- .../aggregator/AggregatingMessageHandler.java | 8 +- .../aggregator/CorrelatingMessageBarrier.java | 9 ++- .../aggregator/CorrelationStrategy.java | 4 +- ...ressionEvaluatingMessageListProcessor.java | 11 ++- .../aggregator/MessageGroupProcessor.java | 5 +- .../SequenceSizeReleaseStrategy.java | 8 +- .../integration/annotation/Aggregator.java | 16 ++-- .../integration/annotation/Payload.java | 10 +-- .../integration/annotation/Payloads.java | 4 +- .../integration/annotation/Publisher.java | 6 +- .../PublisherAnnotationBeanPostProcessor.java | 16 +++- .../aop/PublisherMetadataSource.java | 14 +++- .../channel/AbstractMessageChannel.java | 18 ++++- .../channel/AbstractPollableChannel.java | 15 ++-- .../integration/channel/DirectChannel.java | 9 ++- .../integration/channel/ExecutorChannel.java | 12 ++- .../integration/channel/PriorityChannel.java | 12 ++- .../channel/PublishSubscribeChannel.java | 15 +++- .../integration/channel/QueueChannel.java | 18 +++-- .../channel/QueueChannelOperations.java | 11 ++- ...stractSimpleMessageHandlerFactoryBean.java | 8 +- ...tegrationEvaluationContextFactoryBean.java | 3 +- ...AbstractMethodAnnotationPostProcessor.java | 8 +- .../xml/AbstractChannelAdapterParser.java | 9 ++- .../config/xml/AbstractChannelParser.java | 9 ++- .../xml/AbstractConsumerEndpointParser.java | 6 +- ...tractDelegatingConsumerEndpointParser.java | 6 +- .../xml/AbstractInboundGatewayParser.java | 7 +- .../AbstractOutboundChannelAdapterParser.java | 11 ++- .../xml/AbstractOutboundGatewayParser.java | 4 + ...actPollingInboundChannelAdapterParser.java | 4 + .../config/xml/AbstractRouterParser.java | 4 +- .../xml/HeaderEnricherParserSupport.java | 6 +- .../config/xml/IntegrationNamespaceUtils.java | 21 +++++- .../context/IntegrationContextUtils.java | 15 ++-- .../context/IntegrationObjectSupport.java | 18 +++-- .../context/IntegrationProperties.java | 5 +- .../integration/context/Orderable.java | 6 +- .../integration/core/MessageProducer.java | 6 +- .../integration/core/MessageSource.java | 8 +- .../dispatcher/AbstractDispatcher.java | 10 ++- .../dispatcher/BroadcastingDispatcher.java | 10 ++- .../dispatcher/UnicastingDispatcher.java | 8 +- .../endpoint/AbstractMessageSource.java | 11 ++- .../endpoint/SourcePollingChannelAdapter.java | 13 +++- .../expression/ExpressionEvalMap.java | 4 +- .../expression/ExpressionUtils.java | 4 +- ...oadableResourceBundleExpressionSource.java | 13 +++- .../integration/filter/MessageFilter.java | 15 +++- .../gateway/GatewayProxyFactoryBean.java | 15 +++- .../gateway/MessagingGatewaySupport.java | 10 ++- .../AbstractReplyProducingMessageHandler.java | 27 ++++++- ...ProducingPostProcessingMessageHandler.java | 4 +- .../integration/handler/DelayHandler.java | 31 +++++++- .../ExpressionEvaluatingMessageProcessor.java | 13 +++- .../integration/handler/LoggingHandler.java | 7 +- .../handler/MessageHandlerChain.java | 13 +++- .../integration/handler/MessageProcessor.java | 7 +- .../advice/AbstractRequestHandlerAdvice.java | 17 ++++- ...ressionEvaluatingRequestHandlerAdvice.java | 9 ++- .../json/JsonToObjectTransformer.java | 7 +- .../json/ObjectToJsonTransformer.java | 7 +- .../mapping/AbstractHeaderMapper.java | 30 +++++++- .../integration/metadata/MetadataStore.java | 11 ++- .../router/AbstractMappingMessageRouter.java | 24 +++++- .../router/AbstractMessageRouter.java | 19 ++++- .../integration/router/HeaderValueRouter.java | 4 +- .../MappingMessageRouterManagement.java | 7 +- .../router/RecipientListRouter.java | 8 +- .../scheduling/PollerMetadata.java | 6 +- .../selector/MessageSelectorChain.java | 16 +++- .../selector/PayloadTypeSelector.java | 11 ++- .../splitter/AbstractMessageSplitter.java | 13 +++- .../splitter/DefaultMessageSplitter.java | 7 +- .../store/AbstractMessageGroupStore.java | 38 +++++----- .../integration/store/MessageGroup.java | 11 ++- .../integration/store/MessageGroupStore.java | 39 ++++++---- .../integration/store/MessageStore.java | 24 +++--- .../store/MessageStoreException.java | 26 +++---- .../integration/store/SimpleMessageStore.java | 31 +++++++- .../integration/support/MessageBuilder.java | 27 ++++++- .../converter/MapMessageConverter.java | 13 ++-- .../IntegrationResourceHolder.java | 9 ++- .../transformer/AbstractTransformer.java | 11 ++- .../transformer/ClaimCheckInTransformer.java | 8 +- .../transformer/ClaimCheckOutTransformer.java | 10 ++- .../transformer/ContentEnricher.java | 20 ++++- .../transformer/HeaderEnricher.java | 9 ++- .../transformer/MapToObjectTransformer.java | 6 +- .../MessageTransformingHandler.java | 4 +- .../integration/util/DefaultLockRegistry.java | 6 +- .../integration/util/UpperBound.java | 11 ++- .../util/WhileLockedProcessor.java | 7 +- ...licationEventListeningMessageProducer.java | 4 +- .../feed/inbound/FeedEntryMessageSource.java | 16 +++- .../file/DefaultFileNameGenerator.java | 6 +- .../integration/file/FileLocker.java | 6 +- .../file/FileWritingMessageHandler.java | 18 ++++- .../AbstractFilePayloadTransformerParser.java | 8 +- .../file/filters/AbstractFileListFilter.java | 8 +- .../AbstractRegexPatternFileListFilter.java | 8 +- .../AbstractSimplePatternFileListFilter.java | 7 +- .../file/filters/AcceptAllFileListFilter.java | 5 +- .../file/filters/CompositeFileListFilter.java | 6 +- .../file/filters/FileListFilter.java | 5 +- .../file/remote/InputStreamCallback.java | 4 +- .../file/remote/RemoteFileOperations.java | 8 +- .../file/remote/RemoteFileUtils.java | 7 +- .../file/remote/SessionCallback.java | 4 +- .../remote/SessionCallbackWithoutResult.java | 4 +- .../AbstractRemoteFileOutboundGateway.java | 17 +++-- .../FileTransferringMessageHandler.java | 13 +--- .../remote/session/CachingSessionFactory.java | 11 ++- .../file/remote/session/Session.java | 7 +- .../AbstractInboundFileSynchronizer.java | 6 +- ...InboundFileSynchronizingMessageSource.java | 10 ++- .../file/support/FileExistsMode.java | 3 +- .../FileTailingMessageProducerSupport.java | 6 +- .../AbstractFilePayloadTransformer.java | 15 +++- .../transformer/FileToStringTransformer.java | 4 +- .../inbound/FtpInboundFileSynchronizer.java | 4 +- .../session/AbstractFtpSessionFactory.java | 45 ++++++----- .../gemfire/store/GemfireMessageStore.java | 17 +++-- .../groovy/GroovyCommandMessageProcessor.java | 19 +++-- ...GroovyScriptExecutingMessageProcessor.java | 9 ++- ...ultipartAwareFormHttpMessageConverter.java | 6 +- .../HttpRequestHandlingController.java | 14 +++- .../HttpRequestHandlingEndpointSupport.java | 40 ++++++++-- ...tegrationRequestMappingHandlerMapping.java | 6 +- .../FileCopyingMultipartFileReader.java | 13 +++- .../http/multipart/MultipartFileReader.java | 8 +- .../multipart/SimpleMultipartFileReader.java | 9 ++- .../HttpRequestExecutingMessageHandler.java | 50 +++++++++++-- .../http/support/DefaultHttpHeaderMapper.java | 14 +++- ...ternetProtocolReceivingChannelAdapter.java | 4 +- ...InternetProtocolSendingMessageHandler.java | 8 +- .../integration/ip/CommonSocketOptions.java | 14 +++- .../ip/config/IpAdapterParserUtils.java | 25 ++++--- .../TcpConnectionFactoryFactoryBean.java | 48 +++++++----- .../ip/tcp/TcpOutboundGateway.java | 21 ++++-- .../AbstractClientConnectionFactory.java | 6 +- .../connection/AbstractConnectionFactory.java | 23 +++--- .../AbstractServerConnectionFactory.java | 10 ++- .../ClientModeConnectionManager.java | 6 +- .../ip/tcp/connection/TcpConnection.java | 10 +-- ...nnectionEventListeningMessageProducer.java | 4 +- .../tcp/connection/TcpConnectionSupport.java | 4 +- .../ip/tcp/connection/TcpMessageMapper.java | 10 ++- .../TcpNetClientConnectionFactory.java | 4 +- .../ip/tcp/connection/TcpNetConnection.java | 17 +---- .../TcpNetServerConnectionFactory.java | 5 +- .../TcpNioClientConnectionFactory.java | 4 +- .../ip/tcp/connection/TcpNioConnection.java | 37 ++++----- .../connection/TcpNioConnectionSupport.java | 4 +- .../tcp/connection/TcpNioSSLConnection.java | 16 +--- .../TcpNioServerConnectionFactory.java | 12 ++- .../tcp/connection/TcpSSLContextSupport.java | 6 +- .../ByteArrayLengthHeaderSerializer.java | 31 +++++--- .../ip/tcp/serializer/MapJsonSerializer.java | 6 +- .../udp/MulticastSendingMessageHandler.java | 15 ++-- .../udp/UnicastReceivingChannelAdapter.java | 12 +-- .../integration/ip/util/TestingUtilities.java | 6 +- ...onEvaluatingSqlParameterSourceFactory.java | 7 +- .../integration/jdbc/JdbcMessageStore.java | 17 ++--- .../jdbc/SqlParameterSourceFactory.java | 4 +- .../integration/jdbc/StoredProcExecutor.java | 22 ++++-- .../jdbc/StoredProcOutboundGateway.java | 6 +- .../jdbc/StoredProcPollingChannelAdapter.java | 5 +- .../jdbc/config/StoredProcParserUtils.java | 20 ++--- .../jdbc/store/JdbcChannelMessageStore.java | 38 ++++++---- .../ChannelPublishingJmsMessageListener.java | 41 +++++++++- .../jms/DefaultJmsHeaderMapper.java | 9 ++- .../jms/JmsDestinationPollingSource.java | 13 ++-- .../integration/jms/JmsOutboundGateway.java | 73 +++++++++++++----- .../jms/JmsSendingMessageHandler.java | 5 +- .../jms/SubscribableJmsChannel.java | 14 +++- .../jmx/AttributePollingMessageSource.java | 10 ++- .../integration/jmx/MBeanAttributeFilter.java | 8 +- .../integration/jmx/MBeanObjectConverter.java | 8 +- .../jmx/MBeanTreePollingMessageSource.java | 14 ++-- .../jmx/NamedFieldsMBeanAttributeFilter.java | 4 +- .../NotNamedFieldsMBeanAttributeFilter.java | 4 +- .../NotificationListeningMessageProducer.java | 14 +++- .../NotificationPublishingMessageHandler.java | 9 ++- .../jmx/OperationInvokingMessageHandler.java | 10 ++- .../integration/jpa/core/JpaExecutor.java | 14 ++-- .../jpa/core/JpaOperationFailedException.java | 7 +- .../integration/jpa/core/JpaOperations.java | 75 +++++++++++-------- .../jpa/outbound/JpaOutboundGateway.java | 6 +- .../JpaOutboundGatewayFactoryBean.java | 8 +- .../integration/jpa/support/JpaUtils.java | 15 +++- .../ParameterSourceFactory.java | 5 +- .../mail/AbstractMailReceiver.java | 23 +++++- .../mail/ImapIdleChannelAdapter.java | 10 ++- .../integration/mail/ImapMailReceiver.java | 11 ++- .../integration/mail/MailTransportUtils.java | 5 +- .../integration/mail/SearchTermStrategy.java | 8 +- .../transformer/MailToStringTransformer.java | 6 +- .../mongodb/inbound/MongoDbMessageSource.java | 21 +++--- .../MongoDbStoringMessageHandler.java | 14 ++-- .../mongodb/store/MongoDbMessageStore.java | 31 +++++++- .../channel/SubscribableRedisChannel.java | 14 +++- .../RedisQueueMessageDrivenEndpoint.java | 6 +- .../inbound/RedisStoreMessageSource.java | 13 ++-- .../redis/metadata/RedisMetadataStore.java | 16 +++- .../RedisPublishingMessageHandler.java | 4 +- .../RedisStoreWritingMessageHandler.java | 28 ++++--- .../integration/rmi/RmiInboundGateway.java | 6 +- ...stractScriptExecutingMessageProcessor.java | 10 ++- .../integration/scripting/ScriptExecutor.java | 24 +++--- .../config/AbstractScriptParser.java | 6 +- .../ScriptExecutingMessageProcessor.java | 48 ++++++------ .../config/jsr223/Jsr223TransformerTests.java | 6 +- .../channel/DefaultChannelAccessPolicy.java | 11 ++- .../session/DefaultSftpSessionFactory.java | 48 +++++++++++- .../CharacterStreamWritingMessageHandler.java | 24 ++++-- .../TcpSyslogReceivingChannelAdapter.java | 4 +- .../test/matcher/HeaderMatcher.java | 6 +- .../test/matcher/PayloadMatcher.java | 7 +- .../test/matcher/TypeSafeMatcher.java | 14 ++-- .../support/AbstractResponseValidator.java | 31 ++++++-- .../test/support/MessageValidator.java | 34 +++++++-- .../test/support/RequestResponseScenario.java | 63 ++++++++++------ .../inbound/AbstractTwitterMessageSource.java | 11 ++- .../ws/AbstractWebServiceOutboundGateway.java | 8 +- .../MarshallingWebServiceInboundGateway.java | 8 +- .../MarshallingWebServiceOutboundGateway.java | 19 +++-- ...gregatedXmlMessageValidationException.java | 1 + .../integration/xml/router/XPathRouter.java | 25 ++++--- .../AbstractXPathMessageSelector.java | 6 +- .../StringValueTestXPathMessageSelector.java | 19 ++--- .../XmlValidatingMessageSelector.java | 7 +- .../integration/xml/source/SourceFactory.java | 7 +- .../transformer/MarshallingTransformer.java | 10 ++- .../transformer/UnmarshallingTransformer.java | 10 ++- .../xml/transformer/XPathHeaderEnricher.java | 8 +- .../xml/transformer/XPathTransformer.java | 20 +++-- .../transformer/XsltPayloadTransformer.java | 12 ++- .../integration/xml/xpath/XPathUtils.java | 4 +- .../inbound/ChatMessageListeningEndpoint.java | 25 ++++--- 249 files changed, 2265 insertions(+), 985 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 d3c10fb720..4a493573a1 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-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -17,8 +17,8 @@ package org.springframework.integration.amqp.channel; import org.springframework.amqp.core.AmqpTemplate; -import org.springframework.messaging.Message; import org.springframework.integration.channel.AbstractMessageChannel; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -39,6 +39,8 @@ public abstract class AbstractAmqpChannel extends AbstractMessageChannel { /** * Subclasses may override this method to return an Exchange name. * By default, Messages will be sent to the no-name Direct Exchange. + * + * @return The exchange name. */ protected String getExchangeName() { return ""; @@ -47,6 +49,8 @@ public abstract class AbstractAmqpChannel extends AbstractMessageChannel { /** * Subclasses may override this method to return a routing key. * By default, there will be no routing key (empty string). + * + * @return The routing key. */ protected String getRoutingKey() { return ""; 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 837d5edd09..03755f7efd 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -78,7 +78,7 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel imple /** * Specify the maximum number of subscribers supported by the * channel's dispatcher (if it is an {@link AbstractDispatcher}). - * @param maxSubscribers + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; @@ -87,10 +87,12 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel imple } } + @Override public boolean subscribe(MessageHandler handler) { return this.dispatcher.addHandler(handler); } + @Override public boolean unsubscribe(MessageHandler handler) { return this.dispatcher.removeHandler(handler); } @@ -148,6 +150,7 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel imple } + @Override public void onMessage(org.springframework.amqp.core.Message message) { Message messageToSend = null; try { @@ -186,36 +189,43 @@ abstract class AbstractSubscribableAmqpChannel extends AbstractAmqpChannel imple * SmartLifecycle implementation (delegates to the MessageListener container) */ + @Override public boolean isAutoStartup() { return (this.container != null) ? this.container.isAutoStartup() : false; } + @Override public int getPhase() { return (this.container != null) ? this.container.getPhase() : 0; } + @Override public boolean isRunning() { return (this.container != null) ? this.container.isRunning() : false; } + @Override public void start() { if (this.container != null) { this.container.start(); } } + @Override public void stop() { if (this.container != null) { this.container.stop(); } } + @Override public void stop(Runnable callback) { if (this.container != null) { this.container.stop(callback); } } + @Override public void destroy() throws Exception { if (this.container != null) { this.container.destroy(); diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java index 181f9d40d9..bbf8815887 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PointToPointSubscribableAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -41,6 +41,8 @@ public class PointToPointSubscribableAmqpChannel extends AbstractSubscribableAmq /** * Provide a Queue name to be used. If this is not provided, * the Queue's name will be the same as the channel name. + * + * @param queueName The queue name. */ public void setQueueName(String queueName) { this.queueName = queueName; 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 ad7589da6e..346333956d 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -21,16 +21,16 @@ import org.springframework.amqp.core.AmqpTemplate; import org.springframework.amqp.core.Queue; import org.springframework.amqp.rabbit.core.RabbitAdmin; import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; import org.springframework.messaging.PollableChannel; -import org.springframework.integration.support.MessageBuilder; import org.springframework.util.Assert; /** * A {@link PollableChannel} implementation that is backed by an AMQP Queue. * Messages will be sent to the default (no-name) exchange with that Queue's * name as the routing key. - * + * * @author Mark Fisher * @since 2.1 */ @@ -54,6 +54,8 @@ public class PollableAmqpChannel extends AbstractAmqpChannel implements Pollable * Provide an explicitly configured queue name. If this is not provided, then a Queue will be created * implicitly with the channelName as its name. The implicit creation will require that either an AmqpAdmin * instance has been provided or that the configured AmqpTemplate is an instance of RabbitTemplate. + * + * @param queueName The queue name. */ public void setQueueName(String queueName) { this.queueName = queueName; @@ -63,6 +65,8 @@ public class PollableAmqpChannel extends AbstractAmqpChannel implements Pollable * Provide an instance of AmqpAdmin for implicitly declaring Queues if the queueName is not provided. * When providing a RabbitTemplate implementation, this is not strictly necessary since a RabbitAdmin * instance can be created from the template's ConnectionFactory reference. + * + * @param amqpAdmin The amqp admin. */ public void setAmqpAdmin(AmqpAdmin amqpAdmin) { this.amqpAdmin = amqpAdmin; @@ -73,7 +77,7 @@ public class PollableAmqpChannel extends AbstractAmqpChannel implements Pollable AmqpTemplate amqpTemplate = this.getAmqpTemplate(); if (this.queueName == null) { if (this.amqpAdmin == null && amqpTemplate instanceof RabbitTemplate) { - this.amqpAdmin = new RabbitAdmin(((RabbitTemplate) amqpTemplate).getConnectionFactory()); + this.amqpAdmin = new RabbitAdmin(((RabbitTemplate) amqpTemplate).getConnectionFactory()); } Assert.notNull(this.amqpAdmin, "If no queueName is configured explicitly, an AmqpAdmin instance must be provided, " + @@ -88,6 +92,7 @@ public class PollableAmqpChannel extends AbstractAmqpChannel implements Pollable return this.queueName; } + @Override public Message receive() { if (!this.getInterceptors().preReceive(this)) { return null; @@ -106,6 +111,7 @@ public class PollableAmqpChannel extends AbstractAmqpChannel implements Pollable return this.getInterceptors().postReceive(replyMessage, this) ; } + @Override public Message receive(long timeout) { if (logger.isInfoEnabled()) { logger.info("Calling receive with a timeout value on PollableAmqpChannel. " + diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java index 4f7af317ff..30da510713 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/channel/PublishSubscribeAmqpChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -46,6 +46,8 @@ public class PublishSubscribeAmqpChannel extends AbstractSubscribableAmqpChannel * FanoutExchange will be declared implicitly, and its name will be the same * as the channel name prefixed by "si.fanout.". In either case, an effectively * anonymous Queue will be declared automatically. + * + * @param exchange The fanout exchange. */ public void setExchange(FanoutExchange exchange) { this.exchange = exchange; diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java index eac098b520..e5822036f0 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -149,6 +149,8 @@ public class AmqpChannelFactoryBean extends AbstractFactoryBean aggregateHeaders(MessageGroup group) { Map aggregatedHeaders = new HashMap(); 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 0566041ba0..cf35260f8f 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -26,6 +26,7 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.NullChannel; import org.springframework.integration.core.MessageProducer; +import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.MessageGroupStore; @@ -33,14 +34,12 @@ import org.springframework.integration.store.MessageGroupStore.MessageGroupCallb import org.springframework.integration.store.MessageStore; import org.springframework.integration.store.SimpleMessageGroup; import org.springframework.integration.store.SimpleMessageStore; -import org.springframework.integration.support.converter.SimpleMessageConverter; import org.springframework.integration.util.DefaultLockRegistry; import org.springframework.integration.util.LockRegistry; import org.springframework.integration.util.UUIDConverter; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessagingException; -import org.springframework.integration.core.MessagingTemplate; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; @@ -257,8 +256,8 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageH /** * Allows you to provide additional logic that needs to be performed after the MessageGroup was released. - * @param group - * @param completedMessages + * @param group The group. + * @param completedMessages The completed messages. */ protected abstract void afterRelease(MessageGroup group, Collection> completedMessages); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AggregatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AggregatingMessageHandler.java index 7fd9125f1c..130320ec54 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AggregatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AggregatingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -15,9 +15,9 @@ package org.springframework.integration.aggregator; import java.util.Collection; -import org.springframework.messaging.Message; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.MessageGroupStore; +import org.springframework.messaging.Message; /** * Aggregator specific implementation of {@link AbstractCorrelatingMessageHandler}. @@ -46,7 +46,9 @@ public class AggregatingMessageHandler extends AbstractCorrelatingMessageHandler } /** - * Will set the 'expireGroupsUponCompletion' flag + * Will set the 'expireGroupsUponCompletion' flag. + * + * @param expireGroupsUponCompletion true when groups should be expired on completion. * * @see #afterRelease */ diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java index 41bd82bfc7..88b300db31 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageBarrier.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -20,12 +20,12 @@ import java.util.concurrent.ConcurrentMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.messaging.Message; import org.springframework.integration.core.MessageSource; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.MessageGroupStore; import org.springframework.integration.store.SimpleMessageStore; +import org.springframework.messaging.Message; /** * This Endpoint serves as a barrier for messages that should not be processed yet. The decision when a message can be @@ -70,6 +70,8 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements /** * Set the CorrelationStrategy to be used to determine the correlation key for incoming messages + * + * @param correlationStrategy The correlation strategy. */ public void setCorrelationStrategy(CorrelationStrategy correlationStrategy) { this.correlationStrategy = correlationStrategy; @@ -77,6 +79,8 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements /** * Set the ReleaseStrategy that should be used when deciding if a group in this barrier may be released. + * + * @param releaseStrategy The release strategy. */ public void setReleaseStrategy(ReleaseStrategy releaseStrategy) { this.releaseStrategy = releaseStrategy; @@ -100,6 +104,7 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements } + @Override public Message receive() { for (Object key : correlationLocks.keySet()) { Object lock = getLock(key); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelationStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelationStrategy.java index 422dd11ad9..b124738f47 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelationStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/CorrelationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -31,6 +31,8 @@ public interface CorrelationStrategy { * Find the correlation key for the given message. If no key can be determined the strategy should not return * null, but throw an exception. * + * @param message The message. + * @return The correlation key. */ Object getCorrelationKey(Message message); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageListProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageListProcessor.java index 2ec511ef4a..b1d80c47ab 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageListProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ExpressionEvaluatingMessageListProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -23,13 +23,13 @@ import org.springframework.expression.ExpressionParser; import org.springframework.expression.ParseException; import org.springframework.expression.spel.SpelParserConfiguration; import org.springframework.expression.spel.standard.SpelExpressionParser; -import org.springframework.messaging.Message; import org.springframework.integration.util.AbstractExpressionEvaluator; +import org.springframework.messaging.Message; /** * A base class for aggregators that evaluates a SpEL expression with the message list as the root object within the * evaluation context. - * + * * @author Dave Syer * @since 2.0 */ @@ -40,9 +40,11 @@ public class ExpressionEvaluatingMessageListProcessor extends AbstractExpression private final Expression expression; private volatile Class expectedType = null; - + /** * Set the result type expected from evaluation of the expression. + * + * @param expectedType The expected type. */ public void setExpectedType(Class expectedType) { this.expectedType = expectedType; @@ -61,6 +63,7 @@ public class ExpressionEvaluatingMessageListProcessor extends AbstractExpression * Processes the Message by evaluating the expression with that Message as the root object. The expression * evaluation result Object will be returned. */ + @Override public Object process(Collection> messages) { return this.evaluateExpression(this.expression, messages, this.expectedType); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupProcessor.java index 624a567758..c95c1ac190 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageGroupProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -29,6 +29,9 @@ public interface MessageGroupProcessor { * group, while a resequencing processor will return all messages whose preceding sequence has been satisfied. *

* If a multiple messages are returned the return value must be a Collection<Message>. + * + * @param group The message group. + * @return The result of processing the group. */ Object processMessageGroup(MessageGroup group); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java index 69f95e76e0..2372392d21 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -24,9 +24,10 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.messaging.Message; + import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.store.MessageGroup; +import org.springframework.messaging.Message; /** * An implementation of {@link ReleaseStrategy} that simply compares the current size of the message list to the @@ -58,12 +59,13 @@ public class SequenceSizeReleaseStrategy implements ReleaseStrategy { * Flag that determines if partial sequences are allowed. If true then as soon as enough messages arrive that can be * ordered they will be released, provided they all have sequence numbers greater than those already released. * - * @param releasePartialSequences + * @param releasePartialSequences true when partial sequences should be released. */ public void setReleasePartialSequences(boolean releasePartialSequences) { this.releasePartialSequences = releasePartialSequences; } + @Override public boolean canRelease(MessageGroup messageGroup) { boolean canRelease = false; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Aggregator.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Aggregator.java index b0a22dcb71..4521e32696 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Aggregator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Aggregator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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,12 +25,12 @@ import java.lang.annotation.Target; import org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler; /** - * Indicates that a method is capable of aggregating messages. + * Indicates that a method is capable of aggregating messages. *

* A method annotated with @Aggregator may accept a collection * of Messages or Message payloads and should return a single * Message or a single Object to be used as a Message payload. - * + * * @author Marius Bogoevici * @author Oleg Zhurakousky */ @@ -40,27 +40,27 @@ import org.springframework.integration.aggregator.AbstractCorrelatingMessageHand public @interface Aggregator { /** - * channel name for receiving messages to be aggregated + * @return The channel name for receiving messages to be aggregated */ String inputChannel() default ""; /** - * channel name for sending aggregated result messages + * @return The channel name for sending aggregated result messages */ String outputChannel() default ""; /** - * channel name for sending discarded messages (due to a timeout) + * @return The channel name for sending discarded messages (due to a timeout) */ String discardChannel() default ""; /** - * timeout for sending results to the reply target (in milliseconds) + * @return The timeout for sending results to the reply target (in milliseconds) */ long sendTimeout() default AbstractCorrelatingMessageHandler.DEFAULT_SEND_TIMEOUT; /** - * indicates whether to send an incomplete aggregate on expiry of the message group + * @return Indicates whether to send an incomplete aggregate on expiry of the message group */ boolean sendPartialResultsOnExpiry() default false; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java index 27adcc9fb0..f49247e3d7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -23,14 +23,14 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * This annotation allows you to specify a SpEL expression indicating that a method + * This annotation allows you to specify a SpEL expression indicating that a method * parameter's value should be mapped from the payload of a Message. The expression * will be evaluated against the payload object as the root context. The annotated * parameter type must match or be convertible from the evaluation result. *

- * Example: void foo(@Payload("city.name") String cityName) - will map the value of + * Example: void foo(@Payload("city.name") String cityName) - will map the value of * the 'name' property of the 'city' property of the payload object. - * + * * @author Oleg Zhurakousky * @since 2.0 */ @@ -40,7 +40,7 @@ import java.lang.annotation.Target; public @interface Payload { /** - * Expression for matching against nested properties of the payload. + * @return The expression for matching against nested properties of the payload. */ String value() default ""; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payloads.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payloads.java index 85f521184b..7cf5103968 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payloads.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payloads.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -39,7 +39,7 @@ import java.lang.annotation.Target; public @interface Payloads { /** - * Expression for matching against nested properties of the payloads. + * @return The expression for matching against nested properties of the payloads. */ String value() default ""; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Publisher.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Publisher.java index 115d3fd156..c02fb5b8f7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Publisher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Publisher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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,7 +25,7 @@ import java.lang.annotation.Target; * Annotation to indicate that a method, or all public methods if applied at * class-level, should publish Messages. The @Payload and @Header annotations * can be used in conjunction with this to determine the content of the Message. - * + * * @author Mark Fisher * @since 2.0 */ @@ -34,7 +34,7 @@ import java.lang.annotation.Target; public @interface Publisher { /** - * Name of the Message Channel to which Messages will be published. + * @return The name of the Message Channel to which Messages will be published. */ String channel() default ""; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java index 426df1c6ed..262222bd9d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -27,13 +27,13 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.core.Ordered; -import org.springframework.messaging.MessageChannel; import org.springframework.integration.annotation.Publisher; +import org.springframework.messaging.MessageChannel; import org.springframework.util.ClassUtils; /** * Post-processes beans that contain the method-level @{@link Publisher} annotation. - * + * * @author Oleg Zhurakousky * @author Mark Fisher * @since 2.0 @@ -56,15 +56,19 @@ public class PublisherAnnotationBeanPostProcessor extends ProxyConfig /** * Set the default channel where Messages should be sent if the annotation * itself does not provide a channel. + * + * @param defaultChannel The default channel. */ public void setDefaultChannel(MessageChannel defaultChannel){ this.defaultChannel = defaultChannel; } + @Override public void setBeanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; } + @Override public void setBeanClassLoader(ClassLoader classLoader) { this.beanClassLoader = classLoader; } @@ -73,21 +77,25 @@ public class PublisherAnnotationBeanPostProcessor extends ProxyConfig this.order = order; } + @Override public int getOrder() { return this.order; } + @Override public void afterPropertiesSet(){ advisor = new PublisherAnnotationAdvisor(); advisor.setBeanFactory(beanFactory); advisor.setDefaultChannel(defaultChannel); } + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean; } - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { Class targetClass = AopUtils.getTargetClass(bean); if (targetClass == null) { return bean; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java index 0ea7933cc2..7186404149 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -22,8 +22,9 @@ import java.util.Map; /** * Strategy for determining the channel name, payload expression, and header expressions * for the {@link MessagePublishingInterceptor}. - * + * * @author Mark Fisher + * @author Gary Russell * @since 2.0 */ interface PublisherMetadataSource { @@ -40,12 +41,18 @@ interface PublisherMetadataSource { /** * Returns the channel name to which Messages should be published * for this particular method invocation. + * + * @param method The Method. + * @return The channel name. */ String getChannelName(Method method); /** * Returns the expression string to be evaluated for creating the Message * payload. + * + * @param method The Method. + * @return The payload expression. */ String getPayloadExpression(Method method); @@ -53,6 +60,9 @@ interface PublisherMetadataSource { * Returns the map of expression strings to be evaluated for any headers * that should be set on the published Message. The keys in the Map are * header names, the values are the expression strings. + * + * @param method The Method. + * @return The header expressions. */ Map getHeaderExpressions(Method method); 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 a4906a3ed2..203852cb03 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -78,6 +78,9 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im *

* If this property is not set explicitly, any Message payload type will be * accepted. + * + * @param datatypes The supported data types. + * * @see #setConversionService(ConversionService) */ public void setDatatypes(Class... datatypes) { @@ -88,6 +91,8 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im /** * Set the list of channel interceptors. This will clear any existing * interceptors. + * + * @param interceptors The list of interceptors. */ public void setInterceptors(List interceptors) { Collections.sort(interceptors, new OrderComparator()); @@ -96,6 +101,8 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im /** * Add a channel interceptor to the end of the list. + * + * @param interceptor The interceptor. */ public void addInterceptor(ChannelInterceptor interceptor) { this.interceptors.add(interceptor); @@ -109,6 +116,8 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im * bean named "integrationConversionService" defined within that context. * Finally, if that bean is not available, it will fallback to the * "conversionService" bean, if available. + * + * @param conversionService The conversion service. */ @Override public void setConversionService(ConversionService conversionService) { @@ -117,6 +126,8 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im /** * Exposes the interceptor list for subclasses. + * + * @return The channel interceptor list. */ protected ChannelInterceptorList getInterceptors() { return this.interceptors; @@ -125,6 +136,7 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im /** * Returns the fully qualified channel name including the application context * id, if available. + * * @return The name. */ public String getFullChannelName() { @@ -222,6 +234,10 @@ public abstract class AbstractMessageChannel extends IntegrationObjectSupport im * must return immediately with or without success). A negative timeout * value indicates that the method should block until either the message is * accepted or the blocking thread is interrupted. + * + * @param message The message. + * @param timeout The timeout. + * @return true if the send was successful. */ protected abstract boolean doSend(Message message, long timeout); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractPollableChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractPollableChannel.java index cafb45250d..ce86b755dc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractPollableChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/AbstractPollableChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -21,7 +21,7 @@ import org.springframework.messaging.PollableChannel; /** * Base class for all pollable channels. - * + * * @author Mark Fisher */ public abstract class AbstractPollableChannel extends AbstractMessageChannel implements PollableChannel { @@ -29,10 +29,11 @@ public abstract class AbstractPollableChannel extends AbstractMessageChannel imp /** * Receive the first available message from this channel. If the channel * contains no messages, this method will block. - * + * * @return the first available message or null if the * receiving thread is interrupted. */ + @Override public final Message receive() { return this.receive(-1); } @@ -43,13 +44,14 @@ public abstract class AbstractPollableChannel extends AbstractMessageChannel imp * elapses. If the specified timeout is 0, the method will return * immediately. If less than zero, it will block indefinitely (see * {@link #receive()}). - * + * * @param timeout the timeout in milliseconds - * + * * @return the first available message or null if no message * is available within the allotted time or the receiving thread is * interrupted. */ + @Override public final Message receive(long timeout) { if (!this.getInterceptors().preReceive(this)) { return null; @@ -65,6 +67,9 @@ public abstract class AbstractPollableChannel extends AbstractMessageChannel imp * return immediately with or without success). A negative timeout value * indicates that the method should block until either a message is * available or the blocking thread is interrupted. + * + * @param timeout The timeout. + * @return The message, or null. */ protected abstract Message doReceive(long timeout); 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 2db6c14949..5b67dd34dd 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-2013 the original author or authors. + * Copyright 2002-2014 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,6 +47,8 @@ public class DirectChannel extends AbstractSubscribableChannel { /** * Create a DirectChannel with a {@link LoadBalancingStrategy}. The * strategy must not be null. + * + * @param loadBalancingStrategy The load balancing strategy implementation. */ public DirectChannel(LoadBalancingStrategy loadBalancingStrategy) { this.dispatcher.setLoadBalancingStrategy(loadBalancingStrategy); @@ -56,6 +58,8 @@ public class DirectChannel extends AbstractSubscribableChannel { /** * Specify whether the channel's dispatcher should have failover enabled. * By default, it will. Set this value to 'false' to disable it. + * + * @param failover The failover boolean. */ public void setFailover(boolean failover) { this.dispatcher.setFailover(failover); @@ -64,7 +68,8 @@ public class DirectChannel extends AbstractSubscribableChannel { /** * Specify the maximum number of subscribers supported by the * channel's dispatcher. - * @param maxSubscribers + * + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; 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 cb43531494..6eb9ff0305 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -63,6 +63,8 @@ public class ExecutorChannel extends AbstractSubscribableChannel { * {@link Executor} when dispatching Messages. *

* The Executor must not be null. + * + * @param executor The executor. */ public ExecutorChannel(Executor executor) { this(executor, new RoundRobinLoadBalancingStrategy()); @@ -73,6 +75,9 @@ public class ExecutorChannel extends AbstractSubscribableChannel { * delegates to the provided {@link Executor} when dispatching Messages. *

* The Executor must not be null. + * + * @param executor The executor. + * @param loadBalancingStrategy The load balancing strategy implementation. */ public ExecutorChannel(Executor executor, LoadBalancingStrategy loadBalancingStrategy) { Assert.notNull(executor, "executor must not be null"); @@ -88,6 +93,8 @@ public class ExecutorChannel extends AbstractSubscribableChannel { /** * Specify whether the channel's dispatcher should have failover enabled. * By default, it will. Set this value to 'false' to disable it. + * + * @param failover The failover boolean. */ public void setFailover(boolean failover) { this.failover = failover; @@ -97,7 +104,8 @@ public class ExecutorChannel extends AbstractSubscribableChannel { /** * Specify the maximum number of subscribers supported by the * channel's dispatcher. - * @param maxSubscribers + * + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java index e021095578..3132d92c01 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -44,6 +44,9 @@ public class PriorityChannel extends QueueChannel { * will be determined by the provided {@link Comparator}. If the comparator * is null, the priority will be based upon the value of * {@link IntegrationMessageHeaderAccessor#getPriority()}. + * + * @param capacity The capacity. + * @param comparator The comparator. */ public PriorityChannel(int capacity, Comparator> comparator) { super(new PriorityBlockingQueue>(11, new SequenceFallbackComparator(comparator))); @@ -53,6 +56,8 @@ public class PriorityChannel extends QueueChannel { /** * Create a channel with the specified queue capacity. Message priority * will be based upon the value of {@link IntegrationMessageHeaderAccessor#getPriority()}. + * + * @param capacity The queue capacity. */ public PriorityChannel(int capacity) { this(capacity, null); @@ -63,6 +68,8 @@ public class PriorityChannel extends QueueChannel { * determined by the provided {@link Comparator}. If the comparator * is null, the priority will be based upon the value of * {@link IntegrationMessageHeaderAccessor#getPriority()}. + * + * @param comparator The comparator. */ public PriorityChannel(Comparator> comparator) { this(0, comparator); @@ -103,6 +110,7 @@ public class PriorityChannel extends QueueChannel { this.targetComparator = targetComparator; } + @Override public int compare(Message message1, Message message2) { int compareResult = 0; if (this.targetComparator != null){ @@ -140,10 +148,12 @@ public class PriorityChannel extends QueueChannel { return this.rootMessage; } + @Override public MessageHeaders getHeaders() { return this.rootMessage.getHeaders(); } + @Override public Object getPayload() { return rootMessage.getPayload(); } 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 5f7de0e48e..8a49ce0659 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -55,6 +55,8 @@ public class PublishSubscribeChannel extends AbstractSubscribableChannel { * Create a PublishSubscribeChannel that will use an {@link Executor} * to invoke the handlers. If this is null, each invocation will occur in * the message sender's thread. + * + * @param executor The executor. */ public PublishSubscribeChannel(Executor executor) { this.executor = executor; @@ -80,6 +82,9 @@ public class PublishSubscribeChannel extends AbstractSubscribableChannel { * a {@link MessagePublishingErrorHandler} that sends error messages to * the failed request Message's error channel header if available or to * the default 'errorChannel' otherwise. + * + * @param errorHandler The error handler. + * * @see #PublishSubscribeChannel(Executor) */ public void setErrorHandler(ErrorHandler errorHandler) { @@ -91,6 +96,8 @@ public class PublishSubscribeChannel extends AbstractSubscribableChannel { * ignored. By default this is false meaning that an Exception * will be thrown whenever a handler fails. To override this and suppress * Exceptions, set the value to true. + * + * @param ignoreFailures true if failures should be ignored. */ public void setIgnoreFailures(boolean ignoreFailures) { this.ignoreFailures = ignoreFailures; @@ -104,6 +111,8 @@ public class PublishSubscribeChannel extends AbstractSubscribableChannel { * not be applied. If planning to use an Aggregator downstream * with the default correlation and completion strategies, you should set * this flag to true. + * + * @param applySequence true if the sequence information should be applied. */ public void setApplySequence(boolean applySequence) { this.applySequence = applySequence; @@ -113,7 +122,8 @@ public class PublishSubscribeChannel extends AbstractSubscribableChannel { /** * Specify the maximum number of subscribers supported by the * channel's dispatcher. - * @param maxSubscribers + * + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; @@ -124,6 +134,7 @@ public class PublishSubscribeChannel extends AbstractSubscribableChannel { * If at least this number of subscribers receive the message, * {@link #send(org.springframework.messaging.Message)} * will return true. Default: 0. + * * @param minSubscribers The minimum number of subscribers. */ public void setMinSubscribers(int minSubscribers) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannel.java index 7d2b47ad4e..32c9514fde 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -22,8 +22,8 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import org.springframework.messaging.Message; import org.springframework.integration.core.MessageSelector; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -43,6 +43,8 @@ public class QueueChannel extends AbstractPollableChannel implements QueueChanne /** * Create a channel with the specified queue. + * + * @param queue The queue. */ public QueueChannel(BlockingQueue> queue) { Assert.notNull(queue, "'queue' must not be null"); @@ -51,6 +53,8 @@ public class QueueChannel extends AbstractPollableChannel implements QueueChanne /** * Create a channel with the specified queue capacity. + * + * @param capacity The capacity. */ public QueueChannel(int capacity) { Assert.isTrue(capacity > 0, "The capacity must be a positive integer. " + @@ -104,18 +108,14 @@ public class QueueChannel extends AbstractPollableChannel implements QueueChanne } } - /** - * Remove all {@link Message Messages} from this channel. - */ + @Override public List> clear() { List> clearedMessages = new ArrayList>(); this.queue.drainTo(clearedMessages); return clearedMessages; } - /** - * Remove any {@link Message Messages} that are not accepted by the provided selector. - */ + @Override public List> purge(MessageSelector selector) { if (selector == null) { return this.clear(); @@ -131,10 +131,12 @@ public class QueueChannel extends AbstractPollableChannel implements QueueChanne return purgedMessages; } + @Override public int getQueueSize() { return this.queue.size(); } + @Override public int getRemainingCapacity() { return this.queue.remainingCapacity(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannelOperations.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannelOperations.java index 7a3d68602d..46653ca0e1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannelOperations.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/QueueChannelOperations.java @@ -17,8 +17,8 @@ package org.springframework.integration.channel; import java.util.List; -import org.springframework.messaging.Message; import org.springframework.integration.core.MessageSelector; +import org.springframework.messaging.Message; /** * Operations available on a channel that has queuing semantics. @@ -31,21 +31,26 @@ public interface QueueChannelOperations { /** * Remove all {@link Message Messages} from this channel. + * + * @return The messages that were removed. */ List> clear(); /** * Remove any {@link Message Messages} that are not accepted by the provided selector. + * + * @param selector The message selector. + * @return The list of messages that were purged. */ List> purge(MessageSelector selector); /** - * Return the current number of queued {@link Message Messages} in this channel. + * @return The current number of queued {@link Message Messages} in this channel. */ int getQueueSize(); /** - * Return the remaining capacity of this channel. + * @return The remaining capacity of this channel. */ int getRemainingCapacity(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java index 57457b34ac..7759ee32f2 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -73,6 +73,7 @@ public abstract class AbstractSimpleMessageHandlerFactoryBean getObjectType() { if (this.handler != null) { return this.handler.getClass(); @@ -147,6 +150,7 @@ public abstract class AbstractSimpleMessageHandlerFactoryBean * - *

*

* After initialization this factory populates functions and property accessors from * {@link SpelFunctionFactoryBean}s and {@link SpelPropertyAccessorRegistrar}, respectively. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java index c6a9af6cfa..0b45706140 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -67,6 +67,7 @@ public abstract class AbstractMethodAnnotationPostProcessor + *

* Includes logic to determine {@link org.springframework.messaging.MessageChannel}: * if 'channel' attribute is defined - uses its value as 'channelName'; * if 'id' attribute is defined - creates {@link DirectChannel} at runtime and uses id's value as 'channelName'; @@ -87,6 +87,11 @@ public abstract class AbstractChannelAdapterParser extends AbstractBeanDefinitio /** * Subclasses must implement this method to parse the adapter element. * The name of the MessageChannel bean is provided. + * + * @param element The element. + * @param parserContext The parser context. + * @param channelName The channel name. + * @return The bean definition. */ protected abstract AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractChannelParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractChannelParser.java index 6c78baa3ec..a653d1d67f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractChannelParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractChannelParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -65,9 +65,6 @@ public abstract class AbstractChannelParser extends AbstractBeanDefinitionParser return beanDefinition; } - /* (non-Javadoc) - * @see org.springframework.beans.factory.xml.AbstractBeanDefinitionParser#registerBeanDefinition(org.springframework.beans.factory.config.BeanDefinitionHolder, org.springframework.beans.factory.support.BeanDefinitionRegistry) - */ @Override protected void registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry) { String scope = definition.getBeanDefinition().getScope(); @@ -83,6 +80,10 @@ public abstract class AbstractChannelParser extends AbstractBeanDefinitionParser * arguments or properties should be configured. This base class will * configure the interceptors including the 'datatype' interceptor if * the 'datatype' attribute is defined on the channel element. + * + * @param element The element. + * @param parserContext The parser context. + * @return The bean definition builder. */ protected abstract BeanDefinitionBuilder buildBeanDefinition(Element element, ParserContext parserContext); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractConsumerEndpointParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractConsumerEndpointParser.java index 7c3a8c414b..e16b813260 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractConsumerEndpointParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractConsumerEndpointParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -68,6 +68,10 @@ public abstract class AbstractConsumerEndpointParser extends AbstractBeanDefinit /** * Parse the MessageHandler. + * + * @param element The element. + * @param parserContext The parser context. + * @return The bean definition builder. */ protected abstract BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractDelegatingConsumerEndpointParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractDelegatingConsumerEndpointParser.java index 93c5b6d8d0..f1265c4171 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractDelegatingConsumerEndpointParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractDelegatingConsumerEndpointParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -125,6 +125,10 @@ abstract class AbstractDelegatingConsumerEndpointParser extends AbstractConsumer /** * Subclasses may override this no-op method to provide additional configuration. + * + * @param builder The builder. + * @param element The element. + * @param parserContext The parser context. */ void postProcess(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) { } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractInboundGatewayParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractInboundGatewayParser.java index a178591b57..18628e7861 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractInboundGatewayParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractInboundGatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -28,7 +28,7 @@ import org.springframework.util.StringUtils; /** * Base class for inbound gateway parsers. - * + * * @author Mark Fisher * @author Gary Russell */ @@ -76,6 +76,9 @@ public abstract class AbstractInboundGatewayParser extends AbstractSimpleBeanDef /** * Subclasses may add to the bean definition by overriding this method. + * + * @param builder The builder. + * @param element The element. */ protected void doPostProcess(BeanDefinitionBuilder builder, Element element) { } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundChannelAdapterParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundChannelAdapterParser.java index be29947f09..39d997187f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundChannelAdapterParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundChannelAdapterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -123,6 +123,10 @@ public abstract class AbstractOutboundChannelAdapterParser extends AbstractChann * Override this method to control the registration process and return the bean name. * If parsing a bean definition whose name can be auto-generated, consider using * {@link #parseConsumer(Element, ParserContext)} instead. + * + * @param element The element. + * @param parserContext The parser context. + * @return The bean component definition. */ protected BeanComponentDefinition doParseAndRegisterConsumer(Element element, ParserContext parserContext) { AbstractBeanDefinition definition = this.parseConsumer(element, parserContext); @@ -143,12 +147,17 @@ public abstract class AbstractOutboundChannelAdapterParser extends AbstractChann /** * Override this method to return the BeanDefinition for the MessageConsumer. It will * be registered with a generated name. + * + * @param element The element. + * @param parserContext The parser context. + * @return The bean definition. */ protected abstract AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext); /** * Override this to signal that this channel adapter is actually using a AbstractReplyProducingMessageHandler * while it is not possible for this parser to determine that because, say, a FactoryBean is being used. + * * @return false, unless overridden. */ protected boolean isUsingReplyProducer() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundGatewayParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundGatewayParser.java index a593e4a735..9f3f8ff379 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundGatewayParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractOutboundGatewayParser.java @@ -61,6 +61,10 @@ public abstract class AbstractOutboundGatewayParser extends AbstractConsumerEndp /** * Subclasses may override this method for additional configuration. + + * @param builder The builder. + * @param element The element. + * @param parserContext The parser context. */ protected void postProcessGateway(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) { } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java index fd1771761b..def09edd47 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java @@ -62,6 +62,10 @@ public abstract class AbstractPollingInboundChannelAdapterParser extends Abstrac /** * Subclasses must implement this method to parse the PollableSource instance * which the created Channel Adapter will poll. + * + * @param element The element. + * @param parserContext The parser context. + * @return The bean metadata element. */ protected abstract BeanMetadataElement parseSource(Element element, ParserContext parserContext); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractRouterParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractRouterParser.java index 5d3106c6af..bf6a0620c4 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractRouterParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractRouterParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -68,6 +68,8 @@ public abstract class AbstractRouterParser extends AbstractConsumerEndpointParse /** * Returns the name of the attribute that provides a key for the * channel mappings. This can be overridden by subclasses. + * + * @return The mapping key attribute name. */ protected String getMappingKeyAttributeName() { return "value"; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java index fba8d51b2e..3c2e05ecca 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/HeaderEnricherParserSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -281,6 +281,10 @@ public abstract class HeaderEnricherParserSupport extends AbstractTransformerPar /** * Subclasses may override this method to provide any additional processing. + * + * @param builder The builder. + * @param element The element. + * @param parserContext The parser context. */ protected void postProcessHeaderEnricher(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) { } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceUtils.java index 5953c0cab5..e0fc3ee718 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/IntegrationNamespaceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -205,6 +205,9 @@ public abstract class IntegrationNamespaceUtils { /** * Provides a user friendly description of an element based on its node name and, if available, its "id" attribute * value. This is useful for creating error messages from within bean definition parsers. + * + * @param element The element. + * @return The description. */ public static String createElementDescription(Element element) { String elementId = "'" + element.getNodeName() + "'"; @@ -303,7 +306,13 @@ public abstract class IntegrationNamespaceUtils { } /** - * Utility method to configure HeaderMapper for Inbound and Outbound channel adapters/gateway + * Utility method to configure a HeaderMapper for Inbound and Outbound channel adapters/gateway. + * + * @param element The element. + * @param rootBuilder The root builder. + * @param parserContext The parser context. + * @param headerMapperClass The header mapper class. + * @param replyHeaderValue The reply header value. */ public static void configureHeaderMapper(Element element, BeanDefinitionBuilder rootBuilder, ParserContext parserContext, Class headerMapperClass, String replyHeaderValue) { @@ -340,7 +349,10 @@ public abstract class IntegrationNamespaceUtils { /** * Parse a "transactional" element and configure a {@link TransactionInterceptor} * with "transactionManager" and other "transactionDefinition" properties. - * For example, this advisor will be applied on the Polling Task proxy + * For example, this advisor will be applied on the Polling Task proxy. + * + * @param txElement The transactional element. + * @return The bean definition. * * @see AbstractPollingEndpoint */ @@ -357,6 +369,9 @@ public abstract class IntegrationNamespaceUtils { /** * Parse attributes of "transactional" element and configure a {@link DefaultTransactionAttribute} * with provided "transactionDefinition" properties. + * + * @param txElement The transactional element. + * @return The bean definition. */ public static BeanDefinition configureTransactionDefinition(Element txElement) { BeanDefinitionBuilder txDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(DefaultTransactionAttribute.class); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java index 76adc2a9e1..f1d45ad71f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -52,32 +52,32 @@ public abstract class IntegrationContextUtils { public static final String INTEGRATION_GLOBAL_PROPERTIES_BEAN_NAME = "integrationGlobalProperties"; /** - * Return the {@link MetadataStore} bean whose name is "metadataStore". * @param beanFactory BeanFactory for lookup, must not be null. + * @return The {@link MetadataStore} bean whose name is "metadataStore". */ public static MetadataStore getMetadataStore(BeanFactory beanFactory) { return getBeanOfType(beanFactory, METADATA_STORE_BEAN_NAME, MetadataStore.class); } /** - * Return the {@link MessageChannel} bean whose name is "errorChannel". * @param beanFactory BeanFactory for lookup, must not be null. + * @return The {@link MessageChannel} bean whose name is "errorChannel". */ public static MessageChannel getErrorChannel(BeanFactory beanFactory) { return getBeanOfType(beanFactory, ERROR_CHANNEL_BEAN_NAME, MessageChannel.class); } /** - * Return the {@link TaskScheduler} bean whose name is "taskScheduler" if available. * @param beanFactory BeanFactory for lookup, must not be null. + * @return The {@link TaskScheduler} bean whose name is "taskScheduler" if available. */ public static TaskScheduler getTaskScheduler(BeanFactory beanFactory) { return getBeanOfType(beanFactory, TASK_SCHEDULER_BEAN_NAME, TaskScheduler.class); } /** - * Return the {@link TaskScheduler} bean whose name is "taskScheduler". * @param beanFactory BeanFactory for lookup, must not be null. + * @return The {@link TaskScheduler} bean whose name is "taskScheduler". * @throws IllegalStateException if no such bean is available */ public static TaskScheduler getRequiredTaskScheduler(BeanFactory beanFactory) { @@ -87,16 +87,16 @@ public abstract class IntegrationContextUtils { } /** - * Return the {@link ConversionService} bean whose name is "integrationConversionService" if available. * @param beanFactory BeanFactory for lookup, must not be null. + * @return The {@link ConversionService} bean whose name is "integrationConversionService" if available. */ public static ConversionService getConversionService(BeanFactory beanFactory) { return getBeanOfType(beanFactory, INTEGRATION_CONVERSION_SERVICE_BEAN_NAME, ConversionService.class); } /** - * Return the instance of {@link StandardEvaluationContext} bean whose name is "integrationEvaluationContext" . * @param beanFactory BeanFactory for lookup, must not be null. + * @return the instance of {@link StandardEvaluationContext} bean whose name is "integrationEvaluationContext" . */ public static StandardEvaluationContext getEvaluationContext(BeanFactory beanFactory) { return getBeanOfType(beanFactory, INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME, StandardEvaluationContext.class); @@ -111,6 +111,7 @@ public abstract class IntegrationContextUtils { } /** + * @param beanFactory The bean factory. * @return the global {@link IntegrationContextUtils#INTEGRATION_GLOBAL_PROPERTIES_BEAN_NAME} * bean from provided {@code #beanFactory}, which represents the merged * properties values from all 'META-INF/spring.integration.default.properties' 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 a194255bda..d6b9fc6335 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -39,7 +39,7 @@ import org.springframework.util.StringUtils; /** * A base class that provides convenient access to the bean factory as * well as {@link TaskScheduler} and {@link ConversionService} instances. - *

+ * *

This is intended to be used as a base class for internal framework * components whereas code built upon the integration framework should not * require tight coupling with the context but rather rely on standard @@ -76,6 +76,7 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo private volatile ApplicationContext applicationContext; + @Override public final void setBeanName(String beanName) { this.beanName = beanName; } @@ -84,14 +85,14 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo * Will return the name of this component identified by {@link #componentName} field. * If {@link #componentName} was not set this method will default to the 'beanName' of this component; */ + @Override public final String getComponentName() { return StringUtils.hasText(this.componentName) ? this.componentName : this.beanName; } /** * Sets the name of this component. - * - * @param componentName + * @param componentName The component name. */ public void setComponentName(String componentName) { this.componentName = componentName; @@ -100,21 +101,25 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo /** * Subclasses may implement this method to provide component type information. */ + @Override public String getComponentType() { return null; } + @Override public final void setBeanFactory(BeanFactory beanFactory) { Assert.notNull(beanFactory, "'beanFactory' must not be null"); this.beanFactory = beanFactory; this.integrationProperties = IntegrationContextUtils.getIntegrationProperties(this.beanFactory); } + @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { Assert.notNull(applicationContext, "'applicationContext' must not be null"); this.applicationContext = applicationContext; } + @Override public final void afterPropertiesSet() { try { this.onInit(); @@ -129,6 +134,7 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo /** * Subclasses may implement this for initialization logic. + * @throws Exception Any exception. */ protected void onInit() throws Exception { } @@ -179,7 +185,8 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo } /** - * @see IntegrationContextUtils#getIntegrationProperties + * @see IntegrationContextUtils#getIntegrationProperties(BeanFactory) + * @return The global integration properties. */ protected Properties getIntegrationProperties() { return this.integrationProperties; @@ -188,6 +195,7 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo /** * @param key Integration property. * @param tClass the class to convert a value of Integration property. + * @param The expected type of the property. * @return the value of the Integration property converted to the provide type. */ protected T getIntegrationProperty(String key, Class tClass) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java index 38faa7a16d..a02eb0cfe0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2014 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. @@ -55,8 +55,7 @@ public final class IntegrationProperties { /** * Specifies the value of {@link org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler#poolSize} - * for {@code taskScheduler} bean initialized but Integration infrastructure. - * @see org.springframework.integration.config.xml.DefaultConfiguringBeanFactoryPostProcessor#registerTaskScheduler + * for the {@code taskScheduler} bean initialized by the AbstractTransformerIntegration infrastructure. */ public static final String TASKSCHEDULER_POOLSIZE = "taskScheduler.poolSize"; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/Orderable.java b/spring-integration-core/src/main/java/org/springframework/integration/context/Orderable.java index a632036109..e18497e75a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/Orderable.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/Orderable.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -22,7 +22,7 @@ import org.springframework.core.Ordered; * Interface that extends {@link Ordered} while also exposing the * {@link #setOrder(int)} as an interface-level so that it is avaiable * on AOP proxies, etc. - * + * * @author Mark Fisher * @since 2.0 */ @@ -30,6 +30,8 @@ public interface Orderable extends Ordered { /** * Set the order for this component. + * + * @param order the order. */ void setOrder(int order); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/core/MessageProducer.java b/spring-integration-core/src/main/java/org/springframework/integration/core/MessageProducer.java index ea25231a5a..138596b2bc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/core/MessageProducer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/core/MessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -21,7 +21,7 @@ import org.springframework.messaging.MessageChannel; /** * Base interface for any component that is capable of sending * Messages to a {@link MessageChannel}. - * + * * @author Mark Fisher * @since 2.0 */ @@ -29,6 +29,8 @@ public interface MessageProducer { /** * Specify the MessageChannel to which produced Messages should be sent. + * + * @param outputChannel The output channel. */ void setOutputChannel(MessageChannel outputChannel); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/core/MessageSource.java b/spring-integration-core/src/main/java/org/springframework/integration/core/MessageSource.java index e806f1f538..071e286a0d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/core/MessageSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/core/MessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -19,8 +19,8 @@ package org.springframework.integration.core; import org.springframework.messaging.Message; /** - * Base interface for any source of {@link Message Messages} that can be polled. - * + * Base interface for any source of {@link Message Messages} that can be polled. + * * @author Mark Fisher */ public interface MessageSource { @@ -28,6 +28,8 @@ public interface MessageSource { /** * Retrieve the next available message from this source. * Returns null if no message is available. + * + * @return The messasge or null. */ Message receive(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java index 9b3b8524bd..562ffbdd1b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/AbstractDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -20,6 +20,7 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.messaging.MessageHandler; import org.springframework.util.Assert; @@ -49,7 +50,7 @@ public abstract class AbstractDispatcher implements MessageDispatcher { /** * Set the maximum subscribers allowed by this dispatcher. - * @param maxSubscribers + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; @@ -58,6 +59,8 @@ public abstract class AbstractDispatcher implements MessageDispatcher { /** * Returns an unmodifiable {@link Set} of this dispatcher's handlers. This * is provided for access by subclasses. + * + * @return The message handlers. */ protected Set getHandlers() { return handlers.asUnmodifiableSet(); @@ -66,8 +69,10 @@ public abstract class AbstractDispatcher implements MessageDispatcher { /** * Add the handler to the internal Set. * + * @param handler The handler to add. * @return the result of {@link Set#add(Object)} */ + @Override public boolean addHandler(MessageHandler handler) { Assert.notNull(handler, "handler must not be null"); Assert.isTrue(this.handlers.size() < this.maxSubscribers, "Maximum subscribers exceeded"); @@ -79,6 +84,7 @@ public abstract class AbstractDispatcher implements MessageDispatcher { * * @return the result of {@link Set#remove(Object)} */ + @Override public boolean removeHandler(MessageHandler handler) { Assert.notNull(handler, "handler must not be null"); return this.handlers.remove(handler); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java index 75dccae4de..c30be65f13 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/BroadcastingDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -78,6 +78,8 @@ public class BroadcastingDispatcher extends AbstractDispatcher { * one throws an Exception. Since the Executor is most likely using a different thread, this flag would only affect * whether an error Message is sent to the error channel or not in the case that such an Executor has been * configured. + * + * @param ignoreFailures true when failures are to be ignored. */ public void setIgnoreFailures(boolean ignoreFailures) { this.ignoreFailures = ignoreFailures; @@ -85,7 +87,9 @@ public class BroadcastingDispatcher extends AbstractDispatcher { /** * Specify whether to apply sequence numbers to the messages prior to sending to the handlers. By default, sequence - * numbers will not be applied + * numbers will not be applied. + * + * @param applySequence true when sequence information should be applied. */ public void setApplySequence(boolean applySequence) { this.applySequence = applySequence; @@ -100,6 +104,7 @@ public class BroadcastingDispatcher extends AbstractDispatcher { this.minSubscribers = minSubscribers; } + @Override public boolean dispatch(Message message) { int dispatched = 0; int sequenceNumber = 1; @@ -113,6 +118,7 @@ public class BroadcastingDispatcher extends AbstractDispatcher { .pushSequenceDetails(message.getHeaders().getId(), sequenceNumber++, sequenceSize).build(); if (this.executor != null) { this.executor.execute(new Runnable() { + @Override public void run() { invokeHandler(handler, messageToSend); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java index cdc3871a58..96dd34bb68 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/UnicastingDispatcher.java @@ -1,4 +1,4 @@ -/* Copyright 2002-2013 the original author or authors. +/* Copyright 2002-2014 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. @@ -71,6 +71,8 @@ public class UnicastingDispatcher extends AbstractDispatcher { * Specify whether this dispatcher should failover when a single * {@link MessageHandler} throws an Exception. The default value is * true. + * + * @param failover The failover boolean. */ public void setFailover(boolean failover) { this.failover = failover; @@ -78,6 +80,8 @@ public class UnicastingDispatcher extends AbstractDispatcher { /** * Provide a {@link LoadBalancingStrategy} for this dispatcher. + * + * @param loadBalancingStrategy The load balancing strategy implementation. */ public void setLoadBalancingStrategy(LoadBalancingStrategy loadBalancingStrategy) { Lock lock = rwLock.writeLock(); @@ -90,9 +94,11 @@ public class UnicastingDispatcher extends AbstractDispatcher { } } + @Override public final boolean dispatch(final Message message) { if (this.executor != null) { this.executor.execute(new Runnable() { + @Override public void run() { doDispatch(message); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractMessageSource.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractMessageSource.java index c27353b76e..93b8399f43 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractMessageSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/AbstractMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -21,11 +21,11 @@ import java.util.HashMap; import java.util.Map; import org.springframework.expression.Expression; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.integration.core.MessageSource; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.util.AbstractExpressionEvaluator; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.CollectionUtils; /** @@ -43,9 +43,10 @@ public abstract class AbstractMessageSource extends AbstractExpressionEvaluat ? headerExpressions : Collections.emptyMap(); } + @Override @SuppressWarnings("unchecked") public final Message receive() { - Message message = null; + Message message = null; Object result = this.doReceive(); Map headers = this.evaluateHeaders(); if (result instanceof Message) { @@ -93,6 +94,8 @@ public abstract class AbstractMessageSource extends AbstractExpressionEvaluat /** * Subclasses must implement this method. Typically the returned value will be the payload of * type T, but the returned value may also be a Message instance whose payload is of type T. + * + * @return The value returned. */ protected abstract Object doReceive(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java index d02c999402..a3f7210190 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -17,6 +17,7 @@ package org.springframework.integration.endpoint; import org.springframework.integration.core.MessageSource; +import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.history.MessageHistory; import org.springframework.integration.history.TrackableComponent; import org.springframework.integration.support.context.NamedComponent; @@ -24,7 +25,6 @@ import org.springframework.integration.transaction.IntegrationResourceHolder; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessagingException; -import org.springframework.integration.core.MessagingTemplate; import org.springframework.util.Assert; /** @@ -48,6 +48,8 @@ public class SourcePollingChannelAdapter extends AbstractPollingEndpoint /** * Specify the source to be polled for Messages. + * + * @param source The message source. */ public void setSource(MessageSource source) { this.source = source; @@ -55,6 +57,8 @@ public class SourcePollingChannelAdapter extends AbstractPollingEndpoint /** * Specify the {@link MessageChannel} where Messages should be sent. + * + * @param outputChannel The output channel. */ public void setOutputChannel(MessageChannel outputChannel) { this.outputChannel = outputChannel; @@ -63,6 +67,8 @@ public class SourcePollingChannelAdapter extends AbstractPollingEndpoint /** * Specify the maximum time to wait for a Message to be sent to the * output channel. + * + * @param sendTimeout The send timeout. */ public void setSendTimeout(long sendTimeout) { this.messagingTemplate.setSendTimeout(sendTimeout); @@ -70,7 +76,10 @@ public class SourcePollingChannelAdapter extends AbstractPollingEndpoint /** * Specify whether this component should be tracked in the Message History. + * + * @param shouldTrack true if the component should be tracked. */ + @Override public void setShouldTrack(boolean shouldTrack) { this.shouldTrack = shouldTrack; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java index 5777708b7c..33cef76261 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -41,6 +41,7 @@ import org.springframework.util.Assert; *

* A {@link ExpressionEvalMapBuilder} must be used to instantiate this class * via its {@link #from(Map)} method: + *

*
  * {@code
  *ExpressionEvalMap evalMap = ExpressionEvalMap
@@ -53,7 +54,6 @@ import org.springframework.util.Assert;
  *	.build();
  *}
  * 
- *

*

* Thread-safety depends on the original underlying Map. * Objects of this class are not serializable. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionUtils.java index 5f1e925668..8564cc86ff 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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 ExpressionUtils { /** * Obtains the context from the beanFactory if not null; emits a warning if the beanFactory * is null. - * @param beanFactory + * @param beanFactory The bean factory. * @return The evaluation context. */ public static StandardEvaluationContext createStandardEvaluationContext(BeanFactory beanFactory) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java index fd70724c98..7b60795847 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/expression/ReloadableResourceBundleExpressionSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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 @@ import org.springframework.util.StringUtils; * This class uses {@link java.util.Properties} instances as its custom data structure for expressions, * loading them via a {@link org.springframework.util.PropertiesPersister} strategy: The default * strategy is capable of loading properties files with a specific character encoding, if desired. - * + * * @author Juergen Hoeller * @author Mark Fisher * @since 2.0 @@ -179,6 +179,8 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc * desirable in an application server environment, where the system Locale * is not relevant to the application at all: Set this flag to "false" * in such a scenario. + * + * @param fallbackToSystemLocale true to fall back. */ public void setFallbackToSystemLocale(boolean fallbackToSystemLocale) { this.fallbackToSystemLocale = fallbackToSystemLocale; @@ -197,6 +199,8 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc *

  • A value of "0" will check the last-modified timestamp of the file on * every expression access. Do not use this in a production environment! * + * + * @param cacheSeconds The cache seconds. */ public void setCacheSeconds(int cacheSeconds) { this.cacheMillis = (cacheSeconds * 1000); @@ -205,6 +209,9 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc /** * Set the PropertiesPersister to use for parsing properties files. *

    The default is a DefaultPropertiesPersister. + * + * @param propertiesPersister The properties persister. + * * @see org.springframework.util.DefaultPropertiesPersister */ public void setPropertiesPersister(PropertiesPersister propertiesPersister) { @@ -221,6 +228,7 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc * @see org.springframework.core.io.DefaultResourceLoader * @see org.springframework.context.ResourceLoaderAware */ + @Override public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader()); } @@ -229,6 +237,7 @@ public class ReloadableResourceBundleExpressionSource implements ExpressionSourc /** * Resolves the given key in the retrieved bundle files to an Expression. */ + @Override public Expression getExpression(String key, Locale locale) { String expressionString = this.getExpressionString(key, locale); if (expressionString != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java b/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java index d234ae6008..089b2e797c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/filter/MessageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -17,11 +17,11 @@ package org.springframework.integration.filter; import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; import org.springframework.integration.MessageRejectedException; import org.springframework.integration.core.MessageSelector; import org.springframework.integration.handler.AbstractReplyProducingPostProcessingMessageHandler; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; /** @@ -49,6 +49,8 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa /** * Create a MessageFilter that will delegate to the given * {@link MessageSelector}. + * + * @param selector The message selector. */ public MessageFilter(MessageSelector selector) { Assert.notNull(selector, "selector must not be null"); @@ -66,6 +68,8 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa * (in such a case, the Message will be sent to the discard channel, * and then the exception will be thrown). * @see #setDiscardChannel(MessageChannel) + * + * @param throwExceptionOnRejection true if an exception should be thrown. */ public void setThrowExceptionOnRejection(boolean throwExceptionOnRejection) { this.throwExceptionOnRejection = throwExceptionOnRejection; @@ -77,6 +81,9 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa * the 'throwExceptionOnRejection' flag determines whether rejected Messages * trigger an exception. That value is evaluated regardless of the presence * of a discard channel. + * + * @param discardChannel The discard channel. + * * @see #setThrowExceptionOnRejection(boolean) */ public void setDiscardChannel(MessageChannel discardChannel) { @@ -87,6 +94,8 @@ public class MessageFilter extends AbstractReplyProducingPostProcessingMessageHa * Set to 'true' if you wish the discard processing to occur within any * request handler advice applied to this filter. Also applies to * throwing an exception on rejection. Default: true. + * + * @param discardWithinAdvice true to discard within the advice. */ public void setDiscardWithinAdvice(boolean discardWithinAdvice) { this.setPostProcessWithinAdvice(discardWithinAdvice); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java index cf9bd225e5..c294185e21 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -126,6 +126,8 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab /** * Set the interface class that the generated proxy should implement. * If none is provided explicitly, the default is {@link RequestReplyExchanger}. + * + * @param serviceInterface The service interface. */ public void setServiceInterface(Class serviceInterface) { Assert.notNull(serviceInterface, "'serviceInterface' must not be null"); @@ -137,7 +139,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab * Set the default request channel. * * @param defaultRequestChannel the channel to which request messages will - * be sent if no request channel has been configured with an annotation + * be sent if no request channel has been configured with an annotation. */ public void setDefaultRequestChannel(MessageChannel defaultRequestChannel) { this.defaultRequestChannel = defaultRequestChannel; @@ -159,6 +161,8 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab * Set the error channel. If no error channel is provided, this gateway will * propagate Exceptions to the caller. To completely suppress Exceptions, provide * a reference to the "nullChannel" here. + * + * @param errorChannel The error channel. */ public void setErrorChannel(MessageChannel errorChannel) { this.errorChannel = errorChannel; @@ -184,6 +188,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab this.defaultReplyTimeout = defaultReplyTimeout; } + @Override public void setShouldTrack(boolean shouldTrack) { this.shouldTrack = shouldTrack; if (!CollectionUtils.isEmpty(this.gatewayMap)) { @@ -212,6 +217,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab this.globalMethodMetadata = globalMethodMetadata; } + @Override public void setBeanClassLoader(ClassLoader beanClassLoader) { this.beanClassLoader = beanClassLoader; } @@ -254,10 +260,12 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab return this.serviceInterface; } + @Override public Class getObjectType() { return (this.serviceInterface != null ? this.serviceInterface : null); } + @Override public Object getObject() throws Exception { if (this.serviceProxy == null) { this.onInit(); @@ -266,10 +274,12 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab return this.serviceProxy; } + @Override public boolean isSingleton() { return true; } + @Override public Object invoke(final MethodInvocation invocation) throws Throwable { if (Future.class.isAssignableFrom(invocation.getMethod().getReturnType())) { return this.asyncExecutor.submit(new AsyncInvocationTask(invocation)); @@ -514,6 +524,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint implements Trackab this.invocation = invocation; } + @Override public Object call() throws Exception { try { return doInvoke(this.invocation); 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 0dae307251..efcc995337 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -16,6 +16,7 @@ package org.springframework.integration.gateway; +import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.endpoint.AbstractEndpoint; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.integration.endpoint.PollingConsumer; @@ -31,7 +32,6 @@ import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessagingException; import org.springframework.messaging.PollableChannel; import org.springframework.messaging.SubscribableChannel; -import org.springframework.integration.core.MessagingTemplate; import org.springframework.messaging.support.ErrorMessage; import org.springframework.util.Assert; @@ -105,6 +105,8 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint implement * Set the error channel. If no error channel is provided, this gateway will * propagate Exceptions to the caller. To completely suppress Exceptions, provide * a reference to the "nullChannel" here. + * + * @param errorChannel The error channel. */ public void setErrorChannel(MessageChannel errorChannel) { this.errorChannel = errorChannel; @@ -134,6 +136,8 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint implement /** * Provide an {@link InboundMessageMapper} for creating request Messages * from any object passed in a send or sendAndReceive operation. + * + * @param requestMapper The request mapper. */ public void setRequestMapper(InboundMessageMapper requestMapper) { requestMapper = (requestMapper != null) ? requestMapper : new DefaultRequestMapper(); @@ -144,6 +148,8 @@ public abstract class MessagingGatewaySupport extends AbstractEndpoint implement /** * Provide an {@link OutboundMessageMapper} for mapping to objects from * any reply Messages received in receive or sendAndReceive operations. + * + * @param replyMapper The reply mapper. */ public void setReplyMapper(OutboundMessageMapper replyMapper) { this.messageConverter.setOutboundMessageMapper(replyMapper); 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 398d1b430e..96b397f8b5 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -23,6 +23,7 @@ import org.aopalliance.aop.Advice; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.integration.core.MessageProducer; +import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; @@ -30,7 +31,6 @@ import org.springframework.messaging.MessageDeliveryException; import org.springframework.messaging.MessageHeaders; import org.springframework.messaging.core.DestinationResolutionException; import org.springframework.messaging.core.DestinationResolver; -import org.springframework.integration.core.MessagingTemplate; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; @@ -65,19 +65,24 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa } + @Override public void setOutputChannel(MessageChannel outputChannel) { this.outputChannel = outputChannel; } /** * Set the timeout for sending reply Messages. + * + * @param sendTimeout The send timeout. */ public void setSendTimeout(long sendTimeout) { this.messagingTemplate.setSendTimeout(sendTimeout); } /** - * Set the DestinationResolver to be used when there is no default output channel. + * Set the DestinationResolver<MessageChannel> to be used when there is no default output channel. + * + * @param channelResolver The channel resolver. */ public void setChannelResolver(DestinationResolver channelResolver) { Assert.notNull(channelResolver, "'channelResolver' must not be null"); @@ -87,6 +92,8 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa /** * Flag whether a reply is required. If true an incoming message MUST result in a reply message being sent. * If false an incoming message MAY result in a reply message being sent. Default is false. + * + * @param requiresReply true if a reply is required. */ public void setRequiresReply(boolean requiresReply) { this.requiresReply = requiresReply; @@ -94,6 +101,8 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa /** * Provides access to the {@link MessagingTemplate} for subclasses. + * + * @return The messaging template. */ protected MessagingTemplate getMessagingTemplate() { return this.messagingTemplate; @@ -109,6 +118,7 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa return this.adviceChain != null && this.adviceChain.size() > 0; } + @Override public void setBeanClassLoader(ClassLoader beanClassLoader) { this.beanClassLoader = beanClassLoader; } @@ -201,6 +211,7 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa * Send a reply Message. The 'replyChannelHeaderValue' will be considered only if this handler's * 'outputChannel' is null. In that case, the header value must not also be * null, and it must be an instance of either String or {@link MessageChannel}. + * * @param replyMessage the reply Message to send * @param replyChannelHeaderValue the 'replyChannel' header value from the original request */ @@ -222,6 +233,9 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa /** * Send the message to the given channel. The channel must be a String or * {@link MessageChannel} instance, never null. + * + * @param message The message. + * @param channel The channel to which to send the message. */ private void sendMessage(final Message message, final Object channel) { if (channel instanceof MessageChannel) { @@ -247,6 +261,8 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa /** * Subclasses may override this. True by default. + * + * @return true if the request headers should be copied. */ protected boolean shouldCopyRequestHeaders() { return true; @@ -257,6 +273,9 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa * value may be a Message, a MessageBuilder, or any plain Object. The base class * will handle the final creation of a reply Message from any of those starting * points. If the return value is null, the Message flow will end here. + * + * @param requestMessage The request message. + * @return The result of handling the message, or {@code null}. */ protected abstract Object handleRequestMessage(Message requestMessage); @@ -265,11 +284,13 @@ public abstract class AbstractReplyProducingMessageHandler extends AbstractMessa Object handleRequestMessage(Message requestMessage); + @Override String toString(); } private class AdvisedRequestHandler implements RequestHandler { + @Override public Object handleRequestMessage(Message requestMessage) { return AbstractReplyProducingMessageHandler.this.handleRequestMessage(requestMessage); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingPostProcessingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingPostProcessingMessageHandler.java index 3677a55c7b..ef03c86ba7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingPostProcessingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractReplyProducingPostProcessingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -33,6 +33,8 @@ public abstract class AbstractReplyProducingPostProcessingMessageHandler * the scope of any configured advice classes. If false, the * post processing will occur after the advice chain returns. Default true. * This is only applicable if there is in fact an advice chain present. + * + * @param postProcessWithinAdvice true if the post processing should be performed within the advice. */ public void setPostProcessWithinAdvice(boolean postProcessWithinAdvice) { this.postProcessWithinAdvice = postProcessWithinAdvice; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java index 8e431c1a0a..1436c2c153 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/DelayHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -32,7 +32,6 @@ import org.springframework.expression.Expression; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.SpelParserConfiguration; import org.springframework.expression.spel.standard.SpelExpressionParser; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.store.MessageGroup; @@ -42,8 +41,9 @@ import org.springframework.integration.store.SimpleMessageStore; import org.springframework.integration.support.MessageBuilder; import org.springframework.jmx.export.annotation.ManagedResource; import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.MessageHandlingException; +import org.springframework.messaging.MessagingException; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.util.Assert; @@ -110,6 +110,8 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * to store delayed Messages in the {@link MessageGroupStore}. The sending of Messages after * the delay will be handled by registered in the ApplicationContext default {@link ThreadPoolTaskScheduler}. * + * @param messageGroupId The message group identifier. + * * @see IntegrationObjectSupport#getTaskScheduler() */ public DelayHandler(String messageGroupId) { @@ -120,6 +122,9 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement /** * Create a DelayHandler with the given default delay. The sending of Messages * after the delay will be handled by the provided {@link TaskScheduler}. + * + * @param messageGroupId The message group identifier. + * @param taskScheduler A task scheduler. */ public DelayHandler(String messageGroupId, TaskScheduler taskScheduler) { this(messageGroupId); @@ -130,7 +135,9 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * Set the default delay in milliseconds. If no {@code delayExpression} property * has been provided, the default delay will be applied to all Messages. If * a delay should only be applied to Messages with evaluation result from - * @code delayExpression}, then set this value to 0. + * {@code delayExpression}, then set this value to 0. + * + * @param defaultDelay The default delay in milliseconds. */ public void setDefaultDelay(long defaultDelay) { this.defaultDelay = defaultDelay; @@ -141,6 +148,8 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * (in milliseconds) or a Date to delay until. If this property is set, any * such header value will take precedence over this handler's default delay. * @deprecated in favor of {@link #delayExpression} + * + * @param delayHeaderName The name of the header. */ @Deprecated public void setDelayHeaderName(String delayHeaderName) { @@ -151,6 +160,8 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * Specify the {@link Expression} that should be checked for a delay period * (in milliseconds) or a Date to delay until. If this property is set, the * result of the expression evaluation will take precedence over this handler's default delay. + * + * @param delayExpression The delay expression. */ public void setDelayExpression(Expression delayExpression) { this.delayExpression = delayExpression; @@ -164,6 +175,8 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * {@code Exception} will be thrown to the caller without falling back to the to the {@link #defaultDelay}. * Default is {@code true}. * + * @param ignoreExpressionFailures true if expression evaluation failures should be ignored. + * * @see #determineDelayForMessage */ public void setIgnoreExpressionFailures(boolean ignoreExpressionFailures) { @@ -173,6 +186,8 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement /** * Specify the {@link MessageGroupStore} that should be used to store Messages * while awaiting the delay. + * + * @param messageStore The message store. */ public void setMessageStore(MessageGroupStore messageStore) { Assert.state(messageStore != null, "MessageStore must not be null"); @@ -183,6 +198,8 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * Specify the {@code List} to advise {@link DelayHandler.ReleaseMessageHandler} proxy. * Usually used to add transactions to delayed messages retrieved from a transactional message store. * + * @param delayedAdviceChain The advice chain. + * * @see #createReleaseMessageTask */ public void setDelayedAdviceChain(List delayedAdviceChain) { @@ -310,6 +327,7 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement final Message messageToSchedule = delayedMessage; this.getTaskScheduler().schedule(new Runnable() { + @Override public void run() { releaseMessage(messageToSchedule); } @@ -334,6 +352,7 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement } } + @Override public int getDelayedMessageCount() { return this.messageStore.messageGroupSize(this.messageGroupId); } @@ -345,10 +364,12 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * and schedules task about 'delay' logic. * This behavior is dictated by the avoidance of invocation thread overload. */ + @Override public void reschedulePersistedMessages() { MessageGroup messageGroup = this.messageStore.getMessageGroup(this.messageGroupId); for (final Message message : messageGroup.getMessages()) { this.getTaskScheduler().schedule(new Runnable() { + @Override public void run() { long delay = determineDelayForMessage(message); if (delay > 0) { @@ -374,6 +395,7 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement * * @see #reschedulePersistedMessages */ + @Override public void onApplicationEvent(ContextRefreshedEvent event) { if (!this.initialized.getAndSet(true)) { this.reschedulePersistedMessages(); @@ -390,6 +412,7 @@ public class DelayHandler extends AbstractReplyProducingMessageHandler implement */ private class ReleaseMessageHandler implements MessageHandler { + @Override public void handleMessage(Message message) throws MessagingException { DelayHandler.this.doReleaseMessage(message); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java index 361e3ec8a8..11d96267bc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -24,7 +24,7 @@ import org.springframework.util.Assert; /** * A {@link MessageProcessor} implementation that evaluates a SpEL expression * with the Message itself as the root object within the evaluation context. - * + * * @author Mark Fisher * @since 2.0 */ @@ -37,6 +37,8 @@ public class ExpressionEvaluatingMessageProcessor extends AbstractMessageProc /** * Create an {@link ExpressionEvaluatingMessageProcessor} for the given expression. + * + * @param expression The expression. */ public ExpressionEvaluatingMessageProcessor(Expression expression) { this(expression, null); @@ -46,6 +48,9 @@ public class ExpressionEvaluatingMessageProcessor extends AbstractMessageProc /** * Create an {@link ExpressionEvaluatingMessageProcessor} for the given expression * and expected type for its evaluation result. + * + * @param expression The expression. + * @param expectedType The expected type. */ public ExpressionEvaluatingMessageProcessor(Expression expression, Class expectedType) { Assert.notNull(expression, "The expression must not be null"); @@ -62,7 +67,11 @@ public class ExpressionEvaluatingMessageProcessor extends AbstractMessageProc /** * Processes the Message by evaluating the expression with that Message as the * root object. The expression evaluation result Object will be returned. + * + * @param message The message. + * @return The result of processing the message. */ + @Override public T processMessage(Message message) { return this.evaluateExpression(this.expression, message, this.expectedType); } 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 c85073ae95..42cff1b391 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-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -63,6 +63,8 @@ public class LoggingHandler extends AbstractMessageHandler { * Create a LoggingHandler with the given log level (case-insensitive). *

    * The valid levels are: FATAL, ERROR, WARN, INFO, DEBUG, or TRACE + *

    + * @param level The level. */ public LoggingHandler(String level) { Assert.notNull(level, "'level' cannot be null"); @@ -93,6 +95,7 @@ public class LoggingHandler extends AbstractMessageHandler { /** * Set the logging {@link Level}. + * * @param level the level. */ public void setLevel(Level level) { @@ -108,6 +111,8 @@ public class LoggingHandler extends AbstractMessageHandler { /** * Specify whether to log the full Message. Otherwise, only the payload will be logged. This value is * false by default. + * + * @param shouldLogFullMessage true if the complete message should be logged. */ public void setShouldLogFullMessage(boolean shouldLogFullMessage) { Assert.isTrue(!(this.expressionSet), "Cannot set both 'expression' AND 'shouldLogFullMessage' properties"); 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 4d991b82a3..254d8874b3 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -23,13 +23,13 @@ import java.util.concurrent.locks.ReentrantLock; import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.BeanFactory; import org.springframework.context.Lifecycle; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.core.MessageProducer; import org.springframework.integration.filter.MessageFilter; import org.springframework.integration.support.channel.BeanFactoryChannelResolver; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.MessageHandlingException; import org.springframework.messaging.core.DestinationResolver; import org.springframework.util.Assert; @@ -50,7 +50,6 @@ import org.springframework.util.Assert; *

    * This component can be used from the namespace to improve the readability of * the configuration by removing channels that can be created implicitly. - *

    * *

      * {@code
    @@ -95,6 +94,7 @@ public class MessageHandlerChain extends AbstractMessageHandler implements Messa
     		this.handlers = handlers;
     	}
     
    +	@Override
     	public void setOutputChannel(MessageChannel outputChannel) {
     		this.outputChannel = outputChannel;
     	}
    @@ -141,9 +141,11 @@ public class MessageHandlerChain extends AbstractMessageHandler implements Messa
     						"the last one in the chain must implement the MessageProducer interface.");
     				final MessageHandler nextHandler = handlers.get(i + 1);
     				final MessageChannel nextChannel = new MessageChannel() {
    +					@Override
     					public boolean send(Message message, long timeout) {
     						return this.send(message);
     					}
    +					@Override
     					public boolean send(Message message) {
     						nextHandler.handleMessage(message);
     						return true;
    @@ -174,6 +176,7 @@ public class MessageHandlerChain extends AbstractMessageHandler implements Messa
     	 * SmartLifecycle implementation (delegates to the {@link #handlers})
     	 */
     
    +	@Override
     	public final boolean isRunning() {
     		this.lifecycleLock.lock();
     		try {
    @@ -184,6 +187,7 @@ public class MessageHandlerChain extends AbstractMessageHandler implements Messa
     		}
     	}
     
    +	@Override
     	public final void start() {
     		this.lifecycleLock.lock();
     		try {
    @@ -200,6 +204,7 @@ public class MessageHandlerChain extends AbstractMessageHandler implements Messa
     		}
     	}
     
    +	@Override
     	public final void stop() {
     		this.lifecycleLock.lock();
     		try {
    @@ -245,10 +250,12 @@ public class MessageHandlerChain extends AbstractMessageHandler implements Messa
     
     	private class ReplyForwardingMessageChannel implements MessageChannel {
     
    +		@Override
     		public boolean send(Message message) {
     			return this.send(message, -1);
     		}
     
    +		@Override
     		public boolean send(Message message, long timeout) {
     			timeout = (MessageHandlerChain.this.sendTimeout != null)
     					? MessageHandlerChain.this.sendTimeout : timeout;
    diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageProcessor.java
    index 7b23de55a3..b16172d417 100644
    --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageProcessor.java
    +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/MessageProcessor.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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,7 +35,7 @@ import org.springframework.messaging.Message;
      * This strategy and its various implementations are considered part of the
      * internal "support" API, intended for use by Spring Integration's various
      * message-handling components. As such, it is subject to change.
    - * 
    + *
      * @author Mark Fisher
      * @since 2.0
      */
    @@ -43,6 +43,9 @@ public interface MessageProcessor {
     
     	/**
     	 * Process the Message and return a value (or null).
    +	 *
    +	 * @param message The message to process.
    +	 * @return The result.
     	 */
     	T processMessage(Message message);
     
    diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java
    index a085bd1ee1..45cf53e690 100644
    --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java
    +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/AbstractRequestHandlerAdvice.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -23,10 +23,10 @@ import org.apache.commons.logging.Log;
     import org.apache.commons.logging.LogFactory;
     
     import org.springframework.aop.ProxyMethodInvocation;
    -import org.springframework.messaging.Message;
     import org.springframework.integration.context.IntegrationObjectSupport;
    -import org.springframework.messaging.MessageHandler;
     import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
    +import org.springframework.messaging.Message;
    +import org.springframework.messaging.MessageHandler;
     
     /**
      * Base class for {@link MessageHandler} advice classes. Subclasses should provide
    @@ -43,6 +43,7 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
     
     	protected final Log logger = LogFactory.getLog(this.getClass());
     
    +	@Override
     	public final Object invoke(final MethodInvocation invocation) throws Throwable {
     
     		Method method = invocation.getMethod();
    @@ -67,6 +68,7 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
     			try {
     				return doInvoke(new ExecutionCallback() {
     
    +					@Override
     					public Object execute() throws Exception {
     						try {
     							return invocation.proceed();
    @@ -79,6 +81,7 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
     						}
     					}
     
    +					@Override
     					public Object cloneAndExecute() throws Exception {
     						try {
     							/*
    @@ -118,7 +121,7 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
     	 * @param target   The target handler.
     	 * @param message  The message that will be sent to the handler.
     	 * @return the result after invoking the {@link MessageHandler}.
    -	 * @throws Exception
    +	 * @throws Exception Any Exception.
     	 */
     	protected abstract Object doInvoke(ExecutionCallback callback, Object target, Message message) throws Exception;
     
    @@ -160,6 +163,9 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
     
     		/**
     		 * Call this for a normal invocation.proceed().
    +		 *
    +		 * @return The result of the execution.
    +		 * @throws Exception Any Exception.
     		 */
     		Object execute() throws Exception;
     
    @@ -167,6 +173,9 @@ public abstract class AbstractRequestHandlerAdvice extends IntegrationObjectSupp
     		 * Call this when it is necessary to clone the invocation before
     		 * calling proceed() - such as when the invocation might be called
     		 * multiple times - for example in a retry advice.
    +		 *
    +		 * @return The result of the execution.
    +		 * @throws Exception Any Exception.
     		 */
     		Object cloneAndExecute() throws Exception;
     
    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 a97c1f75c6..2e946ada24 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-2012 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -83,7 +83,7 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan
     	/**
     	 * If true, any exception will be caught and null returned.
     	 * Default false.
    -	 * @param trapException
    +	 * @param trapException true to trap Exceptions.
     	 */
     	public void setTrapException(boolean trapException) {
     		this.trapException = trapException;
    @@ -92,7 +92,8 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan
     	/**
     	 * If true, the result of evaluating the onFailureExpression will
     	 * be returned as the result of AbstractReplyProducingMessageHandler.handleRequestMessage(Message).
    -	 * @param returnFailureExpressionResult
    +	 *
    +	 * @param returnFailureExpressionResult true to return the result of the evaluation.
     	 */
     	public void setReturnFailureExpressionResult(boolean returnFailureExpressionResult) {
     		this.returnFailureExpressionResult = returnFailureExpressionResult;
    @@ -102,7 +103,7 @@ public class ExpressionEvaluatingRequestHandlerAdvice extends AbstractRequestHan
     	 * If true and an onSuccess expression evaluation fails with an exception, the exception will be thrown to the
     	 * caller. If false, the exception is caught. Default false. Ignored for onFailure expression evaluation - the
     	 * original exception will be propagated (unless trapException is true).
    -	 * @param propagateOnSuccessEvaluationFailures
    +	 * @param propagateOnSuccessEvaluationFailures The propagateOnSuccessEvaluationFailures to set.
     	 */
     	public void setPropagateEvaluationFailures(boolean propagateOnSuccessEvaluationFailures) {
     		this.propagateOnSuccessEvaluationFailures = propagateOnSuccessEvaluationFailures;
    diff --git a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonToObjectTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonToObjectTransformer.java
    index 2f6ce78af1..778cc3a38f 100644
    --- a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonToObjectTransformer.java
    +++ b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonToObjectTransformer.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -56,6 +56,11 @@ public class JsonToObjectTransformer extends AbstractTransformer implements Bean
     	/**
     	 * Backward compatibility - allows existing configurations using Jackson 1.x to inject
     	 * an ObjectMapper directly.
    +	 *
    +	 * @param targetClass The target class.
    +	 * @param objectMapper The object mapper.
    +	 * @throws ClassNotFoundException When the target class is not found.
    +	 *
     	 * @deprecated in favor of {@link #JsonToObjectTransformer(Class, JsonObjectMapper)}
     	 */
     	@Deprecated
    diff --git a/spring-integration-core/src/main/java/org/springframework/integration/json/ObjectToJsonTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/json/ObjectToJsonTransformer.java
    index 2c569eadd3..b9cd53c47d 100644
    --- a/spring-integration-core/src/main/java/org/springframework/integration/json/ObjectToJsonTransformer.java
    +++ b/spring-integration-core/src/main/java/org/springframework/integration/json/ObjectToJsonTransformer.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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,6 +53,9 @@ public class ObjectToJsonTransformer extends AbstractTransformer {
     	/**
     	 * Backward compatibility - allows existing configurations using Jackson 1.x to inject
     	 * an ObjectMapper directly.
    +	 *
    +	 * @param objectMapper The object mapper.
    +	 *
     	 * @deprecated in favor of {@link #ObjectToJsonTransformer(JsonObjectMapper)}
     	 */
     	@Deprecated
    @@ -81,7 +84,7 @@ public class ObjectToJsonTransformer extends AbstractTransformer {
     	/**
     	 * Sets the content-type header value
     	 *
    -	 * @param contentType
    +	 * @param contentType The content type.
     	 */
     	public void setContentType(String contentType) {
     		// only null assertion is needed since "" is a valid value
    diff --git a/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java
    index 2e2c7430ea..b97b4f03d3 100644
    --- a/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java
    +++ b/spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -78,6 +78,8 @@ public abstract class AbstractHeaderMapper implements RequestReplyHeaderMappe
     	 * 

    * This will match the header name directly or, for non-standard headers, it will match * the header name prefixed with the value, if specified, by {@link #setUserDefinedHeaderPrefix(String)}. + * + * @param requestHeaderNames The request header names. */ public void setRequestHeaderNames(String[] requestHeaderNames) { Assert.notNull(requestHeaderNames, "'requestHeaderNames' must not be null"); @@ -90,6 +92,8 @@ public abstract class AbstractHeaderMapper implements RequestReplyHeaderMappe * The values can also contain simple wildcard patterns (e.g. "foo*" or "*foo") to be matched. *

    * Any non-standard headers will be prefixed with the value specified by {@link #setUserDefinedHeaderPrefix(String)}. + * + * @param replyHeaderNames The reply header names. */ public void setReplyHeaderNames(String[] replyHeaderNames) { Assert.notNull(replyHeaderNames, "'replyHeaderNames' must not be null"); @@ -103,6 +107,8 @@ public abstract class AbstractHeaderMapper implements RequestReplyHeaderMappe * This does not affect the standard properties for the particular protocol, such as * contentType for AMQP, etc. The header names used for mapping such properties are * defined in a corresponding Headers class as constants (e.g. AmqpHeaders). + * + * @param userDefinedHeaderPrefix The user defined header prefix. */ public void setUserDefinedHeaderPrefix(String userDefinedHeaderPrefix) { this.userDefinedHeaderPrefix = (userDefinedHeaderPrefix != null) ? userDefinedHeaderPrefix : ""; @@ -111,28 +117,44 @@ public abstract class AbstractHeaderMapper implements RequestReplyHeaderMappe /** * Maps headers from a Spring Integration MessageHeaders instance to the target instance * matching on the set of REQUEST headers (if different). + * + * @param headers The headers. + * @param target The target. */ + @Override public void fromHeadersToRequest(MessageHeaders headers, T target) { this.fromHeaders(headers, target, this.requestHeaderNames); } /** * Maps headers from a Spring Integration MessageHeaders instance to the target instance * matching on the set of REPLY headers (if different). + * + * @param headers The headers. + * @param target The target. */ + @Override public void fromHeadersToReply(MessageHeaders headers, T target) { this.fromHeaders(headers, target, this.replyHeaderNames); } /** * Maps headers/properties of the target object to Map of MessageHeaders * matching on the set of REQUEST headers + * + * @param source The source. + * @return The headers. */ + @Override public Map toHeadersFromRequest(T source) { return this.toHeaders(source, this.requestHeaderNames); } /** * Maps headers/properties of the target object to Map of MessageHeaders * matching on the set of REPLY headers + * + * @param source The source. + * @return The headers. */ + @Override public Map toHeadersFromReply(T source) { return this.toHeaders(source, this.replyHeaderNames); } @@ -285,21 +307,21 @@ public abstract class AbstractHeaderMapper implements RequestReplyHeaderMappe } /** - * Returns the list of standard REQUEST headers. Implementation provided by a subclass + * @return The list of standard REQUEST headers. Implementation provided by a subclass */ protected List getStandardReplyHeaderNames(){ return Collections.emptyList(); } /** - * Returns the PREFIX used by standard headers (if any) + * @return The PREFIX used by standard headers (if any) */ protected List getStandardRequestHeaderNames(){ return Collections.emptyList(); } /** - * Returns the list of standard REPLY headers. Implementation provided by a subclass + * @return The list of standard REPLY headers. Implementation provided by a subclass */ protected abstract String getStandardHeaderPrefix(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStore.java b/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStore.java index 06d48c9cab..cf392acbce 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/metadata/MetadataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -33,18 +33,25 @@ public interface MetadataStore { /** * Writes a key value pair to this MetadataStore. + * + * @param key The key. + * @param value The value. */ void put(String key, String value); /** * Reads a value for the given key from this MetadataStore. + * + * @param key The key. + * @return The value. */ @ManagedAttribute String get(String key); /** * Remove a value for the given key from this MetadataStore. - * return the previous value associated with key, or + * @param key The key. + * @return The previous value associated with key, or * null if there was no mapping for key. */ @ManagedAttribute diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMappingMessageRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMappingMessageRouter.java index b6c058b376..1558d2d78a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMappingMessageRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMappingMessageRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -61,6 +61,8 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Provide mappings from channel keys to channel names. * Channel names will be resolved by the {@link DestinationResolver}. + * + * @param channelMappings The channel mappings. */ public void setChannelMappings(Map channelMappings) { Map oldChannelMappings = this.channelMappings; @@ -78,6 +80,8 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter * The default is a BeanFactoryChannelResolver. * This is considered an infrastructural configuration option and * as of 2.1 has been deprecated as a configuration-driven attribute. + * + * @param channelResolver The channel resolver. */ public void setChannelResolver(DestinationResolver channelResolver) { Assert.notNull(channelResolver, "'channelResolver' must not be null"); @@ -86,6 +90,8 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Specify a prefix to be added to each channel name prior to resolution. + * + * @param prefix The prefix. */ public void setPrefix(String prefix) { this.prefix = prefix; @@ -93,6 +99,8 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Specify a suffix to be added to each channel name prior to resolution. + * + * @param suffix The suffix. */ public void setSuffix(String suffix) { this.suffix = suffix; @@ -101,6 +109,8 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Specify whether this router should ignore any failure to resolve a channel name to * an actual MessageChannel instance when delegating to the ChannelResolver strategy. + * + * @param resolutionRequired true if resolution is required. */ public void setResolutionRequired(boolean resolutionRequired) { this.resolutionRequired = resolutionRequired; @@ -109,6 +119,8 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Returns an unmodifiable version of the channel mappings. * This is intended for use by subclasses only. + * + * @return The channel mappings. */ protected Map getChannelMappings() { return Collections.unmodifiableMap(this.channelMappings); @@ -116,7 +128,11 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Add a channel mapping from the provided key to channel name. + * + * @param key The key. + * @param channelName The channel name. */ + @Override @ManagedOperation public void setChannelMapping(String key, String channelName) { this.channelMappings.put(key, channelName); @@ -124,7 +140,10 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter /** * Remove a channel mapping for the given key if present. + * + * @param key The key. */ + @Override @ManagedOperation public void removeChannelMapping(String key) { this.channelMappings.remove(key); @@ -142,6 +161,9 @@ public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter * Subclasses must implement this method to return the channel keys. * A "key" might be present in this router's "channelMappings", or it * could be the channel's name or even the Message Channel instance itself. + * + * @param message The message. + * @return The channel keys. */ protected abstract List getChannelKeys(Message message); 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 02089144e6..facfd93dc0 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -21,6 +21,7 @@ import java.util.Collection; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.integration.channel.NullChannel; +import org.springframework.integration.core.MessagingTemplate; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.support.MessageBuilder; import org.springframework.jmx.export.annotation.ManagedResource; @@ -28,7 +29,6 @@ import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageDeliveryException; import org.springframework.messaging.MessagingException; -import org.springframework.integration.core.MessagingTemplate; /** * Base class for all Message Routers. @@ -58,6 +58,8 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { * {@link MessageDeliveryException}. * * If messages shall be ignored (dropped) instead, please provide a {@link NullChannel}. + * + * @param defaultOutputChannel The default output channel. */ public void setDefaultOutputChannel(MessageChannel defaultOutputChannel) { this.defaultOutputChannel = defaultOutputChannel; @@ -66,6 +68,8 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { /** * Set the timeout for sending a message to the resolved channel. By default, there is no timeout, meaning the send * will block indefinitely. + * + * @param timeout The timeout. */ public void setTimeout(long timeout) { this.messagingTemplate.setSendTimeout(timeout); @@ -75,6 +79,8 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { * Specify whether send failures for one or more of the recipients should be ignored. By default this is * false meaning that an Exception will be thrown whenever a send fails. To override this and suppress * Exceptions, set the value to true. + * + * @param ignoreSendFailures true to ignore send failures. */ public void setIgnoreSendFailures(boolean ignoreSendFailures) { this.ignoreSendFailures = ignoreSendFailures; @@ -85,6 +91,8 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { * channels. By default, this value is false meaning that sequence headers will not be * applied. If planning to use an Aggregator downstream with the default correlation and completion strategies, you * should set this flag to true. + * + * @param applySequence true to apply sequence information. */ public void setApplySequence(boolean applySequence) { this.applySequence = applySequence; @@ -96,7 +104,9 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { } /** - * Provides {@link MessagingTemplate} access for subclasses. + * Provides {@link MessagingTemplate} access for subclasses + * + * @return The messaging template. */ protected MessagingTemplate getMessagingTemplate() { return this.messagingTemplate; @@ -116,6 +126,9 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { /** * Subclasses must implement this method to return a Collection of zero or more * MessageChannels to which the given Message should be routed. + * + * @param message The message. + * @return The collection of message channels. */ protected abstract Collection determineTargetChannels(Message message); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java index a27daca046..9eb24d8523 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -36,6 +36,8 @@ public class HeaderValueRouter extends AbstractMappingMessageRouter { /** * Create a router that uses the provided header name to lookup a channel. + * + * @param headerName The header name. */ public HeaderValueRouter(String headerName) { Assert.notNull(headerName, "'headerName' must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/MappingMessageRouterManagement.java b/spring-integration-core/src/main/java/org/springframework/integration/router/MappingMessageRouterManagement.java index 66f3eb5559..79f9848b91 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/MappingMessageRouterManagement.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/MappingMessageRouterManagement.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -26,12 +26,17 @@ public interface MappingMessageRouterManagement { /** * Add a channel mapping from the provided key to channel name. + * + * @param key The key. + * @param channelName The channel name. */ @ManagedOperation public abstract void setChannelMapping(String key, String channelName); /** * Remove a channel mapping for the given key if present. + * + * @param key The key. */ @ManagedOperation public abstract void removeChannelMapping(String key); 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 8d77b8016b..0e3d3a0bd3 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -21,9 +21,9 @@ import java.util.Collection; import java.util.List; import org.springframework.beans.factory.InitializingBean; +import org.springframework.integration.core.MessageSelector; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; -import org.springframework.integration.core.MessageSelector; import org.springframework.util.Assert; /** @@ -64,6 +64,8 @@ public class RecipientListRouter extends AbstractMessageRouter implements Initia * Set the channels for this router. Either call this method or * {@link #setRecipients(List)} but not both. If MessageSelectors should be * considered, then use {@link #setRecipients(List)}. + * + * @param channels The channels. */ public void setChannels(List channels) { Assert.notEmpty(channels, "channels must not be empty"); @@ -76,6 +78,8 @@ public class RecipientListRouter extends AbstractMessageRouter implements Initia /** * Set the recipients for this router. + * + * @param recipients The recipients. */ public void setRecipients(List recipients) { Assert.notEmpty(recipients, "recipients must not be empty"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java index 0c9feeb870..5c5a21dde7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scheduling/PollerMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -20,6 +20,7 @@ import java.util.List; import java.util.concurrent.Executor; import org.aopalliance.aop.Advice; + import org.springframework.beans.factory.BeanFactory; import org.springframework.integration.transaction.TransactionSynchronizationFactory; import org.springframework.scheduling.Trigger; @@ -88,6 +89,8 @@ public class PollerMetadata { * *

    The default is unbounded. * + * @param maxMessagesPerPoll The maxMessagesPerPoll to set. + * * @see #MAX_MESSAGES_UNBOUNDED */ public void setMaxMessagesPerPoll(long maxMessagesPerPoll) { @@ -134,6 +137,7 @@ public class PollerMetadata { /** * Return the default {@link PollerMetadata} bean if available. * @param beanFactory BeanFactory for lookup, must not be null. + * @return The poller metadata. */ public static PollerMetadata getDefaultPollerMetadata(BeanFactory beanFactory) { Assert.notNull(beanFactory, "BeanFactory must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/selector/MessageSelectorChain.java b/spring-integration-core/src/main/java/org/springframework/integration/selector/MessageSelectorChain.java index ebcd7ea2d1..56ffae7014 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/selector/MessageSelectorChain.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/selector/MessageSelectorChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2014 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. @@ -19,8 +19,8 @@ package org.springframework.integration.selector; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import org.springframework.messaging.Message; import org.springframework.integration.core.MessageSelector; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -28,7 +28,7 @@ import org.springframework.util.Assert; * chain of selectors. Whether the Message is {@link #accept(Message) accepted} * is based upon the tallied results of the individual selectors' responses in * accordance with this chain's {@link VotingStrategy}. - * + * * @author Mark Fisher */ public class MessageSelectorChain implements MessageSelector { @@ -44,6 +44,8 @@ public class MessageSelectorChain implements MessageSelector { /** * Specify the voting strategy for this selector chain. *

    The default is {@link VotingStrategy#ALL}. + * + * @param votingStrategy The voting strategy. */ public void setVotingStrategy(VotingStrategy votingStrategy) { Assert.notNull(votingStrategy, "votingStrategy must not be null"); @@ -52,6 +54,8 @@ public class MessageSelectorChain implements MessageSelector { /** * Add a selector to the end of the chain. + * + * @param selector The message selector. */ public void add(MessageSelector selector) { this.selectors.add(selector); @@ -59,6 +63,9 @@ public class MessageSelectorChain implements MessageSelector { /** * Add a selector to the chain at the specified index. + * + * @param index The index. + * @param selector The message selector. */ public void add(int index, MessageSelector selector) { this.selectors.add(index, selector); @@ -66,6 +73,8 @@ public class MessageSelectorChain implements MessageSelector { /** * Initialize the selector chain. Removes any existing selectors. + * + * @param selectors The message selectors. */ public void setSelectors(List selectors) { Assert.notEmpty(selectors, "selectors must not be empty"); @@ -81,6 +90,7 @@ public class MessageSelectorChain implements MessageSelector { * the individual selectors' responses in accordance with this chain's * {@link VotingStrategy}. */ + @Override public final boolean accept(Message message) { int count = 0; int accepted = 0; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java b/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java index 08cfd698e3..fd68216acb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/selector/PayloadTypeSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2014 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. @@ -19,24 +19,26 @@ package org.springframework.integration.selector; import java.util.ArrayList; import java.util.List; -import org.springframework.messaging.Message; import org.springframework.integration.core.MessageSelector; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** * A {@link MessageSelector} implementation that checks the type of the * {@link Message} payload. The payload type must be assignable to at least one * of the selector's accepted types. - * + * * @author Mark Fisher */ public class PayloadTypeSelector implements MessageSelector { - private List> acceptedTypes = new ArrayList>(); + private final List> acceptedTypes = new ArrayList>(); /** * Create a selector for the provided types. At least one is required. + * + * @param types The types. */ public PayloadTypeSelector(Class... types) { Assert.notEmpty(types, "at least one type is required"); @@ -46,6 +48,7 @@ public class PayloadTypeSelector implements MessageSelector { } + @Override public boolean accept(Message message) { Assert.notNull(message, "'message' must not be null"); Object payload = message.getPayload(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java index 64c51699b6..47186e3481 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/splitter/AbstractMessageSplitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -20,16 +20,16 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHeaders; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHeaders; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; /** * Base class for Message-splitting handlers. - * + * * @author Mark Fisher * @author Dave Syer */ @@ -39,6 +39,8 @@ public abstract class AbstractMessageSplitter extends AbstractReplyProducingMess /** * Set the applySequence flag to the specified value. Defaults to true. + * + * @param applySequence true to apply sequence information. */ public void setApplySequence(boolean applySequence) { this.applySequence = applySequence; @@ -105,6 +107,9 @@ public abstract class AbstractMessageSplitter extends AbstractReplyProducingMess * Array. The individual elements may be Messages, but it is not necessary. If the elements are not Messages, each * will be provided as the payload of a Message. It is also acceptable to return a single Object or Message. In that * case, a single reply Message will be produced. + * + * @param message The message. + * @return The result of splitting the message. */ protected abstract Object splitMessage(Message message); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java b/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java index 0f21565d41..e87faa5574 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/splitter/DefaultMessageSplitter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2014 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. @@ -27,7 +27,7 @@ import org.springframework.messaging.Message; * after receiving an array or Collection. If a value is provided for the * 'delimiters' property, then String payloads will be tokenized based on * those delimiters. - * + * * @author Mark Fisher */ public class DefaultMessageSplitter extends AbstractMessageSplitter { @@ -39,11 +39,14 @@ public class DefaultMessageSplitter extends AbstractMessageSplitter { * Set delimiters to use for tokenizing String values. The default is * null indicating that no tokenization should occur. If * delimiters are provided, they will be applied to any String payload. + * + * @param delimiters The delimiters. */ public void setDelimiters(String delimiters) { this.delimiters = delimiters; } + @Override protected final Object splitMessage(Message message) { Object payload = message.getPayload(); if (payload instanceof String && this.delimiters != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java index 29b5160313..85a0feb399 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractMessageGroupStore.java @@ -1,11 +1,11 @@ /* - * Copyright 2002-2011 the original author or authors. - * + * Copyright 2002-2014 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. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. @@ -18,12 +18,13 @@ import java.util.LinkedHashSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.jmx.export.annotation.ManagedAttribute; /** * @author Dave Syer * @author Oleg Zhurakousky - * + * * @since 2.0 * */ @@ -31,13 +32,10 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It protected final Log logger = LogFactory.getLog(getClass()); - private Collection expiryCallbacks = new LinkedHashSet(); - + private final Collection expiryCallbacks = new LinkedHashSet(); + private volatile boolean timeoutOnIdle; - /** - * - */ public AbstractMessageGroupStore() { super(); } @@ -45,7 +43,7 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It /** * Convenient injection point for expiry callbacks in the message store. Each of the callbacks provided will simply * be registered with the store using {@link #registerMessageGroupExpiryCallback(MessageGroupCallback)}. - * + * * @param expiryCallbacks the expiry callbacks to add */ public void setExpiryCallbacks(Collection expiryCallbacks) { @@ -53,25 +51,29 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It registerMessageGroupExpiryCallback(callback); } } - + public boolean isTimeoutOnIdle() { return timeoutOnIdle; } /** * Allows you to override the rule for the timeout calculation. Typical timeout is based from the time - * the {@link MessageGroup} was created. If you want the timeout to be based on the time + * the {@link MessageGroup} was created. If you want the timeout to be based on the time * the {@link MessageGroup} was idling (e.g., inactive from the last update) invoke this method with 'true'. * Default is 'false'. + * + * @param timeoutOnIdle The boolean. */ public void setTimeoutOnIdle(boolean timeoutOnIdle) { this.timeoutOnIdle = timeoutOnIdle; } + @Override public void registerMessageGroupExpiryCallback(MessageGroupCallback callback) { expiryCallbacks.add(callback); } + @Override public int expireMessageGroups(long timeout) { int count = 0; long threshold = System.currentTimeMillis() - timeout; @@ -81,7 +83,7 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It if (this.isTimeoutOnIdle() && group.getLastModified() > 0) { timestamp = group.getLastModified(); } - + if (timestamp <= threshold) { count++; expire(group); @@ -90,6 +92,7 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It return count; } + @Override @ManagedAttribute public int getMessageCountForAllMessageGroups() { int count = 0; @@ -99,6 +102,7 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It return count; } + @Override @ManagedAttribute public int getMessageGroupCount() { int count = 0; @@ -109,9 +113,9 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It } private void expire(MessageGroup group) { - + RuntimeException exception = null; - + for (MessageGroupCallback callback : expiryCallbacks) { try { callback.execute(this, group); @@ -122,7 +126,7 @@ public abstract class AbstractMessageGroupStore implements MessageGroupStore, It logger.error("Exception in expiry callback", e); } } - + if (exception != null) { throw exception; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroup.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroup.java index ea39dc9b06..2b9811638e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroup.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -33,11 +33,16 @@ public interface MessageGroup { /** * Query if the message can be added. + * + * @param message The message. + * @return true if the message can be added. */ boolean canAdd(Message message); /** * Returns all available Messages from the group at the time of invocation + * + * @return The messages. */ Collection> getMessages(); @@ -47,7 +52,7 @@ public interface MessageGroup { Object getGroupId(); /** - * Returns the sequenceNumber of the last released message. Used in Resequencer use cases only + * @return the sequenceNumber of the last released message. Used in Resequencer use cases only */ int getLastReleasedMessageSequenceNumber(); @@ -57,7 +62,7 @@ public interface MessageGroup { boolean isComplete(); /** - * + * Complete the group. */ void complete(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java index 4ff5ca0172..416a9749c1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -14,8 +14,8 @@ package org.springframework.integration.store; import java.util.Iterator; -import org.springframework.messaging.Message; import org.springframework.jmx.export.annotation.ManagedAttribute; +import org.springframework.messaging.Message; /** * Interface for storage operations on groups of messages linked by a group id. @@ -49,8 +49,10 @@ public interface MessageGroupStore { int getMessageGroupCount(); /** - * Returns the size of this MessageGroup - * @param groupId + * Returns the size of this MessageGroup. + * + * @param groupId The group identifier. + * @return The size. */ @ManagedAttribute int messageGroupSize(Object groupId); @@ -59,37 +61,41 @@ public interface MessageGroupStore { * Return all Messages currently in the MessageStore that were stored using * {@link #addMessageToGroup(Object, Message)} with this group id. * - * @return a group of messages, empty if none exists for this key + * @param groupId The group identifier. + * @return A group of messages, empty if none exists for this key. */ MessageGroup getMessageGroup(Object groupId); /** * Store a message with an association to a group id. This can be used to group messages together. * - * @param groupId the group id to store the message under - * @param message a message + * @param groupId The group id to store the message under. + * @param message A message. + * @return The message group. */ MessageGroup addMessageToGroup(Object groupId, Message message); /** * Persist a deletion on a single message from the group. The group is modified to reflect that 'messageToRemove' is * no longer present in the group. - * @param key the groupId for the group containing the message - * @param messageToRemove the message to be removed + * + * @param key The groupId for the group containing the message. + * @param messageToRemove The message to be removed. + * @return The message Group. */ MessageGroup removeMessageFromGroup(Object key, Message messageToRemove); /** * Remove the message group with this id. * - * @param groupId the id of the group to remove + * @param groupId The id of the group to remove. */ void removeMessageGroup(Object groupId); /** * Register a callback for when a message group is expired through {@link #expireMessageGroups(long)}. * - * @param callback a callback to execute when a message group is cleaned up + * @param callback A callback to execute when a message group is cleaned up. */ void registerMessageGroupExpiryCallback(MessageGroupCallback callback); @@ -108,12 +114,14 @@ public interface MessageGroupStore { /** * Allows you to set the sequence number of the last released Message. Used for Resequencing use cases - * @param sequenceNumber + * + * @param groupId The group identifier. + * @param sequenceNumber The sequence number. */ void setLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber); /** - * Returns the iterator of currently accumulated {@link MessageGroup}s + * @return The iterator of currently accumulated {@link MessageGroup}s. */ Iterator iterator(); @@ -121,6 +129,9 @@ public interface MessageGroupStore { /** * Polls Message from this {@link MessageGroup} (in FIFO style if supported by the implementation) * while also removing the polled {@link Message} + * + * @param groupId The group identifier. + * @return The message. */ Message pollMessageFromGroup(Object groupId); @@ -128,6 +139,8 @@ public interface MessageGroupStore { * Completes this MessageGroup. Completion of the MessageGroup generally means * that this group should not be allowing any more mutating operation to be performed on it. * For example any attempt to add/remove new Message form the group should not be allowed. + * + * @param groupId The group identifier. */ void completeGroup(Object groupId); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStore.java index f6ddf67ac2..9a0d1c11a8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2014 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. @@ -18,22 +18,23 @@ package org.springframework.integration.store; import java.util.UUID; -import org.springframework.messaging.Message; import org.springframework.jmx.export.annotation.ManagedAttribute; +import org.springframework.messaging.Message; /** * Strategy interface for storing and retrieving messages. - * + * * @author Mark Fisher * @author Iwein Fuld * @author Dave Syer - * + * * @since 2.0 */ public interface MessageStore { /** - * Return the Message with the given id, or null if no Message with that id exists in the MessageStore. + * @param id The message identifier. + * @return The Message with the given id, or null if no Message with that id exists in the MessageStore. */ Message getMessage(UUID id); @@ -42,22 +43,27 @@ public interface MessageStore { * does then the return value can be different than the input. The id of the return value will be used as an index * so that the {@link #getMessage(UUID)} and {@link #removeMessage(UUID)} behave properly. Since messages are * immutable, putting the same message more than once is a no-op. - * - * @return the message that was stored + * + * @param message The message. + * @param The payload type. + * @return The message that was stored. */ Message addMessage(Message message); /** * Remove the Message with the given id from the MessageStore, if present, and return it. If no Message with that id * is present in the store, this will return null. + * + * @param id THe message identifier. + * @return The message. */ Message removeMessage(UUID id); /** * Optional attribute giving the number of messages in the store. Implementations may decline to respond by throwing * an exception. - * - * @return the number of messages + * + * @return The number of messages. * @throws UnsupportedOperationException if not implemented */ @ManagedAttribute diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStoreException.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStoreException.java index 6e8db54891..23c2aa24fb 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStoreException.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageStoreException.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 the original author or authors + * Copyright 2007-2014 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. @@ -21,7 +21,7 @@ import org.springframework.messaging.MessagingException; /** * Exception for problems that occur when using a {@link MessageStore} implementation. - * + * * @author Oleg Zhurakousky * @since 2.1 */ @@ -30,47 +30,47 @@ public class MessageStoreException extends MessagingException { private static final long serialVersionUID = 1L; /** - * @param message + * @param message The message. */ public MessageStoreException(Message message) { super(message); } /** - * @param description + * @param description The description. */ public MessageStoreException(String description) { super(description); } /** - * @param description - * @param cause + * @param description The description. + * @param cause The cause. */ public MessageStoreException(String description, Throwable cause) { super(description, cause); } /** - * @param message - * @param description + * @param message The message. + * @param description The description. */ public MessageStoreException(Message message, String description) { super(message, description); } /** - * @param message - * @param cause + * @param message The message. + * @param cause The cause. */ public MessageStoreException(Message message, Throwable cause) { super(message, cause); } /** - * @param message - * @param description - * @param cause + * @param message The message. + * @param description The description. + * @param cause The cause. */ public MessageStoreException(Message message, String description, Throwable cause) { super(message, description, cause); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java index f248004bdd..935e977e04 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -21,13 +21,13 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.locks.Lock; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.integration.util.DefaultLockRegistry; import org.springframework.integration.util.LockRegistry; import org.springframework.integration.util.UpperBound; import org.springframework.jmx.export.annotation.ManagedAttribute; import org.springframework.jmx.export.annotation.ManagedResource; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; @@ -64,6 +64,9 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes * {@link #addMessage(Message)} and to those stored via {@link #addMessageToGroup(Object, Message)}. In both cases * the capacity applies to the number of messages that can be stored, and once that limit is reached attempting to * store another will result in an exception. + * + * @param individualCapacity The message capacity. + * @param groupCapacity The capacity of each group. */ public SimpleMessageStore(int individualCapacity, int groupCapacity) { this(individualCapacity, groupCapacity, new DefaultLockRegistry()); @@ -73,6 +76,10 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes * See {@link #SimpleMessageStore(int, int)}. * Also allows the provision of a custom {@link LockRegistry} * rather than using the default. + * + * @param individualCapacity The message capacity. + * @param groupCapacity The capacity of each group. + * @param lockRegistry The lock registry. */ public SimpleMessageStore(int individualCapacity, int groupCapacity, LockRegistry lockRegistry) { Assert.notNull(lockRegistry, "The LockRegistry cannot be null"); @@ -85,6 +92,8 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes /** * Creates a SimpleMessageStore with the same capacity for individual and grouped messages. + * + * @param capacity The capacity. */ public SimpleMessageStore(int capacity) { this(capacity, capacity); @@ -103,11 +112,13 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes this.lockRegistry = lockRegistry; } + @Override @ManagedAttribute public long getMessageCount() { return idToMessage.size(); } + @Override public Message addMessage(Message message) { this.isUsed = true; if (!individualUpperBound.tryAcquire(0)) { @@ -118,19 +129,23 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes return message; } + @Override public Message getMessage(UUID key) { return (key != null) ? this.idToMessage.get(key) : null; } + @Override public Message removeMessage(UUID key) { if (key != null) { individualUpperBound.release(); return this.idToMessage.remove(key); } - else + else { return null; + } } + @Override public MessageGroup getMessageGroup(Object groupId) { Assert.notNull(groupId, "'groupId' must not be null"); @@ -143,6 +158,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes return simpleMessageGroup; } + @Override public MessageGroup addMessageToGroup(Object groupId, Message message) { if (!groupUpperBound.tryAcquire(0)) { throw new MessagingException(this.getClass().getSimpleName() @@ -171,6 +187,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes } } + @Override public void removeMessageGroup(Object groupId) { Lock lock = this.lockRegistry.obtain(groupId); try { @@ -193,6 +210,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes } } + @Override public MessageGroup removeMessageFromGroup(Object groupId, Message messageToRemove) { Lock lock = this.lockRegistry.obtain(groupId); try { @@ -215,10 +233,12 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes } } + @Override public Iterator iterator() { return new HashSet(groupIdToMessageGroup.values()).iterator(); } + @Override public void setLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) { Lock lock = this.lockRegistry.obtain(groupId); try { @@ -240,6 +260,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes } } + @Override public void completeGroup(Object groupId) { Lock lock = this.lockRegistry.obtain(groupId); try { @@ -261,6 +282,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes } } + @Override public Message pollMessageFromGroup(Object groupId) { Collection> messageList = this.getMessageGroup(groupId).getMessages(); Message message = null; @@ -273,6 +295,7 @@ public class SimpleMessageStore extends AbstractMessageGroupStore implements Mes return message; } + @Override public int messageGroupSize(Object groupId) { return this.getMessageGroup(groupId).size(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java b/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java index 9599d409af..257e6c06d9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -24,11 +24,11 @@ import java.util.List; import java.util.Map; import org.springframework.integration.IntegrationMessageHeaderAccessor; -import org.springframework.messaging.support.GenericMessage; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHeaders; import org.springframework.messaging.support.ErrorMessage; +import org.springframework.messaging.support.GenericMessage; import org.springframework.util.Assert; /** @@ -65,6 +65,8 @@ public final class MessageBuilder { * provided message. The payload of the provided Message will also be used as the payload for the new message. * * @param message the Message from which the payload and all headers will be copied + * @param The type of the payload. + * @return A MessageBuilder. */ public static MessageBuilder fromMessage(Message message) { Assert.notNull(message, "message must not be null"); @@ -76,6 +78,8 @@ public final class MessageBuilder { * Create a builder for a new {@link Message} instance with the provided payload. * * @param payload the payload for the new message + * @param The type of the payload. + * @return A MessageBuilder. */ public static MessageBuilder withPayload(T payload) { MessageBuilder builder = new MessageBuilder(payload, null); @@ -84,6 +88,10 @@ public final class MessageBuilder { /** * Set the value for the given header name. If the provided value is null, the header will be removed. + * + * @param headerName The header name. + * @param headerValue The header value. + * @return this MessageBuilder. */ public MessageBuilder setHeader(String headerName, Object headerValue) { this.headerAccessor.setHeader(headerName, headerValue); @@ -92,6 +100,10 @@ public final class MessageBuilder { /** * Set the value for the given header name only if the header name is not already associated with a value. + * + * @param headerName The header name. + * @param headerValue The header value. + * @return this MessageBuilder. */ public MessageBuilder setHeaderIfAbsent(String headerName, Object headerValue) { this.headerAccessor.setHeaderIfAbsent(headerName, headerValue); @@ -103,7 +115,8 @@ public final class MessageBuilder { * may contain simple matching patterns for header names. Supported pattern styles are: * "xxx*", "*xxx", "*xxx*" and "xxx*yyy". * - * @param headerPatterns + * @param headerPatterns The header patterns. + * @return this MessageBuilder. */ public MessageBuilder removeHeaders(String... headerPatterns) { this.headerAccessor.removeHeaders(headerPatterns); @@ -111,6 +124,8 @@ public final class MessageBuilder { } /** * Remove the value for the given header name. + * @param headerName The header name. + * @return this MessageBuilder. */ public MessageBuilder removeHeader(String headerName) { this.headerAccessor.removeHeader(headerName); @@ -122,6 +137,9 @@ public final class MessageBuilder { * {@link #copyHeadersIfAbsent(Map)} to avoid overwriting values. Note that the 'id' and 'timestamp' header values * will never be overwritten. * + * @param headersToCopy The headers to copy. + * @return this MessageBuilder. + * * @see MessageHeaders#ID * @see MessageHeaders#TIMESTAMP */ @@ -132,6 +150,9 @@ public final class MessageBuilder { /** * Copy the name-value pairs from the provided Map. This operation will not overwrite any existing values. + * + * @param headersToCopy The headers to copy. + * @return this MessageBuilder. */ public MessageBuilder copyHeadersIfAbsent(Map headersToCopy) { this.headerAccessor.copyHeadersIfAbsent(headersToCopy); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java index b7f8021a86..1a9b1dc00c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/converter/MapMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -41,7 +41,8 @@ public class MapMessageConverter implements MessageConverter { * Headers to be converted in {@link #fromMessage(Message, Class)}. * {@link #toMessage(Object, MessageHeaders)} will populate all headers found in * the map, unless {@link #filterHeadersInToMessage} is true. - * @param headerNames + * + * @param headerNames The header names. */ public void setHeaderNames(String... headerNames) { this.headerNames = headerNames; @@ -52,7 +53,8 @@ public class MapMessageConverter implements MessageConverter { * will be mapped. Set this property * to 'true' if you wish to limit the inbound headers to those in * the #headerNames. - * @param filterHeadersInToMessage + * + * @param filterHeadersInToMessage true if the headers should be filtered. */ public void setFilterHeadersInToMessage(boolean filterHeadersInToMessage) { this.filterHeadersInToMessage = filterHeadersInToMessage; @@ -73,11 +75,6 @@ public class MapMessageConverter implements MessageConverter { headers.keySet().retainAll(Arrays.asList(this.headerNames)); } messageBuilder.copyHeaders(headers); - /*for (Entry entry : headers.entrySet()) { - if (this.filterHeadersInToMessage ? this.headerNames.contains(entry.getKey()) : true) { - messageBuilder.setHeader(entry.getKey(), entry.getValue()); - } - }*/ } Message convertedMessage = messageBuilder.build(); return convertedMessage; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java index 159f346199..be1ad93712 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/IntegrationResourceHolder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -49,8 +49,8 @@ public class IntegrationResourceHolder implements ResourceHolder { /** * Adds attribute to this {@link ResourceHolder} instance * - * @param key - * @param value + * @param key The key. + * @param value The value. */ public void addAttribute(String key, Object value){ this.attributes.put(key, value); @@ -66,12 +66,15 @@ public class IntegrationResourceHolder implements ResourceHolder { return Collections.unmodifiableMap(attributes); } + @Override public void reset() { } + @Override public void unbound() { } + @Override public boolean isVoid() { return false; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/AbstractTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/AbstractTransformer.java index 0babd6d07b..243b33bdae 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/AbstractTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/AbstractTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2014 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. @@ -16,18 +16,19 @@ package org.springframework.integration.transformer; -import org.springframework.messaging.Message; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; /** * A base class for {@link Transformer} implementations. - * + * * @author Mark Fisher * @author Oleg Zhurakousky */ public abstract class AbstractTransformer extends IntegrationObjectSupport implements Transformer { + @Override public final Message transform(Message message) { try { Object result = this.doTransform(message); @@ -50,6 +51,10 @@ public abstract class AbstractTransformer extends IntegrationObjectSupport imple * logic. If the return value is itself a Message, it will be used as the * result. Otherwise, any non-null return value will be used as the payload * of the result Message. + * + * @param message The message. + * @return The result of the transformation. + * @throws Exception Any exception. */ protected abstract Object doTransform(Message message) throws Exception; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckInTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckInTransformer.java index 08cc794391..abe210da58 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckInTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckInTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -16,15 +16,15 @@ package org.springframework.integration.transformer; -import org.springframework.messaging.Message; import org.springframework.integration.store.MessageStore; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** * Transformer that stores a Message and returns a new Message whose payload * is the id of the stored Message. - * + * * @author Mark Fisher * @since 2.0 */ @@ -35,6 +35,8 @@ public class ClaimCheckInTransformer extends AbstractTransformer { /** * Create a claim check-in transformer that will delegate to the provided MessageStore. + * + * @param messageStore The message store. */ public ClaimCheckInTransformer(MessageStore messageStore) { Assert.notNull(messageStore, "MessageStore must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckOutTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckOutTransformer.java index bcb0ce421d..8597ea5b8a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckOutTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckOutTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -18,16 +18,16 @@ package org.springframework.integration.transformer; import java.util.UUID; -import org.springframework.messaging.Message; import org.springframework.integration.store.MessageStore; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** * Transformer that accepts a Message whose payload is a UUID and retrieves the Message associated * with that id from a MessageStore if available. An Exception will be thrown if no Message with * that ID can be retrieved from the given MessageStore. - * + * * @author Mark Fisher * @author Oleg Zhurakousky * @author Nick Spacek @@ -42,12 +42,14 @@ public class ClaimCheckOutTransformer extends AbstractTransformer { /** * Create a claim check-out transformer that will delegate to the provided MessageStore. + * + * @param messageStore The message store. */ public ClaimCheckOutTransformer(MessageStore messageStore) { Assert.notNull(messageStore, "MessageStore must not be null"); this.messageStore = messageStore; } - + public void setRemoveMessage(boolean removeMessage) { this.removeMessage = removeMessage; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java index b0539cdc08..dffa01255b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -26,15 +26,15 @@ import org.springframework.expression.Expression; import org.springframework.expression.spel.SpelParserConfiguration; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.expression.IntegrationEvaluationContextAware; import org.springframework.integration.gateway.MessagingGatewaySupport; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.transformer.support.HeaderValueMessageProcessor; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHandlingException; import org.springframework.util.Assert; import org.springframework.util.ReflectionUtils; @@ -80,6 +80,8 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler implem * Provide the map of expressions to evaluate when enriching the target payload. * The keys should simply be property names, and the values should be Expressions * that will evaluate against the reply Message as the root object. + * + * @param propertyExpressions The property expressions. */ public void setPropertyExpressions(Map propertyExpressions) { Assert.notEmpty(propertyExpressions, "propertyExpressions must not be empty"); @@ -99,6 +101,8 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler implem * the target MessageHeaders. * The keys should simply be header names, and the values should be Expressions * that will evaluate against the reply Message as the root object. + * + * @param headerExpressions The header expressions. */ public void setHeaderExpressions(Map> headerExpressions) { Assert.notEmpty(headerExpressions, "headerExpressions must not be empty"); @@ -112,6 +116,8 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler implem * Gateway will be initialized. Setting a request channel is optional. * Not setting a request channel is useful in situations where * message payloads shall be enriched with static values only. + * + * @param requestChannel The request channel. */ public void setRequestChannel(MessageChannel requestChannel) { this.requestChannel = requestChannel; @@ -121,6 +127,8 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler implem * Sets the content enricher's reply channel. If not specified, yet the request * channel is set, an anonymous reply channel will automatically created * for each request. + * + * @param replyChannel The reply channel. */ public void setReplyChannel(MessageChannel replyChannel) { this.replyChannel = replyChannel; @@ -171,6 +179,8 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler implem * If more sophisticated logic is required (e.g. changing the message * headers etc.) please use additional downstream transformers. * + * @param requestPayloadExpression The request payload expression. + * */ public void setRequestPayloadExpression(Expression requestPayloadExpression) { this.requestPayloadExpression = requestPayloadExpression; @@ -179,6 +189,8 @@ public class ContentEnricher extends AbstractReplyProducingMessageHandler implem /** * Specify whether to clone payload objects to create the target object. * This is only applicable for payload types that implement Cloneable. + * + * @param shouldClonePayload true if the payload should be cloned. */ public void setShouldClonePayload(boolean shouldClonePayload) { this.shouldClonePayload = shouldClonePayload; 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 31d5f1b041..a3ea6f849f 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -60,6 +60,8 @@ public class HeaderEnricher implements Transformer, BeanNameAware, InitializingB /** * Create a HeaderEnricher with the given map of headers. + * + * @param headersToAdd The headers to add. */ public HeaderEnricher(Map> headersToAdd) { this.headersToAdd = (headersToAdd != null) ? headersToAdd @@ -80,11 +82,14 @@ public class HeaderEnricher implements Transformer, BeanNameAware, InitializingB * true. Set this to false if a * null value should trigger removal of the * corresponding header instead. + * + * @param shouldSkipNulls true when null values should be skipped. */ public void setShouldSkipNulls(boolean shouldSkipNulls) { this.shouldSkipNulls = shouldSkipNulls; } + @Override public Message transform(Message message) { try { Map headerMap = new HashMap(message.getHeaders()); @@ -147,6 +152,7 @@ public class HeaderEnricher implements Transformer, BeanNameAware, InitializingB * org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang * .String) */ + @Override public void setBeanName(String beanName) { this.beanName = beanName; @@ -158,6 +164,7 @@ public class HeaderEnricher implements Transformer, BeanNameAware, InitializingB * @see * org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ + @Override public void afterPropertiesSet() throws Exception { boolean shouldOverwrite = this.defaultOverwrite; for (HeaderValueMessageProcessor processor : this.headersToAdd.values()) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java index c71be91220..e88a943965 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -45,7 +45,7 @@ public class MapToObjectTransformer extends AbstractPayloadTransformer private final String targetBeanName; /** - * @param targetClass + * @param targetClass The target class. */ public MapToObjectTransformer(Class targetClass) { Assert.notNull(targetClass, "targetClass must not be null"); @@ -54,7 +54,7 @@ public class MapToObjectTransformer extends AbstractPayloadTransformer } /** - * @param beanName + * @param beanName The bean name. */ public MapToObjectTransformer(String beanName) { Assert.hasText(beanName, "beanName must not be empty"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java index caacdadc6d..d338d05725 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -39,6 +39,8 @@ public class MessageTransformingHandler extends AbstractReplyProducingMessageHan /** * Create a {@link MessageTransformingHandler} instance that delegates to * the provided {@link Transformer}. + * + * @param transformer The transformer. */ public MessageTransformingHandler(Transformer transformer) { Assert.notNull(transformer, "transformer must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/DefaultLockRegistry.java b/spring-integration-core/src/main/java/org/springframework/integration/util/DefaultLockRegistry.java index eff7151b37..b0bb43fc63 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/DefaultLockRegistry.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/DefaultLockRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -52,8 +52,7 @@ public final class DefaultLockRegistry implements LockRegistry { *

  • 0x3ff (1023) - 1024 locks
  • *
  • 0xfff (4095) - 4096 locks
  • * - *

    - * @param mask + * @param mask The bit mask. */ public DefaultLockRegistry(int mask){ String bits = Integer.toBinaryString(mask); @@ -71,6 +70,7 @@ public final class DefaultLockRegistry implements LockRegistry { * the mask and using the result as an index to the lock table. * @param lockKey the object used to derive the lock index. */ + @Override public Lock obtain(Object lockKey) { Assert.notNull(lockKey, "'lockKey' must not be null"); Integer lockIndex = lockKey.hashCode() & this.mask; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java b/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java index f65376d573..8812c2ecf7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/UpperBound.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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,11 +35,13 @@ public final class UpperBound { /** * Create an UpperBound with the given capacity. If the given capacity is less than 1 * an infinite UpperBound is created. + * + * @param capacity The capacity. */ public UpperBound(int capacity) { this.semaphore = (capacity > 0) ? new Semaphore(capacity, true) : null; } - + public int availablePermits(){ if (semaphore == null){ return Integer.MAX_VALUE; @@ -52,6 +54,9 @@ public final class UpperBound { * Acquires a permit from the underlying semaphore if this UpperBound is bounded and returns * true if it succeeds within the given timeout. If the timeout is less than 0, it will block * indefinitely. + * + * @param timeoutInMilliseconds The time to wait until a permit is available. + * @return true if a permit is aquired. */ public boolean tryAcquire(long timeoutInMilliseconds) { if (this.semaphore != null) { @@ -83,6 +88,8 @@ public final class UpperBound { /** * Releases several locks on the underlying semaphore. This is typically not done by the same Thread * that acquired the lock, but by the thread that picked up the message. + * + * @param permits The number of permits to release. */ public void release(int permits) { if (this.semaphore != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java index 348c4df167..2c0bf817dc 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/WhileLockedProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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,8 +58,9 @@ public abstract class WhileLockedProcessor { /** * Override this method to provide the behavior that needs to be executed - * while under lock - * @throws IOException + * while under the lock. + * + * @throws IOException Any IOException. */ protected abstract void whileLocked() throws IOException; } diff --git a/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java b/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java index 8c3942eb8a..320d528ea1 100644 --- a/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java +++ b/spring-integration-event/src/main/java/org/springframework/integration/event/inbound/ApplicationEventListeningMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,6 +66,8 @@ public class ApplicationEventListeningMessageProducer extends ExpressionMessageP * with the {@link ApplicationEventMulticaster} which clears the listener cache. The cache will be * refreshed on the next appropriate {@link ApplicationEvent}. * + * @param eventTypes The event types. + * * @see ApplicationEventMulticaster#addApplicationListener * @see #supportsEventType */ diff --git a/spring-integration-feed/src/main/java/org/springframework/integration/feed/inbound/FeedEntryMessageSource.java b/spring-integration-feed/src/main/java/org/springframework/integration/feed/inbound/FeedEntryMessageSource.java index cdcd28c2c1..d57a00d43f 100644 --- a/spring-integration-feed/src/main/java/org/springframework/integration/feed/inbound/FeedEntryMessageSource.java +++ b/spring-integration-feed/src/main/java/org/springframework/integration/feed/inbound/FeedEntryMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,14 +25,14 @@ import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import org.springframework.beans.factory.BeanFactory; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.integration.context.IntegrationContextUtils; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.core.MessageSource; import org.springframework.integration.metadata.MetadataStore; import org.springframework.integration.metadata.SimpleMetadataStore; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -82,6 +82,9 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements * Creates a FeedEntryMessageSource that will use a HttpURLFeedFetcher to read feeds from the given URL. * If the feed URL has a protocol other than http*, consider providing a custom implementation of the * {@link FeedFetcher} via the alternate constructor. + * + * @param feedUrl The URL. + * @param metadataKey The metadata key. */ public FeedEntryMessageSource(URL feedUrl, String metadataKey) { this(feedUrl, metadataKey, new HttpURLFeedFetcher(HashMapFeedInfoCache.getInstance())); @@ -89,6 +92,10 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements /** * Creates a FeedEntryMessageSource that will use the provided FeedFetcher to read from the given feed URL. + * + * @param feedUrl The URL. + * @param metadataKey The metadata key. + * @param feedFetcher The feed fetcher. */ public FeedEntryMessageSource(URL feedUrl, String metadataKey, FeedFetcher feedFetcher) { Assert.notNull(feedUrl, "feedUrl must not be null"); @@ -110,6 +117,7 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements return "feed:inbound-channel-adapter"; } + @Override public Message receive() { Assert.isTrue(this.initialized, "'FeedEntryReaderMessageSource' must be initialized before it can produce Messages."); SyndEntry entry = doReceive(); @@ -218,6 +226,7 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements private static class SyndEntryPublishedDateComparator implements Comparator { + @Override public int compare(SyndEntry entry1, SyndEntry entry2) { Date date1 = getLastModifiedDate(entry1); Date date2 = getLastModifiedDate(entry2); @@ -238,6 +247,7 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements /** * @see com.sun.syndication.fetcher.FetcherListener#fetcherEvent(com.sun.syndication.fetcher.FetcherEvent) */ + @Override public void fetcherEvent(final FetcherEvent event) { String eventType = event.getEventType(); if (FetcherEvent.EVENT_TYPE_FEED_POLLED.equals(eventType)) { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/DefaultFileNameGenerator.java b/spring-integration-file/src/main/java/org/springframework/integration/file/DefaultFileNameGenerator.java index d839ce0ead..4a33eacffe 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/DefaultFileNameGenerator.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/DefaultFileNameGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -52,6 +52,8 @@ public class DefaultFileNameGenerator extends AbstractExpressionEvaluator implem /** * Specify an expression to be evaluated against the Message * in order to generate a file name. + * + * @param expression The expression. */ public void setExpression(String expression) { Assert.hasText(expression, "expression must not be empty"); @@ -61,6 +63,8 @@ public class DefaultFileNameGenerator extends AbstractExpressionEvaluator implem /** * Specify a custom header name to check for the file name. * The default is defined by {@link FileHeaders#FILENAME}. + * + * @param headerName The header name. */ public void setHeaderName(String headerName) { Assert.notNull(headerName, "'headerName' must not be null"); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileLocker.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileLocker.java index 06b02a358f..c2fc25ea5f 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileLocker.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileLocker.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -26,7 +26,7 @@ import java.io.File; * * If a filter that respects locks is required extend * {@link org.springframework.integration.file.locking.AbstractFileLockerFilter} instead. - * + * * @author Iwein Fuld * @since 2.0 */ @@ -37,12 +37,14 @@ public interface FileLocker { * successful, false otherwise. * * @param fileToLock the file that should be locked according to this locker + * @return true if successful. */ boolean lock(File fileToLock); /** * Checks whether the file passed in can be locked by this locker. This method never changes the locked state. * + * @param file The file. * @return true if the file was locked by another locker than this locker */ boolean isLockable(File file); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java index 8a7e0286ea..a5f9f8d99a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileWritingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,8 +34,6 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.file.support.FileExistsMode; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; @@ -44,7 +42,9 @@ import org.springframework.integration.util.DefaultLockRegistry; import org.springframework.integration.util.LockRegistry; import org.springframework.integration.util.PassThruLockRegistry; import org.springframework.integration.util.WhileLockedProcessor; +import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.MessageHandlingException; import org.springframework.util.Assert; import org.springframework.util.FileCopyUtils; import org.springframework.util.StringUtils; @@ -132,6 +132,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand * true. If set to false and the * destination directory does not exist, an Exception will be thrown upon * initialization. + * + * @param autoCreateDirectory true to create the directory if needed. */ public void setAutoCreateDirectory(boolean autoCreateDirectory) { this.autoCreateDirectory = autoCreateDirectory; @@ -142,7 +144,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand * appear in the file system with an additional suffix, which by default is * ".writing". This can be changed by setting this property. * - * @param temporaryFileSuffix + * @param temporaryFileSuffix The temporary file suffix. */ public void setTemporaryFileSuffix(String temporaryFileSuffix) { Assert.notNull(temporaryFileSuffix, "'temporaryFileSuffix' must not be null"); // empty string is OK @@ -181,6 +183,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand /** * Specify whether a reply Message is expected. If not, this handler will simply return null for a * successful response or throw an Exception for a non-successful response. The default is true. + * + * @param expectReply true if a reply is expected. */ public void setExpectReply(boolean expectReply) { this.expectReply = expectReply; @@ -193,6 +197,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand /** * Provide the {@link FileNameGenerator} strategy to use when generating * the destination file's name. + * + * @param fileNameGenerator The file name generator. */ public void setFileNameGenerator(FileNameGenerator fileNameGenerator) { Assert.notNull(fileNameGenerator, "FileNameGenerator must not be null"); @@ -206,6 +212,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand * will only have an effect if the inbound Message has a File payload or * a {@link FileHeaders#ORIGINAL_FILE} header value containing either a * File instance or a String representing the original file path. + * + * @param deleteSourceFiles true to delete the source files. */ public void setDeleteSourceFiles(boolean deleteSourceFiles) { this.deleteSourceFiles = deleteSourceFiles; @@ -214,6 +222,8 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand /** * Set the charset name to use when writing a File from a String-based * Message payload. + * + * @param charset The charset. */ public void setCharset(String charset) { Assert.notNull(charset, "charset must not be null"); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/AbstractFilePayloadTransformerParser.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/AbstractFilePayloadTransformerParser.java index 74f9383589..041724ad8e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/AbstractFilePayloadTransformerParser.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/AbstractFilePayloadTransformerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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,7 +25,7 @@ import org.springframework.util.StringUtils; /** * Base class for File payload transformer parsers. - * + * * @author Mark Fisher */ public abstract class AbstractFilePayloadTransformerParser extends AbstractTransformerParser { @@ -41,6 +41,10 @@ public abstract class AbstractFilePayloadTransformerParser extends AbstractTrans /** * Subclasses may override this method to provide additional configuration. + * + * @param element The element. + * @param parserContext The parser context. + * @param builder The builder. */ protected void postProcessTransformer(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractFileListFilter.java index 46a89e7417..0e58abd00c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -32,7 +32,8 @@ public abstract class AbstractFileListFilter implements FileListFilter { /** * {@inheritDoc} */ - public final List filterFiles(F[] files) { + @Override + public final List filterFiles(F[] files) { List accepted = new ArrayList(); if (files != null) { for (F file : files) { @@ -46,6 +47,9 @@ public abstract class AbstractFileListFilter implements FileListFilter { /** * Subclasses must implement this method. + * + * @param file The file. + * @return true if the file passes the filter. */ protected abstract boolean accept(F file); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java index 15514c9e18..953576100b 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractRegexPatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -52,6 +52,7 @@ public abstract class AbstractRegexPatternFileListFilter extends AbstractFile this.pattern = Pattern.compile(pattern); } + @Override public void afterPropertiesSet() throws Exception { Assert.notNull(this.pattern, "'pattern' must not be null!"); } @@ -62,7 +63,10 @@ public abstract class AbstractRegexPatternFileListFilter extends AbstractFile } /** - * Subclasses must implement this method to extract the file's name. + * Subclasses must implement this method to extract the file's name. + * + * @param file The file. + * @return The file name. */ protected abstract String getFilename(F file); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java index 0fdccc848f..4c23e5c842 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractSimplePatternFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -50,7 +50,10 @@ public abstract class AbstractSimplePatternFileListFilter extends AbstractFil } /** - * Subclasses must implement this method to extract the file's name. + * Subclasses must implement this method to extract the file's name. + * + * @param file The file. + * @return The file name. */ protected abstract String getFilename(F file); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java index 6a8da438a6..342302e92a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AcceptAllFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -23,7 +23,8 @@ package org.springframework.integration.file.filters; * * @author Iwein Fuld * @author Josh Long - * @param + * + * @param The type that will be filtered. */ public class AcceptAllFileListFilter extends AbstractFileListFilter { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/CompositeFileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/CompositeFileListFilter.java index 1b5f33549d..235dfab23c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/CompositeFileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/CompositeFileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -33,7 +33,8 @@ import org.springframework.util.Assert; * * @author Iwein Fuld * @author Josh Long - * @param + * + * @param The type that will be filtered. */ public class CompositeFileListFilter implements FileListFilter { @@ -87,6 +88,7 @@ public class CompositeFileListFilter implements FileListFilter { } + @Override public List filterFiles(F[] files) { Assert.notNull(files, "'files' should not be null"); List results = new ArrayList(Arrays.asList(files)); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java index d2daa85666..d52dd601b2 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -32,6 +32,9 @@ public interface FileListFilter { /** * Filters out files and returns the files that are left in a list, or an * empty list when a null is passed in. + * + * @param files The files. + * @return The filtered files. */ List filterFiles(F[] files); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/InputStreamCallback.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/InputStreamCallback.java index 47bf6284af..ee9d68129e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/InputStreamCallback.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/InputStreamCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -33,7 +33,7 @@ public interface InputStreamCallback { * this method exits. * * @param stream The InputStream. - * @throws IOException + * @throws IOException Any IOException. */ void doWithInputStream(InputStream stream) throws IOException; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileOperations.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileOperations.java index c52a5a5f61..4012fd9149 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileOperations.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -31,7 +31,6 @@ public interface RemoteFileOperations { * * @param message The message. * @return The remote path, or null if no local file was found. - * @throws Exception */ String send(Message message); @@ -43,13 +42,13 @@ public interface RemoteFileOperations { * @param message The message. * @param subDirectory The sub directory. * @return The remote path, or null if no local file was found. - * @throws Exception */ - String send(Message message, String subDirectory); + /** * Retrieve a remote file as an InputStream, based on information in a message. * + * @param message The message. * @param callback the callback. * @return true if the operation was successful. */ @@ -76,6 +75,7 @@ public interface RemoteFileOperations { * Reliably closes the session when the method exits. * * @param callback the SessionCallback. + * @param The type returned by {@link SessionCallback#doInSession(org.springframework.integration.file.remote.session.Session)}. * @return The result of the callback method. */ T execute(SessionCallback callback); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileUtils.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileUtils.java index 22f9c23e76..b2826109ad 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileUtils.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -20,6 +20,7 @@ import java.util.LinkedList; import java.util.List; import org.apache.commons.logging.Log; + import org.springframework.integration.file.remote.session.Session; /** @@ -37,7 +38,9 @@ public class RemoteFileUtils { * @param The session type. * @param path The directory path. * @param session The session. - * @throws IOException + * @param remoteFileSeparator The remote file separator. + * @param logger The logger. + * @throws IOException Any IOException. */ public static void makeDirectories(String path, Session session, String remoteFileSeparator, Log logger) throws IOException { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallback.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallback.java index 1970bb2a6d..066d66d8b2 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallback.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -36,7 +36,7 @@ public interface SessionCallback { * * @param session The session. * @return The result of type T. - * @throws IOException + * @throws IOException Any IOException. */ T doInSession(Session session) throws IOException; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallbackWithoutResult.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallbackWithoutResult.java index b13af2c978..590f9f88d8 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallbackWithoutResult.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/SessionCallbackWithoutResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -41,7 +41,7 @@ public abstract class SessionCallbackWithoutResult implements SessionCallback * care of closing the session after this method exits. * * @param session The session. - * @throws IOException + * @throws IOException Any IOException. */ protected abstract void doInSessionWithoutResult(Session session) throws IOException; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java index cb8cea30c0..da14b17b83 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -624,10 +624,14 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply * Copy a remote file to the configured local directory. * * - * @param message - * @param session - * @param remoteDir - *@param remoteFilePath @throws IOException + * @param message The message. + * @param session The session. + * @param remoteDir The remote directory. + * @param remoteFilePath The remote file path. + * @param remoteFilename The remote file name. + * @param lsFirst true to execute an 'ls' command first. + * @return The file. + * @throws IOException Any IOException. */ protected File get(Message message, Session session, String remoteDir, String remoteFilePath, String remoteFilename, boolean lsFirst) throws IOException { @@ -771,7 +775,8 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply } /** - * @param remoteFilePath + * @param remoteFilePath The remote file path. + * @return The remote file name. */ protected String getRemoteFilename(String remoteFilePath) { String remoteFileName; 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 4157fe9933..6a8af5b68c 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -16,8 +16,6 @@ package org.springframework.integration.file.remote.handler; -import java.io.File; - import org.springframework.expression.Expression; import org.springframework.integration.file.FileNameGenerator; import org.springframework.integration.file.remote.RemoteFileTemplate; @@ -72,23 +70,14 @@ public class FileTransferringMessageHandler extends AbstractMessageHandler { return this.remoteFileTemplate.getTemporaryFileSuffix(); } - /** - * @deprecated This property is no longer used; byte[] and String payloads are written directly - */ - @Deprecated - public void setTemporaryDirectory(File temporaryDirectory) { - } - protected boolean isUseTemporaryFileName() { return this.remoteFileTemplate.isUseTemporaryFileName(); } - public void setUseTemporaryFileName(boolean useTemporaryFileName) { this.remoteFileTemplate.setUseTemporaryFileName(useTemporaryFileName); } - public void setFileNameGenerator(FileNameGenerator fileNameGenerator) { this.remoteFileTemplate.setFileNameGenerator(fileNameGenerator); } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java index d28e8762c8..8d41cd11fd 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/CachingSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -51,6 +51,7 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe /** * Create a CachingSessionFactory with an unlimited number of sessions. + * * @param sessionFactory the underlying session factory. */ public CachingSessionFactory(SessionFactory sessionFactory) { @@ -63,8 +64,9 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe * calling threads will block until a session is available. * @see #setSessionWaitTimeout(long) * @see #setPoolSize(int) - * @param sessionFactory the underlying session factory. - * @param sessionCacheSize the maximum cache size. + * + * @param sessionFactory The underlying session factory. + * @param sessionCacheSize The maximum cache size. */ public CachingSessionFactory(SessionFactory sessionFactory, int sessionCacheSize) { this.sessionFactory = sessionFactory; @@ -91,6 +93,7 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe /** * Sets the limit of how long to wait for a session to become available. * + * @param sessionWaitTimeout the session wait timeout. * @throws IllegalStateException if the wait expires prior to a Session becoming available. */ public void setSessionWaitTimeout(long sessionWaitTimeout) { @@ -100,6 +103,8 @@ public class CachingSessionFactory implements SessionFactory, DisposableBe /** * Modify the target session pool size; the actual pool size will adjust up/down * to this size as and when sessions are requested or retrieved. + * + * @param poolSize The pool size. */ public void setPoolSize(int poolSize) { this.pool.setPoolSize(poolSize); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/Session.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/Session.java index 2b9469c74d..de13dc30ea 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/Session.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/Session.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -54,8 +54,9 @@ public interface Session { /** * Retrieve a remote file as a raw {@link InputStream}. - * @param source The path of the remote file + * @param source The path of the remote file. * @return The raw inputStream. + * @throws IOException Any IOException. */ InputStream readRaw(String source) throws IOException; @@ -63,7 +64,7 @@ public interface Session { * Invoke after closing the InputStream from {@link #readRaw(String)}. * Required by some session providers. * @return true if successful. - * @throws IOException + * @throws IOException Any IOException. */ boolean finalizeRaw() throws IOException; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java index 4b243e9c01..7584a09b1e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,6 +98,8 @@ public abstract class AbstractInboundFileSynchronizer implements InboundFileS /** * Create a synchronizer with the {@link SessionFactory} used to acquire {@link Session} instances. + * + * @param sessionFactory The session factory. */ public AbstractInboundFileSynchronizer(SessionFactory sessionFactory) { Assert.notNull(sessionFactory, "sessionFactory must not be null"); @@ -121,6 +123,8 @@ public abstract class AbstractInboundFileSynchronizer implements InboundFileS /** * Specify the full path to the remote directory. + * + * @param remoteDirectory The remote directory. */ public void setRemoteDirectory(String remoteDirectory) { this.remoteDirectory = remoteDirectory; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java index a9d1b3b284..a4482139cb 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -22,8 +22,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.regex.Pattern; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.integration.core.MessageSource; import org.springframework.integration.endpoint.MessageProducerSupport; import org.springframework.integration.file.FileReadingMessageSource; @@ -31,6 +29,8 @@ import org.springframework.integration.file.filters.AcceptOnceFileListFilter; import org.springframework.integration.file.filters.CompositeFileListFilter; import org.springframework.integration.file.filters.FileListFilter; import org.springframework.integration.file.filters.RegexPatternFileListFilter; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -114,7 +114,8 @@ public abstract class AbstractInboundFileSynchronizingMessageSource extends M *

    * The default is an {@link AcceptOnceFileListFilter} which filters duplicate file * names (processed during the current execution). - * @param localFileListFilter + * + * @param localFileListFilter The local file list filter. */ public void setLocalFilter(FileListFilter localFileListFilter) { this.localFileListFilter = localFileListFilter; @@ -154,6 +155,7 @@ public abstract class AbstractInboundFileSynchronizingMessageSource extends M * If the result is null, it attempts to sync up with the remote directory to populate the file source. * Then, it polls the file source again and returns the result, whether or not it is null. */ + @Override public final Message receive() { Assert.state(this.fileSource != null, "fileSource must not be null"); Assert.state(this.synchronizer != null, "synchronizer must not be null"); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/support/FileExistsMode.java b/spring-integration-file/src/main/java/org/springframework/integration/file/support/FileExistsMode.java index b848ebbf97..fd04f0713e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/support/FileExistsMode.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/support/FileExistsMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -54,6 +54,7 @@ public enum FileExistsMode { * {@link IllegalStateException} is thrown. * * @param fileExistsModeAsString Must neither be null nor empty + * @return the enum for the string value. */ public static FileExistsMode getForString(String fileExistsModeAsString) { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java index ca690951df..64c0aaa511 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -21,11 +21,11 @@ import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.core.task.TaskExecutor; -import org.springframework.messaging.Message; import org.springframework.integration.endpoint.MessageProducerSupport; import org.springframework.integration.file.FileHeaders; import org.springframework.integration.file.event.FileIntegrationEvent; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -69,7 +69,7 @@ public abstract class FileTailingMessageProducerSupport extends MessageProducerS /** * A task executor; default is a {@link SimpleAsyncTaskExecutor}. - * @param taskExecutor + * @param taskExecutor The task executor. */ public void setTaskExecutor(TaskExecutor taskExecutor) { Assert.notNull("'taskExecutor' cannot be null"); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java index 611e994d0f..02e1355b05 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/AbstractFilePayloadTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2014 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. @@ -21,16 +21,16 @@ import java.io.File; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.integration.file.FileHeaders; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.transformer.Transformer; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** * Base class for transformers that convert a File payload. - * + * * @author Mark Fisher */ public abstract class AbstractFilePayloadTransformer implements Transformer { @@ -43,11 +43,14 @@ public abstract class AbstractFilePayloadTransformer implements Transformer { /** * Specify whether to delete the File after transformation. * Default is false. + * + * @param deleteFiles true to delete the file. */ public void setDeleteFiles(boolean deleteFiles) { this.deleteFiles = deleteFiles; } + @Override public final Message transform(Message message) { try { Assert.notNull(message, "Message must not be null"); @@ -74,6 +77,10 @@ public abstract class AbstractFilePayloadTransformer implements Transformer { /** * Subclasses must implement this method to transform the File contents. + * + * @param file The file. + * @return The result of the transformation. + * @throws Exception Any Exception. */ protected abstract T transformFile(File file) throws Exception; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java index f86327f661..9caed42133 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/transformer/FileToStringTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -39,6 +39,8 @@ public class FileToStringTransformer extends AbstractFilePayloadTransformer sessionFactory) { super(sessionFactory); diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java index f687328fee..b07d1decae 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/AbstractFtpSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -26,9 +26,9 @@ import org.apache.commons.net.ftp.FTPClientConfig; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; -import org.springframework.messaging.MessagingException; import org.springframework.integration.file.remote.session.Session; import org.springframework.integration.file.remote.session.SessionFactory; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -72,7 +72,7 @@ public abstract class AbstractFtpSessionFactory implements *

  • {@link org.apache.commons.net.ftp.FTP#BINARY_FILE_TYPE} (DEFAULT)
  • *
  • {@link org.apache.commons.net.ftp.FTP#LOCAL_FILE_TYPE}
  • * - * @param fileType + * @param fileType The file type. */ public void setFileType(int fileType) { this.fileType = fileType; @@ -87,7 +87,7 @@ public abstract class AbstractFtpSessionFactory implements Assert.notNull(config); this.config = config; } - + public void setBufferSize(int bufferSize) { this.bufferSize = bufferSize; } @@ -123,14 +123,17 @@ public abstract class AbstractFtpSessionFactory implements * to occur between the client (local) and server and that the server * is in passive mode, requiring the client to connect to the * server's data port to initiate a transfer. + * + * @param clientMode The client mode. */ public void setClientMode(int clientMode) { - Assert.isTrue(clientMode == FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE || - clientMode == FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE, + Assert.isTrue(clientMode == FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE || + clientMode == FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE, "Only local modes are supported. Was: " + clientMode); this.clientMode = clientMode; } + @Override public Session getSession() { try { return new FtpSession(this.createClient()); @@ -140,31 +143,31 @@ public abstract class AbstractFtpSessionFactory implements } } - private T createClient() throws SocketException, IOException { + private T createClient() throws SocketException, IOException { final T client = this.createClientInstance(); Assert.notNull(client, "client must not be null"); client.configure(this.config); Assert.hasText(this.username, "username is required"); - + this.postProcessClientBeforeConnect(client); - + // Connect client.connect(this.host, this.port); - + if (!FTPReply.isPositiveCompletion(client.getReplyCode())) { throw new MessagingException("Connecting to server [" + host + ":" + port + "] failed. Please check the connection."); - } + } logger.debug("Connected to server [" + host + ":" + port + "]"); - + // Login if (!client.login(username, password)) { - throw new IllegalStateException("Login failed. The respponse from the server is: " + + throw new IllegalStateException("Login failed. The respponse from the server is: " + client.getReplyString()); } - + this.postProcessClientAfterConnect(client); - + this.updateClientMode(client); client.setFileType(fileType); client.setBufferSize(bufferSize); @@ -191,14 +194,20 @@ public abstract class AbstractFtpSessionFactory implements protected abstract T createClientInstance(); /** - * Will handle additional initialization after client.connect() method was invoked, - * but before any action on the client has been taken + * Will handle additional initialization after client.connect() method was invoked, + * but before any action on the client has been taken + * + * @param t The client. + * @throws IOException Any IOException */ protected void postProcessClientAfterConnect(T t) throws IOException { // NOOP } /** - * Will handle additional initialization before client.connect() method was invoked. + * Will handle additional initialization before client.connect() method was invoked. + * + * @param client The client. + * @throws IOException Any IOException. */ protected void postProcessClientBeforeConnect(T client) throws IOException { // NOOP diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java index 3bd1921329..ffd7ff0023 100644 --- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java +++ b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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,7 +35,7 @@ import com.gemstone.gemfire.cache.Region; /** * Gemfire implementation of the key/value style {@link MessageStore} and * {@link MessageGroupStore} - * + * * @author Mark Fisher * @author Oleg Zhurakousky * @author David Turanski @@ -55,7 +55,8 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements * Provides the region to be used for the message store. This is useful when * using a configured region. This is also required if using a client region * on a remote cache server. - * @param messageStoreRegion the region + * + * @param messageStoreRegion The region. */ public GemfireMessageStore(Region messageStoreRegion) { cache = null; @@ -64,7 +65,8 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements /** * Provides a cache reference used to create a message store region named * 'messageStoreRegion' - * @param cache + * + * @param cache The cache. */ public GemfireMessageStore(Cache cache) { Assert.notNull(cache, "'cache' must not be null"); @@ -74,18 +76,19 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements public void setIgnoreJta(boolean ignoreJta) { this.ignoreJta = ignoreJta; } - + + @Override @SuppressWarnings("unchecked") public void afterPropertiesSet() { if (this.messageStoreRegion != null) { return; } - + try { if (logger.isDebugEnabled()){ logger.debug("creating message store region as '" + MESSAGE_STORE_REGION_NAME + "'"); } - + RegionAttributesFactoryBean attributesFactoryBean = new RegionAttributesFactoryBean(); attributesFactoryBean.setIgnoreJTA(this.ignoreJta); attributesFactoryBean.afterPropertiesSet(); diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java index f2b2018e81..f83e026d39 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyCommandMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -13,12 +13,15 @@ package org.springframework.integration.groovy; +import groovy.lang.Binding; +import groovy.lang.GString; + import java.util.Map; -import org.springframework.messaging.Message; import org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor; import org.springframework.integration.scripting.DefaultScriptVariableGenerator; import org.springframework.integration.scripting.ScriptVariableGenerator; +import org.springframework.messaging.Message; import org.springframework.scripting.ScriptSource; import org.springframework.scripting.groovy.GroovyObjectCustomizer; import org.springframework.scripting.groovy.GroovyScriptFactory; @@ -26,9 +29,6 @@ import org.springframework.scripting.support.StaticScriptSource; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; -import groovy.lang.Binding; -import groovy.lang.GString; - /** * @author Dave Syer * @author Mark Fisher @@ -53,6 +53,8 @@ public class GroovyCommandMessageProcessor extends AbstractScriptExecutingMessag /** * Creates a {@link GroovyCommandMessageProcessor} that will use the provided {@link ScriptVariableGenerator}. + * + * @param scriptVariableGenerator The variable generator. */ public GroovyCommandMessageProcessor(ScriptVariableGenerator scriptVariableGenerator) { super(scriptVariableGenerator); @@ -63,6 +65,8 @@ public class GroovyCommandMessageProcessor extends AbstractScriptExecutingMessag * and provided {@link Binding}. * Provided 'binding' will be used in the {@link BindingOverwriteGroovyObjectCustomizerDecorator} to overwrite * original Groovy Script 'binding'. + * + * @param binding The binding. */ public GroovyCommandMessageProcessor(Binding binding) { this(); @@ -74,6 +78,9 @@ public class GroovyCommandMessageProcessor extends AbstractScriptExecutingMessag * Creates a {@link GroovyCommandMessageProcessor} that will use the provided {@link ScriptVariableGenerator} and Binding. * Provided 'binding' will be used in the {@link BindingOverwriteGroovyObjectCustomizerDecorator} to overwrite * original Groovy Script 'binding'. + * + * @param binding The binding. + * @param scriptVariableGenerator The variable generator. */ public GroovyCommandMessageProcessor(Binding binding, ScriptVariableGenerator scriptVariableGenerator) { this(scriptVariableGenerator); @@ -83,6 +90,8 @@ public class GroovyCommandMessageProcessor extends AbstractScriptExecutingMessag /** * Sets a {@link GroovyObjectCustomizer} for this processor. + * + * @param customizer The customizer. */ public void setCustomizer(GroovyObjectCustomizer customizer) { this.customizer = customizer; diff --git a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java index fbf370fdc1..b8482910b2 100644 --- a/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java +++ b/spring-integration-groovy/src/main/java/org/springframework/integration/groovy/GroovyScriptExecutingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -68,6 +68,8 @@ public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecuti /** * Create a processor for the given {@link ScriptSource} that will use a * DefaultScriptVariableGenerator. + * + * @param scriptSource The script source. */ public GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource) { super(); @@ -77,6 +79,9 @@ public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecuti /** * Create a processor for the given {@link ScriptSource} that will use the provided * ScriptVariableGenerator. + * + * @param scriptSource The script source. + * @param scriptVariableGenerator The variable generator. */ public GroovyScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptVariableGenerator scriptVariableGenerator) { super(scriptVariableGenerator); @@ -99,6 +104,8 @@ public class GroovyScriptExecutingMessageProcessor extends AbstractScriptExecuti /** * Sets a {@link GroovyObjectCustomizer} for this processor. + * + * @param customizer The customizer. */ public void setCustomizer(GroovyObjectCustomizer customizer) { this.customizerDecorator.setCustomizer(customizer); diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java b/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java index b5dfa47e62..266889c89e 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/converter/MultipartAwareFormHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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,6 +53,8 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver /** * Sets the character set used for writing form data. + * + * @param charset The charset. */ public void setCharset(Charset charset) { this.wrappedConverter.setCharset(charset); @@ -60,6 +62,8 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver /** * Specify the {@link MultipartFileReader} to use when reading {@link MultipartFile} content. + * + * @param multipartFileReader The multipart file reader. */ public void setMultipartFileReader(MultipartFileReader multipartFileReader) { Assert.notNull(multipartFileReader, "multipartFileReader must not be null"); 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 92c46d82ee..059ca4778d 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -81,6 +81,8 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu /** * Specify the view name. + * + * @param viewName The view name. */ public void setViewName(String viewName) { Assert.isTrue(StringUtils.hasText(viewName), "View name must contain text"); @@ -91,6 +93,8 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu * Specify the key to be used when adding the reply Message or payload to the core map (will be payload only unless * the value of {@link HttpRequestHandlingController#setExtractReplyPayload(boolean)} is false). The * default key is "reply". + * + * @param replyKey The reply key. */ public void setReplyKey(String replyKey) { this.replyKey = (replyKey != null) ? replyKey : DEFAULT_REPLY_KEY; @@ -99,7 +103,8 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu /** * The key used to expose {@link Errors} in the core, in the case that message handling fails. Defaults to * "errors". - * @param errorsKey the key value to set + * + * @param errorsKey The key value to set. */ public void setErrorsKey(String errorsKey) { this.errorsKey = errorsKey; @@ -111,7 +116,7 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu * The default value is spring.integration.http.handler.error. Three arguments are provided: the * exception, its message and its stack trace as a String. * - * @param errorCode the error code to set + * @param errorCode The error code to set. */ public void setErrorCode(String errorCode) { this.errorCode = errorCode; @@ -120,6 +125,8 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu /** * Specifies a SpEL expression to evaluate in order to generate the view name. * The EvaluationContext will be populated with the reply message as the root object, + * + * @param viewExpression The view expression. */ public void setViewExpression(Expression viewExpression) { this.viewExpression = viewExpression; @@ -135,6 +142,7 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu * Handles the HTTP request by generating a Message and sending it to the request channel. If this gateway's * 'expectReply' property is true, it will also generate a response from the reply Message once received. */ + @Override public final ModelAndView handleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception { ModelAndView modelAndView = new ModelAndView(); 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 165429100d..c7a6943fd5 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -185,7 +185,7 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa } /** - * @return whether to expect reply + * @return Whether to expect a reply. */ protected boolean isExpectReply() { return expectReply; @@ -194,6 +194,9 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Set the path template for which this endpoint expects requests. * May include path variable {keys} to match against. + * + * @param path The path. + * * @deprecated since 3.0 in favor of {@linkplain #requestMapping} */ @Deprecated @@ -202,8 +205,9 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa } /** - * @deprecated since 3.0 in favor of {@linkplain #requestMapping} - */ + * @return The path. + * @deprecated since 3.0 in favor of {@linkplain #requestMapping} + */ @Deprecated String getPath() { String[] pathPatterns = this.requestMapping.getPathPatterns(); @@ -222,6 +226,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa *
  • #matrixVariables
  • *
  • #cookies * + * + * @param payloadExpression The payload expression. */ public void setPayloadExpression(Expression payloadExpression) { this.payloadExpression = payloadExpression; @@ -240,6 +246,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa *
  • #matrixVariables
  • *
  • #cookies * + * + * @param headerExpressions The header expressions. */ public void setHeaderExpressions(Map headerExpressions) { this.headerExpressions = headerExpressions; @@ -248,6 +256,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Set the message body converters to use. These converters are used to convert from and to HTTP requests and * responses. + * + * @param messageConverters The message converters. */ public void setMessageConverters(List> messageConverters) { Assert.noNullElements(messageConverters.toArray(), "'messageConverters' must not contain null entries"); @@ -267,6 +277,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Flag which determines if the default converters should be available after * custom converters. + * + * @param mergeWithDefaultConverters true to merge, false to replace. */ public void setMergeWithDefaultConverters(boolean mergeWithDefaultConverters) { this.mergeWithDefaultConverters = mergeWithDefaultConverters; @@ -274,6 +286,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Set the {@link HeaderMapper} to use when mapping between HTTP headers and MessageHeaders. + * + * @param headerMapper The header mapper. */ public void setHeaderMapper(HeaderMapper headerMapper) { Assert.notNull(headerMapper, "headerMapper must not be null"); @@ -282,6 +296,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Set the {@link RequestMapping} which allows you to specify a flexible RESTFul-mapping for this endpoint. + * + * @param requestMapping The request mapping. */ public void setRequestMapping(RequestMapping requestMapping) { Assert.notNull(requestMapping, "requestMapping must not be null"); @@ -294,6 +310,9 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Specify the supported request methods for this gateway. By default, only GET and POST are supported. + * + * @param supportedMethods The supported methods. + * * @deprecated since 3.0 in favor to {@linkplain #requestMapping} */ @Deprecated @@ -306,6 +325,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa * Specify the type of payload to be generated when the inbound HTTP request content is read by the * {@link HttpMessageConverter}s. By default this value is null which means at runtime any "text" Content-Type will * result in String while all others default to byte[].class. + * + * @param requestPayloadType The payload type. */ public void setRequestPayloadType(Class requestPayloadType) { this.requestPayloadType = requestPayloadType; @@ -314,6 +335,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa /** * Specify whether only the reply Message's payload should be passed in the response. If this is set to 'false', the * entire Message will be used to generate the response. The default is 'true'. + * + * @param extractReplyPayload true to extract the reply payload. */ public void setExtractReplyPayload(boolean extractReplyPayload) { this.extractReplyPayload = extractReplyPayload; @@ -323,6 +346,8 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa * Specify the {@link MultipartResolver} to use when checking requests. If no resolver is provided, the * "multipartResolver" bean in the context will be used as a fallback. If that is not available either, this * endpoint will not support multipart requests. + * + * @param multipartResolver The multipart resolver. */ public void setMultipartResolver(MultipartResolver multipartResolver) { this.multipartResolver = multipartResolver; @@ -370,7 +395,10 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa * Handles the HTTP request by generating a Message and sending it to the request channel. If this gateway's * 'expectReply' property is true, it will also generate a response from the reply Message once received. * - * @return a the response Message + * @param servletRequest The servlet request. + * @param servletResponse The servlet response. + * @return The response Message. + * @throws IOException Any IOException. */ protected final Message doHandleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { if (this.isShuttingDown()) { @@ -631,11 +659,13 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa return this.shuttingDown; } + @Override public int beforeShutdown() { this.shuttingDown = true; return this.activeCount.get(); } + @Override public int afterShutdown() { return this.activeCount.get(); } diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java index 21a0e77678..47c5c18816 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -39,13 +39,13 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl * detects and registers {@link RequestMappingInfo}s for {@link HttpRequestHandlingEndpointSupport} * from a Spring Integration HTTP configuration of * {@code } and {@code } elements. - *

    + *

    * This class is automatically configured as a bean in the application context during the parsing phase of * the {@code } and {@code } elements, if there is none registered, yet. * However it can be configured as a regular bean with appropriate configuration for * {@link RequestMappingHandlerMapping}. It is recommended to have only one similar bean in the application context * using the 'id' {@link org.springframework.integration.http.support.HttpContextUtils#HANDLER_MAPPING_BEAN_NAME}. - *

    + *

    * In most cases, Spring MVC offers to configure Request Mapping via {@code org.springframework.stereotype.Controller} * and {@link org.springframework.web.bind.annotation.RequestMapping}. * That's why Spring MVC's Handler Mapping infrastructure relies on {@link org.springframework.web.method.HandlerMethod}, diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java index c6ed57bdd1..6d76231e69 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/FileCopyingMultipartFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -28,7 +28,7 @@ import org.springframework.web.multipart.MultipartFile; * {@link MultipartFileReader} implementation that copies the MulitpartFile's * content to a new temporary File in the specified directory. If no directory * is provided, the Files will be created in the default temporary directory. - * + * * @author Mark Fisher * @since 2.0 */ @@ -47,7 +47,7 @@ public class FileCopyingMultipartFileReader implements MultipartFileReader { /** * Reads {@link MultipartFile} content. + * + * @param multipartFile The multipart file. + * @return The result of reading the file. + * @throws IOException Any IOException. */ T readMultipartFile(MultipartFile multipartFile) throws IOException; diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java index 344bb79c0e..bf39eae86b 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/multipart/SimpleMultipartFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -26,8 +26,8 @@ import org.springframework.web.util.WebUtils; /** * {@link MultipartFileReader} implementation that does not maintain metadata from * the original {@link MultipartFile} instance. Instead this simply reads the file - * content directly as either a String or byte array depending on the Content-Type. - * + * content directly as either a String or byte array depending on the Content-Type. + * * @author Mark Fisher * @since 2.0 */ @@ -39,12 +39,15 @@ public class SimpleMultipartFileReader implements MultipartFileReader { /** * Specify the default charset name to use when converting multipart file * content into Strings if the multipart itself does not provide a charset. + * + * @param defaultCharset The default charset. */ public void setDefaultMultipartCharset(String defaultCharset) { this.defaultCharset = Charset.forName( defaultCharset != null ? defaultCharset : WebUtils.DEFAULT_CHARACTER_ENCODING); } + @Override public Object readMultipartFile(MultipartFile multipartFile) throws IOException { if (multipartFile.getContentType() != null && multipartFile.getContentType().startsWith("text")) { MediaType contentType = MediaType.parseMediaType(multipartFile.getContentType()); diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandler.java b/spring-integration-http/src/main/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandler.java index fdfe6eb4e3..b1cc38263c 100755 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandler.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/outbound/HttpRequestExecutingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -45,7 +45,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.expression.ExpressionEvalMap; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; @@ -54,6 +53,7 @@ import org.springframework.integration.mapping.HeaderMapper; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.MessageHandlingException; import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -118,6 +118,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Create a handler that will send requests to the provided URI. + * + * @param uri The URI. */ public HttpRequestExecutingMessageHandler(URI uri) { this(uri.toString()); @@ -125,6 +127,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Create a handler that will send requests to the provided URI. + * + * @param uri The URI. */ public HttpRequestExecutingMessageHandler(String uri) { this(uri, null); @@ -132,6 +136,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Create a handler that will send requests to the provided URI Expression. + * + * @param uriExpression The URI expression. */ public HttpRequestExecutingMessageHandler(Expression uriExpression) { this(uriExpression, null); @@ -139,8 +145,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Create a handler that will send requests to the provided URI using a provided RestTemplate - * @param uri - * @param restTemplate + * @param uri The URI. + * @param restTemplate The rest template. */ public HttpRequestExecutingMessageHandler(String uri, RestTemplate restTemplate) { this(new LiteralExpression(uri), restTemplate); @@ -156,7 +162,7 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * Create a handler that will send requests to the provided URI using a provided RestTemplate * @param uriExpression A SpEL Expression that can be resolved against the message object and * {@link BeanFactory}. - * @param restTemplate + * @param restTemplate The rest template. */ public HttpRequestExecutingMessageHandler(Expression uriExpression, RestTemplate restTemplate) { Assert.notNull(uriExpression, "URI Expression is required"); @@ -168,6 +174,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * Specify whether the real URI should be encoded after uriVariables * expanding and before send request via {@link RestTemplate}. The default value is true. * + * @param encodeUri true if the URI should be encoded. + * * @see UriComponentsBuilder */ public void setEncodeUri(boolean encodeUri) { @@ -177,7 +185,7 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Specify the SpEL {@link Expression} to determine {@link HttpMethod} dynamically * - * @param httpMethodExpression + * @param httpMethodExpression The method expression. */ public void setHttpMethodExpression(Expression httpMethodExpression) { Assert.notNull(httpMethodExpression, "'httpMethodExpression' must not be null"); @@ -186,6 +194,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Specify the {@link HttpMethod} for requests. The default method will be POST. + * + * @param httpMethod The method. */ public void setHttpMethod(HttpMethod httpMethod) { this.httpMethodExpression = new LiteralExpression(httpMethod.name()); @@ -195,6 +205,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * Specify whether the outbound message's payload should be extracted * when preparing the request body. Otherwise the Message instance itself * will be serialized. The default value is true. + * + * @param extractPayload true if the payload should be extracted. */ public void setExtractPayload(boolean extractPayload) { this.extractPayload = extractPayload; @@ -204,6 +216,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Specify the charset name to use for converting String-typed payloads to * bytes. The default is 'UTF-8'. + * + * @param charset The charset. */ public void setCharset(String charset) { Assert.isTrue(Charset.isSupported(charset), "unsupported charset '" + charset + "'"); @@ -213,6 +227,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Specify whether a reply Message is expected. If not, this handler will simply return null for a * successful response or throw an Exception for a non-successful response. The default is true. + * + * @param expectReply true if a reply is expected. */ public void setExpectReply(boolean expectReply) { this.expectReply = expectReply; @@ -224,6 +240,9 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * be returned as a payload of the reply Message. * To take advantage of the HttpMessageConverters * registered on this adapter, provide a different type). + * + * @param expectedResponseType The expected type. + * * Also see {@link #setExpectedResponseTypeExpression(Expression)} */ public void setExpectedResponseType(Class expectedResponseType) { @@ -235,6 +254,9 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * Specify the {@link Expression} to determine the type for the expected response * The returned value of the expression could be an instance of {@link Class} or * {@link String} representing a fully qualified class name + * + * @param expectedResponseTypeExpression The expected response type expression. + * * Also see {@link #setExpectedResponseTypeExpression(Expression)} */ public void setExpectedResponseTypeExpression(Expression expectedResponseTypeExpression) { @@ -243,6 +265,9 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Set the {@link ResponseErrorHandler} for the underlying {@link RestTemplate}. + * + * @param errorHandler The error handler. + * * @see RestTemplate#setErrorHandler(ResponseErrorHandler) */ public void setErrorHandler(ResponseErrorHandler errorHandler) { @@ -252,6 +277,9 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Set a list of {@link HttpMessageConverter}s to be used by the underlying {@link RestTemplate}. * Converters configured via this method will override the default converters. + * + * @param messageConverters The message converters. + * * @see RestTemplate#setMessageConverters(java.util.List) */ public void setMessageConverters(List> messageConverters) { @@ -259,6 +287,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe } /** + * @param headerMapper The header mapper. + * * Set the {@link HeaderMapper} to use when mapping between HTTP headers and MessageHeaders. */ public void setHeaderMapper(HeaderMapper headerMapper) { @@ -268,6 +298,9 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Set the {@link ClientHttpRequestFactory} for the underlying {@link RestTemplate}. + * + * @param requestFactory The request factory. + * * @see RestTemplate#setRequestFactory(ClientHttpRequestFactory) */ public void setRequestFactory(ClientHttpRequestFactory requestFactory) { @@ -277,6 +310,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe /** * Set the Map of URI variable expressions to evaluate against the outbound message * when replacing the variable placeholders in a URI template. + * + * @param uriVariableExpressions The URI variable expressions. */ public void setUriVariableExpressions(Map uriVariableExpressions) { synchronized (this.uriVariableExpressions) { @@ -289,6 +324,8 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * Set the {@link Expression} to evaluate against the outbound message; the expression * must evaluate to a Map of URI variable expressions to evaluate against the outbound message * when replacing the variable placeholders in a URI template. + * + * @param uriVariablesExpression The URI variables expression. */ public void setUriVariablesExpression(Expression uriVariablesExpression) { this.uriVariablesExpression = uriVariablesExpression; @@ -298,6 +335,7 @@ public class HttpRequestExecutingMessageHandler extends AbstractReplyProducingMe * Set to true if you wish 'Set-Cookie' headers in responses to be * transferred as 'Cookie' headers in subsequent interactions for * a message. + * * @param transferCookies the transferCookies to set. */ public void setTransferCookies(boolean transferCookies) { diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java b/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java index e924aaa2ff..00cbe35504 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/support/DefaultHttpHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,9 +47,9 @@ import org.springframework.core.convert.TypeDescriptor; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; -import org.springframework.messaging.MessageHeaders; import org.springframework.integration.context.IntegrationContextUtils; import org.springframework.integration.mapping.HeaderMapper; +import org.springframework.messaging.MessageHeaders; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; @@ -278,6 +278,8 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF *

    * Any non-standard headers will be prefixed with the value specified by * {@link DefaultHttpHeaderMapper#setUserDefinedHeaderPrefix(String)}. The default is 'X-'. + * + * @param outboundHeaderNames The outbound header names. */ public void setOutboundHeaderNames(String[] outboundHeaderNames) { this.outboundHeaderNames = (outboundHeaderNames != null) ? outboundHeaderNames : new String[0]; @@ -291,6 +293,8 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF * This will match the header name directly or, for non-standard HTTP headers, it will match * the header name prefixed with the value specified by * {@link DefaultHttpHeaderMapper#setUserDefinedHeaderPrefix(String)}. The default is 'X-'. + * + * @param inboundHeaderNames The inbound header names. */ public void setInboundHeaderNames(String[] inboundHeaderNames) { this.inboundHeaderNames = (inboundHeaderNames != null) ? inboundHeaderNames : new String[0]; @@ -318,6 +322,8 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF /** * Sets the prefix to use with user-defined (non-standard) headers. Default is 'X-'. + * + * @param userDefinedHeaderPrefix The user defined header prefix. */ public void setUserDefinedHeaderPrefix(String userDefinedHeaderPrefix) { this.userDefinedHeaderPrefix = (userDefinedHeaderPrefix != null) ? userDefinedHeaderPrefix : ""; @@ -989,6 +995,8 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF * Factory method for creating a basic outbound mapper instance. * This will map all standard HTTP request headers when sending an HTTP request, * and it will map all standard HTTP response headers when receiving an HTTP response. + * + * @return The default outbound mapper. */ public static DefaultHttpHeaderMapper outboundMapper() { DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper(); @@ -1002,6 +1010,8 @@ public class DefaultHttpHeaderMapper implements HeaderMapper, BeanF * Factory method for creating a basic inbound mapper instance. * This will map all standard HTTP request headers when receiving an HTTP request, * and it will map all standard HTTP response headers when sending an HTTP response. + * + * @return The default inbound mapper. */ public static DefaultHttpHeaderMapper inboundMapper() { DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper(); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java index 062fe913fa..40b4c02520 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolReceivingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -118,7 +118,7 @@ public abstract class AbstractInternetProtocolReceivingChannelAdapter /** * Creates a default task executor if none was supplied. * - * @param threadName + * @param threadName The thread name. */ protected void checkTaskExecutor(final String threadName) { if (this.active && this.taskExecutor == null) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java index ca54bbfd04..13369a3b2a 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/AbstractInternetProtocolSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -57,7 +57,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst /** * @see Socket#setSoTimeout(int) * @see DatagramSocket#setSoTimeout(int) - * @param timeout + * @param timeout The timeout. */ @Override public void setSoTimeout(int timeout) { @@ -67,7 +67,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst /** * @see Socket#setReceiveBufferSize(int) * @see DatagramSocket#setReceiveBufferSize(int) - * @param size + * @param size The receive buffer size. */ @Override public void setSoReceiveBufferSize(int size) { @@ -76,7 +76,7 @@ public abstract class AbstractInternetProtocolSendingMessageHandler extends Abst /** * @see Socket#setSendBufferSize(int) * @see DatagramSocket#setSendBufferSize(int) - * @param size + * @param size The send buffer size. */ @Override public void setSoSendBufferSize(int size) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/CommonSocketOptions.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/CommonSocketOptions.java index bdbd844bdf..74010c4c3a 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/CommonSocketOptions.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/CommonSocketOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2011 the original author or authors. + * Copyright 2001-2014 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. @@ -28,21 +28,27 @@ public interface CommonSocketOptions { /** * @see Socket#setSoTimeout(int) * @see DatagramSocket#setSoTimeout(int) + * + * @param soTimeout The timeout. */ void setSoTimeout(int soTimeout); /** * @see Socket#setReceiveBufferSize(int) * @see DatagramSocket#setReceiveBufferSize(int) + * + * @param soReceiveBufferSize The receive buffer size. */ void setSoReceiveBufferSize(int soReceiveBufferSize); /** * @see Socket#setSendBufferSize(int) * @see DatagramSocket#setSendBufferSize(int) + * + * @param soSendBufferSize The send buffer size. */ void setSoSendBufferSize(int soSendBufferSize); - + /** * On a multi-homed system, specifies the ip address of the network interface used to communicate. * For inbound adapters and gateways, specifies the interface used to listed for incoming connections. @@ -50,8 +56,8 @@ public interface CommonSocketOptions { * specifies the interface to which multicast packets will be sent. For UDP unicast and multicast * adapters, specifies which interface to which the acknowledgment socket will be bound. Does not * apply to TCP outbound adapters and gateways. - * - * @param localAddress + * + * @param localAddress The local address. */ void setLocalAddress(String localAddress); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java index 21c475e840..1caaa6767e 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -132,6 +132,7 @@ public abstract class IpAdapterParserUtils { * @param builder the bean definition builder to be configured * @param element the XML element where the attribute should be defined * @param attributeName the name of the attribute whose value will be + * @param trueFalse not used * used to populate the property */ public static void addConstuctorValueIfAttributeDefined(BeanDefinitionBuilder builder, @@ -143,9 +144,9 @@ public abstract class IpAdapterParserUtils { } /** - * @param element - * @param builder - * @param parserContext + * @param element The element. + * @param builder The builder. + * @param parserContext The parser context. */ public static void addHostAndPortToConstructor(Element element, BeanDefinitionBuilder builder, ParserContext parserContext) { @@ -160,9 +161,9 @@ public abstract class IpAdapterParserUtils { } /** - * @param element - * @param builder - * @param parserContext + * @param element The element. + * @param builder The builder. + * @param parserContext The parser context. */ public static void addPortToConstructor(Element element, BeanDefinitionBuilder builder, ParserContext parserContext) { @@ -172,8 +173,8 @@ public abstract class IpAdapterParserUtils { /** * Asserts that a port attribute is supplied. - * @param element - * @param parserContext + * @param element The element. + * @param parserContext The parser context. * @return The value of the attribute. * @throws BeanCreationException if attribute is not provided. */ @@ -188,7 +189,7 @@ public abstract class IpAdapterParserUtils { /** * Gets the multicast attribute, if present; if not returns 'false'. - * @param element + * @param element The element. * @return The value of the attribute or false. */ static String getMulticast(Element element) { @@ -202,8 +203,8 @@ public abstract class IpAdapterParserUtils { /** * Sets the common port attributes on the bean being built (timeout, receive buffer size, * send buffer size). - * @param builder - * @param element + * @param builder The builder. + * @param element The element. */ static void addCommonSocketOptions(BeanDefinitionBuilder builder, Element element) { IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, SO_TIMEOUT); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java index 34308fde77..7ce55b9ff8 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionFactoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -243,7 +243,7 @@ public class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean deserializer) { @@ -341,7 +341,7 @@ public class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean serializer) { @@ -350,7 +350,7 @@ public class TcpConnectionFactoryFactoryBean extends AbstractFactoryBean message) { String connectionId = (String) message.getHeaders().get(IpHeaders.CONNECTION_ID); if (connectionId == null) { @@ -192,10 +193,12 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler imp connectionFactory.registerSender(this); } + @Override public void addNewConnection(TcpConnection connection) { // do nothing - no asynchronous multiplexing supported } + @Override public void removeDeadConnection(TcpConnection connection) { // do nothing - no asynchronous multiplexing supported } @@ -203,6 +206,8 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Specify the Spring Integration reply channel. If this property is not * set the gateway will check for a 'replyChannel' header on the request. + * + * @param replyChannel The reply channel. */ public void setReplyChannel(MessageChannel replyChannel) { this.setOutputChannel(replyChannel); @@ -212,26 +217,32 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler imp return "ip:tcp-outbound-gateway"; } + @Override public void start() { this.connectionFactory.start(); } + @Override public void stop() { this.connectionFactory.stop(); } + @Override public boolean isRunning() { return this.connectionFactory.isRunning(); } + @Override public int getPhase() { return this.phase; } + @Override public boolean isAutoStartup() { return this.autoStartup; } + @Override public void stop(Runnable callback) { this.connectionFactory.stop(callback); } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java index 700b54c865..72f397ec67 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractClientConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -48,6 +48,7 @@ public abstract class AbstractClientConnectionFactory extends AbstractConnection * true, a new connection is returned; otherwise a single connection is * reused for all requests while the connection remains open. */ + @Override public TcpConnectionSupport getConnection() throws Exception { this.checkActive(); return this.obtainConnection(); @@ -156,7 +157,8 @@ public abstract class AbstractClientConnectionFactory extends AbstractConnection /** * Force close the connection and null the field if it's * a shared connection. - * @param connection + * + * @param connection The connection. */ public void forceClose(TcpConnection connection) { if (this.theConnection == connection) { 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 d92ddd56c5..3ce73b304b 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -44,9 +44,9 @@ import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.SmartLifecycle; import org.springframework.core.serializer.Deserializer; import org.springframework.core.serializer.Serializer; -import org.springframework.messaging.MessagingException; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.ip.tcp.serializer.ByteArrayCrLfSerializer; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -137,7 +137,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport /** * Sets socket attributes on the socket. * @param socket The socket. - * @throws SocketException + * @throws SocketException Any SocketException. */ protected void setSocketAttributes(Socket socket) throws SocketException { if (this.soTimeout >= 0) { @@ -370,7 +370,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport /** * If true, sockets created by this factory will be used once. - * @param singleUse + * @param singleUse The singleUse to set. */ public void setSingleUse(boolean singleUse) { this.singleUse = singleUse; @@ -425,6 +425,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport /** * Creates a taskExecutor (if one was not provided). + * @return The executor. */ protected Executor getTaskExecutor() { if (!this.active) { @@ -515,9 +516,10 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport * Removes closed connections from the connections field, and from the connections parameter. * * @param selectionCount Number of IO Events, if 0 we were probably woken up by a close. - * @param selector The selector - * @param connections Map of connections - * @throws IOException + * @param selector The selector. + * @param server The server socket channel. + * @param connections Map of connections. + * @throws IOException Any IOException. */ protected void processNioSelections(int selectionCount, final Selector selector, ServerSocketChannel server, Map connections) throws IOException { @@ -632,9 +634,10 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport } /** - * @param selector - * @param now - * @throws IOException + * @param selector The selector. + * @param server The server socket channel. + * @param now The current time. + * @throws IOException Any IOException. */ protected void doAccept(final Selector selector, ServerSocketChannel server, long now) throws IOException { throw new UnsupportedOperationException("Nio server factory must override this method"); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java index 6699b18b63..1ca506025f 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractServerConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013 the original author or authors. + * Copyright 2001-2014 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,8 @@ public abstract class AbstractServerConnectionFactory /** * The port on which the factory will listen. - * @param port + * + * @param port The port. */ public AbstractServerConnectionFactory(int port) { super(port); @@ -69,6 +70,7 @@ public abstract class AbstractServerConnectionFactory * Not supported because the factory manages multiple connections and this * method cannot discriminate. */ + @Override public TcpConnection getConnection() throws Exception { throw new UnsupportedOperationException("Getting a connection from a server factory is not supported"); } @@ -158,18 +160,20 @@ public abstract class AbstractServerConnectionFactory /** * The number of sockets in the connection backlog. Default 5; * increase if you expect high connection rates. - * @param backlog + * @param backlog The backlog to set. */ public void setBacklog(int backlog) { Assert.isTrue(backlog >= 0, "You cannot set backlog negative"); this.backlog = backlog; } + @Override public int beforeShutdown() { this.shuttingDown = true; return 0; } + @Override public int afterShutdown() { this.stop(); return 0; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java index 94d574f99f..fff4d4fb4c 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/ClientModeConnectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -17,6 +17,7 @@ package org.springframework.integration.ip.tcp.connection; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.util.Assert; /** @@ -38,7 +39,7 @@ public class ClientModeConnectionManager implements Runnable { private volatile TcpConnection lastConnection; /** - * @param clientConnectionFactory + * @param clientConnectionFactory The connection factory. */ public ClientModeConnectionManager( AbstractConnectionFactory clientConnectionFactory) { @@ -46,6 +47,7 @@ public class ClientModeConnectionManager implements Runnable { this.clientConnectionFactory = clientConnectionFactory; } + @Override public void run() { synchronized (this.clientConnectionFactory) { try { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnection.java index 0ea93dda37..4f51e04524 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013 the original author or authors. + * Copyright 2001-2014 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,16 +47,16 @@ public interface TcpConnection extends Runnable { /** * Converts and sends the message. - * @param message The message - * @throws Exception + * @param message The message, + * @throws Exception Any Exception. */ void send(Message message) throws Exception; /** * Uses the deserializer to obtain the message payload * from the connection's input stream. - * @return The payload - * @throws Exception + * @return The payload. + * @throws Exception Any Exception. */ Object getPayload() throws Exception; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java index e4a95d5063..76bf1d55de 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -44,6 +44,8 @@ public class TcpConnectionEventListeningMessageProducer extends MessageProducerS * Set the list of event types (classes that extend TcpConnectionEvent) that * this adapter should send to the message channel. By default, all event * types will be sent. + * + * @param eventTypes The event types. */ public void setEventTypes(Class[] eventTypes) { Assert.notEmpty(eventTypes, "at least one event type is required"); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java index 226c452cbd..f41b9f2917 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013 the original author or authors. + * Copyright 2001-2014 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. @@ -171,6 +171,8 @@ public abstract class TcpConnectionSupport implements TcpConnection { /** * If we have been intercepted, propagate the close from the outermost interceptor; * otherwise, just call close(). + * + * @param isException true when this call is the result of an Exception. */ protected void closeConnection(boolean isException) { if (!(this.listener instanceof TcpConnectionInterceptor)) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java index fe7be52c7f..45b7d8d66d 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -21,12 +21,12 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.ip.IpHeaders; import org.springframework.integration.mapping.InboundMessageMapper; import org.springframework.integration.mapping.OutboundMessageMapper; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandlingException; /** * Maps incoming data from a {@link TcpConnection} to a {@link Message}. @@ -54,6 +54,7 @@ public class TcpMessageMapper implements private volatile boolean applySequence = false; + @Override public Message toMessage(TcpConnection connection) throws Exception { Message message = null; Object payload = connection.getPayload(); @@ -102,6 +103,7 @@ public class TcpMessageMapper implements return null; } + @Override public Object fromMessage(Message message) throws Exception { if (this.stringToBytes) { return getPayloadAsBytes(message); @@ -146,14 +148,14 @@ public class TcpMessageMapper implements /** * Sets whether outbound String payloads are to be converted * to byte[]. Default is true. - * @param stringToBytes + * @param stringToBytes The stringToBytes to set. */ public void setStringToBytes(boolean stringToBytes) { this.stringToBytes = stringToBytes; } /** - * @param applySequence the applySequence to set + * @param applySequence The applySequence to set. */ public void setApplySequence(boolean applySequence) { this.applySequence = applySequence; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java index 7c02f261a2..e4857003a8 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetClientConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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 class TcpNetClientConnectionFactory extends * @param host The host. * @param port The port. * @return The Socket - * @throws IOException + * @throws IOException Any IOException. */ protected Socket createSocket(String host, int port) throws IOException { return this.tcpSocketFactorySupport.getSocketFactory().createSocket(host, port); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java index 31d14172eb..dab0c96db7 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013 the original author or authors. + * Copyright 2001-2014 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. @@ -41,21 +41,6 @@ public class TcpNetConnection extends TcpConnectionSupport { private volatile long lastSend; - /** - * Constructs a TcpNetConnection for the socket. - * @param socket the socket - * @param server if true this connection was created as - * a result of an incoming request. - * @param lookupHost true if hostname lookup should be performed, otherwise the connection will - * be identified using the ip address. - * @deprecated Use {@link #TcpNetConnection(Socket, boolean, boolean, ApplicationEventPublisher, String)} - * TODO: Remove in 3.1/4.0 - */ - @Deprecated - public TcpNetConnection(Socket socket, boolean server, boolean lookupHost) { - this(socket, server, lookupHost, null, null); - } - /** * Constructs a TcpNetConnection for the socket. * @param socket the socket diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java index 0504f2f693..491888fc24 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetServerConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -55,6 +55,7 @@ public class TcpNetServerConnectionFactory extends AbstractServerConnectionFacto * connection {@link TcpConnection#run()} using the task executor. * I/O errors on the server socket/channel are logged and the factory is stopped. */ + @Override public void run() { ServerSocket theServerSocket = null; if (this.getListener() == null) { @@ -133,7 +134,7 @@ public class TcpNetServerConnectionFactory extends AbstractServerConnectionFacto * @param whichNic An InetAddress if binding to a specific network interface. Set to * null when configured to bind to all interfaces. * @return The Server Socket. - * @throws IOException + * @throws IOException Any IOException. */ protected ServerSocket createServerSocket(int port, int backlog, InetAddress whichNic) throws IOException { ServerSocketFactory serverSocketFactory = this.tcpSocketFactorySupport.getServerSocketFactory(); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java index 877d4998e2..b179b2fd86 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -100,7 +100,7 @@ public class TcpNioClientConnectionFactory extends /** * When set to true, connections created by this factory attempt * to use direct buffers where possible. - * @param usingDirectBuffers + * @param usingDirectBuffers The usingDirectBuffers to set. * @see ByteBuffer */ public void setUsingDirectBuffers(boolean usingDirectBuffers) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java index a7f63f324a..73edaf47d9 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,9 +35,9 @@ import java.util.concurrent.atomic.AtomicInteger; import org.springframework.context.ApplicationEventPublisher; import org.springframework.core.serializer.Serializer; +import org.springframework.integration.ip.tcp.serializer.SoftEndOfStreamException; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; -import org.springframework.integration.ip.tcp.serializer.SoftEndOfStreamException; import org.springframework.util.Assert; /** @@ -77,22 +77,13 @@ public class TcpNioConnection extends TcpConnectionSupport { /** * Constructs a TcpNetConnection for the SocketChannel. - * @param socketChannel the socketChannel - * @param server if true this connection was created as - * a result of an incoming request. - * @deprecated Use {@link #TcpNioConnection(SocketChannel, boolean, boolean, ApplicationEventPublisher, String)} - * TODO: Remove in 3.1/4.0 - */ - @Deprecated - public TcpNioConnection(SocketChannel socketChannel, boolean server, boolean lookupHost) throws Exception { - this(socketChannel, server, lookupHost, null, null); - } - - /** - * Constructs a TcpNetConnection for the SocketChannel. - * @param socketChannel the socketChannel - * @param server if true this connection was created as + * @param socketChannel The socketChannel. + * @param server If true, this connection was created as * a result of an incoming request. + * @param lookupHost true to perform reverse lookups. + * @param applicationEventPublisher The event publisher. + * @param connectionFactoryName The name of the connection factory creating this connection. + * @throws Exception Any Exception. */ public TcpNioConnection(SocketChannel socketChannel, boolean server, boolean lookupHost, ApplicationEventPublisher applicationEventPublisher, @@ -128,10 +119,12 @@ public class TcpNioConnection extends TcpConnectionSupport { super.close(); } + @Override public boolean isOpen() { return this.socketChannel.isOpen(); } + @Override @SuppressWarnings("unchecked") public void send(Message message) throws Exception { synchronized(this.socketChannel) { @@ -149,14 +142,17 @@ public class TcpNioConnection extends TcpConnectionSupport { } } + @Override public Object getPayload() throws Exception { return this.getDeserializer().deserialize(this.channelInputStream); } + @Override public int getPort() { return this.socketChannel.socket().getPort(); } + @Override public Object getDeserializerStateKey() { return this.channelInputStream; } @@ -164,6 +160,9 @@ public class TcpNioConnection extends TcpConnectionSupport { /** * Allocates a ByteBuffer of the requested length using normal or * direct buffers, depending on the usingDirectBuffers field. + * + * @param length The buffer length. + * @return The buffer. */ protected ByteBuffer allocate(int length) { ByteBuffer buffer; @@ -183,6 +182,7 @@ public class TcpNioConnection extends TcpConnectionSupport { * and there is no more data; thus freeing the thread to work on other * sockets. */ + @Override public void run() { if (logger.isTraceEnabled()) { logger.trace(this.getConnectionId() + " Nio message assembler running..."); @@ -357,6 +357,7 @@ public class TcpNioConnection extends TcpConnectionSupport { * Hence the count down latch. */ this.taskExecutor.execute(new Runnable() { + @Override public void run() { try { TcpNioConnection.this.sendToPipe(rawBuffer); @@ -448,7 +449,7 @@ public class TcpNioConnection extends TcpConnectionSupport { /** * If true, connection will attempt to use direct buffers where * possible. - * @param usingDirectBuffers + * @param usingDirectBuffers the usingDirectBuffers to set. */ public void setUsingDirectBuffers(boolean usingDirectBuffers) { this.usingDirectBuffers = usingDirectBuffers; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java index 3bbfcda1b7..7c71fb6e31 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -40,7 +40,7 @@ public interface TcpNioConnectionSupport { * @param connectionFactoryName the name of the connection factory creating this connection; used * during event publishing, may be null, in which case "unknown" will be used. * @return the TcpNioConnection - * @throws Exception + * @throws Exception Any exception. */ TcpNioConnection createNewConnection(SocketChannel socketChannel, boolean server, boolean lookupHost, diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java index 50a65d44ee..3a4bc5279e 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioSSLConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -67,17 +67,6 @@ public class TcpNioSSLConnection extends TcpNioConnection { private boolean needMoreNetworkData; - /** - * @deprecated Use {@link #TcpNioSSLConnection(SocketChannel, boolean, boolean, ApplicationEventPublisher, String, SSLEngine)} - * TODO: Remove in 3.1/4.0 - */ - @Deprecated - public TcpNioSSLConnection(SocketChannel socketChannel, boolean server, - boolean lookupHost, SSLEngine sslEngine) throws Exception { - super(socketChannel, server, lookupHost, null, null); - this.sslEngine = sslEngine; - } - public TcpNioSSLConnection(SocketChannel socketChannel, boolean server, boolean lookupHost, ApplicationEventPublisher applicationEventPublisher, String connectionFactoryName, SSLEngine sslEngine) throws Exception { @@ -85,7 +74,6 @@ public class TcpNioSSLConnection extends TcpNioConnection { this.sslEngine = sslEngine; } - /** * Overrides super class method to perform decryption and/or participate * in handshaking. Decrypted data is sent to the super class to be @@ -229,6 +217,8 @@ public class TcpNioSSLConnection extends TcpNioConnection { /** * Initializes the SSLEngine and sets up the encryption/decryption buffers. + * + * @throws IOException Any IOException. */ public void init() throws IOException { if (this.decoded == null) { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java index 53f2921e33..39c13e0445 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioServerConnectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -148,12 +148,10 @@ public class TcpNioServerConnectionFactory extends AbstractServerConnectionFacto } /** - * @param selector - * @param server - * @param now - * @throws IOException - * @throws SocketException - * @throws ClosedChannelException + * @param selector The selector. + * @param server The server socket channel. + * @param now The current time. + * @throws IOException Any IOException. */ @Override protected void doAccept(final Selector selector, ServerSocketChannel server, long now) throws IOException { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpSSLContextSupport.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpSSLContextSupport.java index e2c32c93cb..58e90cd642 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpSSLContextSupport.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpSSLContextSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -32,8 +32,8 @@ public interface TcpSSLContextSupport { /** * Gets an SSLContext. * @return the SSLContext. - * @throws GeneralSecurityException - * @throws IOException + * @throws GeneralSecurityException Any GeneralSecurityException. + * @throws IOException Any IOException. */ SSLContext getSSLContext() throws GeneralSecurityException, IOException; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java index 4d0674d03e..84d3eb673e 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/ByteArrayLengthHeaderSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -15,7 +15,6 @@ */ package org.springframework.integration.ip.tcp.serializer; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -24,6 +23,7 @@ import java.nio.ByteBuffer; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + /** * Reads data in an InputStream to a byte[]; data must be preceded by * a binary length (network byte order, not included in resulting byte[]). @@ -75,7 +75,7 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer * Constructs the serializer using the supplied header size. * Valid header sizes are {@link #HEADER_SIZE_INT} (default), * {@link #HEADER_SIZE_UNSIGNED_BYTE} and {@link #HEADER_SIZE_UNSIGNED_SHORT} - * @param headerSize + * @param headerSize The header size. */ public ByteArrayLengthHeaderSerializer(int headerSize) { if (headerSize != HEADER_SIZE_INT && @@ -92,7 +92,11 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer * IOException if the length field exceeds the maxMessageSize. * Throws a {@link SoftEndOfStreamException} if the stream * is closed between messages. + * + * @param inputStream The input stream. + * @throws IOException Any IOException. */ + @Override public byte[] deserialize(InputStream inputStream) throws IOException { int messageLength = this.readHeader(inputStream); if (logger.isDebugEnabled()) { @@ -110,7 +114,11 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer /** * Writes the byte[] to the output stream, preceded by a 4 byte * length in network byte order (big endian). + * + * @param bytes The bytes. + * @param outputStream The output stream. */ + @Override public void serialize(byte[] bytes, OutputStream outputStream) throws IOException { this.writeHeader(outputStream, bytes.length); outputStream.write(bytes); @@ -120,10 +128,12 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer /** * Reads data from the socket and puts the data in buffer. Blocks until * buffer is full or a socket timeout occurs. + * + * @param inputStream The input stream. * @param buffer the buffer into which the data should be read * @param header true if we are reading the header * @return {@code < 0} if socket closed and not in the middle of a message - * @throws IOException + * @throws IOException Any IOException. */ protected int read(InputStream inputStream, byte[] buffer, boolean header) throws IOException { @@ -151,9 +161,9 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer /** * Writes the header, according to the header format. - * @param outputStream - * @param length - * @throws IOException + * @param outputStream The output stream. + * @param length The length. + * @throws IOException Any IOException. */ protected void writeHeader(OutputStream outputStream, int length) throws IOException { ByteBuffer lengthPart = ByteBuffer.allocate(this.headerSize); @@ -185,9 +195,10 @@ public class ByteArrayLengthHeaderSerializer extends AbstractByteArraySerializer /** * Reads the header and returns the length of the data part. - * @param inputStream - * @return The length of the data part - * @throws IOException + * + * @param inputStream The input stream. + * @return The length of the data part. + * @throws IOException Any IOException. * @throws SoftEndOfStreamException if socket closes * before any length data read. */ diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializer.java index aaa06a7eeb..4832eec8fe 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializer.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/serializer/MapJsonSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,7 +34,7 @@ import org.springframework.util.Assert; * Serializes a {@link Map} as JSON. Deserializes JSON to * a {@link Map}. The default {@link JacksonJsonObjectMapperProvider#newInstance()} can be * overridden using {@link #setJsonObjectMapper(JsonObjectMapper)}. - *

    + *

    * The JSON deserializer can't delimit multiple JSON * objects. Therefore another (de)serializer is used to * apply structure to the stream. By default, this is a @@ -86,6 +86,7 @@ public class MapJsonSerializer implements Serializer>, Deserializer deserialize(InputStream inputStream) throws IOException { byte[] bytes = this.packetDeserializer.deserialize(inputStream); try { @@ -96,6 +97,7 @@ public class MapJsonSerializer implements Serializer>, Deserializer object, OutputStream outputStream) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java index 67205e1c72..f02477d2f0 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/MulticastSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2011 the original author or authors. + * Copyright 2001-2014 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. @@ -29,11 +29,11 @@ import org.springframework.messaging.MessageHandler; * A {@link MessageHandler} implementation that maps a Message into * a UDP datagram packet and sends that to the specified multicast address * (224.0.0.0 to 239.255.255.255) and port. - * + * * The only difference between this and its super class is the * ability to specify how many acknowledgments are required to * determine success. - * + * * @author Gary Russell * @since 2.0 */ @@ -42,7 +42,7 @@ public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler private int timeToLive = -1; private String localAddress; - + /** * Constructs a MulticastSendingMessageHandler to send data to the multicast address/port. * @param address The multicast address. @@ -138,11 +138,12 @@ public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler this.setSocket(socket); } } - + /** * If acknowledge = true; how many acks needed for success. - * @param minAcksForSuccess + * + * @param minAcksForSuccess The minimum number of acks that will represent success. */ public void setMinAcksForSuccess(int minAcksForSuccess) { this.setAckCounter(minAcksForSuccess); @@ -150,12 +151,14 @@ public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler /** * Set the underlying {@link MulticastSocket} time to live property. + * * @param timeToLive {@link MulticastSocket#setTimeToLive(int)} */ public void setTimeToLive(int timeToLive) { this.timeToLive = timeToLive; } + @Override public void setLocalAddress(String localAddress) { this.localAddress = localAddress; } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java index 9c3749bacd..29bf37b573 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/UnicastReceivingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -26,11 +26,11 @@ import java.net.SocketTimeoutException; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter; +import org.springframework.integration.ip.IpHeaders; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; import org.springframework.messaging.MessagingException; -import org.springframework.integration.ip.AbstractInternetProtocolReceivingChannelAdapter; -import org.springframework.integration.ip.IpHeaders; /** * A channel adapter to receive incoming UDP packets. Packets can optionally be preceded by a @@ -53,7 +53,7 @@ public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolRece /** * Constructs a UnicastReceivingChannelAdapter that listens on the specified port. - * @param port + * @param port The port. */ public UnicastReceivingChannelAdapter(int port) { super(port); @@ -199,8 +199,8 @@ public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolRece /** * Sets timeout and receive buffer size * - * @param socket - * @throws SocketException + * @param socket The socket. + * @throws SocketException Any socket exception. */ protected void setSocketAttributes(DatagramSocket socket) throws SocketException { diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java index 7d5960947a..02dd550023 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/util/TestingUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,7 +34,7 @@ public class TestingUtilities { * starting a test. Waits for up to 10 seconds by default. * @param serverConnectionFactory The server connection factory. * @param delay How long to wait in milliseconds; default 10000 (10 seconds) if null. - * @throws IllegalStateException + * @throws IllegalStateException If the server does not start listening in time. */ public static void waitListening(AbstractServerConnectionFactory serverConnectionFactory, Long delay) throws IllegalStateException { @@ -64,7 +64,7 @@ public class TestingUtilities { * Waits for up to 10 seconds by default. * @param serverConnectionFactory The server connection factory. * @param delay How long to wait in milliseconds; default 10000 (10 seconds) if null. - * @throws IllegalStateException + * @throws IllegalStateException If the server doesn't stop listening in time. */ public static void waitStopListening(AbstractServerConnectionFactory serverConnectionFactory, Long delay) throws IllegalStateException { diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java index 494aac5a8a..3f55c689ee 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/ExpressionEvaluatingSqlParameterSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -81,7 +81,7 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre * context: generally in an outbound setting it is a Message, and in an inbound setting it is a result set row (a * Map or a domain object if a RowMapper has been provided). The {@link #setStaticParameters(Map) static parameters} * can be referred to in an expression using the variable #staticParameters, for example: - *

    + *

      * * * @@ -123,6 +123,7 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre this.parameterExpressions = paramExpressions; } + @Override public SqlParameterSource createParameterSource(final Object input) { return new ExpressionEvaluatingSqlParameterSource(input, this.staticParameters, this.parameterExpressions); } @@ -148,6 +149,7 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre this.values.putAll(staticParameters); } + @Override public Object getValue(String paramName) throws IllegalArgumentException { if (values.containsKey(paramName)) { return values.get(paramName); @@ -179,6 +181,7 @@ public class ExpressionEvaluatingSqlParameterSourceFactory extends AbstractExpre return value; } + @Override public boolean hasValue(String paramName) { try { Object value = getValue(paramName); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java index b9458ac282..aa66c86b6c 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -33,14 +33,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.DirectFieldAccessor; +import org.springframework.beans.factory.InitializingBean; import org.springframework.core.serializer.Deserializer; import org.springframework.core.serializer.Serializer; import org.springframework.core.serializer.support.DeserializingConverter; import org.springframework.core.serializer.support.SerializingConverter; import org.springframework.dao.DuplicateKeyException; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.MessageHeaders; import org.springframework.integration.jdbc.store.JdbcChannelMessageStore; import org.springframework.integration.store.AbstractMessageGroupStore; import org.springframework.integration.store.MessageGroup; @@ -58,6 +56,9 @@ import org.springframework.jdbc.support.lob.DefaultLobHandler; import org.springframework.jdbc.support.lob.LobHandler; import org.springframework.jmx.export.annotation.ManagedAttribute; import org.springframework.jmx.export.annotation.ManagedResource; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHeaders; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -81,7 +82,7 @@ import org.springframework.util.StringUtils; * @since 2.0 */ @ManagedResource -public class JdbcMessageStore extends AbstractMessageGroupStore implements MessageStore { +public class JdbcMessageStore extends AbstractMessageGroupStore implements MessageStore, InitializingBean { private static final Log logger = LogFactory.getLog(JdbcMessageStore.class); @@ -286,11 +287,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa this.deserializer = new DeserializingConverter((Deserializer) deserializer); } - /** - * Check mandatory properties (data source and incrementer). - * - * @throws Exception - */ + @Override public void afterPropertiesSet() throws Exception { Assert.state(jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided"); } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java index 5e0427590b..a21a97a862 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -29,7 +29,9 @@ public interface SqlParameterSourceFactory { /** * Return a new {@link SqlParameterSource}. + * * @param input the raw message or query result to be transformed into a SqlParameterSource + * @return The parameter source. */ public SqlParameterSource createParameterSource(Object input); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java index c41c726804..9bb63cd511 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -12,7 +12,6 @@ */ package org.springframework.integration.jdbc; - import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collections; @@ -54,6 +53,7 @@ import com.google.common.cache.CacheStats; import com.google.common.cache.LoadingCache; + /** * This class is used by all Stored Procedure (Stored Function) components and * provides the core functionality to execute those. @@ -157,7 +157,9 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * Verifies parameters, sets the parameters on {@link SimpleJdbcCallOperations} * and ensures the appropriate {@link SqlParameterSourceFactory} is defined * when {@link ProcedureParameter} are passed in. + * {@inheritDoc} */ + @Override public void afterPropertiesSet() { if (this.storedProcedureNameExpression == null) { @@ -274,6 +276,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * Execute a Stored Procedure or Function - Use with {@link Message} is * available to extract {@link ProcedureParameter} values from it. * + * @param message A message. * @return Map containing the stored procedure results if any. */ public Map executeStoredProcedure(Message message) { @@ -327,8 +330,6 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { } - /** - */ private static Map executeStoredProcedure(SimpleJdbcCallOperations simpleJdbcCallOperations, SqlParameterSource storedProcedureParameterSource) { @@ -346,6 +347,8 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * from the JDBC Meta-data. However, if the used database does not support * meta data lookups or if you like to provide customized parameter definitions, * this flag can be set to 'true'. It defaults to 'false'. + * + * @param ignoreColumnMetaData true to ignore column metadata. */ public void setIgnoreColumnMetaData(boolean ignoreColumnMetaData) { this.ignoreColumnMetaData = ignoreColumnMetaData; @@ -354,6 +357,8 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { /** * Custom Stored Procedure parameters that may contain static values * or Strings representing an {@link Expression}. + * + * @param procedureParameters The parameters. */ public void setProcedureParameters(List procedureParameters) { @@ -371,6 +376,8 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * If you database system is not fully supported by Spring and thus obtaining * parameter definitions from the JDBC Meta-data is not possible, you must define * the {@link SqlParameter} explicitly. + * + * @param sqlParameters The parameters. */ public void setSqlParameters(List sqlParameters) { Assert.notEmpty(sqlParameters, "sqlParameters must not be null or empty."); @@ -391,7 +398,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * If not the SqlParameterSourceFactory will be replaced the default * {@link ExpressionEvaluatingSqlParameterSourceFactory}. * - * @param sqlParameterSourceFactory + * @param sqlParameterSourceFactory The paramtere source factory. */ public void setSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) { Assert.notNull(sqlParameterSourceFactory, "sqlParameterSourceFactory must not be null."); @@ -504,7 +511,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * Indicates the procedure's return value should be included in the results * returned. * - * @param returnValueRequired + * @param returnValueRequired true to include the return value. */ public void setReturnValueRequired(boolean returnValueRequired) { this.returnValueRequired = returnValueRequired; @@ -524,6 +531,8 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * Only few developers will probably ever like to process update counts, thus * the value defaults to true. * + * @param skipUndeclaredResults The boolean. + * */ public void setSkipUndeclaredResults(boolean skipUndeclaredResults) { this.skipUndeclaredResults = skipUndeclaredResults; @@ -608,6 +617,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { * * @param beanFactory If set must not be null. */ + @Override public void setBeanFactory(BeanFactory beanFactory) { Assert.notNull(returningResultSetRowMappers, "returningResultSetRowMappers must not be null."); this.beanFactory = beanFactory; diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java index df9938b2af..0fb9db68e3 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -19,10 +19,10 @@ package org.springframework.integration.jdbc; import java.sql.CallableStatement; import java.util.Map; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandlingException; import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; @@ -100,7 +100,7 @@ public class StoredProcOutboundGateway extends AbstractReplyProducingMessageHand * Therefore, even if you set expectSingleResult = true, you may end up with * a collection being returned. * - * @param expectSingleResult + * @param expectSingleResult true if a single result is expected. */ public void setExpectSingleResult(boolean expectSingleResult) { this.expectSingleResult = expectSingleResult; diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapter.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapter.java index 83460f0942..8e71dd660a 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapter.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcPollingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -59,6 +59,7 @@ public class StoredProcPollingChannelAdapter extends IntegrationObjectSupport im * RowMapper has been provided, the values mapped from those rows. If the * query returns no rows, this method will return null. */ + @Override public Message receive() { Object payload = poll(); if (payload == null) { @@ -130,7 +131,7 @@ public class StoredProcPollingChannelAdapter extends IntegrationObjectSupport im * Therefore, even if you set expectSingleResult = true, you may end up with * a collection being returned. * - * @param expectSingleResult + * @param expectSingleResult true if a single result is expected. */ public void setExpectSingleResult(boolean expectSingleResult) { this.expectSingleResult = expectSingleResult; diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java index 8b5fbdf18f..319978415a 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcParserUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -19,10 +19,9 @@ package org.springframework.integration.jdbc.config; import java.sql.Types; import java.util.List; -import org.w3c.dom.Element; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Element; import org.springframework.beans.BeanMetadataElement; import org.springframework.beans.factory.config.BeanDefinition; @@ -60,8 +59,9 @@ public final class StoredProcParserUtils { } /** - * @param storedProcComponent - * @param parserContext + * @param storedProcComponent The element. + * @param parserContext The parser context. + * @return The list of bean definitions. */ public static ManagedList getSqlParameterDefinitionBeanDefinitions( Element storedProcComponent, ParserContext parserContext) { @@ -147,8 +147,9 @@ public final class StoredProcParserUtils { } /** - * @param storedProcComponent - * @param parserContext + * @param storedProcComponent The element. + * @param parserContext The parser context. + * @return The list of bean definitions. */ public static ManagedList getProcedureParameterBeanDefinitions( Element storedProcComponent, ParserContext parserContext) { @@ -205,8 +206,9 @@ public final class StoredProcParserUtils { } /** - * @param storedProcComponent - * @param parserContext + * @param storedProcComponent The element. + * @param parserContext The parser context. + * @return The list of bean metadata objects. */ public static ManagedMap getReturningResultsetBeanDefinitions( Element storedProcComponent, ParserContext parserContext) { diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java index a679ecbe78..ded30029e5 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -38,8 +38,6 @@ import org.springframework.core.serializer.Deserializer; import org.springframework.core.serializer.Serializer; import org.springframework.core.serializer.support.DeserializingConverter; import org.springframework.core.serializer.support.SerializingConverter; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHeaders; import org.springframework.integration.jdbc.JdbcMessageStore; import org.springframework.integration.jdbc.store.channel.ChannelMessageStoreQueryProvider; import org.springframework.integration.jdbc.store.channel.DerbyChannelMessageStoreQueryProvider; @@ -65,6 +63,8 @@ import org.springframework.jdbc.support.lob.LobHandler; import org.springframework.jmx.export.annotation.ManagedAttribute; import org.springframework.jmx.export.annotation.ManagedMetric; import org.springframework.jmx.export.annotation.ManagedResource; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHeaders; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -218,7 +218,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Method not implemented. - * @throws UnsupportedOperationException + * @throws UnsupportedOperationException Method not supported. */ @Override public void setLastReleasedSequenceNumberForGroup(Object groupId, final int sequenceNumber) { @@ -366,7 +366,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement * with Oracle, the fetchSize value of 1 is needed to ensure FIFO characteristics * of polled messages. Please see the Oracle {@link ChannelMessageStoreQueryProvider} for more details. * - * @throws Exception + * @throws Exception Any Exception. */ @Override public void afterPropertiesSet() throws Exception { @@ -429,7 +429,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Method not implemented. - * @throws UnsupportedOperationException + * + * @throws UnsupportedOperationException Method not supported. */ @Override public void completeGroup(Object groupId) { @@ -509,7 +510,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Method not implemented. - * @throws UnsupportedOperationException + * @return The message count. + * @throws UnsupportedOperationException Method not supported. */ @ManagedAttribute public long getMessageCount() { @@ -518,7 +520,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Method not implemented. - * @throws UnsupportedOperationException + * @return The message count. + * @throws UnsupportedOperationException Method not supported. */ @Override @ManagedAttribute @@ -536,7 +539,9 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Method not implemented. - * @throws UnsupportedOperationException + * + * @return The message group count. + * @throws UnsupportedOperationException Method not supported. */ @Override @ManagedAttribute @@ -549,8 +554,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement * simple map-based cache, only replacing the table prefix on the first access to a named query. Further * accesses will be resolved from the cache. * - * @param sqlQuery the SQL query to be transformed - * @return a transformed query with replacements + * @param sqlQuery The SQL query to be transformed. + * @return A transformed query with replacements. */ protected String getQuery(String sqlQuery) { String query = queryCache.get(sqlQuery); @@ -565,7 +570,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Method not implemented. - * @throws UnsupportedOperationException + * + * @throws UnsupportedOperationException Method not supported. */ @Override public Iterator iterator() { @@ -575,6 +581,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Returns the number of messages persisted for the specified channel id (groupId) * and the specified region ({@link #setRegion(String)}). + * + * @return The message group size. */ @Override @ManagedAttribute @@ -606,8 +614,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement /** * Remove a single message from the database. * - * @param groupId The channel id to remove the message from - * @param messageToRemove The message to remove + * @param groupId The channel id to remove the message from. + * @param messageToRemove The message to remove. * */ @Override @@ -643,7 +651,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement *

    Only applicable if {@link #setUsingIdCache(boolean)} is set to * true

    . * - * @param messageId + * @param messageId The message identifier. */ public void removeFromIdCache(String messageId) { if (logger.isDebugEnabled()) { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java index e76dbd6872..62edea4451 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -32,8 +32,6 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.InitializingBean; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; import org.springframework.integration.gateway.MessagingGatewaySupport; import org.springframework.integration.history.TrackableComponent; import org.springframework.integration.support.MessageBuilder; @@ -43,6 +41,8 @@ import org.springframework.jms.support.converter.MessageConverter; import org.springframework.jms.support.converter.SimpleMessageConverter; import org.springframework.jms.support.destination.DestinationResolver; import org.springframework.jms.support.destination.DynamicDestinationResolver; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; /** @@ -90,6 +90,8 @@ public class ChannelPublishingJmsMessageListener /** * Specify whether a JMS reply Message is expected. + * + * @param expectReply true if a reply is expected. */ public void setExpectReply(boolean expectReply) { this.expectReply = expectReply; @@ -138,6 +140,8 @@ public class ChannelPublishingJmsMessageListener * Set the default reply destination to send reply messages to. This will * be applied in case of a request message that does not carry a * "JMSReplyTo" field. + * + * @param defaultReplyDestination The default reply destination. */ public void setDefaultReplyDestination(Destination defaultReplyDestination) { this.defaultReplyDestination = defaultReplyDestination; @@ -148,6 +152,9 @@ public class ChannelPublishingJmsMessageListener * This will be applied in case of a request message that does not carry a * "JMSReplyTo" field. *

    Alternatively, specify a JMS Destination object as "defaultReplyDestination". + * + * @param destinationName The default reply destination name. + * * @see #setDestinationResolver * @see #setDefaultReplyDestination(javax.jms.Destination) */ @@ -160,6 +167,9 @@ public class ChannelPublishingJmsMessageListener * This will be applied in case of a request message that does not carry a * "JMSReplyTo" field. *

    Alternatively, specify a JMS Destination object as "defaultReplyDestination". + * + * @param destinationName The default reply topic name. + * * @see #setDestinationResolver * @see #setDefaultReplyDestination(javax.jms.Destination) */ @@ -169,6 +179,9 @@ public class ChannelPublishingJmsMessageListener /** * Specify the time-to-live property for JMS reply Messages. + * + * @param replyTimeToLive The reply time to live. + * * @see javax.jms.MessageProducer#setTimeToLive(long) */ public void setReplyTimeToLive(long replyTimeToLive) { @@ -177,6 +190,9 @@ public class ChannelPublishingJmsMessageListener /** * Specify the priority value for JMS reply Messages. + * + * @param replyPriority The reply priority. + * * @see javax.jms.MessageProducer#setPriority(int) */ public void setReplyPriority(int replyPriority) { @@ -185,6 +201,9 @@ public class ChannelPublishingJmsMessageListener /** * Specify the delivery mode for JMS reply Messages. + * + * @param replyDeliveryPersistent true for a persistent reply message. + * * @see javax.jms.MessageProducer#setDeliveryMode(int) */ public void setReplyDeliveryPersistent(boolean replyDeliveryPersistent) { @@ -201,6 +220,8 @@ public class ChannelPublishingJmsMessageListener * instead, then this value should be set to "JMSCorrelationID". * Any other value will be treated as a JMS String Property to be copied as-is * from the request Message into the reply Message with the same property name. + * + * @param correlationKey The correlation key. */ public void setCorrelationKey(String correlationKey) { this.correlationKey = correlationKey; @@ -209,6 +230,8 @@ public class ChannelPublishingJmsMessageListener /** * Specify whether explicit QoS should be enabled for replies * (for timeToLive, priority, and deliveryMode settings). + * + * @param explicitQosEnabledForReplies true to enable explicit QoS. */ public void setExplicitQosEnabledForReplies(boolean explicitQosEnabledForReplies) { this.explicitQosEnabledForReplies = explicitQosEnabledForReplies; @@ -219,6 +242,9 @@ public class ChannelPublishingJmsMessageListener * destination names for this listener. *

    The default resolver is a DynamicDestinationResolver. Specify a * JndiDestinationResolver for resolving destination names as JNDI locations. + * + * @param destinationResolver The destination resolver. + * * @see org.springframework.jms.support.destination.DynamicDestinationResolver * @see org.springframework.jms.support.destination.JndiDestinationResolver */ @@ -233,7 +259,7 @@ public class ChannelPublishingJmsMessageListener * If none is provided, a {@link SimpleMessageConverter} will * be used. * - * @param messageConverter + * @param messageConverter The message converter. */ public void setMessageConverter(MessageConverter messageConverter) { this.messageConverter = messageConverter; @@ -243,6 +269,8 @@ public class ChannelPublishingJmsMessageListener * Provide a {@link JmsHeaderMapper} implementation to use when * converting between JMS Messages and Spring Integration Messages. * If none is provided, a {@link DefaultJmsHeaderMapper} will be used. + * + * @param headerMapper The header mapper. */ public void setHeaderMapper(JmsHeaderMapper headerMapper) { this.headerMapper = headerMapper; @@ -253,6 +281,8 @@ public class ChannelPublishingJmsMessageListener * to converting into a Spring Integration Message. This value is set to * true by default. To send the JMS Message itself as a * Spring Integration Message payload, set this to false. + * + * @param extractRequestPayload true if the request payload should be extracted. */ public void setExtractRequestPayload(boolean extractRequestPayload) { this.extractRequestPayload = extractRequestPayload; @@ -263,6 +293,8 @@ public class ChannelPublishingJmsMessageListener * extracted prior to converting into a JMS Message. This value is set to * true by default. To send the Spring Integration Message * itself as the JMS Message's body, set this to false. + * + * @param extractReplyPayload true if the reply payload should be extracted. */ public void setExtractReplyPayload(boolean extractReplyPayload) { this.extractReplyPayload = extractReplyPayload; @@ -386,6 +418,7 @@ public class ChannelPublishingJmsMessageListener /** * Resolve the default reply destination into a JMS {@link Destination}, using this * listener's {@link DestinationResolver} in case of a destination name. + * @param session The session. * @return the located {@link Destination} * @throws javax.jms.JMSException if resolution failed * @see #setDefaultReplyDestination diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java index 6d64ce99e1..307dc324fe 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/DefaultJmsHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -28,6 +28,7 @@ import javax.jms.JMSException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.messaging.MessageHeaders; import org.springframework.util.StringUtils; @@ -71,6 +72,8 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { * This does not affect the JMS properties covered by the specification/API, * such as JMSCorrelationID, etc. The header names used for mapping such * properties are all defined in our {@link JmsHeaders}. + * + * @param inboundPrefix The inbound prefix. */ public void setInboundPrefix(String inboundPrefix) { this.inboundPrefix = (inboundPrefix != null) ? inboundPrefix : ""; @@ -84,11 +87,14 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { * This does not affect the JMS properties covered by the specification/API, * such as JMSCorrelationID, etc. The header names used for mapping such * properties are all defined in our {@link JmsHeaders}. + * + * @param outboundPrefix The outbound prefix. */ public void setOutboundPrefix(String outboundPrefix) { this.outboundPrefix = (outboundPrefix != null) ? outboundPrefix : ""; } + @Override public void fromHeaders(MessageHeaders headers, javax.jms.Message jmsMessage) { try { Object jmsCorrelationId = headers.get(JmsHeaders.CORRELATION_ID); @@ -151,6 +157,7 @@ public class DefaultJmsHeaderMapper implements JmsHeaderMapper { } } + @Override public Map toHeaders(javax.jms.Message jmsMessage) { Map headers = new HashMap(); try { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java index 2b4a3ecdaf..46f630d44a 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsDestinationPollingSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -20,13 +20,13 @@ import java.util.Map; import javax.jms.Destination; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.core.MessageSource; import org.springframework.integration.support.MessageBuilder; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.support.converter.MessageConverter; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -34,7 +34,7 @@ import org.springframework.util.Assert; * only recommended for very low message volume. Otherwise, the * {@link JmsMessageDrivenEndpoint} that uses Spring's MessageListener container * support is a better option. - * + * * @author Mark Fisher * @author Oleg Zhurakousky */ @@ -73,6 +73,8 @@ public class JmsDestinationPollingSource extends IntegrationObjectSupport implem /** * Specify a JMS Message Selector expression to use when receiving Messages. + * + * @param messageSelector The message selector. */ public void setMessageSelector(String messageSelector) { this.messageSelector = messageSelector; @@ -83,10 +85,11 @@ public class JmsDestinationPollingSource extends IntegrationObjectSupport implem } /** - * Will receive a JMS {@link javax.jms.Message} converting and returning it as + * Will receive a JMS {@link javax.jms.Message} converting and returning it as * a Spring Integration {@link Message}. This method will also use the current * {@link JmsHeaderMapper} instance to map JMS properties to the MessageHeaders. */ + @Override @SuppressWarnings("unchecked") public Message receive() { Message convertedMessage = null; diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java index 82457818ce..15cb203f9b 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java @@ -45,7 +45,6 @@ import javax.jms.Topic; import org.springframework.context.SmartLifecycle; import org.springframework.expression.Expression; import org.springframework.integration.IntegrationMessageHeaderAccessor; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.MessageTimeoutException; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor; @@ -60,6 +59,7 @@ import org.springframework.jms.support.destination.DynamicDestinationResolver; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageDeliveryException; +import org.springframework.messaging.MessageHandlingException; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; @@ -149,6 +149,9 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * specified as a boolean value ("true" or "false"). This will set the delivery * mode accordingly to either "PERSISTENT" (1) or "NON_PERSISTENT" (2). *

    The default is "true", i.e. delivery mode "PERSISTENT". + * + * @param deliveryPersistent true for a persistent delivery. + * * @see javax.jms.DeliveryMode#PERSISTENT * @see javax.jms.DeliveryMode#NON_PERSISTENT */ @@ -159,6 +162,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Set the JMS ConnectionFactory that this gateway should use. * This is a required property. + * + * @param connectionFactory The connection factory. */ public void setConnectionFactory(ConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; @@ -167,6 +172,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Set the JMS Destination to which request Messages should be sent. * Either this or one of 'requestDestinationName' or 'requestDestinationExpression' is required. + * + * @param requestDestination The request destination. */ public void setRequestDestination(Destination requestDestination) { if (requestDestination instanceof Topic) { @@ -178,6 +185,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Set the name of the JMS Destination to which request Messages should be sent. * Either this or one of 'requestDestination' or 'requestDestinationExpression' is required. + * + * @param requestDestinationName The request destination name. */ public void setRequestDestinationName(String requestDestinationName) { this.requestDestinationName = requestDestinationName; @@ -187,6 +196,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * Set the SpEL Expression to be used for determining the request Destination instance * or request destination name. Either this or one of 'requestDestination' or * 'requestDestinationName' is required. + * + * @param requestDestinationExpression The request destination expression. */ public void setRequestDestinationExpression(Expression requestDestinationExpression) { Assert.notNull(requestDestinationExpression, "'requestDestinationExpression' must not be null"); @@ -196,6 +207,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Set the JMS Destination from which reply Messages should be received. * If none is provided, this gateway will create a {@link TemporaryQueue} per invocation. + * + * @param replyDestination The reply destination. */ public void setReplyDestination(Destination replyDestination) { if (replyDestination instanceof Topic) { @@ -207,6 +220,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Set the name of the JMS Destination from which reply Messages should be received. * If none is provided, this gateway will create a {@link TemporaryQueue} per invocation. + * + * @param replyDestinationName The reply destination name. */ public void setReplyDestinationName(String replyDestinationName) { this.replyDestinationName = replyDestinationName; @@ -216,6 +231,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * Set the SpEL Expression to be used for determining the reply Destination instance * or reply destination name. Either this or one of 'replyDestination' or * 'replyDestinationName' is required. + * + * @param replyDestinationExpression The reply destination expression. */ public void setReplyDestinationExpression(Expression replyDestinationExpression) { Assert.notNull(replyDestinationExpression, "'replyDestinationExpression' must not be null"); @@ -226,6 +243,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * Provide the {@link DestinationResolver} to use when resolving either a * 'requestDestinationName' or 'replyDestinationName' value. The default * is an instance of {@link DynamicDestinationResolver}. + * + * @param destinationResolver The destination resolver. */ public void setDestinationResolver(DestinationResolver destinationResolver) { this.destinationResolver = destinationResolver; @@ -236,7 +255,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * necessary when providing a destination name for a Topic rather than * a destination reference. * - * @param requestPubSubDomain true if the request destination is a Topic + * @param requestPubSubDomain true if the request destination is a Topic. */ public void setRequestPubSubDomain(boolean requestPubSubDomain) { this.requestPubSubDomain = requestPubSubDomain; @@ -247,7 +266,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * necessary when providing a destination name for a Topic rather than * a destination reference. * - * @param replyPubSubDomain true if the reply destination is a Topic + * @param replyPubSubDomain true if the reply destination is a Topic. */ public void setReplyPubSubDomain(boolean replyPubSubDomain) { this.replyPubSubDomain = replyPubSubDomain; @@ -256,27 +275,18 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Set the max timeout value for the MessageConsumer's receive call when * waiting for a reply. The default value is 5 seconds. + * + * @param receiveTimeout The receive timeout. */ public void setReceiveTimeout(long receiveTimeout) { this.receiveTimeout = receiveTimeout; } - /** - * Specify the JMS DeliveryMode to use when sending request Messages. - * @deprecated use {@link #setDeliveryPersistent(boolean)} - * This should have been deprecated in 2.0 when the attribute was - * deprecated in the schema. As of 3.0, the attribute has been - * removed but this remains to allow users of the API to migrate. - * TODO: Remove in 3.1/4.0 - */ - @Deprecated - public void setDeliveryMode(int deliveryMode) { - this.deliveryMode = deliveryMode; - } - /** * Specify the JMS priority to use when sending request Messages. * The value should be within the range of 0-9. + * + * @param priority The priority. */ public void setPriority(int priority) { this.priority = priority; @@ -285,6 +295,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Specify the timeToLive for each sent Message. * The default value indicates no expiration. + * + * @param timeToLive The time to live. */ public void setTimeToLive(long timeToLive) { this.timeToLive = timeToLive; @@ -293,6 +305,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Specify whether explicit QoS settings are enabled * (deliveryMode, priority, and timeToLive). + * + * @param explicitQosEnabled true to enable explicit QoS. */ public void setExplicitQosEnabled(boolean explicitQosEnabled) { this.explicitQosEnabled = explicitQosEnabled; @@ -308,6 +322,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * If you want to store the outbound correlation UUID value in the actual * JMSCorrelationID property, then set this value to "JMSCorrelationID". * However, any other value will be treated as a JMS String Property. + * + * @param correlationKey The correlation key. */ public void setCorrelationKey(String correlationKey) { this.correlationKey = correlationKey; @@ -319,6 +335,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * the JMS reply Messages back into Spring Integration Messages. *

    * The default is {@link SimpleMessageConverter}. + * + * @param messageConverter The message converter. */ public void setMessageConverter(MessageConverter messageConverter) { Assert.notNull(messageConverter, "'messageConverter' must not be null"); @@ -328,6 +346,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Provide a {@link JmsHeaderMapper} implementation for mapping the * Spring Integration Message Headers to/from JMS Message properties. + * + * @param headerMapper The header mapper. */ public void setHeaderMapper(JmsHeaderMapper headerMapper) { this.headerMapper = headerMapper; @@ -344,7 +364,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp *
    * Default is 'true' * - * @param extractRequestPayload + * @param extractRequestPayload true to extract the request payload. */ public void setExtractRequestPayload(boolean extractRequestPayload) { this.extractRequestPayload = extractRequestPayload; @@ -357,7 +377,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp * Otherwise, the entire JMS Message will become the payload of the * Spring Integration Message. * - * @param extractReplyPayload + * @param extractReplyPayload true to extract the reply payload. */ public void setExtractReplyPayload(boolean extractReplyPayload) { this.extractReplyPayload = extractReplyPayload; @@ -366,6 +386,8 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Specify the Spring Integration reply channel. If this property is not * set the gateway will check for a 'replyChannel' header on the request. + * + * @param replyChannel The reply channel. */ public void setReplyChannel(MessageChannel replyChannel) { this.setOutputChannel(replyChannel); @@ -448,10 +470,12 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp session, replyDestinationName, this.replyPubSubDomain); } + @Override public int getPhase() { return Integer.MAX_VALUE; } + @Override public boolean isAutoStartup() { return this.autoStartup; } @@ -570,6 +594,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } } + @Override public void start() { synchronized (this.lifeCycleMonitor) { if (!this.active) { @@ -584,6 +609,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } } + @Override public void stop() { synchronized (this.lifeCycleMonitor) { if (this.replyContainer != null) { @@ -595,10 +621,12 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp } } + @Override public boolean isRunning() { return this.active; } + @Override public void stop(Runnable callback) { this.stop(); callback.run(); @@ -952,6 +980,9 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Create a new JMS Connection for this JMS gateway. + * + * @return The connection. + * @throws JMSException Any JMSException. */ protected Connection createConnection() throws JMSException { return this.connectionFactory.createConnection(); @@ -959,11 +990,16 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp /** * Create a new JMS Session using the provided Connection. + * + * @param connection The connection. + * @return The session. + * @throws JMSException Any JMSException. */ protected Session createSession(Connection connection) throws JMSException { return connection.createSession(false, Session.AUTO_ACKNOWLEDGE); } + @Override public void onMessage(javax.jms.Message message) { String correlationId = null; try { @@ -1112,6 +1148,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp private class LateReplyReaper implements Runnable { + @Override public void run() { if (logger.isTraceEnabled()) { logger.trace("Running late reply reaper"); diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java index 6780f01050..1861042a5e 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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,6 +82,8 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { * *

    The default value is true. To force passing of the full * Spring Integration Message instead, set this to false. + * + * @param extractPayload true to extract the payload. */ public void setExtractPayload(boolean extractPayload) { this.extractPayload = extractPayload; @@ -159,6 +161,7 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { this.headerMapper = headerMapper; } + @Override public javax.jms.Message postProcessMessage(javax.jms.Message jmsMessage) throws JMSException { this.headerMapper.fromHeaders(this.integrationMessage.getHeaders(), jmsMessage); return jmsMessage; 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 64b6ee06a5..97c159e7f6 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -64,17 +64,19 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr /** * Specify the maximum number of subscribers supported by the * channel's dispatcher. - * @param maxSubscribers + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; } + @Override public boolean subscribe(MessageHandler handler) { Assert.state(this.dispatcher != null, "'MessageDispatcher' must not be null. This channel might not have been initialized"); return this.dispatcher.addHandler(handler); } + @Override public boolean unsubscribe(MessageHandler handler) { Assert.state(this.dispatcher != null, "'MessageDispatcher' must not be null. This channel might not have been initialized"); return this.dispatcher.removeHandler(handler); @@ -139,6 +141,7 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr } + @Override public void onMessage(javax.jms.Message message) { Message messageToSend = null; try { @@ -177,36 +180,43 @@ public class SubscribableJmsChannel extends AbstractJmsChannel implements Subscr * SmartLifecycle implementation (delegates to the MessageListener container) */ + @Override public boolean isAutoStartup() { return (this.container != null) ? this.container.isAutoStartup() : false; } + @Override public int getPhase() { return (this.container != null) ? this.container.getPhase() : 0; } + @Override public boolean isRunning() { return (this.container != null) ? this.container.isRunning() : false; } + @Override public void start() { if (this.container != null) { this.container.start(); } } + @Override public void stop() { if (this.container != null) { this.container.stop(); } } + @Override public void stop(Runnable callback) { if (this.container != null) { this.container.stop(callback); } } + @Override public void destroy() throws Exception { if (this.container != null) { this.container.destroy(); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java index e42041ef97..90a6935c6b 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/AttributePollingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -20,10 +20,10 @@ import javax.management.MBeanServerConnection; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; -import org.springframework.messaging.MessagingException; import org.springframework.integration.core.MessageSource; import org.springframework.integration.endpoint.AbstractMessageSource; import org.springframework.jmx.support.ObjectNameManager; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -45,6 +45,8 @@ public class AttributePollingMessageSource extends AbstractMessageSource /** * Provide the MBeanServer where the JMX MBean has been registered. + * + * @param server The MBean server connection. */ public void setServer(MBeanServerConnection server) { this.server = server; @@ -52,6 +54,8 @@ public class AttributePollingMessageSource extends AbstractMessageSource /** * Specify the String value of the JMX MBean's {@link ObjectName}. + * + * @param objectName The object name. */ public void setObjectName(String objectName) { try { @@ -64,6 +68,8 @@ public class AttributePollingMessageSource extends AbstractMessageSource /** * Specify the name of the attribute to be retrieved. + * + * @param attributeName The attribute name. */ public void setAttributeName(String attributeName) { this.attributeName = attributeName; diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanAttributeFilter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanAttributeFilter.java index bb295c9d24..bc70562b17 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanAttributeFilter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanAttributeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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,9 +25,9 @@ import javax.management.ObjectName; public interface MBeanAttributeFilter { /** - * @param objectName - * @param attributeName - * @return outcome of test + * @param objectName The object name. + * @param attributeName The attribute name. + * @return true if the attribute passes the filter. */ boolean accept(ObjectName objectName, String attributeName); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java index 348ec1c135..90f39c81ca 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanObjectConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -27,9 +27,9 @@ import javax.management.ObjectInstance; public interface MBeanObjectConverter { /** - * @param connection - * @param instance - * @return mapped object instance + * @param connection The connection. + * @param instance The instance. + * @return The mapped object instance. */ Object convert(MBeanServerConnection connection, ObjectInstance instance); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java index 9e304731d4..77f30792ac 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/MBeanTreePollingMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -48,7 +48,7 @@ public class MBeanTreePollingMessageSource extends AbstractMessageSource private final MBeanObjectConverter converter; /** - * @param converter + * @param converter The converter. */ public MBeanTreePollingMessageSource(MBeanObjectConverter converter) { this.converter = converter; @@ -80,13 +80,15 @@ public class MBeanTreePollingMessageSource extends AbstractMessageSource /** * Provide the MBeanServer where the JMX MBean has been registered. + * + * @param server The MBean server connection. */ public void setServer(MBeanServerConnection server) { this.server = server; } /** - * @param queryName + * @param queryName The query name. */ public void setQueryName(String queryName) { Assert.notNull(queryName, "'queryName' must not be null"); @@ -99,14 +101,14 @@ public class MBeanTreePollingMessageSource extends AbstractMessageSource } /** - * @param queryName + * @param queryName The query name. */ public void setQueryNameReference(ObjectName queryName) { this.queryName = queryName; } /** - * @param queryExpression + * @param queryExpression The query expression. */ public void setQueryExpression(String queryExpression) { Assert.notNull(queryExpression, "'queryExpression' must not be null"); @@ -119,7 +121,7 @@ public class MBeanTreePollingMessageSource extends AbstractMessageSource } /** - * @param queryExpression + * @param queryExpression The query expression. */ public void setQueryExpressionReference(QueryExp queryExpression) { this.queryExpression = queryExpression; diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java index f7e045442f..e9ed5539d8 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NamedFieldsMBeanAttributeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -29,7 +29,7 @@ public class NamedFieldsMBeanAttributeFilter implements MBeanAttributeFilter { private final String[] namedFields; /** - * @param namedFields + * @param namedFields The named fields that should pass the filter. */ public NamedFieldsMBeanAttributeFilter(String... namedFields) { this.namedFields = (String[]) Arrays.asList(namedFields).toArray(); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java index de31d41488..595a945962 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotNamedFieldsMBeanAttributeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. @@ -29,7 +29,7 @@ public class NotNamedFieldsMBeanAttributeFilter implements MBeanAttributeFilter private final String[] namedFields; /** - * @param namedFields + * @param namedFields The named fields that should be filtered. */ public NotNamedFieldsMBeanAttributeFilter(String... namedFields) { this.namedFields = (String[]) Arrays.asList(namedFields).toArray(); diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java index a8f5df28c7..f51ea68612 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/NotificationListeningMessageProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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,9 +34,10 @@ import javax.management.ObjectName; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.messaging.Message; + import org.springframework.integration.endpoint.MessageProducerSupport; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; @@ -64,6 +65,8 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport /** * Provide a reference to the MBeanServer where the notification * publishing MBeans are registered. + * + * @param server the MBean server connection. */ public void setServer(MBeanServerConnection server) { this.server = server; @@ -73,6 +76,8 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport * Specify the JMX ObjectNames (or patterns) * of the notification publisher * to which this notification listener should be subscribed. + * + * @param objectNames The object names. */ public void setObjectName(ObjectName... objectNames) { Assert.isTrue(!ObjectUtils.isEmpty(objectNames), "'objectNames' must contain at least one ObjectName"); @@ -82,6 +87,8 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport /** * Specify a {@link NotificationFilter} to be passed to the server * when registering this listener. The filter may be null. + * + * @param filter The filter. */ public void setFilter(NotificationFilter filter) { this.filter = filter; @@ -90,6 +97,8 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport /** * Specify a handback object to provide context to the listener * upon notification. This object may be null. + * + * @param handback The object. */ public void setHandback(Object handback) { this.handback = handback; @@ -101,6 +110,7 @@ public class NotificationListeningMessageProducer extends MessageProducerSupport * not null, it sets that as a Message header value. The Message is then * sent to this producer's output channel. */ + @Override public void handleNotification(Notification notification, Object handback) { if (logger.isInfoEnabled()) { logger.info("received notification: " + notification + ", and handback: " + handback); 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 3a52cbbb06..220bc1f447 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-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -26,7 +26,6 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.ListableBeanFactory; -import org.springframework.messaging.Message; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.mapping.OutboundMessageMapper; import org.springframework.integration.monitor.IntegrationMBeanExporter; @@ -35,6 +34,7 @@ import org.springframework.jmx.export.annotation.ManagedResource; import org.springframework.jmx.export.notification.NotificationPublisher; import org.springframework.jmx.export.notification.NotificationPublisherAware; import org.springframework.jmx.support.ObjectNameManager; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -74,6 +74,8 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler * a default implementation will be used such that String-typed payloads will be * passed as the 'message' of the Notification and all other payload types * will be passed as the 'userData' of the Notification. + * + * @param notificationMapper The notification mapper. */ public void setNotificationMapper(OutboundMessageMapper notificationMapper) { this.notificationMapper = notificationMapper; @@ -84,6 +86,8 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler * use by default when no explicit Notification mapper * has been configured. If not provided, then a notification type header will * be required for each message being mapped into a Notification. + * + * @param defaultNotificationType The default notification type. */ public void setDefaultNotificationType(String defaultNotificationType) { this.defaultNotificationType = defaultNotificationType; @@ -125,6 +129,7 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler private volatile NotificationPublisher notificationPublisher; + @Override public void setNotificationPublisher(NotificationPublisher notificationPublisher) { this.notificationPublisher = notificationPublisher; } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java index a7fe31a71a..a9c87b6b37 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -32,11 +32,11 @@ import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import org.springframework.beans.factory.InitializingBean; -import org.springframework.messaging.MessageHandlingException; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.util.ClassUtils; import org.springframework.jmx.support.ObjectNameManager; import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandlingException; import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; @@ -72,6 +72,8 @@ public class OperationInvokingMessageHandler extends AbstractReplyProducingMessa /** * Provide a reference to the MBeanServer within which the MBean * target for operation invocation has been registered. + * + * @param server The MBean server connection. */ public void setServer(MBeanServerConnection server) { this.server = server; @@ -80,6 +82,8 @@ public class OperationInvokingMessageHandler extends AbstractReplyProducingMessa /** * Specify a default ObjectName to use when no such header is * available on the Message being handled. + * + * @param objectName The object name. */ public void setObjectName(String objectName) { try { @@ -95,6 +99,8 @@ public class OperationInvokingMessageHandler extends AbstractReplyProducingMessa /** * Specify an operation name to be invoked when no such * header is available on the Message being handled. + * + * @param operationName The operation name. */ public void setOperationName(String operationName) { this.operationName = operationName; diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java index 5d9b7f10f0..e09ce195c2 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -219,7 +219,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware, Integrat * Keep in mind that the number of entities effected by the operation may * not necessarily correlate with the number of rows effected in the database. * - * @param message + * @param message The message. * @return Either the number of affected entities when using a JPQL query. * When using a merge/persist the updated/inserted itself is returned. */ @@ -379,6 +379,8 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware, Integrat /** * Execute the JPA operation. Delegates to {@link JpaExecutor#poll(Message)}. + * + * @return The object or null. */ public Object poll() { return this.poll(null); @@ -578,6 +580,8 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware, Integrat * If set to false, the complete result list is returned as the * payload. * + * @param expectSingleResult true if a single object is expected. + * */ public void setExpectSingleResult(boolean expectSingleResult) { this.expectSingleResult = expectSingleResult; @@ -587,7 +591,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware, Integrat * Sets the expression that will be evaluated to get the first result in the query executed. * If a null expression is set, all the results in the result set will be retrieved * - * @param firstResultExpression + * @param firstResultExpression The first result expression. * * @see Query#setFirstResult(int) */ @@ -601,7 +605,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware, Integrat * Sets the expression for maximum number of results expression. It has be a non null value * Not setting one will default to the behavior of fetching all the records * - * @param maxResultsExpression + * @param maxResultsExpression The maximum results expression. */ public void setMaxResultsExpression(Expression maxResultsExpression) { Assert.notNull(maxResultsExpression, "maxResultsExpression cannot be null"); @@ -624,7 +628,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware, Integrat * Sets the evaluation context for evaluating the expression to get the from record of the * result set retrieved by the retrieving gateway. * - * @param evaluationContext + * @param evaluationContext The evaluation context. */ @Override public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) { diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java index 9c9bdf7f18..b5bd6c380e 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperationFailedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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,8 +49,9 @@ public class JpaOperationFailedException extends RuntimeException { /** * If execution of a JPA QL fails, we can set that query using this convenience method. - * @param offendingJPAQl - * @return JpaOperationFailedException + * + * @param offendingJPAQl The offending query. + * @return this. */ public JpaOperationFailedException withOffendingJPAQl(String offendingJPAQl) { setOffendingJPAQl(offendingJPAQl); diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java index 3d62f933a5..2ae7ac0542 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,13 +34,13 @@ public interface JpaOperations { /** * - * @param entity + * @param entity The entity to delete. */ void delete(Object entity); /** * - * @param entities + * @param entities The entities to delete. */ void deleteInBatch(Iterable entities); @@ -57,16 +57,16 @@ public interface JpaOperations { /** * - * @param updateQuery - * @param source - * @return The number of entities updated + * @param updateQuery The update query. + * @param source The parameter source. + * @return The number of entities updated. */ int executeUpdateWithNamedQuery(String updateQuery, ParameterSource source); /** * - * @param updateQuery - * @param source + * @param updateQuery The update query. + * @param source The parameter source. * @return The number of entities updated */ int executeUpdateWithNativeQuery(String updateQuery, ParameterSource source); @@ -75,19 +75,19 @@ public interface JpaOperations { /** * Find an Entity of given type with the given primary key type. * - * @param - * @param entityType - * @param id - * @return The entity if it exist, null is returned otherwise + * @param The type to return. + * @param entityType The type. + * @param id The object identifier. + * @return The entity if it exists, null otherwise. */ T find(Class entityType, Object id); /** * - * @param entityClass - * @param firstResult - * @param maxNumberOfReturnedObjects - * @return List of found entities + * @param entityClass The entity class. + * @param firstResult The index of the first result to return. + * @param maxNumberOfReturnedObjects The number of objects to return. + * @return The list of found entities. */ List getResultListForClass(Class entityClass, int firstResult, @@ -95,11 +95,11 @@ public interface JpaOperations { /** * - * @param selectNamedQuery - * @param jpaQLParameterSource - * @param firstResult - * @param maxNumberOfResults - * @return List of found entities + * @param selectNamedQuery The select named query. + * @param jpaQLParameterSource The paramter source. + * @param firstResult The index of the first result to return. + * @param maxNumberOfResults The number of objects to return. + * @return The list of found entities. */ List getResultListForNamedQuery(String selectNamedQuery, ParameterSource jpaQLParameterSource, int firstResult, @@ -107,12 +107,12 @@ public interface JpaOperations { /** * - * @param selectQuery - * @param entityClass - * @param jpaQLParameterSource - * @param firstResult - * @param maxNumberOfResults - * @return List of found entities + * @param selectQuery The select query. + * @param entityClass The entity class. + * @param jpaQLParameterSource The paramter source. + * @param firstResult The index of the first result to return. + * @param maxNumberOfResults The number of objects to return. + * @return The list of found entities. */ List getResultListForNativeQuery(String selectQuery, Class entityClass, ParameterSource jpaQLParameterSource, @@ -121,9 +121,9 @@ public interface JpaOperations { /** * Executes the provided query to return a list of results - * @param query + * @param query The query. * @param source the Parameter source for this query to be executed, if none then set as null - * @return List of found entities + * @return The list of found entities. */ List getResultListForQuery(String query, ParameterSource source); @@ -131,10 +131,10 @@ public interface JpaOperations { * Executes the provided query to return a list of results. * * @param query Must not be null or empty - * @param firstResult The first result - * @param maxNumberOfResults Must be a non-negative value, any negative or zero will be ignored - * @param source the Parameter source for this query to be executed, if none then set null - * @return List of found entities + * @param firstResult The first result. + * @param maxNumberOfResults Must be a non-negative value, any negative or zero will be ignored. + * @param source the Parameter source for this query to be executed, if none then set null. + * @return The list of found entities. */ List getResultListForQuery(String query, ParameterSource source, int firstResult, int maxNumberOfResults); @@ -167,6 +167,11 @@ public interface JpaOperations { * provided object is {@link Iterable}. * {@code clearOnFlush}parameter specifies, if the {@link javax.persistence.EntityManager#clear()} * should be called after each {@link javax.persistence.EntityManager#flush()}. + * + * @param entity The entity. + * @param flushSize The flush size. + * @param clearOnFlush true to clear after flushing. + * @return The merged object. */ Object merge(Object entity, int flushSize, boolean clearOnFlush); @@ -192,6 +197,10 @@ public interface JpaOperations { * provided object is {@link Iterable}. * {@code clearOnFlush}parameter specifies, if the {@link javax.persistence.EntityManager#clear()} * should be called after each {@link javax.persistence.EntityManager#flush()}. + * + * @param entity The entity. + * @param flushSize The flush size. + * @param clearOnFlush true to clear after flushing. */ void persist(Object entity, int flushSize, boolean clearOnFlush); diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java index e0bcc458e5..6a1934f30e 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -16,11 +16,11 @@ package org.springframework.integration.jpa.outbound; -import org.springframework.messaging.Message; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.jpa.core.JpaExecutor; import org.springframework.integration.jpa.support.OutboundGatewayType; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; import org.springframework.util.Assert; /** @@ -88,7 +88,7 @@ public class JpaOutboundGateway extends AbstractReplyProducingMessageHandler { /** * - * @param gatewayType + * @param gatewayType The gateway type. */ public void setGatewayType(OutboundGatewayType gatewayType) { Assert.notNull(gatewayType, "gatewayType must not be null."); diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java index e3aec65b34..30704e082d 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -23,10 +23,10 @@ import org.aopalliance.aop.Advice; import org.springframework.aop.framework.ProxyFactory; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.AbstractFactoryBean; -import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.MessageHandler; import org.springframework.integration.jpa.core.JpaExecutor; import org.springframework.integration.jpa.support.OutboundGatewayType; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHandler; import org.springframework.transaction.interceptor.TransactionInterceptor; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -128,7 +128,7 @@ public class JpaOutboundGatewayFactoryBean extends AbstractFactoryBean The entity type. + * @return The query. + * */ public static Query applyAndBind(String queryString, Iterable entities, EntityManager entityManager) { @@ -137,6 +146,10 @@ public final class JpaUtils { /** * Returns the query string for the given class name. + * + * @param template The template. + * @param entityName The entity name. + * @return The query string. */ public static String getQueryString(String template, String entityName) { diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ParameterSourceFactory.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ParameterSourceFactory.java index a1360376fa..c23c0cbe44 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ParameterSourceFactory.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/support/parametersource/ParameterSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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,7 +25,8 @@ public interface ParameterSourceFactory { /** * Return a new {@link ParameterSource}. - * @param input the raw message or query result to be transformed into a {@link ParameterSource} + * @param input The raw message or query result to be transformed into a {@link ParameterSource}. + * @return The parameter source. */ ParameterSource createParameterSource(Object input); 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 d91e3a8f05..3af01359a1 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -120,6 +120,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl * Set the {@link Session}. Otherwise, the Session will be created by invocation of * {@link Session#getInstance(Properties)} or {@link Session#getInstance(Properties, Authenticator)}. * + * @param session The session. + * * @see #setJavaMailProperties(Properties) * @see #setJavaMailAuthenticator(Authenticator) */ @@ -132,6 +134,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl * A new {@link Session} will be created with these properties (and the JavaMailAuthenticator if provided). * Use either this method or {@link #setSession}, but not both. * + * @param javaMailProperties The javamail properties. + * * @see #setJavaMailAuthenticator(Authenticator) * @see #setSession(Session) */ @@ -143,6 +147,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl * Optional, sets the Authenticator to be used to obtain a session. This will not be used if * {@link AbstractMailReceiver#setSession} has been used to configure the {@link Session} directly. * + * @param javaMailAuthenticator The javamail authenticator. + * * @see #setSession(Session) */ public void setJavaMailAuthenticator(Authenticator javaMailAuthenticator) { @@ -151,6 +157,8 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl /** * Specify the maximum number of Messages to fetch per call to {@link #receive()}. + * + * @param maxFetchSize The max fetch size. */ public void setMaxFetchSize(int maxFetchSize) { this.maxFetchSize = maxFetchSize; @@ -158,12 +166,16 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl /** * Specify whether mail messages should be deleted after retrieval. + * + * @param shouldDeleteMessages true to delete messages. */ public void setShouldDeleteMessages(boolean shouldDeleteMessages) { this.shouldDeleteMessages = shouldDeleteMessages; } /** * Indicates whether the mail messages should be deleted after being received. + * + * @return true when messages will be deleted. */ protected boolean shouldDeleteMessages() { return this.shouldDeleteMessages; @@ -175,6 +187,9 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl /** * Subclasses must implement this method to return new mail messages. + * + * @return An array of messages. + * @throws MessagingException Any MessagingException. */ protected abstract Message[] searchForNewMessages() throws MessagingException; @@ -227,6 +242,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl return this.store.getFolder(this.url); } + @Override public Message[] receive() throws javax.mail.MessagingException { synchronized (this.folderMonitor) { try { @@ -363,12 +379,13 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl * Optional method allowing you to set additional flags. * Currently only implemented in IMapMailReceiver. * - * @param message - * @throws MessagingException + * @param message The message. + * @throws MessagingException A MessagingException. */ protected void setAdditionalFlags(Message message) throws MessagingException { } + @Override public void destroy() throws Exception { synchronized (this.folderMonitor) { MailTransportUtils.closeFolder(this.folder, this.shouldDeleteMessages); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java index f678f75810..fc9a47e69b 100755 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/ImapIdleChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -119,6 +119,8 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be * Specify whether the IDLE task should reconnect automatically after * catching a {@link FolderClosedException} while waiting for messages. The * default value is true. + * + * @param shouldReconnectAutomatically true to reconnect. */ public void setShouldReconnectAutomatically(boolean shouldReconnectAutomatically) { this.shouldReconnectAutomatically = shouldReconnectAutomatically; @@ -129,6 +131,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be return "mail:imap-idle-channel-adapter"; } + @Override public void setBeanClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } @@ -176,6 +179,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be private class ReceivingTask implements Runnable { + @Override public void run() { try { idleTask.run(); @@ -194,6 +198,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be private class IdleTask implements Runnable { + @Override public void run() { final TaskScheduler scheduler = getTaskScheduler(); Assert.notNull(scheduler, "'taskScheduler' must not be null" ); @@ -239,6 +244,7 @@ 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 = MessageBuilder.withPayload(mailMessage).build(); @@ -282,6 +288,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be private class PingTask implements Runnable { + @Override public void run() { try { Store store = mailReceiver.getStore(); @@ -299,6 +306,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be private volatile boolean delayNextExecution; + @Override public Date nextExecutionTime(TriggerContext triggerContext) { if (delayNextExecution){ delayNextExecution = false; 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 21295bb9b8..c69f601482 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -74,6 +74,8 @@ public class ImapMailReceiver extends AbstractMailReceiver { /** * Check if messages should be marked as read. + * + * @return true if messages should be marked as read. */ public Boolean isShouldMarkMessagesAsRead() { return shouldMarkMessagesAsRead; @@ -83,7 +85,7 @@ public class ImapMailReceiver extends AbstractMailReceiver { * Provides a way to set custom {@link SearchTermStrategy} to compile a {@link SearchTerm} * to be applied when retrieving mail * - * @param searchTermStrategy + * @param searchTermStrategy The search term strategy implementation. */ public void setSearchTermStrategy(SearchTermStrategy searchTermStrategy) { Assert.notNull(searchTermStrategy, "'searchTermStrategy' must not be null"); @@ -92,6 +94,8 @@ public class ImapMailReceiver extends AbstractMailReceiver { /** * Specify if messages should be marked as read. + * + * @param shouldMarkMessagesAsRead true if messages should be marked as read. */ public void setShouldMarkMessagesAsRead(Boolean shouldMarkMessagesAsRead) { this.shouldMarkMessagesAsRead = shouldMarkMessagesAsRead; @@ -100,6 +104,8 @@ public class ImapMailReceiver extends AbstractMailReceiver { /** * This method is unique to the IMAP receiver and only works if IMAP IDLE * is supported (see RFC 2177 for more detail). + * + * @throws MessagingException Any MessagingException. */ public void waitForNewMessages() throws MessagingException { this.openFolder(); @@ -185,6 +191,7 @@ public class ImapMailReceiver extends AbstractMailReceiver { private class DefaultSearchTermStrategy implements SearchTermStrategy { + @Override public SearchTerm generateSearchTerm(Flags supportedFlags, Folder folder) { SearchTerm searchTerm = null; boolean recentFlagSupported = false; diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java index f385e59b77..47a08477ab 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/MailTransportUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2011 the original author or authors. + * Copyright 2007-2014 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. @@ -94,6 +94,9 @@ public abstract class MailTransportUtils { /** * Returns a string representation of the given {@link URLName}, where the * password has been protected. + * + * @param name The URL name. + * @return The result with password protection. */ public static String toPasswordProtectedString(URLName name) { String protocol = name.getProtocol(); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/SearchTermStrategy.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/SearchTermStrategy.java index 6dfc82668c..c88ca3ff7a 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/SearchTermStrategy.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/SearchTermStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -33,9 +33,9 @@ public interface SearchTermStrategy { /** * Will generate an instance of the {@link SearchTerm} * - * @param supportedFlags - * @param folder - * @return The search term + * @param supportedFlags The supported flags. + * @param folder The folder. + * @return The search term. */ SearchTerm generateSearchTerm(Flags supportedFlags, Folder folder); diff --git a/spring-integration-mail/src/main/java/org/springframework/integration/mail/transformer/MailToStringTransformer.java b/spring-integration-mail/src/main/java/org/springframework/integration/mail/transformer/MailToStringTransformer.java index fdcc0e6ee3..d63195c701 100644 --- a/spring-integration-mail/src/main/java/org/springframework/integration/mail/transformer/MailToStringTransformer.java +++ b/spring-integration-mail/src/main/java/org/springframework/integration/mail/transformer/MailToStringTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -29,7 +29,7 @@ import org.springframework.util.Assert; * If the mail message's content is a String, it will be the payload of the * result Message. If the content is a Multipart, a String will be created from * an output stream of bytes using the provided charset (or UTF-8 by default). - * + * * @author Mark Fisher */ public class MailToStringTransformer extends AbstractMailMessageTransformer { @@ -40,6 +40,8 @@ public class MailToStringTransformer extends AbstractMailMessageTransformer entityClass) { Assert.notNull(entityClass, "'entityClass' must not be null"); @@ -135,7 +135,7 @@ public class MongoDbMessageSource extends IntegrationObjectSupport * and the payload of the returned {@link Message} will be the returned target Object of type * identified by {{@link #entityClass} instead of a List. * - * @param expectSingleResult + * @param expectSingleResult true if a single result is expected. */ public void setExpectSingleResult(boolean expectSingleResult) { this.expectSingleResult = expectSingleResult; @@ -146,7 +146,7 @@ public class MongoDbMessageSource extends IntegrationObjectSupport * used by the {@link Query}. The resulting collection name will be included * in the {@link MongoHeaders#COLLECTION_NAME} header. * - * @param collectionNameExpression + * @param collectionNameExpression The collection name expression. */ public void setCollectionNameExpression(Expression collectionNameExpression) { Assert.notNull(collectionNameExpression, "'collectionNameExpression' must not be null"); @@ -158,7 +158,7 @@ public class MongoDbMessageSource extends IntegrationObjectSupport * data read from MongoDb. Only allowed if this instance was constructed with a * {@link MongoDbFactory}. * - * @param mongoConverter + * @param mongoConverter The mongo converter. */ public void setMongoConverter(MongoConverter mongoConverter) { Assert.isNull(this.mongoTemplate, @@ -185,6 +185,7 @@ public class MongoDbMessageSource extends IntegrationObjectSupport * {@link Message} with payload of type {@link List}. The collection name used in the * query will be provided in the {@link MongoHeaders#COLLECTION_NAME} header. */ + @Override public Message receive() { Assert.isTrue(this.initialized, "This class is not yet initialized. Invoke its afterPropertiesSet() method"); Message message = 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 11b015be09..66cdf8f24e 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-2012 the original author or authors + * Copyright 2007-2014 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. @@ -22,10 +22,10 @@ import org.springframework.data.mongodb.core.convert.MongoConverter; import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHandler; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.handler.AbstractMessageHandler; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandler; import org.springframework.util.Assert; /** * Implementation of {@link MessageHandler} which writes Message payload into a MongoDb collection @@ -53,7 +53,7 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler { /** * Will construct this instance using provided {@link MongoDbFactory} * - * @param mongoDbFactory + * @param mongoDbFactory The mongodb factory. */ public MongoDbStoringMessageHandler(MongoDbFactory mongoDbFactory){ Assert.notNull(mongoDbFactory, "'mongoDbFactory' must not be null"); @@ -65,7 +65,7 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler { * Will construct this instance using fully created and initialized instance of * provided {@link MongoOperations} * - * @param mongoTemplate + * @param mongoTemplate The MongoOperations implementation. */ public MongoDbStoringMessageHandler(MongoOperations mongoTemplate){ Assert.notNull(mongoTemplate, "'mongoTemplate' must not be null"); @@ -78,7 +78,7 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler { * of data written to MongoDb. Only allowed if this instance was constructed with a * {@link MongoDbFactory}. * - * @param mongoConverter + * @param mongoConverter The mongo converter. */ public void setMongoConverter(MongoConverter mongoConverter) { Assert.isNull(this.mongoTemplate, @@ -90,7 +90,7 @@ public class MongoDbStoringMessageHandler extends AbstractMessageHandler { * Sets the SpEL {@link Expression} that should resolve to a collection name * used by {@link MongoOperations} to store data * - * @param collectionNameExpression + * @param collectionNameExpression The collection name expression. */ public void setCollectionNameExpression(Expression collectionNameExpression) { Assert.notNull(collectionNameExpression, "'collectionNameExpression' must not be null"); diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java index 3230e21c6d..46cf9bed55 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -45,16 +45,16 @@ import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity; import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty; import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Update; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHeaders; import org.springframework.integration.history.MessageHistory; -import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.store.AbstractMessageGroupStore; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.MessageGroupStore; import org.springframework.integration.store.MessageStore; import org.springframework.integration.store.SimpleMessageGroup; import org.springframework.jmx.export.annotation.ManagedAttribute; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHeaders; +import org.springframework.messaging.support.GenericMessage; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; @@ -104,6 +104,8 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me /** * Create a MongoDbMessageStore using the provided {@link MongoDbFactory}.and the default collection name. + * + * @param mongoDbFactory The mongodb factory. */ public MongoDbMessageStore(MongoDbFactory mongoDbFactory) { this(mongoDbFactory, null); @@ -111,6 +113,9 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me /** * Create a MongoDbMessageStore using the provided {@link MongoDbFactory} and collection name. + * + * @param mongoDbFactory The mongodb factory. + * @param collectionName The collection name. */ public MongoDbMessageStore(MongoDbFactory mongoDbFactory, String collectionName) { Assert.notNull(mongoDbFactory, "mongoDbFactory must not be null"); @@ -121,34 +126,40 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me } + @Override public void setBeanClassLoader(ClassLoader classLoader) { Assert.notNull(classLoader, "classLoader must not be null"); this.classLoader = classLoader; } + @Override public Message addMessage(Message message) { Assert.notNull(message, "'message' must not be null"); this.template.insert(new MessageWrapper(message), this.collectionName); return message; } + @Override public Message getMessage(UUID id) { Assert.notNull(id, "'id' must not be null"); MessageWrapper messageWrapper = this.template.findOne(whereMessageIdIs(id), MessageWrapper.class, this.collectionName); return (messageWrapper != null) ? messageWrapper.getMessage() : null; } + @Override @ManagedAttribute public long getMessageCount() { return this.template.getCollection(this.collectionName).getCount(); } + @Override public Message removeMessage(UUID id) { Assert.notNull(id, "'id' must not be null"); MessageWrapper messageWrapper = this.template.findAndRemove(whereMessageIdIs(id), MessageWrapper.class, this.collectionName); return (messageWrapper != null) ? messageWrapper.getMessage() : null; } + @Override public MessageGroup getMessageGroup(Object groupId) { Assert.notNull(groupId, "'groupId' must not be null"); List messageWrappers = this.template.find(whereGroupIdIs(groupId), MessageWrapper.class, this.collectionName); @@ -178,6 +189,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me return messageGroup; } + @Override public MessageGroup addMessageToGroup(Object groupId, Message message) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(message, "'message' must not be null"); @@ -205,6 +217,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me return this.getMessageGroup(groupId); } + @Override public MessageGroup removeMessageFromGroup(Object groupId, Message messageToRemove) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messageToRemove, "'messageToRemove' must not be null"); @@ -214,6 +227,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me return this.getMessageGroup(groupId); } + @Override public void removeMessageGroup(Object groupId) { List messageWrappers = this.template.find(whereGroupIdIs(groupId), MessageWrapper.class, this.collectionName); for (MessageWrapper messageWrapper : messageWrappers) { @@ -221,6 +235,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me } } + @Override public Iterator iterator() { List groupedMessages = this.template.find(whereGroupIdExists(), MessageWrapper.class, this.collectionName); Map messageGroups = new HashMap(); @@ -233,6 +248,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me return messageGroups.values().iterator(); } + @Override public void completeGroup(Object groupId) { Update update = Update.update(GROUP_COMPLETE_KEY, true); Query q = whereGroupIdIs(groupId); @@ -240,6 +256,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me this.updateGroup(groupId); } + @Override public void setLastReleasedSequenceNumberForGroup(Object groupId, int sequenceNumber) { Update update = Update.update(LAST_RELEASED_SEQUENCE_NUMBER, sequenceNumber); Query q = whereGroupIdIs(groupId); @@ -247,6 +264,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me this.updateGroup(groupId); } + @Override public Message pollMessageFromGroup(Object groupId) { Assert.notNull(groupId, "'groupId' must not be null"); MessageWrapper messageWrapper = this.template.findAndRemove(whereGroupIdIsOrdered(groupId), MessageWrapper.class, this.collectionName); @@ -258,6 +276,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me return message; } + @Override public int messageGroupSize(Object groupId) { long lCount = this.template.count(new Query(where(GROUP_ID_KEY).is(groupId)), this.collectionName); Assert.isTrue(lCount <= Integer.MAX_VALUE, "Message count is out of Integer's range"); @@ -416,6 +435,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me } private static class UuidToDBObjectConverter implements Converter { + @Override public DBObject convert(UUID source) { BasicDBObject dbObject = new BasicDBObject(); dbObject.put("_value", source.toString()); @@ -425,6 +445,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me } private static class DBObjectToUUIDConverter implements Converter { + @Override public UUID convert(DBObject source) { return UUID.fromString((String) source.get("_value")); } @@ -433,6 +454,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me private static class MessageHistoryToDBObjectConverter implements Converter { + @Override public DBObject convert(MessageHistory source) { BasicDBObject obj = new BasicDBObject(); obj.put("_class", MessageHistory.class.getName()); @@ -451,6 +473,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore implements Me private class DBObjectToGenericMessageConverter implements Converter> { + @Override @SuppressWarnings("unchecked") public GenericMessage convert(DBObject source) { MessageReadingMongoConverter converter = (MessageReadingMongoConverter) MongoDbMessageStore.this.template 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 c21e52ad26..954129572d 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -97,17 +97,20 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements /** * Specify the maximum number of subscribers supported by the * channel's dispatcher. - * @param maxSubscribers + * + * @param maxSubscribers The maximum number of subscribers allowed. */ public void setMaxSubscribers(int maxSubscribers) { this.maxSubscribers = maxSubscribers; this.dispatcher.setMaxSubscribers(maxSubscribers); } + @Override public boolean subscribe(MessageHandler handler) { return this.dispatcher.addHandler(handler); } + @Override public boolean unsubscribe(MessageHandler handler) { return this.dispatcher.removeHandler(handler); } @@ -151,36 +154,43 @@ public class SubscribableRedisChannel extends AbstractMessageChannel implements * SmartLifecycle implementation (delegates to the MessageListener container) */ + @Override public boolean isAutoStartup() { return (this.container != null) ? this.container.isAutoStartup() : false; } + @Override public int getPhase() { return (this.container != null) ? this.container.getPhase() : 0; } + @Override public boolean isRunning() { return (this.container != null) ? this.container.isRunning() : false; } + @Override public void start() { if (this.container != null) { this.container.start(); } } + @Override public void stop() { if (this.container != null) { this.container.stop(); } } + @Override public void stop(Runnable callback) { if (this.container != null) { this.container.stop(callback); } } + @Override public void destroy() throws Exception { if (this.container != null) { this.container.destroy(); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java index 415f89cf40..28c5a2c303 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java @@ -115,14 +115,14 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport impl /** * This timeout (milliseconds) is used when retrieving elements from the queue * specified by {@link #boundListOperations}. - *

    + *

    * If the queue does contain elements, the data is retrieved immediately. However, * if the queue is empty, the Redis connection is blocked until either an element * can be retrieved from the queue or until the specified timeout passes. - *

    + *

    * A timeout of zero can be used to block indefinitely. If not set explicitly * the timeout value will default to {@code 1000} - *

    + *

    * See also: http://redis.io/commands/brpop * * @param receiveTimeout Must be non-negative. Specified in milliseconds. diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java index b7e01482c3..5b7c2c72b8 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisStoreMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -27,12 +27,12 @@ import org.springframework.data.redis.support.collections.RedisCollectionFactory import org.springframework.data.redis.support.collections.RedisStore; import org.springframework.expression.Expression; import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.messaging.Message; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.core.MessageSource; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.transaction.IntegrationResourceHolder; +import org.springframework.messaging.Message; import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.util.Assert; /** @@ -64,8 +64,8 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport * It assumes that {@link RedisTemplate} is fully initialized and ready to be used. * The 'keyExpression' will be evaluated on every call to the {@link #receive()} method. * - * @param redisTemplate - * @param keyExpression + * @param redisTemplate The Redis template. + * @param keyExpression The key expression. */ public RedisStoreMessageSource(RedisTemplate redisTemplate, Expression keyExpression) { @@ -85,8 +85,8 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport * * The 'keyExpression' will be evaluated on every call to the {@link #receive()} method. * - * @param connectionFactory - * @param keyExpression + * @param connectionFactory The connection factory. + * @param keyExpression The key expression. */ public RedisStoreMessageSource(RedisConnectionFactory connectionFactory, Expression keyExpression) { @@ -110,6 +110,7 @@ public class RedisStoreMessageSource extends IntegrationObjectSupport * Returns a Message with the view into a {@link RedisStore} identified * by {@link #keyExpression} */ + @Override @SuppressWarnings("unchecked") public Message receive() { String key = this.keyExpression.getValue(this.evaluationContext, String.class); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java index 9e45936094..9506a62a96 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 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. You may obtain a copy of the License at @@ -37,6 +37,8 @@ public class RedisMetadataStore implements MetadataStore { /** * Specifies the {@link RedisProperties} backend for this {@link MetadataStore}. + * + * @param properties The properties. */ public RedisMetadataStore(RedisProperties properties) { Assert.notNull(properties, "'properties' must not be null."); @@ -46,6 +48,8 @@ public class RedisMetadataStore implements MetadataStore { /** * Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory} * and default hash key - {@link #KEY}. + * + * @param connectionFactory The connection factory. */ public RedisMetadataStore(RedisConnectionFactory connectionFactory) { this(connectionFactory, KEY); @@ -53,6 +57,9 @@ public class RedisMetadataStore implements MetadataStore { /** * Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory} and key. + * + * @param connectionFactory The connection factory. + * @param key The key. */ public RedisMetadataStore(RedisConnectionFactory connectionFactory, String key) { Assert.notNull(connectionFactory, "'connectionFactory' must not be null."); @@ -65,6 +72,8 @@ public class RedisMetadataStore implements MetadataStore { /** * Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory} * and default hash key - {@link #KEY}. + * + * @param operations The Redis operations object. */ public RedisMetadataStore(RedisOperations operations) { this(operations, KEY); @@ -72,6 +81,9 @@ public class RedisMetadataStore implements MetadataStore { /** * Initializes the {@link RedisProperties} by provided {@link RedisConnectionFactory} and key. + * + * @param operations The Redis operations object. + * @param key The key. */ public RedisMetadataStore(RedisOperations operations, String key) { Assert.notNull(operations, "'operations' must not be null."); @@ -86,6 +98,7 @@ public class RedisMetadataStore implements MetadataStore { * @param key Must not be null * @param value Must not be null */ + @Override public void put(String key, String value) { Assert.notNull(key, "'key' must not be null."); Assert.notNull(value, "'value' must not be null."); @@ -97,6 +110,7 @@ public class RedisMetadataStore implements MetadataStore { * * @param key Must not be null */ + @Override public String get(String key) { Assert.notNull(key, "'key' must not be null."); return (String) this.properties.get(key); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java index d10b218b80..6b75fda057 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2007-2013 the original author or authors + * Copyright 2007-2014 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. @@ -71,6 +71,8 @@ public class RedisPublishingMessageHandler extends AbstractMessageHandler implem } /** + * @param defaultTopic The default topic. + * * @deprecated in favor of {@link #setTopicExpression(Expression)} or {@link #setTopic(String)} */ @Deprecated 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 7e0cbbc092..fd1741f591 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 @@ -1,5 +1,5 @@ /* - * Copyright 2007-2013 the original author or authors + * Copyright 2007-2014 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. @@ -45,12 +45,12 @@ import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHandlingException; -import org.springframework.messaging.MessageHandler; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.redis.support.RedisHeaders; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.MessageHandlingException; import org.springframework.util.Assert; import org.springframework.util.NumberUtils; @@ -108,7 +108,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { * Constructs an instance using the provided {@link RedisTemplate}. * The RedisTemplate must be fully initialized. * - * @param redisTemplate + * @param redisTemplate The Redis template. */ public RedisStoreWritingMessageHandler(RedisTemplate redisTemplate) { Assert.notNull(redisTemplate, "'redisTemplate' must not be null"); @@ -124,7 +124,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { * hash values, when it is false. * * @see #setExtractPayloadElements(boolean) - * @param connectionFactory + * @param connectionFactory The connection factory. */ public RedisStoreWritingMessageHandler(RedisConnectionFactory connectionFactory) { Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); @@ -138,7 +138,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { * If neither setter is called, the default expression will be 'headers.{@link RedisHeaders#KEY}'. * * @see #setKeyExpression(Expression) - * @param key + * @param key The key. */ public void setKey(String key) { Assert.hasText(key, "key must not be empty"); @@ -152,7 +152,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { * If neither setter is called, the default expression will be 'headers.{@link RedisHeaders#KEY}'. * * @see #setKey(String) - * @param keyExpression + * @param keyExpression The key expression. */ public void setKeyExpression(Expression keyExpression) { Assert.notNull(keyExpression, "keyExpression must not be null"); @@ -162,7 +162,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { /** * Sets the collection type for this handler as per {@link CollectionType}. * - * @param collectionType + * @param collectionType The collection type. */ public void setCollectionType(CollectionType collectionType) { this.collectionType = collectionType; @@ -176,7 +176,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { * the value of this attribute is meaningless as the payload will always be * stored as a single entry. * - * @param extractPayloadElements + * @param extractPayloadElements true if payload elements should be extracted. */ public void setExtractPayloadElements(boolean extractPayloadElements) { this.extractPayloadElements = extractPayloadElements; @@ -185,7 +185,8 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { /** * Sets the expression used as the key for Map and Properties entries. * Default is 'headers.{@link RedisHeaders#MAP_KEY}' - * @param mapKeyExpression + * + * @param mapKeyExpression The map key expression. */ public void setMapKeyExpression(Expression mapKeyExpression) { Assert.notNull(mapKeyExpression, "'mapKeyExpression' must not be null"); @@ -288,6 +289,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { if ((payload instanceof Map && this.verifyAllMapValuesOfTypeNumber((Map) payload))) { final Map payloadAsMap = (Map) payload; this.processInPipeline(new PipelineCallback() { + @Override public void process() { for (Entry entry : payloadAsMap.entrySet()) { Number d = entry.getValue(); @@ -301,6 +303,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { } else if (payload instanceof Collection) { this.processInPipeline(new PipelineCallback() { + @Override public void process() { for (Object object : ((Collection)payload)) { incrementOrOverwrite(ops, object, determineScore(message), zsetIncrementHeader); @@ -348,6 +351,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { (BoundSetOperations) this.redisTemplate.boundSetOps(set.getKey()); this.processInPipeline(new PipelineCallback() { + @Override public void process() { for (Object object : ((Collection)payload)) { ops.add(object); @@ -365,6 +369,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { final Object payload = message.getPayload(); if (this.extractPayloadElements && payload instanceof Map) { this.processInPipeline(new PipelineCallback() { + @Override public void process() { map.putAll((Map) payload); } @@ -380,6 +385,7 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { final Object payload = message.getPayload(); if (this.extractPayloadElements && payload instanceof Properties) { this.processInPipeline(new PipelineCallback() { + @Override public void process() { properties.putAll((Properties) payload); } 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 004350b6fe..f9c811bbc1 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2014 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. @@ -71,6 +71,8 @@ public class RmiInboundGateway extends MessagingGatewaySupport implements Reques /** * Specify whether the gateway should be expected to return a reply. * The default is 'true'. + * + * @param expectReply true when a reply is expected. */ public void setExpectReply(boolean expectReply) { this.expectReply = expectReply; @@ -88,6 +90,7 @@ public class RmiInboundGateway extends MessagingGatewaySupport implements Reques this.remoteInvocationExecutor = remoteInvocationExecutor; } + @Override public String getComponentType() { return "rmi:inbound-gateway"; } @@ -114,6 +117,7 @@ public class RmiInboundGateway extends MessagingGatewaySupport implements Reques super.onInit(); } + @Override public Message exchange(Message message) { if (this.expectReply) { return this.sendAndReceiveMessage(message); diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java index 68bbef905f..885ba2f86f 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/AbstractScriptExecutingMessageProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -19,9 +19,9 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; +import org.springframework.integration.handler.MessageProcessor; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHandlingException; -import org.springframework.integration.handler.MessageProcessor; import org.springframework.scripting.ScriptSource; import org.springframework.util.Assert; @@ -53,6 +53,7 @@ public abstract class AbstractScriptExecutingMessageProcessor implements Mess /** * Executes the script and returns the result. */ + @Override public final T processMessage(Message message) { try { ScriptSource source = this.getScriptSource(message); @@ -86,6 +87,11 @@ public abstract class AbstractScriptExecutingMessageProcessor implements Mess /** * Subclasses must implement this method. In doing so, the execution context * for the script should be populated with the provided script variables. + * + * @param scriptSource The script source. + * @param variables The variables. + * @return The result of the execution. + * @throws Exception Any Exception. */ protected abstract T executeScript(ScriptSource scriptSource, Map variables) throws Exception; diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java index d0b3d8d55e..06d0786eec 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java @@ -1,11 +1,11 @@ /* - * Copyright 2002-2011 the original author or authors. - * + * Copyright 2002-2014 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. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. @@ -24,14 +24,16 @@ import org.springframework.scripting.ScriptSource; public interface ScriptExecutor { /** - * @param scriptSource + * @param scriptSource The script source. + * @return The result of the execution. */ public abstract Object executeScript(ScriptSource scriptSource); - - /** - * @param scriptSource - * @param variables -bind variable + + /** + * @param scriptSource The script source. + * @param variables The variables. + * @return The result of the execution. */ - public abstract Object executeScript(ScriptSource scriptSource,Map variables); - + public abstract Object executeScript(ScriptSource scriptSource, Map variables); + } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/config/AbstractScriptParser.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/config/AbstractScriptParser.java index 5d8c7f0aa6..e223384484 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/config/AbstractScriptParser.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/config/AbstractScriptParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. You may obtain a copy of the License at @@ -105,6 +105,10 @@ public abstract class AbstractScriptParser extends AbstractSingleBeanDefinitionP /** * Subclasses may override this no-op method to provide additional configuration. + * + * @param builder The builder. + * @param element The element. + * @param parserContext The parser context. */ protected void postProcess(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) { } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java index 9763ce73e6..384b7b2854 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/jsr223/ScriptExecutingMessageProcessor.java @@ -1,11 +1,11 @@ /* - * Copyright 2002-2011 the original author or authors. - * + * Copyright 2002-2014 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. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. @@ -14,11 +14,11 @@ package org.springframework.integration.scripting.jsr223; import java.util.Map; -import org.springframework.messaging.Message; import org.springframework.integration.scripting.AbstractScriptExecutingMessageProcessor; import org.springframework.integration.scripting.DefaultScriptVariableGenerator; import org.springframework.integration.scripting.ScriptExecutor; import org.springframework.integration.scripting.ScriptVariableGenerator; +import org.springframework.messaging.Message; import org.springframework.scripting.ScriptSource; import org.springframework.util.Assert; @@ -30,52 +30,56 @@ public class ScriptExecutingMessageProcessor extends AbstractScriptExecutingMess private final ScriptExecutor scriptExecutor; private volatile ScriptSource scriptSource; - + /** * Create a processor for the {@link ScriptSource} using the provided {@link ScriptExecutor} using the DefaultScriptVariableGenerator - * @param scriptSource - * @param scriptExecutor + * + * @param scriptSource The script source. + * @param scriptExecutor The script executor. */ public ScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptExecutor scriptExecutor) { super(); this.scriptSource = scriptSource; - this.scriptExecutor = scriptExecutor; + this.scriptExecutor = scriptExecutor; } - + /** - * Create a processor for the {@link ScriptSource} using the provided {@link ScriptExecutor} - * @param scriptSource - * @param scriptExecutor + * Create a processor for the {@link ScriptSource} using the provided {@link ScriptExecutor} + * + * @param scriptSource The script source. + * @param scriptVariableGenerator The script variable generator. + * @param scriptExecutor The script executor. */ public ScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptVariableGenerator scriptVariableGenerator, ScriptExecutor scriptExecutor) { super(scriptVariableGenerator); this.scriptSource = scriptSource; - this.scriptExecutor = scriptExecutor; + this.scriptExecutor = scriptExecutor; } - + /** * Create a processor for the {@link ScriptSource} using the provided {@link ScriptExecutor} using the DefaultScriptVariableGenerator - * @param scriptSource - * @param scriptExecutor - * @param variables + * + * @param scriptSource The script source. + * @param scriptExecutor The script executor. + * @param variables The variables. */ public ScriptExecutingMessageProcessor(ScriptSource scriptSource, ScriptExecutor scriptExecutor,Map variables ) { super(new DefaultScriptVariableGenerator(variables)); this.scriptSource = scriptSource; - this.scriptExecutor = scriptExecutor; + this.scriptExecutor = scriptExecutor; } - + @Override protected ScriptSource getScriptSource(Message message) { return this.scriptSource; } @Override - protected Object executeScript(ScriptSource scriptSource, Map variables) throws Exception { + protected Object executeScript(ScriptSource scriptSource, Map variables) throws Exception { Assert.notNull(scriptSource, "scriptSource must not be null"); return this.scriptExecutor.executeScript(scriptSource,variables); } - + } diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java index 58a9008fbe..c44793ed9b 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.java @@ -26,12 +26,12 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.integration.channel.QueueChannel; +import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; -import org.springframework.integration.channel.QueueChannel; import org.springframework.messaging.PollableChannel; import org.springframework.messaging.support.GenericMessage; -import org.springframework.integration.support.MessageBuilder; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -94,7 +94,7 @@ public class Jsr223TransformerTests { Set result = new HashSet(); for (int i = 0; i < 100; i++) { - Message message = this.int3162OutputChannel.receive(1000); + Message message = this.int3162OutputChannel.receive(10000); result.add(message.getPayload()); } diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java index 0f53cc5956..607ca0cf55 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/DefaultChannelAccessPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -28,7 +28,7 @@ import org.springframework.util.StringUtils; /** * Creates the {@link ConfigAttribute}s for secured channel * send and receive operations based on simple String values. - * + * * @author Mark Fisher * @author Oleg Zhurakousky */ @@ -43,7 +43,10 @@ public class DefaultChannelAccessPolicy implements ChannelAccessPolicy { * Create an access policy instance. The provided 'sendAccess' and 'receiveAccess' * values may be a single String or a comma-delimited list of values. All whitespace * will be trimmed. A null value indicates that the policy does not - * apply for either send or receive access type. At most one of the values may be null. + * apply for either send or receive access type. At most one of the values may be null. + * + * @param sendAccess The send access value(s). + * @param receiveAccess The receive access value(s). */ @SuppressWarnings("unchecked") public DefaultChannelAccessPolicy(String sendAccess, String receiveAccess) { @@ -74,10 +77,12 @@ public class DefaultChannelAccessPolicy implements ChannelAccessPolicy { } + @Override public Collection getConfigAttributesForSend() { return this.configAttributeDefinitionForSend; } + @Override public Collection getConfigAttributesForReceive() { return this.configAttributeDefinitionForReceive; } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java index 9bad196505..613b47d61f 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -94,7 +94,7 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share } /** - * @param isSharedSession + * @param isSharedSession true if the session is to be shared. */ public DefaultSftpSessionFactory(boolean isSharedSession) { this(new JSch(), isSharedSession); @@ -102,8 +102,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share /** * Intended for use in tests so the jsch can be mocked. - * @param jsch - * @param isSharedSession + * @param jsch The jsch instance. + * @param isSharedSession true if the session is to be shared. */ public DefaultSftpSessionFactory(JSch jsch, boolean isSharedSession) { this.jsch = jsch; @@ -113,6 +113,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share /** * The url of the host you want connect to. This is a mandatory property. * + * @param host The host. + * * @see JSch#getSession(String, String, int) */ public void setHost(String host) { @@ -124,6 +126,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * this value defaults to 22. If specified, this properties must * be a positive number. * + * @param port The port. + * * @see JSch#getSession(String, String, int) */ public void setPort(int port) { @@ -133,6 +137,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share /** * The remote user to use. This is a mandatory property. * + * @param user The user. + * * @see JSch#getSession(String, String, int) */ public void setUser(String user) { @@ -144,6 +150,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * not provided, then the {@link DefaultSftpSessionFactory#privateKey} is * mandatory. * + * @param password The password. + * * @see com.jcraft.jsch.Session#setPassword(String) */ public void setPassword(String password) { @@ -154,6 +162,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * Specifies the filename that will be used to create a host key repository. * The resulting file has the same format as OpenSSH's known_hosts file. * + * @param knownHosts The known hosts. + * * @see JSch#setKnownHosts(String) */ public void setKnownHosts(String knownHosts) { @@ -166,6 +176,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * is not provided, then the {@link DefaultSftpSessionFactory#setPassword(String)} * property is mandatory. * + * @param privateKey The private key. + * * @see JSch#addIdentity(String) * @see JSch#addIdentity(String, String) * @@ -177,6 +189,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share /** * The password for the private key. Optional. * + * @param privateKeyPassphrase The private key passphrase. + * * @see JSch#addIdentity(String, String) */ public void setPrivateKeyPassphrase(String privateKeyPassphrase) { @@ -187,6 +201,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * Using {@link Properties}, you can set additional configuration settings on * the underlying JSch {@link com.jcraft.jsch.Session}. * + * @param sessionConfig The session configuration properties. + * * @see com.jcraft.jsch.Session#setConfig(Properties) */ public void setSessionConfig(Properties sessionConfig) { @@ -197,6 +213,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * Allows for specifying a JSch-based {@link Proxy}. If set, then the proxy * object is used to create the connection to the remote host. * + * @param proxy The proxy. + * * @see com.jcraft.jsch.Session#setProxy(Proxy) */ public void setProxy(Proxy proxy){ @@ -208,6 +226,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * to create a socket to the target host. When a {@link Proxy} is used, the * socket factory is passed to the proxy. By default plain TCP sockets are used. * + * @param socketFactory The socket factory. + * * @see com.jcraft.jsch.Session#setSocketFactory(SocketFactory) */ public void setSocketFactory(SocketFactory socketFactory){ @@ -219,6 +239,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * the default connection timeout. Defaults to 0, which means, * that no timeout will occur. * + * @param timeout The timeout. + * * @see com.jcraft.jsch.Session#setTimeout(int) */ public void setTimeout(Integer timeout) { @@ -229,6 +251,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * Allows you to set the client version property. It's default depends on the * underlying JSch version but it will look like SSH-2.0-JSCH-0.1.45 * + * @param clientVersion The client version. + * * @see com.jcraft.jsch.Session#setClientVersion(String) */ public void setClientVersion(String clientVersion){ @@ -239,6 +263,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * Sets the host key alias, used when comparing the host key to the known * hosts list. * + * @param hostKeyAlias The host key alias. + * * @see com.jcraft.jsch.Session#setHostKeyAlias(String) */ public void setHostKeyAlias(String hostKeyAlias){ @@ -249,6 +275,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * Sets the timeout interval (milliseconds) before a server alive message is * sent, in case no message is received from the server. * + * @param serverAliveInterval The server alive interval. + * * @see com.jcraft.jsch.Session#setServerAliveInterval(int) */ public void setServerAliveInterval(Integer serverAliveInterval){ @@ -260,6 +288,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * any reply from the server before disconnecting. If not set, this property * defaults to 1. * + * @param serverAliveCountMax The server alive count max. + * * @see com.jcraft.jsch.Session#setServerAliveCountMax(int) */ public void setServerAliveCountMax(Integer serverAliveCountMax){ @@ -273,6 +303,8 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share * {@link com.jcraft.jsch.Session#setDaemonThread(boolean)}. There, this * property will default to false, if not explicitly set. * + * @param enableDaemonThread true to enable a daemon thread. + * * @see com.jcraft.jsch.Session#setDaemonThread(boolean) */ public void setEnableDaemonThread(Boolean enableDaemonThread){ @@ -280,6 +312,7 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share } + @Override public Session getSession() { Assert.hasText(this.host, "host must not be empty"); Assert.hasText(this.user, "user must not be empty"); @@ -407,29 +440,36 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share this.password = password; } + @Override public String getPassphrase() { return null; // pass } + @Override public String getPassword() { return this.password; } + @Override public boolean promptPassphrase(String string) { return true; } + @Override public boolean promptPassword(String string) { return true; } + @Override public boolean promptYesNo(String string) { return true; } + @Override public void showMessage(String string) { } + @Override public String[] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo) { return null; diff --git a/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java b/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java index 47f0c9e6c7..b341784519 100644 --- a/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java +++ b/spring-integration-stream/src/main/java/org/springframework/integration/stream/CharacterStreamWritingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2014 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. @@ -26,10 +26,11 @@ import java.io.Writer; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessagingException; -import org.springframework.messaging.MessageHandler; + import org.springframework.integration.handler.AbstractMessageHandler; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.MessagingException; import org.springframework.util.Assert; /** @@ -38,7 +39,7 @@ import org.springframework.util.Assert; * but for other payload types, the result of the object's {@link #toString()} * method will be written. To append a new-line after each write, set the * {@link #setShouldAppendNewLine(boolean) shouldAppendNewLine} flag to 'true'. It is 'false' by default. - * + * * @author Mark Fisher */ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler { @@ -71,6 +72,8 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler /** * Factory method that creates a target for stdout (System.out) with the * default charset encoding. + * + * @return A stdout handler with the default charset. */ public static CharacterStreamWritingMessageHandler stdout() { return stdout(null); @@ -79,6 +82,9 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler /** * Factory method that creates a target for stdout (System.out) with the * specified charset encoding. + * + * @param charsetName The charset name. + * @return A stdout handler. */ public static CharacterStreamWritingMessageHandler stdout(String charsetName) { return createTargetForStream(System.out, charsetName); @@ -87,6 +93,8 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler /** * Factory method that creates a target for stderr (System.err) with the * default charset encoding. + * + * @return A stderr handler with the default charset. */ public static CharacterStreamWritingMessageHandler stderr() { return stderr(null); @@ -95,7 +103,10 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler /** * Factory method that creates a target for stderr (System.err) with the * specified charset encoding. - */ + * + * @param charsetName The charset name. + * @return A stderr handler. + */ public static CharacterStreamWritingMessageHandler stderr(String charsetName) { return createTargetForStream(System.err, charsetName); } @@ -117,6 +128,7 @@ public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler this.shouldAppendNewLine = shouldAppendNewLine; } + @Override protected void handleMessageInternal(Message message) { Object payload = message.getPayload(); if (payload == null) { diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java index 635fb6cc9e..052ee62f2b 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/inbound/TcpSyslogReceivingChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -39,7 +39,7 @@ public class TcpSyslogReceivingChannelAdapter extends SyslogReceivingChannelAdap private volatile ApplicationEventPublisher applicationEventPublisher; /** - * @param connectionFactory + * @param connectionFactory The connection factory. */ public void setConnectionFactory(AbstractServerConnectionFactory connectionFactory) { this.connectionFactory = connectionFactory; diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java index 241b9f5a80..372ba2bf10 100644 --- a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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,7 +35,6 @@ import org.springframework.messaging.MessageHeaders; *

    * For example using {@link Assert#assertThat(Object, Matcher)} for a single * entry: - *

    * *

      * {@code
    @@ -49,7 +48,6 @@ import org.springframework.messaging.MessageHeaders;
      * 
    *

    * For multiple entries to match all: - *

    *

      * {@code
      * Map expectedInHeaderMap = new HashMap();
    @@ -61,7 +59,6 @@ import org.springframework.messaging.MessageHeaders;
      *
      * 

    * For a single key: - *

    * *

      * ANY_HEADER_KEY = "foo";
    @@ -96,6 +93,7 @@ public class HeaderMatcher extends TypeSafeMatcher> {
     	/**
     	 * {@inheritDoc}
     	 */
    +	@Override
     	public void describeTo(Description description) {
     		description.appendText("a Message with Headers containing ").appendDescriptionOf(matcher);
     	}
    diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/PayloadMatcher.java b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/PayloadMatcher.java
    index c6cb07f824..81d32ea0e5 100644
    --- a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/PayloadMatcher.java
    +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/PayloadMatcher.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -29,7 +29,7 @@ import org.springframework.messaging.Message;
      * 

    * A Junit example using {@link Assert#assertThat(Object, Matcher)} could look * like this to test a payload value: - *

    + * *

      * {@code
      * ANY_PAYLOAD = new BigDecimal("1.123");
    @@ -41,7 +41,7 @@ import org.springframework.messaging.Message;
      * 

    * An example using {@link Assert#assertThat(Object, Matcher)} delegating to * another {@link Matcher}. - *

    + * *

      * ANY_PAYLOAD = new BigDecimal("1.123");
      * assertThat(message, PayloadMatcher.hasPayload(is(BigDecimal.class)));
    @@ -80,6 +80,7 @@ public class PayloadMatcher extends TypeSafeMatcher {
     	 * {@inheritDoc}
     	 */
     	//@Override
    +	@Override
     	public void describeTo(Description description) {
     		description.appendText("a Message with payload: ").appendDescriptionOf(matcher);
     
    diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/TypeSafeMatcher.java b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/TypeSafeMatcher.java
    index 4d0f27a248..26541f4707 100644
    --- a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/TypeSafeMatcher.java
    +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/TypeSafeMatcher.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -15,10 +15,10 @@
      */
     package org.springframework.integration.test.matcher;
     
    -import org.hamcrest.BaseMatcher;
    -
     import java.lang.reflect.Method;
     
    +import org.hamcrest.BaseMatcher;
    +
     /**
      * This class was copied from JUnit to avoid using it from org.junit.internal (causing a backwards compatibility issue).
      * If you want to extend this class use a recent version of JUnit, and extend
    @@ -31,11 +31,14 @@ import java.lang.reflect.Method;
      */
     abstract class TypeSafeMatcher extends BaseMatcher {
     
    -    private Class expectedType;
    +    private final Class expectedType;
     
         /**
          * Subclasses should implement this. The item will already have been checked for
          * the specific type and will never be null.
    +     *
    +     * @param item The item.
    +     * @return true if matches.
          */
         public abstract boolean matchesSafely(T item);
     
    @@ -70,7 +73,8 @@ abstract class TypeSafeMatcher extends BaseMatcher {
          * If you need to override this, there's no point on extending TypeSafeMatcher.
          * Instead, extend the {@link BaseMatcher}.
          */
    -    @SuppressWarnings({"unchecked"})
    +    @Override
    +	@SuppressWarnings({"unchecked"})
         public final boolean matches(Object item) {
             return item != null
                     && expectedType.isInstance(item)
    diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/support/AbstractResponseValidator.java b/spring-integration-test/src/main/java/org/springframework/integration/test/support/AbstractResponseValidator.java
    index 7c9117c92b..6be6fc1d0b 100644
    --- a/spring-integration-test/src/main/java/org/springframework/integration/test/support/AbstractResponseValidator.java
    +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/support/AbstractResponseValidator.java
    @@ -1,35 +1,54 @@
    +/*
    + * Copyright 2011-2014 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.
    + * You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
     package org.springframework.integration.test.support;
     
     import org.springframework.messaging.Message;
    -import org.springframework.messaging.MessagingException;
     import org.springframework.messaging.MessageHandler;
    +import org.springframework.messaging.MessagingException;
     /**
      * The base class for response validators used for {@link RequestResponseScenario}s
      * @author David Turanski
      *
      */
     public abstract class AbstractResponseValidator implements MessageHandler {
    -	
    +
     	private Message lastMessage;
    +
         /**
    -     * handle the message 
    +     * handle the message
          */
    -    @SuppressWarnings("unchecked")
    -	//@Override
    +    @Override
    +	@SuppressWarnings("unchecked")
         public void handleMessage(Message message) throws MessagingException {
         	this.lastMessage = message;
             validateResponse((T) (extractPayload()? message.getPayload(): message ));
         }
    +
         /**
          * Implement this method to validate the response (Message or Payload)
    -     * @param response
    +     * @param response The response.
          */
         protected abstract void validateResponse(T response);
    +
         /**
          * If true will extract the payload as the parameter for validateResponse()
          * @return true to extract the payload; false to process the message.
          */
         protected abstract boolean extractPayload();
    +
     	/**
     	 * @return the lastMessage
     	 */
    diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/support/MessageValidator.java b/spring-integration-test/src/main/java/org/springframework/integration/test/support/MessageValidator.java
    index c1647994d8..2a8924f25f 100644
    --- a/spring-integration-test/src/main/java/org/springframework/integration/test/support/MessageValidator.java
    +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/support/MessageValidator.java
    @@ -1,24 +1,44 @@
    +/*
    + * Copyright 2011-2014 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.
    + * You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
     package org.springframework.integration.test.support;
     
     import org.springframework.messaging.Message;
    +
     /**
    - * Validate a message. Create an anonymous instance or subclass to 
    + * Validate a message. Create an anonymous instance or subclass to
      * implement the validateMessage() method
      * @author David Turanski
      *
      */
     public abstract class MessageValidator extends AbstractResponseValidator> {
    -    protected final boolean extractPayload(){
    +
    +    @Override
    +	protected final boolean extractPayload(){
             return false;
         }
    -    
    -    protected final void validateResponse(Message response){
    -        validateMessage((Message) response);
    +
    +    @Override
    +	protected final void validateResponse(Message response){
    +        validateMessage(response);
         }
    +
         /**
          * Implement this method to validate the message
    -     * @param message
    +     * @param message The message.
          */
         protected abstract void validateMessage(Message message);
    -    
    +
     }
    diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java b/spring-integration-test/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java
    index 6e233820b5..7bd59cd2b6 100644
    --- a/spring-integration-test/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java
    +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/support/RequestResponseScenario.java
    @@ -1,11 +1,27 @@
    +/*
    + * Copyright 2011-2014 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.
    + * You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
     package org.springframework.integration.test.support;
     
     import org.springframework.messaging.Message;
     import org.springframework.messaging.support.GenericMessage;
     import org.springframework.util.Assert;
    +
     /**
      * Defines a Spring Integration request response test scenario. All setter methods may
    - * be chained. 
    + * be chained.
      * @author David Turanski
      *
      */
    @@ -16,7 +32,7 @@ public class RequestResponseScenario {
         private Message message;
         private AbstractResponseValidator responseValidator;
         private String name;
    - 
    +
         protected Message getMessage(){
             if (message == null){
                 return new GenericMessage(this.payload);
    @@ -24,6 +40,7 @@ public class RequestResponseScenario {
                 return message;
             }
         }
    +
         /**
          * Create an instance
          * @param inputChannelName the input channel name
    @@ -33,51 +50,51 @@ public class RequestResponseScenario {
             this.inputChannelName = inputChannelName;
             this.outputChannelName = outputChannelName;
         }
    -    
    +
         /**
    -     * 
    +     *
          * @return the input channel name
          */
         public String getInputChannelName() {
             return inputChannelName;
         }
    -    
    +
         /**
    -     * 
    +     *
          * @return the output channel name
          */
         public String getOutputChannelName() {
             return outputChannelName;
         }
    -    
    +
         /**
    -     * 
    +     *
          * @return the request message payload
          */
         public Object getPayload() {
             return payload;
         }
    -    
    +
         /**
          * set the payload of the request message
    -     * @param payload
    +     * @param payload The payload.
          * @return this
          */
         public RequestResponseScenario setPayload(Object payload) {
             this.payload = payload;
             return this;
         }
    -    
    +
         /**
    -     * 
    +     *
          * @return the scenario name
          */
         public String getName() {
             return name;
         }
    -    
    +
         /**
    -     * set the scenario name (optional)
    +     * Set the scenario name (optional)
          * @param name the name
          * @return this
          */
    @@ -85,31 +102,31 @@ public class RequestResponseScenario {
             this.name = name;
             return this;
         }
    -    
    +
         /**
    -     * 
    -     * @return the response validator 
    +     *
    +     * @return the response validator
          * @see AbstractResponseValidator
          */
         public AbstractResponseValidator getResponseValidator(){
             return responseValidator;
         }
    -    
    +
         /**
    -     * Set the response validator 
    +     * Set the response validator
          * @see AbstractResponseValidator
    -     * @param responseValidator
    +     * @param responseValidator The response validator.
          * @return this
          */
         public RequestResponseScenario setResponseValidator(AbstractResponseValidator responseValidator) {
             this.responseValidator = responseValidator;
             return this;
         }
    -    
    -   
    +
    +
         /**
          * Set the request message (as an alternative to setPayload())
    -     * @param message
    +     * @param message The message.
          * @return this
          */
         public RequestResponseScenario setMessage(Message message) {
    diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java
    index d657fc8647..14af90c90c 100644
    --- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java
    +++ b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/AbstractTwitterMessageSource.java
    @@ -1,4 +1,4 @@
    -/* Copyright 2002-2013 the original author or authors.
    +/* Copyright 2002-2014 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.
    @@ -23,8 +23,6 @@ import java.util.Queue;
     import java.util.concurrent.LinkedBlockingQueue;
     
     import org.springframework.beans.factory.BeanFactory;
    -import org.springframework.messaging.Message;
    -import org.springframework.messaging.MessagingException;
     import org.springframework.integration.context.IntegrationContextUtils;
     import org.springframework.integration.context.IntegrationObjectSupport;
     import org.springframework.integration.core.MessageSource;
    @@ -33,6 +31,8 @@ import org.springframework.integration.metadata.SimpleMetadataStore;
     import org.springframework.integration.support.MessageBuilder;
     import org.springframework.jmx.export.annotation.ManagedAttribute;
     import org.springframework.jmx.export.annotation.ManagedOperation;
    +import org.springframework.messaging.Message;
    +import org.springframework.messaging.MessagingException;
     import org.springframework.social.twitter.api.DirectMessage;
     import org.springframework.social.twitter.api.Tweet;
     import org.springframework.social.twitter.api.Twitter;
    @@ -128,6 +128,7 @@ abstract class AbstractTwitterMessageSource extends IntegrationObjectSupport
     
     	}
     
    +	@Override
     	public Message receive() {
     		T tweet = this.tweets.poll();
     		if (tweet == null) {
    @@ -180,6 +181,9 @@ abstract class AbstractTwitterMessageSource extends IntegrationObjectSupport
     	/**
     	 * Subclasses must implement this to return tweets.
     	 * The 'sinceId' value will be negative if no last id is known.
    +	 *
    +	 * @param sinceId The id of the last reported tweet.
    +	 * @return The list of tweets.
     	 */
     	protected abstract List pollForTweets(long sinceId);
     
    @@ -220,6 +224,7 @@ abstract class AbstractTwitterMessageSource extends IntegrationObjectSupport
     
     	private class TweetComparator implements Comparator {
     
    +		@Override
     		public int compare(T tweet1, T tweet2) {
     			// hopefully temporary logic. Will suggest that SpringSocial use a common base class for DM and Tweet
     			if (tweet1 instanceof Tweet && tweet2 instanceof Tweet) {
    diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java
    index 55de7ac575..5e36f930d8 100644
    --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java
    +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2013 the original author or authors.
    + * Copyright 2002-2014 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,6 +98,8 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro
     	/**
     	 * Set the Map of URI variable expressions to evaluate against the outbound message
     	 * when replacing the variable placeholders in a URI template.
    +	 *
    +	 * @param uriVariableExpressions The URI variable expressions.
     	 */
     	public void setUriVariableExpressions(Map uriVariableExpressions) {
     		synchronized (this.uriVariableExpressions) {
    @@ -114,6 +116,8 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro
     	 * Specify whether empty String response payloads should be ignored.
     	 * The default is true. Set this to false if
     	 * you want to send empty String responses in reply Messages.
    +	 *
    +	 * @param ignoreEmptyResponses true if empty responses should be ignored.
     	 */
     	public void setIgnoreEmptyResponses(boolean ignoreEmptyResponses) {
     		this.ignoreEmptyResponses = ignoreEmptyResponses;
    @@ -198,6 +202,7 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro
     			this.requestMessage = requestMessage;
     		}
     
    +		@Override
     		public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException {
     			Object payload = this.requestMessage.getPayload();
     			if (message instanceof SoapMessage){
    @@ -217,6 +222,7 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro
     
     	protected abstract class ResponseMessageExtractor extends TransformerObjectSupport implements WebServiceMessageExtractor {
     
    +		@Override
     		public Object extractData(WebServiceMessage message)
     				throws IOException, TransformerException {
     
    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 123f6537e9..9f56563c21 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-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -16,8 +16,8 @@
     
     package org.springframework.integration.ws;
     
    -import org.springframework.messaging.Message;
     import org.springframework.integration.support.MessageBuilder;
    +import org.springframework.messaging.Message;
     import org.springframework.oxm.Marshaller;
     import org.springframework.oxm.Unmarshaller;
     import org.springframework.util.Assert;
    @@ -65,6 +65,9 @@ public class MarshallingWebServiceInboundGateway extends AbstractWebServiceInbou
     
     	/**
     	 * Creates a new MarshallingWebServiceInboundGateway with the given marshaller and unmarshaller.
    +	 *
    +	 * @param marshaller The marshaller.
    +	 * @param unmarshaller The unmarshaller.
     	 */
     	public MarshallingWebServiceInboundGateway(Marshaller marshaller, Unmarshaller unmarshaller) {
     		Assert.notNull(marshaller, "'marshaller' must no be null");
    @@ -83,6 +86,7 @@ public class MarshallingWebServiceInboundGateway extends AbstractWebServiceInbou
     		this.unmarshaller = unmarshaller;
     	}
     
    +	@Override
     	protected void onInit() throws Exception {
     		super.onInit();
     		Assert.notNull(marshaller, "This implementation requires Marshaller");
    diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
    index 21bd621780..412161cded 100644
    --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
    +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/MarshallingWebServiceOutboundGateway.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2011 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -31,14 +31,14 @@ import org.springframework.ws.support.MarshallingUtils;
     /**
      * An outbound Messaging Gateway for invoking Web Services that also supports
      * marshalling and unmarshalling of the request and response messages.
    - * 
    + *
      * @author Mark Fisher
      * @author Oleg Zhurakousky
      * @see Marshaller
      * @see Unmarshaller
      */
     public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutboundGateway {
    -	
    +
     	private volatile Marshaller marshaller;
     	private volatile Unmarshaller unmarshaller;
     
    @@ -80,6 +80,9 @@ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutb
     	/**
     	 * Sets the provided Marshaller and Unmarshaller on this gateway's WebServiceTemplate.
     	 * Neither may be null.
    +	 *
    +	 * @param marshaller The marshaller.
    +	 * @param unmarshaller The unmarshaller.
     	 */
     	private void configureMarshallers(Marshaller marshaller, Unmarshaller unmarshaller) {
     		Assert.notNull(marshaller, "marshaller must not be null");
    @@ -90,7 +93,7 @@ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutb
     					"both Marshaller and Unmarshaller arguments.");
     			unmarshaller = (Unmarshaller) marshaller;
     		}
    -		
    +
     		Assert.notNull(unmarshaller, "unmarshaller must not be null");
     		this.marshaller = marshaller;
     		this.unmarshaller = unmarshaller;
    @@ -98,13 +101,13 @@ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutb
     
     	@Override
     	protected Object doHandle(String uri, Message requestMessage, WebServiceMessageCallback requestCallback) {
    -		Object reply = this.getWebServiceTemplate().sendAndReceive(uri, 
    +		Object reply = this.getWebServiceTemplate().sendAndReceive(uri,
     				new MarshallingRequestMessageCallback(requestCallback, requestMessage), new MarshallingResponseMessageExtractor());
     		return reply;
     	}
    -	
    +
     	private class MarshallingRequestMessageCallback extends RequestMessageCallback {
    -		
    +
     		public MarshallingRequestMessageCallback(WebServiceMessageCallback requestCallback, Message requestMessage){
     			super(requestCallback, requestMessage);
     		}
    @@ -114,7 +117,7 @@ public class MarshallingWebServiceOutboundGateway extends AbstractWebServiceOutb
     			MarshallingUtils.marshal(marshaller, payload, message);
     		}
     	}
    -	
    +
     	private class MarshallingResponseMessageExtractor extends ResponseMessageExtractor {
     
     		@Override
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java
    index 8f9913f133..378126b8c3 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/AggregatedXmlMessageValidationException.java
    @@ -45,6 +45,7 @@ public class AggregatedXmlMessageValidationException extends RuntimeException {
     	}
     
     	/**
    +	 * @return The exception iterator.
     	 * @deprecated in favor of #getExceptions
     	 */
     	@Deprecated
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java
    index 1a31136c7f..34c0a30823 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/router/XPathRouter.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2011 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -21,20 +21,21 @@ import java.util.HashMap;
     import java.util.List;
     import java.util.Map;
     
    -import org.springframework.messaging.Message;
    +import org.w3c.dom.DOMException;
    +import org.w3c.dom.Node;
    +
     import org.springframework.integration.router.AbstractMappingMessageRouter;
     import org.springframework.integration.xml.DefaultXmlPayloadConverter;
     import org.springframework.integration.xml.XmlPayloadConverter;
    +import org.springframework.messaging.Message;
     import org.springframework.util.Assert;
     import org.springframework.xml.xpath.NodeMapper;
     import org.springframework.xml.xpath.XPathExpression;
     import org.springframework.xml.xpath.XPathExpressionFactory;
    -import org.w3c.dom.DOMException;
    -import org.w3c.dom.Node;
     
     /**
      * Message Router that uses {@link XPathExpression} evaluation to determine channel names.
    - * 
    + *
      * @author Jonas Partner
      * @author Oleg Zhurakousky
      */
    @@ -45,13 +46,13 @@ public class XPathRouter extends AbstractMappingMessageRouter {
     	private final XPathExpression xPathExpression;
     
     	private volatile XmlPayloadConverter converter = new DefaultXmlPayloadConverter();
    -	
    +
     	private volatile boolean evaluateAsString = false;
     
     	/**
     	 * Create a router that uses an XPath expression. The expression may
     	 * contain zero or more namespace prefixes.
    -	 * 
    +	 *
     	 * @param expression the XPath expression as a String
     	 * @param namespaces map of namespaces with prefixes as the map keys
     	 */
    @@ -63,7 +64,7 @@ public class XPathRouter extends AbstractMappingMessageRouter {
     	/**
     	 * Create a router uses an XPath expression with one namespace. For example,
     	 * expression='/ns1:one/@type' prefix='ns1' namespace='www.example.org'
    -	 * 
    +	 *
     	 * @param expression the XPath expression as a String
     	 * @param prefix namespace prefix
     	 * @param namespace namespace uri
    @@ -78,7 +79,7 @@ public class XPathRouter extends AbstractMappingMessageRouter {
     	/**
     	 * Create a router that uses an XPath expression with no namespaces.
     	 * For example '/one/@type'
    -	 * 
    +	 *
     	 * @param expression the XPath expression as a String
     	 */
     	public XPathRouter(String expression) {
    @@ -88,7 +89,7 @@ public class XPathRouter extends AbstractMappingMessageRouter {
     
     	/**
     	 * Create a router that uses the provided XPath expression.
    -	 * 
    +	 *
     	 * @param expression the XPath expression
     	 */
     	public XPathRouter(XPathExpression expression) {
    @@ -102,12 +103,15 @@ public class XPathRouter extends AbstractMappingMessageRouter {
     
     	/**
     	 * Specify the Converter to use when converting payloads prior to XPath evaluation.
    +	 *
    +	 * @param converter The payload converter.
     	 */
     	public void setConverter(XmlPayloadConverter converter) {
     		Assert.notNull(converter, "converter must not be null");
     		this.converter = converter;
     	}
     
    +	@Override
     	public String getComponentType() {
     		return "xml:xpath-router";
     	}
    @@ -126,6 +130,7 @@ public class XPathRouter extends AbstractMappingMessageRouter {
     
     	private static class TextContentNodeMapper implements NodeMapper {
     
    +		@Override
     		public Object mapNode(Node node, int nodeNum) throws DOMException {
     			return node.getTextContent();
     		}
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java
    index af5d217642..ad14bff029 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/AbstractXPathMessageSelector.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -27,7 +27,7 @@ import org.springframework.xml.xpath.XPathExpressionFactory;
     
     /**
      * Base class for XPath {@link MessageSelector} implementations.
    - * 
    + *
      * @author Jonas Partner
      */
     public abstract class AbstractXPathMessageSelector implements MessageSelector {
    @@ -73,6 +73,8 @@ public abstract class AbstractXPathMessageSelector implements MessageSelector {
     
     	/**
     	 * Specify the converter used to convert payloads prior to XPath testing.
    +	 *
    +	 * @param converter The payload converter.
     	 */
     	public void setConverter(XmlPayloadConverter converter) {
     		this.converter = converter;
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java
    index 51cf76a1bb..2f0c759d0e 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/StringValueTestXPathMessageSelector.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -21,14 +21,14 @@ import java.util.Map;
     import org.w3c.dom.Document;
     import org.w3c.dom.Node;
     
    -import org.springframework.messaging.Message;
     import org.springframework.integration.core.MessageSelector;
    +import org.springframework.messaging.Message;
     import org.springframework.xml.xpath.XPathExpression;
     
     /**
      * XPath {@link MessageSelector} that tests if a provided value supports
      * payloads of type {@link Document} or {@link String}.
    - * 
    + *
      * @author Jonas Partner
      */
     public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSelector {
    @@ -40,7 +40,7 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel
     
     	/**
     	 * Create a selector which tests for the given value and supports multiple namespaces.
    -	 * 
    +	 *
     	 * @param expression XPath expression as a String
     	 * @param namespaces Map of namespaces where the keys are namespace prefixes
     	 * @param valueToTestFor value to test for
    @@ -52,7 +52,7 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel
     
     	/**
     	 * Creates a single namespace Xpath selector.
    -	 * 
    +	 *
     	 * @param expression XPath expression as a String
     	 * @param prefix namespace prefix
     	 * @param namespace namespace URI
    @@ -65,7 +65,7 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel
     
     	/**
     	 * Creates a non-namespaced testing selector.
    -	 * 
    +	 *
     	 * @param expression XPath expression as a String
     	 * @param valueToTestFor value to test for
     	 */
    @@ -76,7 +76,7 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel
     
     	/**
     	 * Creates a selector with the provided {@link XPathExpression}.
    -	 * 
    +	 *
     	 * @param expression XPath expression
     	 * @param valueToTestFor value to test for
     	 */
    @@ -89,8 +89,8 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel
     	/**
     	 * Specify whether comparison of value returned by {@link XPathExpression}
     	 * to test value should be case sensitive. Default is 'true'.
    -	 * 
    -	 * @param caseSensitive
    +	 *
    +	 * @param caseSensitive true if the test should be case sensitive.
     	 */
     	public void setCaseSensitive(boolean caseSensitive) {
     		this.caseSensitive = caseSensitive;
    @@ -100,6 +100,7 @@ public class StringValueTestXPathMessageSelector extends AbstractXPathMessageSel
     	 * Evaluate the payload and return true if the value returned by the
     	 * {@link XPathExpression} is equal to the valueToTestFor.
     	 */
    +	@Override
     	public boolean accept(Message message) {
     		Node nodeToTest = getConverter().convertToNode(message.getPayload());
     		String xPathResult = getXPathExpresion().evaluateAsString(nodeToTest);
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java
    index cdfe9357b5..7a365ec974 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java
    @@ -24,13 +24,13 @@ import org.apache.commons.logging.LogFactory;
     import org.xml.sax.SAXParseException;
     
     import org.springframework.core.io.Resource;
    -import org.springframework.messaging.MessageHandlingException;
     import org.springframework.integration.MessageRejectedException;
     import org.springframework.integration.core.MessageSelector;
     import org.springframework.integration.xml.AggregatedXmlMessageValidationException;
     import org.springframework.integration.xml.DefaultXmlPayloadConverter;
     import org.springframework.integration.xml.XmlPayloadConverter;
     import org.springframework.messaging.Message;
    +import org.springframework.messaging.MessageHandlingException;
     import org.springframework.util.Assert;
     import org.springframework.util.ObjectUtils;
     import org.springframework.util.StringUtils;
    @@ -64,6 +64,9 @@ public class XmlValidatingMessageSelector implements MessageSelector {
     	 * type are {@link XmlValidatorFactory#SCHEMA_W3C_XML} or {@link XmlValidatorFactory#SCHEMA_RELAX_NG}.
     	 * If no 'schemaType' is provided it will default to {@link XmlValidatorFactory#SCHEMA_W3C_XML};
     	 *
    +	 * @param schema The schema.
    +	 * @param schemaType The schema type.
    +	 *
     	 * @throws IOException if the XmlValidatorFactory fails to create a validator
     	 */
     	public XmlValidatingMessageSelector(Resource schema, String schemaType) throws IOException {
    @@ -81,6 +84,8 @@ public class XmlValidatingMessageSelector implements MessageSelector {
     
     	/**
     	 * Specify the Converter to use when converting payloads prior to validation.
    +	 *
    +	 * @param converter The payload converter.
     	 */
     	public void setConverter(XmlPayloadConverter converter) {
     		Assert.notNull(converter, "'converter' must not be null");
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/SourceFactory.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/SourceFactory.java
    index efd3eeba79..2153c4e365 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/SourceFactory.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/source/SourceFactory.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -21,13 +21,16 @@ import javax.xml.transform.Source;
     /**
      * Factory to create a {@link Source} possibly taking into account
      * the provided message payload instance.
    - * 
    + *
      * @author Jonas Partner
      */
     public interface SourceFactory {
     
     	/**
     	 * Create appropriate {@link Source} instance for {@code payload}
    +	 *
    +	 * @param payload The payload.
    +	 * @return The source.
     	 */
     	Source createSource(Object payload);
     
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java
    index f2ba1b28d5..7169468c2b 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/MarshallingTransformer.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -21,17 +21,17 @@ import java.io.IOException;
     import javax.xml.parsers.ParserConfigurationException;
     import javax.xml.transform.Result;
     
    -import org.springframework.messaging.Message;
    -import org.springframework.messaging.MessagingException;
     import org.springframework.integration.transformer.AbstractTransformer;
     import org.springframework.integration.xml.result.DomResultFactory;
     import org.springframework.integration.xml.result.ResultFactory;
    +import org.springframework.messaging.Message;
    +import org.springframework.messaging.MessagingException;
     import org.springframework.oxm.Marshaller;
     import org.springframework.util.Assert;
     
     /**
      * An implementation of {@link AbstractTransformer} that delegates to an OXM {@link Marshaller}.
    - * 
    + *
      * @author Mark Fisher
      * @author Jonas Partner
      */
    @@ -67,6 +67,8 @@ public class MarshallingTransformer extends AbstractTransformer {
     	 * Specify whether the source Message's payload should be extracted prior
     	 * to marshalling. This value is set to "true" by default. To send the
     	 * Message itself as input to the Marshaller instead, set this to "false".
    +	 *
    +	 * @param extractPayload true if the payload should be extracted.
     	 */
     	public void setExtractPayload(boolean extractPayload) {
     		this.extractPayload = extractPayload;
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/UnmarshallingTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/UnmarshallingTransformer.java
    index 67434c3cdb..5265410487 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/UnmarshallingTransformer.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/UnmarshallingTransformer.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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,11 +25,11 @@ import javax.xml.transform.stream.StreamSource;
     
     import org.w3c.dom.Document;
     
    -import org.springframework.messaging.MessagingException;
     import org.springframework.integration.transformer.AbstractPayloadTransformer;
     import org.springframework.integration.transformer.Transformer;
     import org.springframework.integration.xml.source.DomSourceFactory;
     import org.springframework.integration.xml.source.SourceFactory;
    +import org.springframework.messaging.MessagingException;
     import org.springframework.oxm.Unmarshaller;
     import org.springframework.util.Assert;
     import org.springframework.xml.transform.StringSource;
    @@ -45,7 +45,7 @@ import org.springframework.xml.transform.StringSource;
      * The Unmarshaller may return a Message, but if the return value is not
      * already a Message instance, a new Message will be created with that
      * return value as its payload.
    - * 
    + *
      * @author Jonas Partner
      */
     public class UnmarshallingTransformer extends AbstractPayloadTransformer {
    @@ -64,6 +64,8 @@ public class UnmarshallingTransformer extends AbstractPayloadTransformer expressionMap) {
     		super(expressionMap);
    @@ -79,10 +81,12 @@ public class XPathHeaderEnricher extends HeaderEnricher {
     			this.overwrite = overwrite;
     		}
     
    +		@Override
     		public Boolean isOverwrite() {
     			return this.overwrite;
     		}
     
    +		@Override
     		public Object processMessage(Message message) {
     			Node node = converter.convertToNode(message.getPayload());
     			Object result = this.evaluationType.evaluateXPath(this.expression, node);
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XPathTransformer.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XPathTransformer.java
    index 5025d5563c..001af3d590 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XPathTransformer.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XPathTransformer.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -18,11 +18,11 @@ package org.springframework.integration.xml.transformer;
     
     import org.w3c.dom.Node;
     
    -import org.springframework.messaging.Message;
     import org.springframework.integration.transformer.AbstractTransformer;
     import org.springframework.integration.xml.DefaultXmlPayloadConverter;
     import org.springframework.integration.xml.XmlPayloadConverter;
     import org.springframework.integration.xml.xpath.XPathEvaluationType;
    +import org.springframework.messaging.Message;
     import org.springframework.util.Assert;
     import org.springframework.xml.xpath.NodeMapper;
     import org.springframework.xml.xpath.XPathExpression;
    @@ -38,7 +38,7 @@ import org.springframework.xml.xpath.XPathExpressionFactory;
      * {@link #setEvaluationType(XPathEvaluationType)} or the presence of a {@link NodeMapper},
      * which takes precedence. If no {@link NodeMapper} or evaluation type is configured explicitly,
      * the default evaluation type is {@link XPathEvaluationType#STRING_RESULT}.
    - * 
    + *
      * @author Mark Fisher
      * @since 2.0
      */
    @@ -55,15 +55,19 @@ public class XPathTransformer extends AbstractTransformer {
     
     	/**
     	 * Create an {@link XPathTransformer} that will create an XPath expression from the given String
    -	 * to be evaluated against converted inbound Message payloads. 
    +	 * to be evaluated against converted inbound Message payloads.
    +	 *
    +	 * @param expression The expression.
     	 */
     	public XPathTransformer(String expression) {
    -		this.xpathExpression = XPathExpressionFactory.createXPathExpression(expression);		
    +		this.xpathExpression = XPathExpressionFactory.createXPathExpression(expression);
     	}
     
     	/**
     	 * Create an {@link XPathTransformer} that will evaluate the given {@link XPathExpression}
     	 * against converted inbound Message payloads.
    +	 *
    +	 * @param expression The expression.
     	 */
     	public XPathTransformer(XPathExpression expression) {
     		Assert.notNull(expression, "expression must not be null");
    @@ -73,6 +77,8 @@ public class XPathTransformer extends AbstractTransformer {
     
     	/**
     	 * Specify the expected {@link XPathEvaluationType}. The default is {@link XPathEvaluationType#STRING_RESULT}.
    +	 *
    +	 * @param evaluationType The evaluation type.
     	 */
     	public void setEvaluationType(XPathEvaluationType evaluationType) {
     		Assert.notNull(evaluationType, "evaluationType must not be null.");
    @@ -83,6 +89,8 @@ public class XPathTransformer extends AbstractTransformer {
     	 * Set a {@link NodeMapper} to use for generating the result object. By default the NodeMapper is null,
     	 * but if explicitly set, type determination is the responsibility of the NodeMapper, taking precedence
     	 * over any configured evaluationType.
    +	 *
    +	 * @param nodeMapper The node mapper.
     	 */
     	public void setNodeMapper(NodeMapper nodeMapper) {
     		this.nodeMapper = nodeMapper;
    @@ -90,6 +98,8 @@ public class XPathTransformer extends AbstractTransformer {
     
     	/**
     	 * Specify the {@link XmlPayloadConverter} to use when converting a Message payload prior to XPath evaluation.
    +	 *
    +	 * @param converter The payload converter.
     	 */
     	public void setConverter(XmlPayloadConverter converter) {
     		Assert.notNull(converter, "converter must not be 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 0cdfd14b3c..48b0e58a66 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-2013 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -141,6 +141,8 @@ public class XsltPayloadTransformer extends AbstractTransformer implements BeanC
     
     	/**
     	 * Sets the SourceFactory.
    +	 *
    +	 * @param sourceFactory The source factory.
     	 */
     	public void setSourceFactory(SourceFactory sourceFactory) {
     		Assert.notNull(sourceFactory, "SourceFactory must not be null");
    @@ -148,7 +150,9 @@ public class XsltPayloadTransformer extends AbstractTransformer implements BeanC
     	}
     
     	/**
    -	 * Sets the ResultFactory
    +	 * Sets the ResultFactory.
    +	 *
    +	 * @param resultFactory The result factory.
     	 */
     	public void setResultFactory(ResultFactory resultFactory) {
     		Assert.notNull(sourceFactory, "ResultFactory must not be null");
    @@ -158,6 +162,8 @@ public class XsltPayloadTransformer extends AbstractTransformer implements BeanC
     
     	/**
     	 * Specify whether to always use source factory even for directly supported payload types.
    +	 *
    +	 * @param alwaysUseSourceFactory true to always use the source factory.
     	 */
     	public void setAlwaysUseSourceFactory(boolean alwaysUseSourceFactory) {
     		this.alwaysUseSourceFactory = alwaysUseSourceFactory;
    @@ -165,6 +171,8 @@ public class XsltPayloadTransformer extends AbstractTransformer implements BeanC
     
     	/**
     	 * Specify whether to always use result factory even for directly supported payload types
    +	 *
    +	 * @param alwaysUseResultFactory true to always use the result factory.
     	 */
     	public void setAlwaysUseResultFactory(boolean alwaysUseResultFactory) {
     		this.alwaysUseResultFactory = alwaysUseResultFactory;
    diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java
    index d536879c86..4a305ab50f 100644
    --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java
    +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2013 the original author or authors.
    + * Copyright 2013-2014 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.
    @@ -30,6 +30,7 @@ import org.w3c.dom.Node;
     
     import org.springframework.integration.xml.DefaultXmlPayloadConverter;
     import org.springframework.integration.xml.XmlPayloadConverter;
    +import org.springframework.messaging.MessagingException;
     import org.springframework.util.Assert;
     import org.springframework.xml.xpath.NodeMapper;
     import org.springframework.xml.xpath.XPathException;
    @@ -73,6 +74,7 @@ public final class XPathUtils {
     	 * @param resultArg an optional parameter to represent the result type of the xpath evaluation.
     	 *                  Only one argument is allowed, which can be an instance of {@link org.springframework.xml.xpath.NodeMapper} or
     	 *                  one of these String constants: "string", "boolean", "number", "node" or "node_list".
    +	 * @param        The required return type.
     	 * @return the result of the xpath expression evaluation.
     	 * @throws IllegalArgumentException - if the provided arguments aren't appropriate types or values;
     	 * @throws MessagingException - if the provided object can't be converted to a {@link Node};
    diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java
    index ffec88d625..73c7d288e1 100644
    --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java
    +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpoint.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2002-2010 the original author or authors.
    + * Copyright 2002-2014 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.
    @@ -31,7 +31,7 @@ import org.springframework.util.StringUtils;
     
     /**
      * This component logs in as a user and forwards any messages to that
    - * user on to downstream components. 
    + * user on to downstream components.
      *
      * @author Josh Long
      * @author Mark Fisher
    @@ -43,7 +43,7 @@ public class ChatMessageListeningEndpoint extends AbstractXmppConnectionAwareEnd
     	private volatile boolean extractPayload = true;
     
     	private final PacketListener packetListener = new ChatMessagePublishingPacketListener();
    -	
    +
     	private volatile XmppHeaderMapper headerMapper = new DefaultXmppHeaderMapper();
     
     	public ChatMessageListeningEndpoint() {
    @@ -53,7 +53,7 @@ public class ChatMessageListeningEndpoint extends AbstractXmppConnectionAwareEnd
     	public ChatMessageListeningEndpoint(XMPPConnection xmppConnection) {
     		super(xmppConnection);
     	}
    -	
    +
     	public void setHeaderMapper(XmppHeaderMapper headerMapper) {
     		this.headerMapper = headerMapper;
     	}
    @@ -63,6 +63,8 @@ public class ChatMessageListeningEndpoint extends AbstractXmppConnectionAwareEnd
     	 * Specify whether the text message body should be extracted when mapping to a
     	 * Spring Integration Message payload. Otherwise, the full XMPP Message will be
     	 * passed within the payload. This value is true by default.
    +	 *
    +	 * @param extractPayload true if the payload should be extracted.
     	 */
     	public void setExtractPayload(boolean extractPayload) {
     		this.extractPayload = extractPayload;
    @@ -89,26 +91,27 @@ public class ChatMessageListeningEndpoint extends AbstractXmppConnectionAwareEnd
     
     	private class ChatMessagePublishingPacketListener implements PacketListener {
     
    +		@Override
     		public void processPacket(final Packet packet) {
     			if (packet instanceof org.jivesoftware.smack.packet.Message) {
     				org.jivesoftware.smack.packet.Message xmppMessage = (org.jivesoftware.smack.packet.Message) packet;
     				Map mappedHeaders = headerMapper.toHeadersFromRequest(xmppMessage);
    -				
    +
     				String messageBody = xmppMessage.getBody();
     				/*
    -				 * Since there are several types of chat messages with different ChatState (e.g., composing, paused etc) 
    -				 * we need to perform further validation since for now we only support messages that have 
    -				 * content (e.g., Use A says 'Hello' to User B). We don't yet support messages with no 
    +				 * Since there are several types of chat messages with different ChatState (e.g., composing, paused etc)
    +				 * we need to perform further validation since for now we only support messages that have
    +				 * content (e.g., Use A says 'Hello' to User B). We don't yet support messages with no
     				 * content (e.g., User A is typing a message for User B etc.).
     				 * See https://jira.springsource.org/browse/INT-1728
    -				 * Also see: packet.getExtensions()   
    +				 * Also see: packet.getExtensions()
     				 */
     				if (StringUtils.hasText(messageBody)){
     					Object payload = (extractPayload ? messageBody : xmppMessage);
    -					
    +
     					MessageBuilder messageBuilder = MessageBuilder.withPayload(payload).copyHeaders(mappedHeaders);
     					sendMessage(messageBuilder.build());
    -				}	
    +				}
     			}
     		}
     	}
    

    Parameter Expressions Samples