Fix compiler warnings and move docbook build to a profile
This commit is contained in:
17
pom.xml
17
pom.xml
@@ -50,6 +50,17 @@
|
|||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>release</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.agilejava.docbkx</groupId>
|
||||||
|
<artifactId>docbkx-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<!-- see 'staging' profile for dry-run deployment settings -->
|
<!-- see 'staging' profile for dry-run deployment settings -->
|
||||||
@@ -77,7 +88,8 @@
|
|||||||
<version>3.0.0.RELEASE</version>
|
<version>3.0.0.RELEASE</version>
|
||||||
</extension>
|
</extension>
|
||||||
</extensions>
|
</extensions>
|
||||||
<plugins>
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.agilejava.docbkx</groupId>
|
<groupId>com.agilejava.docbkx</groupId>
|
||||||
<artifactId>docbkx-maven-plugin</artifactId>
|
<artifactId>docbkx-maven-plugin</artifactId>
|
||||||
@@ -139,6 +151,9 @@
|
|||||||
</postProcess>
|
</postProcess>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
|
|||||||
@@ -50,10 +50,7 @@ final class GlobalChannelInterceptorBeanPostProcessor implements BeanPostProcess
|
|||||||
|
|
||||||
private final Set<GlobalChannelInterceptorWrapper> positiveOrderInterceptors = new LinkedHashSet<GlobalChannelInterceptorWrapper>();
|
private final Set<GlobalChannelInterceptorWrapper> positiveOrderInterceptors = new LinkedHashSet<GlobalChannelInterceptorWrapper>();
|
||||||
private final Set<GlobalChannelInterceptorWrapper> negativeOrderInterceptors = new LinkedHashSet<GlobalChannelInterceptorWrapper>();
|
private final Set<GlobalChannelInterceptorWrapper> negativeOrderInterceptors = new LinkedHashSet<GlobalChannelInterceptorWrapper>();
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param globalInterceptors
|
|
||||||
*/
|
|
||||||
GlobalChannelInterceptorBeanPostProcessor(List<GlobalChannelInterceptorWrapper> channelInterceptors){
|
GlobalChannelInterceptorBeanPostProcessor(List<GlobalChannelInterceptorWrapper> channelInterceptors){
|
||||||
this.channelInterceptors = channelInterceptors;
|
this.channelInterceptors = channelInterceptors;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
package org.springframework.integration.config.xml;
|
package org.springframework.integration.config.xml;
|
||||||
|
|
||||||
import org.springframework.beans.factory.BeanDefinitionStoreException;
|
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.AbstractBeanDefinition;
|
||||||
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
|
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
|
||||||
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
|
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package org.springframework.integration.config.xml;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
|
||||||
import org.springframework.beans.factory.xml.ParserContext;
|
import org.springframework.beans.factory.xml.ParserContext;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.util.xml.DomUtils;
|
import org.springframework.util.xml.DomUtils;
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ import java.util.Iterator;
|
|||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
|
||||||
import org.springframework.integration.context.NamedComponent;
|
import org.springframework.integration.context.NamedComponent;
|
||||||
import org.springframework.integration.core.Message;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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.
|
* 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
|
* Note, any MessageHandler that is wrapped by this class will be tracked in MessageHistory
|
||||||
* only when MessageHistoryWriter is present.<2E>
|
* only when MessageHistoryWriter is present.<2E>
|
||||||
*
|
*
|
||||||
* @author Oleg Zhurakousky
|
* @author Oleg Zhurakousky
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
@@ -40,7 +40,6 @@ public class MessageHistoryAwareMessageHandler implements NamedComponent, Messag
|
|||||||
*
|
*
|
||||||
* @param historyWriter
|
* @param historyWriter
|
||||||
* @param endpointName
|
* @param endpointName
|
||||||
* @param parentHandler
|
|
||||||
*/
|
*/
|
||||||
public MessageHistoryAwareMessageHandler(MessageHistoryWriter historyWriter, String endpointName, MessageHandler targetHandler){
|
public MessageHistoryAwareMessageHandler(MessageHistoryWriter historyWriter, String endpointName, MessageHandler targetHandler){
|
||||||
this.historyWriter = historyWriter;
|
this.historyWriter = historyWriter;
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ package org.springframework.integration.router;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.integration.core.Message;
|
import org.springframework.integration.core.Message;
|
||||||
import org.springframework.integration.core.MessageChannel;
|
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
|
* A Message Router that sends Messages to a list of recipient channels. The
|
||||||
* recipients can be provided as a static list of {@link MessageChannel}
|
* recipients can be provided as a static list of {@link MessageChannel}
|
||||||
* instances via the {@link #setChannels(List)} method, or for dynamic
|
* instances via the {@link #setChannels(List)} method, or for dynamic
|
||||||
* behavior, a map with {@link MessageSelector} instances as the keys and
|
* behavior, the values can be provided via the
|
||||||
* collections of channels as the values can be provided via the
|
* {@link #setRecipients(List)} method.
|
||||||
* {@link #setChannelMap(Map)} method.
|
|
||||||
* <p/>
|
* <p/>
|
||||||
* For more advanced, programmatic control
|
* For more advanced, programmatic control
|
||||||
* of dynamic recipient lists, consider using the @Router annotation or
|
* of dynamic recipient lists, consider using the @Router annotation or
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ class CycleDetector {
|
|||||||
*
|
*
|
||||||
* @param target
|
* @param target
|
||||||
* @param ignorePakages
|
* @param ignorePakages
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public void detectCycle(Object target, String... ignorePakages){
|
public void detectCycle(Object target, String... ignorePakages){
|
||||||
Map<Object, Set<Object>> objectReferenceMap = new HashMap<Object, Set<Object>>();
|
Map<Object, Set<Object>> objectReferenceMap = new HashMap<Object, Set<Object>>();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.springframework.beans.factory.config.ConstructorArgumentValues;
|
|
||||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||||
import org.springframework.context.support.GenericApplicationContext;
|
import org.springframework.context.support.GenericApplicationContext;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class ConverterParserWithExistingConversionServiceTests {
|
|||||||
|
|
||||||
private String text;
|
private String text;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public TestBean1(String text) {
|
public TestBean1(String text) {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
}
|
}
|
||||||
@@ -105,14 +106,13 @@ public class ConverterParserWithExistingConversionServiceTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static class TestConverter implements Converter<TestBean1, TestBean2> {
|
private static class TestConverter implements Converter<TestBean1, TestBean2> {
|
||||||
|
|
||||||
public TestBean2 convert(TestBean1 source) {
|
public TestBean2 convert(TestBean1 source) {
|
||||||
return new TestBean2(source.text.toUpperCase());
|
return new TestBean2(source.text.toUpperCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private static class TestConverter3 implements Converter<TestBean1, TestBean3> {
|
private static class TestConverter3 implements Converter<TestBean1, TestBean3> {
|
||||||
|
|
||||||
public TestBean3 convert(TestBean1 source) {
|
public TestBean3 convert(TestBean1 source) {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.Executor;
|
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.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
import org.springframework.context.support.GenericApplicationContext;
|
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||||
import org.springframework.core.convert.support.GenericConversionService;
|
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.Message;
|
||||||
import org.springframework.integration.core.MessageChannel;
|
import org.springframework.integration.core.MessageChannel;
|
||||||
import org.springframework.integration.endpoint.EventDrivenConsumer;
|
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.MessageHandler;
|
||||||
import org.springframework.integration.message.StringMessage;
|
import org.springframework.integration.message.StringMessage;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class MultipleEndpointGatewayTests {
|
|||||||
public Object echo(Object value){
|
public Object echo(Object value){
|
||||||
return "R:" + value;
|
return "R:" + value;
|
||||||
}
|
}
|
||||||
public Message echoAsMessage(Object value){
|
public Message<?> echoAsMessage(Object value){
|
||||||
return MessageBuilder.withPayload("R:" + value).build();
|
return MessageBuilder.withPayload("R:" + value).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.springframework.integration.history;
|
|||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
import static junit.framework.Assert.assertFalse;
|
import static junit.framework.Assert.assertFalse;
|
||||||
import static junit.framework.Assert.assertTrue;
|
import static junit.framework.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -135,6 +136,7 @@ public class MessageHistoryIntegrationTests {
|
|||||||
endOfThePipeChannel.subscribe(handler);
|
endOfThePipeChannel.subscribe(handler);
|
||||||
Message<?> result = gateway.echo("hello");
|
Message<?> result = gateway.echo("hello");
|
||||||
Mockito.verify(handler, Mockito.times(1)).handleMessage(Mockito.any(Message.class));
|
Mockito.verify(handler, Mockito.times(1)).handleMessage(Mockito.any(Message.class));
|
||||||
|
assertNotNull(result);
|
||||||
//assertEquals("hello", result);
|
//assertEquals("hello", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,7 @@ import junit.framework.Assert;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.ArgumentMatcher;
|
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
import org.mockito.stubbing.Answer;
|
|
||||||
import org.springframework.beans.DirectFieldAccessor;
|
import org.springframework.beans.DirectFieldAccessor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|||||||
@@ -15,20 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.integration.event.config;
|
package org.springframework.integration.event.config;
|
||||||
|
|
||||||
import java.util.concurrent.BrokenBarrierException;
|
|
||||||
import java.util.concurrent.CyclicBarrier;
|
import java.util.concurrent.CyclicBarrier;
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
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.DirectFieldAccessor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.context.ApplicationEvent;
|
import org.springframework.context.ApplicationEvent;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
package org.springframework.integration.ip.config;
|
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.support.BeanDefinitionBuilder;
|
||||||
import org.springframework.beans.factory.xml.ParserContext;
|
import org.springframework.beans.factory.xml.ParserContext;
|
||||||
import org.springframework.core.Conventions;
|
import org.springframework.core.Conventions;
|
||||||
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
|
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
|
||||||
import org.springframework.integration.ip.tcp.MessageFormats;
|
import org.springframework.integration.ip.tcp.MessageFormats;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility methods and constants for IP adapter parsers.
|
* Utility methods and constants for IP adapter parsers.
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
|||||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||||
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
|
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
|
||||||
import org.springframework.beans.factory.xml.ParserContext;
|
import org.springframework.beans.factory.xml.ParserContext;
|
||||||
import org.springframework.core.Conventions;
|
|
||||||
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
|
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
|
||||||
import org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory;
|
import org.springframework.integration.ip.tcp.connection.TcpNetClientConnectionFactory;
|
||||||
import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory;
|
import org.springframework.integration.ip.tcp.connection.TcpNetServerConnectionFactory;
|
||||||
|
|||||||
@@ -172,8 +172,6 @@ public class TcpNioReceivingChannelAdapter extends
|
|||||||
* and calls its {@link NetSocketReader#assembledData}
|
* and calls its {@link NetSocketReader#assembledData}
|
||||||
* method; if a message is fully assembled, calls {@link #sendMessage(Message)} with the
|
* method; if a message is fully assembled, calls {@link #sendMessage(Message)} with the
|
||||||
* mapped message.
|
* mapped message.
|
||||||
*
|
|
||||||
* @param channel
|
|
||||||
*/
|
*/
|
||||||
private void doRead(SelectionKey key) {
|
private void doRead(SelectionKey key) {
|
||||||
NioSocketReader reader = (NioSocketReader) key.attachment();
|
NioSocketReader reader = (NioSocketReader) key.attachment();
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.springframework.commons.serializer.InputStreamingConverter;
|
import org.springframework.commons.serializer.InputStreamingConverter;
|
||||||
import org.springframework.commons.serializer.OutputStreamingConverter;
|
import org.springframework.commons.serializer.OutputStreamingConverter;
|
||||||
import org.springframework.context.Lifecycle;
|
import org.springframework.context.Lifecycle;
|
||||||
import org.springframework.core.task.TaskExecutor;
|
|
||||||
import org.springframework.integration.ip.tcp.converter.ByteArrayCrLfConverter;
|
import org.springframework.integration.ip.tcp.converter.ByteArrayCrLfConverter;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ public abstract class AbstractTcpConnection implements TcpConnection {
|
|||||||
|
|
||||||
protected Log logger = LogFactory.getLog(this.getClass());
|
protected Log logger = LogFactory.getLog(this.getClass());
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("unchecked")
|
||||||
protected InputStreamingConverter inputConverter;
|
protected InputStreamingConverter inputConverter;
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("unchecked")
|
||||||
protected OutputStreamingConverter outputConverter;
|
protected OutputStreamingConverter outputConverter;
|
||||||
|
|
||||||
protected TcpMessageMapper mapper;
|
protected TcpMessageMapper mapper;
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ public class DatagramPacketMessageMapper implements InboundMessageMapper<Datagra
|
|||||||
/**
|
/**
|
||||||
* Prefix raw byte[] from message with 'acknowledge to' and 'message id' "headers".
|
* Prefix raw byte[] from message with 'acknowledge to' and 'message id' "headers".
|
||||||
* @param message
|
* @param message
|
||||||
* @param ackTo
|
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -115,10 +115,6 @@ public class MultiClientTests {
|
|||||||
adapter.stop();
|
adapter.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param i
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String largePayload(int n) {
|
private String largePayload(int n) {
|
||||||
StringBuilder sb = new StringBuilder(n);
|
StringBuilder sb = new StringBuilder(n);
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import static org.junit.Assert.fail;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -25,16 +25,11 @@ import java.net.ServerSocket;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
|
|
||||||
import javax.net.ServerSocketFactory;
|
import javax.net.ServerSocketFactory;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.integration.core.Message;
|
|
||||||
import org.springframework.integration.ip.util.SocketUtils;
|
import org.springframework.integration.ip.util.SocketUtils;
|
||||||
import org.springframework.integration.message.MessageBuilder;
|
import org.springframework.integration.message.MessageBuilder;
|
||||||
|
|
||||||
|
|||||||
@@ -173,10 +173,6 @@ public class MultiClientTests {
|
|||||||
adapter.stop();
|
adapter.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param i
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String largePayload(int n) {
|
private String largePayload(int n) {
|
||||||
StringBuilder sb = new StringBuilder(n);
|
StringBuilder sb = new StringBuilder(n);
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ abstract class MessageListenerContainerConfigurationSupport implements Initializ
|
|||||||
* Blocks until the listener container has subscribed; if the container does not support
|
* Blocks until the listener container has subscribed; if the container does not support
|
||||||
* this test, or the caching mode is incompatible, true is returned. Otherwise blocks
|
* this test, or the caching mode is incompatible, true is returned. Otherwise blocks
|
||||||
* until timeout milliseconds have passed, or the consumer has registered.
|
* until timeout milliseconds have passed, or the consumer has registered.
|
||||||
* @see DefaultMessageListenerContainer.isRegisteredWithDestination()
|
* @see DefaultMessageListenerContainer#isRegisteredWithDestination()
|
||||||
* @param timeout Timeout in milliseconds.
|
* @param timeout Timeout in milliseconds.
|
||||||
* @return True if a subscriber has connected or the container/attributes does not support
|
* @return True if a subscriber has connected or the container/attributes does not support
|
||||||
* the test. False if a valid container does not have a registered consumer within
|
* the test. False if a valid container does not have a registered consumer within
|
||||||
|
|||||||
@@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.integration.jms.config;
|
package org.springframework.integration.jms.config;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import javax.jms.ConnectionFactory;
|
import javax.jms.ConnectionFactory;
|
||||||
import javax.jms.Destination;
|
import javax.jms.Destination;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
@@ -25,7 +23,6 @@ import javax.jms.Session;
|
|||||||
import javax.jms.TextMessage;
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import org.springframework.util.ObjectUtils;
|
|||||||
* defined as {@link JmxHeaders#OBJECT_NAME} and {@link JmxHeaders#OPERATION_NAME},
|
* defined as {@link JmxHeaders#OBJECT_NAME} and {@link JmxHeaders#OPERATION_NAME},
|
||||||
* respectively. In either case, if no header is present, the value resolution
|
* respectively. In either case, if no header is present, the value resolution
|
||||||
* will fallback to the defaults, if any have been configured on this instance via
|
* will fallback to the defaults, if any have been configured on this instance via
|
||||||
* {@link #setDefaultObjectName(String)} and {@link #setDefaultOperationName(String)},
|
* {@link #setObjectName(String)} and {@link #setOperationName(String)},
|
||||||
* respectively.
|
* respectively.
|
||||||
*
|
*
|
||||||
* <p>The operation parameter(s), if any, must be available within the payload of the
|
* <p>The operation parameter(s), if any, must be available within the payload of the
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import org.springframework.util.Assert;
|
|||||||
import org.springframework.util.StringUtils;
|
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.
|
* send and receive operations based on simple String values.
|
||||||
*
|
*
|
||||||
* @author Mark Fisher
|
* @author Mark Fisher
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import org.springframework.security.access.SecurityMetadataSource;
|
|||||||
import org.springframework.util.Assert;
|
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 Mark Fisher
|
||||||
* @author Oleg Zhurakousky
|
* @author Oleg Zhurakousky
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import org.springframework.util.Assert;
|
|||||||
* String, character array, and byte array payloads will be written directly,
|
* String, character array, and byte array payloads will be written directly,
|
||||||
* but for other payload types, the result of the object's {@link #toString()}
|
* 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
|
* 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
|
* @author Mark Fisher
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.springframework.util.StringUtils;
|
|||||||
*
|
*
|
||||||
* @author Josh Long
|
* @author Josh Long
|
||||||
* @author Mark Fisher
|
* @author Mark Fisher
|
||||||
* @see {@link org.jivesoftware.smack.XMPPConnection}
|
* @see org.jivesoftware.smack.XMPPConnection
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public class XmppConnectionFactory extends AbstractFactoryBean<XMPPConnection> {
|
public class XmppConnectionFactory extends AbstractFactoryBean<XMPPConnection> {
|
||||||
|
|||||||
@@ -18,27 +18,26 @@ package org.springframework.integration.xmpp.messages;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import org.jivesoftware.smack.Chat;
|
import org.jivesoftware.smack.Chat;
|
||||||
|
import org.jivesoftware.smack.ChatManager;
|
||||||
import org.jivesoftware.smack.PacketListener;
|
import org.jivesoftware.smack.PacketListener;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.packet.Message;
|
import org.jivesoftware.smack.packet.Message;
|
||||||
import org.jivesoftware.smack.packet.Packet;
|
import org.jivesoftware.smack.packet.Packet;
|
||||||
|
|
||||||
import org.springframework.context.Lifecycle;
|
import org.springframework.context.Lifecycle;
|
||||||
import org.springframework.integration.channel.MessageChannelTemplate;
|
import org.springframework.integration.channel.MessageChannelTemplate;
|
||||||
import org.springframework.integration.core.MessageChannel;
|
import org.springframework.integration.core.MessageChannel;
|
||||||
import org.springframework.integration.endpoint.AbstractEndpoint;
|
import org.springframework.integration.endpoint.AbstractEndpoint;
|
||||||
import org.springframework.integration.message.MessageBuilder;
|
import org.springframework.integration.message.MessageBuilder;
|
||||||
|
import org.springframework.integration.xmpp.XmppConnectionFactory;
|
||||||
import org.springframework.integration.xmpp.XmppHeaders;
|
import org.springframework.integration.xmpp.XmppHeaders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component logs in as a user and forwards any messages <em>to</em> that
|
* This component logs in as a user and forwards any messages <em>to</em> that
|
||||||
* user on to downstream components. The component is an endpoint that has its
|
* user on to downstream components. The component is an endpoint that has its
|
||||||
* own lifecycle and does not need any
|
* own lifecycle and does not need any poller
|
||||||
* {@link org.springframework.integration.endpoint.AbstractPollingEndpoint.Poller}
|
|
||||||
* to work. It takes any message from a given XMPP session (as established by
|
* 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
|
* {@link org.jivesoftware.smack.packet.Message} as the payload of the Spring
|
||||||
* Integration {@link org.springframework.integration.core.Message}. The
|
* Integration {@link org.springframework.integration.core.Message}. The
|
||||||
* {@link org.jivesoftware.smack.Chat} instance that's used is passed along as a
|
* {@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 Josh Long
|
||||||
* @author Mark Fisher
|
* @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
|
* keeps watch over all Chats between the client and any other
|
||||||
* participants.
|
* participants.
|
||||||
* @see {@link org.springframework.integration.channel.MessageChannelTemplate}
|
* @see MessageChannelTemplate
|
||||||
* handles all interesing operations on any Spring Integration channels.
|
* handles all interesing operations on any Spring Integration channels.
|
||||||
* @see {@link org.jivesoftware.smack.XMPPConnection} the XMPPConnection (as
|
* @see XMPPConnection the XMPPConnection (as
|
||||||
* created by
|
* created by {@link XmppConnectionFactory}
|
||||||
* {@link org.springframework.integration.xmpp.XmppConnectionFactory}
|
|
||||||
*/
|
*/
|
||||||
public class XmppMessageDrivenEndpoint extends AbstractEndpoint implements Lifecycle {
|
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 <em>xmpp-connection-factory</em> element.
|
* This will be injected or configured via a <em>xmpp-connection-factory</em> element.
|
||||||
*
|
*
|
||||||
* @param xmppConnection
|
* @param xmppConnection the connection
|
||||||
*/
|
*/
|
||||||
public void setXmppConnection(final XMPPConnection xmppConnection) {
|
public void setXmppConnection(final XMPPConnection xmppConnection) {
|
||||||
this.xmppConnection = xmppConnection;
|
this.xmppConnection = xmppConnection;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class XmppPresenceMessageMapper implements OutboundMessageMapper<Presence
|
|||||||
*
|
*
|
||||||
* @param message the Message whose headers and payload willl b
|
* @param message the Message whose headers and payload willl b
|
||||||
* @return the presence object as constructed from the {@link org.springframework.integration.core.Message} object
|
* @return the presence object as constructed from the {@link org.springframework.integration.core.Message} object
|
||||||
* @throws Exception
|
* @throws Exception if there is a problem
|
||||||
*/
|
*/
|
||||||
public Presence fromMessage(Message<?> message) throws Exception {
|
public Presence fromMessage(Message<?> message) throws Exception {
|
||||||
MessageHeaders messageHeaders = message.getHeaders();
|
MessageHeaders messageHeaders = message.getHeaders();
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class XmppRosterEventMessageDrivenEndpoint extends AbstractEndpoint imple
|
|||||||
/**
|
/**
|
||||||
* This will be injected or configured via a <em>xmpp-connection-factory</em> element.
|
* This will be injected or configured via a <em>xmpp-connection-factory</em> element.
|
||||||
*
|
*
|
||||||
* @param xmppConnection
|
* @param xmppConnection the connection
|
||||||
*/
|
*/
|
||||||
public void setXmppConnection(final XMPPConnection xmppConnection) {
|
public void setXmppConnection(final XMPPConnection xmppConnection) {
|
||||||
this.xmppConnection = xmppConnection;
|
this.xmppConnection = xmppConnection;
|
||||||
|
|||||||
@@ -2,73 +2,81 @@ package org.springframework.integration.xmpp.presence;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
import org.jivesoftware.smack.packet.Presence;
|
import org.jivesoftware.smack.packet.Presence;
|
||||||
|
|
||||||
import org.springframework.context.Lifecycle;
|
import org.springframework.context.Lifecycle;
|
||||||
|
|
||||||
import org.springframework.integration.core.Message;
|
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
|
* @author Josh Long
|
||||||
* @see {@link org.jivesoftware.smack.packet.Presence.Mode} the mode (i.e.: {@link org.jivesoftware.smack.packet.Presence.Mode#away})
|
* @see org.jivesoftware.smack.packet.Presence.Mode the mode (i.e.:
|
||||||
* @see {@link org.jivesoftware.smack.packet.Presence.Type} the type (i.e.: {@link org.jivesoftware.smack.packet.Presence.Type#available} )
|
* {@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
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public class XmppRosterEventMessageSendingHandler implements MessageHandler, Lifecycle {
|
public class XmppRosterEventMessageSendingHandler implements MessageHandler, Lifecycle {
|
||||||
private static final Log logger = LogFactory.getLog(XmppRosterEventMessageDrivenEndpoint.class);
|
private static final Log logger = LogFactory.getLog(XmppRosterEventMessageDrivenEndpoint.class);
|
||||||
private volatile boolean running;
|
|
||||||
private OutboundMessageMapper<Presence> messageMapper;
|
|
||||||
private volatile XMPPConnection xmppConnection;
|
|
||||||
|
|
||||||
public void setXmppConnection(final XMPPConnection xmppConnection) {
|
private volatile boolean running;
|
||||||
this.xmppConnection = xmppConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleMessage(final Message<?> message)
|
private OutboundMessageMapper<Presence> messageMapper;
|
||||||
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 boolean isRunning() {
|
private volatile XMPPConnection xmppConnection;
|
||||||
return this.running;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void start() {
|
public void setXmppConnection(final XMPPConnection xmppConnection) {
|
||||||
if (null == this.messageMapper) {
|
this.xmppConnection = xmppConnection;
|
||||||
this.messageMapper = new XmppPresenceMessageMapper();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
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() {
|
public boolean isRunning() {
|
||||||
this.running = false;
|
return this.running;
|
||||||
|
}
|
||||||
|
|
||||||
if (xmppConnection.isConnected()) {
|
public void start() {
|
||||||
if (logger.isInfoEnabled()) {
|
if (null == this.messageMapper) {
|
||||||
logger.info("shutting down XMPP connection");
|
this.messageMapper = new XmppPresenceMessageMapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
xmppConnection.disconnect();
|
this.running = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public void stop() {
|
||||||
* the MessageMapper is responsible for converting outbound Messages into status updates of type {@link org.jivesoftware.smack.packet.Presence}
|
this.running = false;
|
||||||
* @param messageMapper
|
|
||||||
*/
|
if (xmppConnection.isConnected()) {
|
||||||
public void setMessageMapper(OutboundMessageMapper<Presence> messageMapper) {
|
if (logger.isInfoEnabled()) {
|
||||||
this.messageMapper = messageMapper;
|
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<Presence> messageMapper) {
|
||||||
|
this.messageMapper = messageMapper;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import org.springframework.integration.channel.MessageChannelTemplate;
|
|||||||
import org.springframework.integration.core.Message;
|
import org.springframework.integration.core.Message;
|
||||||
import org.springframework.integration.message.*;
|
import org.springframework.integration.message.*;
|
||||||
|
|
||||||
import org.springframework.integration.xmpp.messages.XmppMessageSendingMessageHandler;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user