diff --git a/spring-integration-hazelcast/build.gradle b/spring-integration-hazelcast/build.gradle index e1e86ec..e05c883 100644 --- a/spring-integration-hazelcast/build.gradle +++ b/spring-integration-hazelcast/build.gradle @@ -7,17 +7,37 @@ apply plugin: 'idea' group = 'org.springframework.integration' +buildscript { + repositories { + maven { url 'http://repo.spring.io/plugins-release' } + } + dependencies { + classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE' + } +} + repositories { + if (version.endsWith('BUILD-SNAPSHOT') || project.hasProperty('platformVersion')) { + maven { url 'http://repo.spring.io/libs-snapshot' } + } maven { url 'http://repo.spring.io/libs-milestone' } } +if (project.hasProperty('platformVersion')) { + apply plugin: 'spring-io' + + dependencies { + springIoVersions "io.spring.platform:platform-bom:${platformVersion}@properties" + } +} + sourceCompatibility = targetCompatibility = 1.7 ext { - hazelcastVersion = '3.4.2' - jacocoVersion = '0.7.2.201409121644' - slf4jVersion = '1.7.11' - springIntegrationVersion = '4.1.3.RELEASE' + hazelcastVersion = '3.5' + jacocoVersion = '0.7.5.201505241946' + slf4jVersion = '1.7.12' + springIntegrationVersion = '4.1.5.RELEASE' idPrefix = 'hazelcast' @@ -221,6 +241,6 @@ task dist(dependsOn: assemble) { task wrapper(type: Wrapper) { description = 'Generates gradlew[.bat] scripts' - gradleVersion = '2.3' + gradleVersion = '2.4' distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip" } diff --git a/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.jar b/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.jar index 085a1cd..b5166da 100644 Binary files a/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.jar and b/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.jar differ diff --git a/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.properties b/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.properties index 7cd1345..7deee99 100644 --- a/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.properties +++ b/spring-integration-hazelcast/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Mar 19 00:10:16 GMT 2015 +#Tue Jun 23 21:21:28 EDT 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-2.3-all.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/HazelcastIntegrationDefinitionValidator.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/HazelcastIntegrationDefinitionValidator.java index 485af74..b797af4 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/HazelcastIntegrationDefinitionValidator.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/HazelcastIntegrationDefinitionValidator.java @@ -20,8 +20,8 @@ import java.util.Arrays; import java.util.List; import java.util.Set; -import reactor.util.CollectionUtils; -import reactor.util.StringUtils; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import com.hazelcast.core.DistributedObject; import com.hazelcast.core.IList; diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastContinuousQueryInboundChannelAdapterParser.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastContinuousQueryInboundChannelAdapterParser.java index 5d02d37..654c632 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastContinuousQueryInboundChannelAdapterParser.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastContinuousQueryInboundChannelAdapterParser.java @@ -26,8 +26,7 @@ import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.integration.config.xml.IntegrationNamespaceUtils; import org.springframework.integration.hazelcast.inbound.HazelcastContinuousQueryMessageProducer; - -import reactor.util.StringUtils; +import org.springframework.util.StringUtils; /** * Hazelcast Continuous Query Inbound Channel Adapter Parser parses diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java index 2bfb61a..918b5cc 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastDistributedSQLInboundChannelAdapterParser.java @@ -24,8 +24,7 @@ import org.springframework.beans.factory.xml.ParserContext; import org.springframework.integration.config.xml.AbstractPollingInboundChannelAdapterParser; import org.springframework.integration.config.xml.IntegrationNamespaceUtils; import org.springframework.integration.hazelcast.inbound.HazelcastDistributedSQLMessageSource; - -import reactor.util.StringUtils; +import org.springframework.util.StringUtils; /** * Hazelcast Distributed SQL Inbound Channel Adapter Parser parses diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastEventDrivenInboundChannelAdapterParser.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastEventDrivenInboundChannelAdapterParser.java index 85dca4d..e22eb43 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastEventDrivenInboundChannelAdapterParser.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/config/xml/HazelcastEventDrivenInboundChannelAdapterParser.java @@ -26,8 +26,7 @@ import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.integration.config.xml.IntegrationNamespaceUtils; import org.springframework.integration.hazelcast.inbound.HazelcastEventDrivenMessageProducer; - -import reactor.util.StringUtils; +import org.springframework.util.StringUtils; /** * Hazelcast Event Driven Inbound Channel Adapter Parser parses diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/AbstractHazelcastMessageProducer.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/AbstractHazelcastMessageProducer.java index 80b8e38..f845989 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/AbstractHazelcastMessageProducer.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/AbstractHazelcastMessageProducer.java @@ -33,6 +33,7 @@ import org.springframework.integration.hazelcast.HazelcastLocalInstanceRegistrar import org.springframework.integration.hazelcast.message.EntryEventMessagePayload; import org.springframework.messaging.Message; import org.springframework.util.Assert; +import org.springframework.util.StringUtils; import com.hazelcast.core.AbstractIMapEvent; import com.hazelcast.core.DistributedObject; @@ -43,8 +44,6 @@ import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.MapEvent; import com.hazelcast.core.MultiMap; -import reactor.util.StringUtils; - /** * Hazelcast Base Event-Driven Message Producer. * diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastContinuousQueryMessageProducer.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastContinuousQueryMessageProducer.java index eb1a5f1..d3905fb 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastContinuousQueryMessageProducer.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastContinuousQueryMessageProducer.java @@ -19,6 +19,7 @@ package org.springframework.integration.hazelcast.inbound; import org.springframework.util.Assert; import com.hazelcast.core.IMap; +import com.hazelcast.map.listener.MapListener; import com.hazelcast.query.SqlPredicate; /** @@ -51,7 +52,8 @@ public class HazelcastContinuousQueryMessageProducer extends AbstractHazelcastMe @Override protected void doStart() { setHazelcastRegisteredEventListenerId(((IMap) this.distributedObject) - .addEntryListener(new HazelcastEntryListener(), new SqlPredicate(this.predicate), this.includeValue)); + .addEntryListener((MapListener) new HazelcastEntryListener(), new SqlPredicate(this.predicate), + this.includeValue)); } @Override diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java index d3f6a13..3c483b0 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/inbound/HazelcastEventDrivenMessageProducer.java @@ -35,6 +35,7 @@ import com.hazelcast.core.Message; import com.hazelcast.core.MessageListener; import com.hazelcast.core.MultiMap; import com.hazelcast.core.ReplicatedMap; +import com.hazelcast.map.listener.MapListener; /** * Hazelcast Event Driven Message Producer is a message producer which enables @@ -64,7 +65,7 @@ public class HazelcastEventDrivenMessageProducer extends AbstractHazelcastMessag protected void doStart() { if (this.distributedObject instanceof IMap) { setHazelcastRegisteredEventListenerId(((IMap) this.distributedObject) - .addEntryListener(new HazelcastEntryListener(), true)); + .addEntryListener((MapListener) new HazelcastEntryListener(), true)); } else if (this.distributedObject instanceof MultiMap) { setHazelcastRegisteredEventListenerId(((MultiMap) this.distributedObject) diff --git a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java index 736c3f9..8ee34f2 100644 --- a/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java +++ b/spring-integration-hazelcast/src/main/java/org/springframework/integration/hazelcast/outbound/HazelcastCacheWritingMessageHandler.java @@ -21,6 +21,7 @@ import java.util.Map; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; +import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.expression.IntegrationEvaluationContextAware; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.hazelcast.HazelcastHeaders; @@ -39,8 +40,7 @@ import com.hazelcast.core.MultiMap; * @author Artem Bilan * @since 1.0.0 */ -public class HazelcastCacheWritingMessageHandler extends AbstractMessageHandler - implements IntegrationEvaluationContextAware { +public class HazelcastCacheWritingMessageHandler extends AbstractMessageHandler { private DistributedObject distributedObject; @@ -72,8 +72,9 @@ public class HazelcastCacheWritingMessageHandler extends AbstractMessageHandler } @Override - public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) { - this.evaluationContext = evaluationContext; + protected void onInit() throws Exception { + super.onInit(); + this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } @Override diff --git a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/inbound/HazelcastMultiMapEventDrivenInboundChannelAdapterTests.java b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/inbound/HazelcastMultiMapEventDrivenInboundChannelAdapterTests.java index cb7caca..606b459 100644 --- a/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/inbound/HazelcastMultiMapEventDrivenInboundChannelAdapterTests.java +++ b/spring-integration-hazelcast/src/test/java/org/springframework/integration/hazelcast/inbound/HazelcastMultiMapEventDrivenInboundChannelAdapterTests.java @@ -40,6 +40,7 @@ import com.hazelcast.core.MultiMap; * Hazelcast MultiMap Event Driven Inbound Channel Adapter Test * * @author Eren Avsarogullari + * @author Artem Bilan * @since 1.0.0 */ @RunWith(SpringJUnit4ClassRunner.class) @@ -107,15 +108,16 @@ public class HazelcastMultiMapEventDrivenInboundChannelAdapterTests extends Abst Assert.assertEquals(Integer.valueOf(2), ((EntryEventMessagePayload) msg .getPayload()).key); + Assert.assertNull(((EntryEventMessagePayload) msg.getPayload()).value); Assert.assertEquals(2, (((EntryEventMessagePayload) msg - .getPayload()).value).getId()); + .getPayload()).oldValue).getId()); Assert.assertEquals("TestName2", (((EntryEventMessagePayload) msg - .getPayload()).value).getName()); + .getPayload()).oldValue).getName()); Assert.assertEquals("TestSurname2", (((EntryEventMessagePayload) msg - .getPayload()).value).getSurname()); + .getPayload()).oldValue).getSurname()); } @Test