You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kf...@apache.org on 2018/05/07 04:40:43 UTC
svn commit: r1831066 - in /tomcat/tc8.5.x/trunk:
java/org/apache/catalina/tribes/membership/McastService.java
webapps/docs/changelog.xml
Author: kfujino
Date: Mon May 7 04:40:43 2018
New Revision: 1831066
URL: http://svn.apache.org/viewvc?rev=1831066&view=rev
Log:
Ensure that the correct default value is returned when retrieve unset properties in McastService.
Modified:
tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java
tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml
Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java?rev=1831066&r1=1831065&r2=1831066&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java (original)
+++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/membership/McastService.java Mon May 7 04:40:43 2018
@@ -94,11 +94,7 @@ public class McastService
*/
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);
}
/**
@@ -122,6 +118,7 @@ public class McastService
hasProperty(properties,"mcastFrequency");
hasProperty(properties,"tcpListenPort");
hasProperty(properties,"tcpListenHost");
+ setDefaults(properties);
this.properties = properties;
}
@@ -611,6 +608,26 @@ public class McastService
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/tc8.5.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml?rev=1831066&r1=1831065&r2=1831066&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.5.x/trunk/webapps/docs/changelog.xml Mon May 7 04:40:43 2018
@@ -88,6 +88,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>
</section>
<section name="Tomcat 8.5.31 (markt)" rtext="2018-05-03">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org