activemq-artemis git commit: ARTEMIS-914 use defaults for ReplicaPolicy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

activemq-artemis git commit: ARTEMIS-914 use defaults for ReplicaPolicy

clebertsuconic-2
Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x 2a485602f -> 3ae209484


ARTEMIS-914 use defaults for ReplicaPolicy

(cherry picked from commit 22c6a81135c3a4be17d7990ff2c3c54029dbdd2f)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3ae20948
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3ae20948
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3ae20948

Branch: refs/heads/1.x
Commit: 3ae2094842dc869bffaad6bf8c6b950a738c3d03
Parents: 2a48560
Author: Justin Bertram <[hidden email]>
Authored: Wed Jan 11 11:40:13 2017 -0600
Committer: Clebert Suconic <[hidden email]>
Committed: Wed Jan 11 14:19:39 2017 -0500

----------------------------------------------------------------------
 .../artemis/core/server/cluster/ha/ReplicaPolicy.java     |  6 ++++++
 .../artemis/core/server/cluster/ha/ReplicatedPolicy.java  | 10 ++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3ae20948/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java
index 89e7ab8..68db06e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicaPolicy.java
@@ -47,6 +47,12 @@ public class ReplicaPolicy extends BackupPolicy {
       this.networkHealthCheck = networkHealthCheck;
    }
 
+   public ReplicaPolicy(final NetworkHealthCheck networkHealthCheck,
+                        ReplicatedPolicy replicatedPolicy) {
+      this.networkHealthCheck = networkHealthCheck;
+      this.replicatedPolicy = replicatedPolicy;
+   }
+
    public ReplicaPolicy(String clusterName,
                         int maxSavedReplicatedJournalsSize,
                         String groupName,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3ae20948/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java
index f743219..82df79c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ReplicatedPolicy.java
@@ -48,7 +48,7 @@ public class ReplicatedPolicy implements HAPolicy<LiveActivation> {
    private final NetworkHealthCheck networkHealthCheck;
 
    public ReplicatedPolicy(NetworkHealthCheck networkHealthCheck) {
-      replicaPolicy = new ReplicaPolicy(clusterName, -1, groupName, this, networkHealthCheck);
+      replicaPolicy = new ReplicaPolicy(networkHealthCheck, this);
       this.networkHealthCheck = networkHealthCheck;
    }
 
@@ -122,7 +122,13 @@ public class ReplicatedPolicy implements HAPolicy<LiveActivation> {
 
    public ReplicaPolicy getReplicaPolicy() {
       if (replicaPolicy == null) {
-         replicaPolicy = new ReplicaPolicy(clusterName, -1, groupName, this, networkHealthCheck);
+         replicaPolicy = new ReplicaPolicy(networkHealthCheck, this);
+         if (clusterName != null && clusterName.length() > 0) {
+            replicaPolicy.setClusterName(clusterName);
+         }
+         if (groupName != null && groupName.length() > 0) {
+            replicaPolicy.setGroupName(groupName);
+         }
       }
       return replicaPolicy;
    }

Loading...