ARTEMIS-914 use defaults for ReplicaPolicy
This commit is contained in:
parent
0386263c83
commit
22c6a81135
|
@ -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,
|
||||
|
|
|
@ -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…
Reference in New Issue