diff --git a/pom.xml b/pom.xml index a989c2a6a0..d9a9b5f4ae 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,17 @@ + + release + + + + com.agilejava.docbkx + docbkx-maven-plugin + + + + @@ -77,7 +88,8 @@ 3.0.0.RELEASE - + + com.agilejava.docbkx docbkx-maven-plugin @@ -139,6 +151,9 @@ + + + maven-javadoc-plugin 2.5 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorBeanPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorBeanPostProcessor.java index 593726caf8..5e252a5747 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorBeanPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/interceptor/GlobalChannelInterceptorBeanPostProcessor.java @@ -50,10 +50,7 @@ final class GlobalChannelInterceptorBeanPostProcessor implements BeanPostProcess private final Set positiveOrderInterceptors = new LinkedHashSet(); private final Set negativeOrderInterceptors = new LinkedHashSet(); - /** - * - * @param globalInterceptors - */ + GlobalChannelInterceptorBeanPostProcessor(List channelInterceptors){ this.channelInterceptors = channelInterceptors; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/MessageHistoryParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/MessageHistoryParser.java index a5e55ac2f1..36832fce79 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/MessageHistoryParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/MessageHistoryParser.java @@ -16,8 +16,6 @@ package org.springframework.integration.config.xml; import org.springframework.beans.factory.BeanDefinitionStoreException; -import org.springframework.beans.factory.parsing.BeanDefinitionParsingException; -import org.springframework.beans.factory.parsing.Problem; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/PointToPointChannelParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/PointToPointChannelParser.java index 600ee400e6..5385da3851 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/PointToPointChannelParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/PointToPointChannelParser.java @@ -19,7 +19,6 @@ package org.springframework.integration.config.xml; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java index 4243255267..28e7919719 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java @@ -22,9 +22,7 @@ import java.util.Iterator; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; -import org.springframework.beans.factory.BeanFactory; import org.springframework.integration.context.NamedComponent; -import org.springframework.integration.core.Message; import org.springframework.util.StringUtils; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryAwareMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryAwareMessageHandler.java index 6c6a49408f..88c0c392d1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryAwareMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistoryAwareMessageHandler.java @@ -26,7 +26,7 @@ import org.springframework.integration.message.MessageRejectedException; /** * Wrapper class to be used when a particular MessageHandler needs to be tracked in MessageHistory. * Note, any MessageHandler that is wrapped by this class will be tracked in MessageHistory - * only when MessageHistoryWriter is present.Ê + * only when MessageHistoryWriter is present.� * * @author Oleg Zhurakousky * @since 2.0 @@ -40,7 +40,6 @@ public class MessageHistoryAwareMessageHandler implements NamedComponent, Messag * * @param historyWriter * @param endpointName - * @param parentHandler */ public MessageHistoryAwareMessageHandler(MessageHistoryWriter historyWriter, String endpointName, MessageHandler targetHandler){ this.historyWriter = historyWriter; 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 aaad585c16..a8be741e53 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 @@ -19,8 +19,6 @@ package org.springframework.integration.router; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import java.util.Map; - import org.springframework.beans.factory.InitializingBean; import org.springframework.integration.core.Message; import org.springframework.integration.core.MessageChannel; @@ -38,9 +36,8 @@ import org.springframework.util.Assert; * A Message Router that sends Messages to a list of recipient channels. The * recipients can be provided as a static list of {@link MessageChannel} * instances via the {@link #setChannels(List)} method, or for dynamic - * behavior, a map with {@link MessageSelector} instances as the keys and - * collections of channels as the values can be provided via the - * {@link #setChannelMap(Map)} method. + * behavior, the values can be provided via the + * {@link #setRecipients(List)} method. *

* For more advanced, programmatic control * of dynamic recipient lists, consider using the @Router annotation or diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/CycleDetector.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/CycleDetector.java index 0e993bfe8a..346bced406 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/CycleDetector.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/CycleDetector.java @@ -52,7 +52,6 @@ class CycleDetector { * * @param target * @param ignorePakages - * @return */ public void detectCycle(Object target, String... ignorePakages){ Map> objectReferenceMap = new HashMap>(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java index 944156e98d..3c4d48fc2b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/SubscriberOrderTests.java @@ -23,7 +23,6 @@ import java.util.List; import org.junit.Test; -import org.springframework.beans.factory.config.ConstructorArgumentValues; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.support.GenericApplicationContext; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java index 18346d15d7..f470f984b7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/ConverterParserWithExistingConversionServiceTests.java @@ -72,6 +72,7 @@ public class ConverterParserWithExistingConversionServiceTests { private String text; + @SuppressWarnings("unused") public TestBean1(String text) { this.text = text; } @@ -105,14 +106,13 @@ public class ConverterParserWithExistingConversionServiceTests { } } - @SuppressWarnings("unused") private static class TestConverter implements Converter { public TestBean2 convert(TestBean1 source) { return new TestBean2(source.text.toUpperCase()); } } - @SuppressWarnings("unused") + private static class TestConverter3 implements Converter { public TestBean3 convert(TestBean1 source) { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java index 0ced4c8f71..3b8d53ff71 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java @@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.lang.reflect.Method; -import java.util.Iterator; import java.util.Random; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; @@ -32,7 +31,6 @@ import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; @@ -43,9 +41,6 @@ import org.springframework.integration.context.IntegrationContextUtils; import org.springframework.integration.core.Message; import org.springframework.integration.core.MessageChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; -import org.springframework.integration.handler.BridgeHandler; -import org.springframework.integration.history.MessageHistoryEvent; -import org.springframework.integration.history.MessageHistoryWriter; import org.springframework.integration.message.MessageHandler; import org.springframework.integration.message.StringMessage; import org.springframework.util.ReflectionUtils; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java index 696db434e7..8e7802bf8e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java @@ -65,7 +65,7 @@ public class MultipleEndpointGatewayTests { public Object echo(Object value){ return "R:" + value; } - public Message echoAsMessage(Object value){ + public Message echoAsMessage(Object value){ return MessageBuilder.withPayload("R:" + value).build(); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java index 5b55ac0f96..9ac7ba29b3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java @@ -18,6 +18,7 @@ package org.springframework.integration.history; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertNotNull; import java.util.Iterator; import java.util.Map; @@ -135,6 +136,7 @@ public class MessageHistoryIntegrationTests { endOfThePipeChannel.subscribe(handler); Message result = gateway.echo("hello"); Mockito.verify(handler, Mockito.times(1)).handleMessage(Mockito.any(Message.class)); + assertNotNull(result); //assertEquals("hello", result); } diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventInboundChannelAdapterParserTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventInboundChannelAdapterParserTests.java index 9f2d2cbf6a..a800e14c0b 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventInboundChannelAdapterParserTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventInboundChannelAdapterParserTests.java @@ -19,11 +19,7 @@ import junit.framework.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.ArgumentMatcher; -import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java index 0ebad6d578..d5b175bcba 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java @@ -15,20 +15,13 @@ */ package org.springframework.integration.event.config; -import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.ExecutorService; - import junit.framework.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; 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 6581bc3c33..afaf66a55a 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 @@ -16,14 +16,14 @@ package org.springframework.integration.ip.config; -import org.w3c.dom.Element; - +import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.core.Conventions; import org.springframework.integration.config.xml.IntegrationNamespaceUtils; import org.springframework.integration.ip.tcp.MessageFormats; import org.springframework.util.StringUtils; +import org.w3c.dom.Element; /** * Utility methods and constants for IP adapter parsers. diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionParser.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionParser.java index aa8f3baf72..b4f7a7e42b 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionParser.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionParser.java @@ -20,7 +20,6 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.core.Conventions; import org.springframework.integration.config.xml.IntegrationNamespaceUtils; import org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory; import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpNioReceivingChannelAdapter.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpNioReceivingChannelAdapter.java index 9231098a61..7ac98bedc5 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpNioReceivingChannelAdapter.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/TcpNioReceivingChannelAdapter.java @@ -172,8 +172,6 @@ public class TcpNioReceivingChannelAdapter extends * and calls its {@link NetSocketReader#assembledData} * method; if a message is fully assembled, calls {@link #sendMessage(Message)} with the * mapped message. - * - * @param channel */ private void doRead(SelectionKey key) { NioSocketReader reader = (NioSocketReader) key.attachment(); 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 9db9edfdf2..7f68c7534d 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 @@ -26,7 +26,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.commons.serializer.InputStreamingConverter; import org.springframework.commons.serializer.OutputStreamingConverter; import org.springframework.context.Lifecycle; -import org.springframework.core.task.TaskExecutor; import org.springframework.integration.ip.tcp.converter.ByteArrayCrLfConverter; import org.springframework.util.Assert; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractTcpConnection.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractTcpConnection.java index 3dba24ab1b..4344b98dec 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractTcpConnection.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractTcpConnection.java @@ -36,10 +36,10 @@ public abstract class AbstractTcpConnection implements TcpConnection { protected Log logger = LogFactory.getLog(this.getClass()); - @SuppressWarnings("rawtypes") + @SuppressWarnings("unchecked") protected InputStreamingConverter inputConverter; - @SuppressWarnings("rawtypes") + @SuppressWarnings("unchecked") protected OutputStreamingConverter outputConverter; protected TcpMessageMapper mapper; diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/DatagramPacketMessageMapper.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/DatagramPacketMessageMapper.java index 6aaca4e039..1e155321ca 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/DatagramPacketMessageMapper.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/udp/DatagramPacketMessageMapper.java @@ -112,7 +112,6 @@ public class DatagramPacketMessageMapper implements InboundMessageMapperThe operation parameter(s), if any, must be available within the payload of the diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java index e7c4cbcb56..1000dbc815 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java @@ -22,7 +22,7 @@ import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** - * Creates the {@link ConfigAttributeDefinition}s for secured channel + * Creates the {@link ConfigAttribute}s for secured channel * send and receive operations based on simple String values. * * @author Mark Fisher diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelInvocationDefinitionSource.java b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelInvocationDefinitionSource.java index 7d7b84db21..bdf8e7d4ec 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelInvocationDefinitionSource.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelInvocationDefinitionSource.java @@ -32,7 +32,7 @@ import org.springframework.security.access.SecurityMetadataSource; import org.springframework.util.Assert; /** - * The {@link ObjectDefinitionSource} implementation for secured {@link MessageChannel}s. + * The {@link SecurityMetadataSource} implementation for secured {@link MessageChannel}s. * * @author Mark Fisher * @author Oleg Zhurakousky 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 8608bd0909..b5ec7c7130 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 @@ -37,7 +37,7 @@ import org.springframework.util.Assert; * String, character array, and byte array payloads will be written directly, * 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 #shouldAppendNewLine} flag to 'true'. It is 'false' by default. + * {@link #setShouldAppendNewLine(boolean) shouldAppendNewLine} flag to 'true'. It is 'false' by default. * * @author Mark Fisher */ diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppConnectionFactory.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppConnectionFactory.java index e546f31543..3aa3149828 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppConnectionFactory.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppConnectionFactory.java @@ -29,7 +29,7 @@ import org.springframework.util.StringUtils; * * @author Josh Long * @author Mark Fisher - * @see {@link org.jivesoftware.smack.XMPPConnection} + * @see org.jivesoftware.smack.XMPPConnection * @since 2.0 */ public class XmppConnectionFactory extends AbstractFactoryBean { diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/messages/XmppMessageDrivenEndpoint.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/messages/XmppMessageDrivenEndpoint.java index 4a85b82979..e8ff347e69 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/messages/XmppMessageDrivenEndpoint.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/messages/XmppMessageDrivenEndpoint.java @@ -18,27 +18,26 @@ package org.springframework.integration.xmpp.messages; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.jivesoftware.smack.Chat; +import org.jivesoftware.smack.ChatManager; import org.jivesoftware.smack.PacketListener; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Packet; - import org.springframework.context.Lifecycle; import org.springframework.integration.channel.MessageChannelTemplate; import org.springframework.integration.core.MessageChannel; import org.springframework.integration.endpoint.AbstractEndpoint; import org.springframework.integration.message.MessageBuilder; +import org.springframework.integration.xmpp.XmppConnectionFactory; import org.springframework.integration.xmpp.XmppHeaders; /** * This component logs in as a user and forwards any messages to that * user on to downstream components. The component is an endpoint that has its - * own lifecycle and does not need any - * {@link org.springframework.integration.endpoint.AbstractPollingEndpoint.Poller} + * own lifecycle and does not need any poller * to work. It takes any message from a given XMPP session (as established by - * the current {@link org.jivesoftware.smack.XMPPConnection}) and forwards the + * the current {@link XMPPConnection}) and forwards the * {@link org.jivesoftware.smack.packet.Message} as the payload of the Spring * Integration {@link org.springframework.integration.core.Message}. The * {@link org.jivesoftware.smack.Chat} instance that's used is passed along as a @@ -60,14 +59,14 @@ import org.springframework.integration.xmpp.XmppHeaders; * * @author Josh Long * @author Mark Fisher - * @see {@link org.jivesoftware.smack.ChatManager} the ChatManager class that + * + * @see ChatManager the ChatManager class that * keeps watch over all Chats between the client and any other * participants. - * @see {@link org.springframework.integration.channel.MessageChannelTemplate} + * @see MessageChannelTemplate * handles all interesing operations on any Spring Integration channels. - * @see {@link org.jivesoftware.smack.XMPPConnection} the XMPPConnection (as - * created by - * {@link org.springframework.integration.xmpp.XmppConnectionFactory} + * @see XMPPConnection the XMPPConnection (as + * created by {@link XmppConnectionFactory} */ public class XmppMessageDrivenEndpoint extends AbstractEndpoint implements Lifecycle { @@ -84,7 +83,7 @@ public class XmppMessageDrivenEndpoint extends AbstractEndpoint implements Lifec /** * This will be injected or configured via a xmpp-connection-factory element. * - * @param xmppConnection + * @param xmppConnection the connection */ public void setXmppConnection(final XMPPConnection xmppConnection) { this.xmppConnection = xmppConnection; diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppPresenceMessageMapper.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppPresenceMessageMapper.java index 0523a2f772..713451fa2f 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppPresenceMessageMapper.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppPresenceMessageMapper.java @@ -65,7 +65,7 @@ public class XmppPresenceMessageMapper implements OutboundMessageMapper message) throws Exception { MessageHeaders messageHeaders = message.getHeaders(); diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageDrivenEndpoint.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageDrivenEndpoint.java index b6833f9e40..1e75a1cc79 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageDrivenEndpoint.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageDrivenEndpoint.java @@ -53,7 +53,7 @@ public class XmppRosterEventMessageDrivenEndpoint extends AbstractEndpoint imple /** * This will be injected or configured via a xmpp-connection-factory element. * - * @param xmppConnection + * @param xmppConnection the connection */ public void setXmppConnection(final XMPPConnection xmppConnection) { this.xmppConnection = xmppConnection; diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageSendingHandler.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageSendingHandler.java index 5b2f5d0849..c6fbadc37b 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageSendingHandler.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/presence/XmppRosterEventMessageSendingHandler.java @@ -2,73 +2,81 @@ package org.springframework.integration.xmpp.presence; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.packet.Presence; - import org.springframework.context.Lifecycle; - import org.springframework.integration.core.Message; -import org.springframework.integration.message.*; - +import org.springframework.integration.message.MessageDeliveryException; +import org.springframework.integration.message.MessageHandler; +import org.springframework.integration.message.MessageHandlingException; +import org.springframework.integration.message.MessageRejectedException; +import org.springframework.integration.message.OutboundMessageMapper; /** - * This class will facilitate publishing updated presence values for a given connection. This change happens on the {@link org.jivesoftware.smack.Roster#subscriptionMode} property. - * + * This class will facilitate publishing updated presence values for a given connection. This change happens on the + * {@link org.jivesoftware.smack.Roster#setSubscriptionMode(org.jivesoftware.smack.Roster.SubscriptionMode)} property. + * * @author Josh Long - * @see {@link org.jivesoftware.smack.packet.Presence.Mode} the mode (i.e.: {@link org.jivesoftware.smack.packet.Presence.Mode#away}) - * @see {@link org.jivesoftware.smack.packet.Presence.Type} the type (i.e.: {@link org.jivesoftware.smack.packet.Presence.Type#available} ) + * @see org.jivesoftware.smack.packet.Presence.Mode the mode (i.e.: + * {@link org.jivesoftware.smack.packet.Presence.Mode#away}) + * @see org.jivesoftware.smack.packet.Presence.Type the type (i.e.: + * {@link org.jivesoftware.smack.packet.Presence.Type#available} ) * @since 2.0 */ public class XmppRosterEventMessageSendingHandler implements MessageHandler, Lifecycle { - private static final Log logger = LogFactory.getLog(XmppRosterEventMessageDrivenEndpoint.class); - private volatile boolean running; - private OutboundMessageMapper messageMapper; - private volatile XMPPConnection xmppConnection; + private static final Log logger = LogFactory.getLog(XmppRosterEventMessageDrivenEndpoint.class); - public void setXmppConnection(final XMPPConnection xmppConnection) { - this.xmppConnection = xmppConnection; - } + private volatile boolean running; - public void handleMessage(final Message message) - throws MessageRejectedException, MessageHandlingException, MessageDeliveryException { - try { - Presence presence = this.messageMapper.fromMessage(message); - this.xmppConnection.sendPacket(presence); - } catch (Exception e) { - logger.error("Failed to map packet to message ", e); - } - } + private OutboundMessageMapper messageMapper; - public boolean isRunning() { - return this.running; - } + private volatile XMPPConnection xmppConnection; - public void start() { - if (null == this.messageMapper) { - this.messageMapper = new XmppPresenceMessageMapper(); - } + public void setXmppConnection(final XMPPConnection xmppConnection) { + this.xmppConnection = xmppConnection; + } - this.running = true; - } + public void handleMessage(final Message message) throws MessageRejectedException, MessageHandlingException, + MessageDeliveryException { + try { + Presence presence = this.messageMapper.fromMessage(message); + this.xmppConnection.sendPacket(presence); + } + catch (Exception e) { + logger.error("Failed to map packet to message ", e); + } + } - public void stop() { - this.running = false; + public boolean isRunning() { + return this.running; + } - if (xmppConnection.isConnected()) { - if (logger.isInfoEnabled()) { - logger.info("shutting down XMPP connection"); - } + public void start() { + if (null == this.messageMapper) { + this.messageMapper = new XmppPresenceMessageMapper(); + } - xmppConnection.disconnect(); - } - } + this.running = true; + } - /** - * the MessageMapper is responsible for converting outbound Messages into status updates of type {@link org.jivesoftware.smack.packet.Presence} - * @param messageMapper - */ - public void setMessageMapper(OutboundMessageMapper messageMapper) { - this.messageMapper = messageMapper; - } + public void stop() { + this.running = false; + + if (xmppConnection.isConnected()) { + if (logger.isInfoEnabled()) { + logger.info("shutting down XMPP connection"); + } + + xmppConnection.disconnect(); + } + } + + /** + * the MessageMapper is responsible for converting outbound Messages into status updates of type + * {@link org.jivesoftware.smack.packet.Presence} + * @param messageMapper mapper for the message into a {@link Presence} instance + */ + public void setMessageMapper(OutboundMessageMapper messageMapper) { + this.messageMapper = messageMapper; + } } diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppHeaderEnricherParserTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppHeaderEnricherParserTests.java index 807ef70513..8b5761543a 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppHeaderEnricherParserTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppHeaderEnricherParserTests.java @@ -29,7 +29,6 @@ import org.springframework.integration.channel.MessageChannelTemplate; import org.springframework.integration.core.Message; import org.springframework.integration.message.*; -import org.springframework.integration.xmpp.messages.XmppMessageSendingMessageHandler; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;