Author: kfujino
Date: Mon May 7 04:43:21 2018
New Revision: 1831068
URL: http://svn.apache.org/viewvc?rev=1831068&view=rev
Log:
Ensure that the correct default value is returned when retrieve unset
properties in McastService.
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java?rev=1831068&r1=1831067&r2=1831068&view=diff
==============================================================================
---
tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java
(original)
+++
tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java
Mon May 7 04:43:21 2018
@@ -91,11 +91,7 @@ public class McastService implements Mem
*/
public McastService() {
//default values
- properties.setProperty("mcastPort","45564");
- properties.setProperty("mcastAddress","228.0.0.4");
- properties.setProperty("memberDropTime","3000");
- properties.setProperty("mcastFrequency","500");
-
+ setDefaults(this.properties);
}
/**
@@ -128,6 +124,7 @@ public class McastService implements Mem
hasProperty(properties,"mcastFrequency");
hasProperty(properties,"tcpListenPort");
hasProperty(properties,"tcpListenHost");
+ setDefaults(properties);
this.properties = properties;
}
@@ -692,6 +689,26 @@ public class McastService implements Mem
this.channel = channel;
}
+ protected void setDefaults(Properties properties) {
+ // default values
+ if (properties.getProperty("mcastPort") == null)
+ properties.setProperty("mcastPort","45564");
+ if (properties.getProperty("mcastAddress") == null)
+ properties.setProperty("mcastAddress","228.0.0.4");
+ if (properties.getProperty("memberDropTime") == null)
+ properties.setProperty("memberDropTime","3000");
+ if (properties.getProperty("mcastFrequency") == null)
+ properties.setProperty("mcastFrequency","500");
+ if (properties.getProperty("recoveryCounter") == null)
+ properties.setProperty("recoveryCounter", "10");
+ if (properties.getProperty("recoveryEnabled") == null)
+ properties.setProperty("recoveryEnabled", "true");
+ if (properties.getProperty("recoverySleepTime") == null)
+ properties.setProperty("recoverySleepTime", "5000");
+ if (properties.getProperty("localLoopbackDisabled") == null)
+ properties.setProperty("localLoopbackDisabled", "false");
+ }
+
/**
* Simple test program
* @param args Command-line arguments
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1831068&r1=1831067&r2=1831068&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Mon May 7 04:43:21 2018
@@ -104,6 +104,14 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Tribes">
+ <changelog>
+ <fix>
+ Ensure that the correct default value is returned when retrieve unset
+ properties in <code>McastService</code>. (kfujino)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Other">
<changelog>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]