diff --git a/build.gradle b/build.gradle index dc722d56..03d2eac9 100644 --- a/build.gradle +++ b/build.gradle @@ -83,7 +83,6 @@ configure(allprojects) { imports { mavenBom "org.springframework.cloud:spring-cloud-dependencies:Dalston.BUILD-SNAPSHOT" mavenBom "org.springframework.boot:spring-boot-dependencies:$springBootVersion" - mavenBom "org.springframework.cloud:spring-cloud-cluster-dependencies:$springCloudClusterVersion" } dependencies { dependency "log4j:log4j:$log4jVersion" @@ -303,7 +302,7 @@ project('spring-statemachine-cluster') { dependencies { compile project(":spring-statemachine-zookeeper") - compile "org.springframework.cloud:spring-cloud-cluster-zookeeper" + compile "org.springframework.integration:spring-integration-zookeeper" testCompile project(":spring-statemachine-test") testCompile "org.apache.curator:curator-test" diff --git a/spring-statemachine-cluster/src/main/java/org/springframework/statemachine/cluster/LeaderZookeeperStateMachineEnsemble.java b/spring-statemachine-cluster/src/main/java/org/springframework/statemachine/cluster/LeaderZookeeperStateMachineEnsemble.java index 26ad1b8d..58a6fbfe 100644 --- a/spring-statemachine-cluster/src/main/java/org/springframework/statemachine/cluster/LeaderZookeeperStateMachineEnsemble.java +++ b/spring-statemachine-cluster/src/main/java/org/springframework/statemachine/cluster/LeaderZookeeperStateMachineEnsemble.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ import java.util.HashMap; import java.util.Map; import org.apache.curator.framework.CuratorFramework; -import org.springframework.cloud.cluster.leader.Context; -import org.springframework.cloud.cluster.leader.DefaultCandidate; -import org.springframework.cloud.cluster.zk.leader.LeaderInitiator; +import org.springframework.integration.leader.Context; +import org.springframework.integration.leader.DefaultCandidate; +import org.springframework.integration.zookeeper.leader.LeaderInitiator; import org.springframework.statemachine.StateMachine; import org.springframework.statemachine.ensemble.StateMachineEnsemble; import org.springframework.statemachine.zookeeper.ZookeeperStateMachineEnsemble; diff --git a/spring-statemachine-zookeeper/src/main/java/org/springframework/statemachine/zookeeper/ZookeeperStateMachineEnsemble.java b/spring-statemachine-zookeeper/src/main/java/org/springframework/statemachine/zookeeper/ZookeeperStateMachineEnsemble.java index c87abb89..cbc5c708 100644 --- a/spring-statemachine-zookeeper/src/main/java/org/springframework/statemachine/zookeeper/ZookeeperStateMachineEnsemble.java +++ b/spring-statemachine-zookeeper/src/main/java/org/springframework/statemachine/zookeeper/ZookeeperStateMachineEnsemble.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ import org.apache.curator.framework.api.transaction.CuratorTransaction; import org.apache.curator.framework.api.transaction.CuratorTransactionFinal; import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex; -import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode; -import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.Mode; +import org.apache.curator.framework.recipes.nodes.PersistentNode; import org.apache.curator.framework.state.ConnectionState; import org.apache.curator.framework.state.ConnectionStateListener; +import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.data.Stat; import org.springframework.statemachine.StateMachine; @@ -75,7 +75,7 @@ public class ZookeeperStateMachineEnsemble extends StateMachineEnsembleObj private final AtomicReference stateRef = new AtomicReference(); private final AtomicReference notifyRef = new AtomicReference(); private final CuratorWatcher watcher = new StateWatcher(); - private PersistentEphemeralNode node; + private PersistentNode node; private final Queue> joinQueue = new ConcurrentLinkedQueue>(); private final List> joined = new ArrayList>(); private final Object joinLock = new Object(); @@ -297,7 +297,7 @@ public class ZookeeperStateMachineEnsemble extends StateMachineEnsembleObj } } - node = new PersistentEphemeralNode(curatorClient, Mode.EPHEMERAL, memberPath + "/" + uuid, new byte[0]); + node = new PersistentNode(curatorClient, CreateMode.EPHEMERAL, true, memberPath + "/" + uuid, new byte[0]); node.start(); node.waitForInitialCreate(60, TimeUnit.SECONDS);