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 2015/10/27 08:44:11 UTC

svn commit: r1710731 - in /tomcat/tc8.0.x/trunk: java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java webapps/docs/changelog.xml

Author: kfujino
Date: Tue Oct 27 07:44:11 2015
New Revision: 1710731

URL: http://svn.apache.org/viewvc?rev=1710731&view=rev
Log:
When starting the StaticMembershipInterceptor, StaticMembershipInterceptor checks the required Interceptors.
If the required Interceptor does not exist, it issues warning logs.

Modified:
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties
    tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
    tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties?rev=1710731&r1=1710730&r2=1710731&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/LocalStrings.properties Tue Oct 27 07:44:11 2015
@@ -32,6 +32,8 @@ nonBlockingCoordinator.memberDisappeared
 nonBlockingCoordinator.heartbeat.inconsistency=Heartbeat found inconsistency, restart election
 nonBlockingCoordinator.heartbeat.failed=Unable to perform heartbeat.
 orderInterceptor.messageAdded.sameCounter=Message added has the same counter, synchronization bug. Disable the order interceptor
+staticMembershipInterceptor.no.failureDetector=There is no TcpFailureDetector. Automatic detection of static members does not work properly. By defining the StaticMembershipInterceptor under the TcpFailureDetector, automatic detection of the static members will work.
+staticMembershipInterceptor.no.pingInterceptor=There is no TcpPingInterceptor. The health check of static members does not work properly. By defining the TcpPingInterceptor, the health check of static members will work.
 tcpFailureDetector.memberDisappeared.verify=Received memberDisappeared[{0}] message. Will verify.
 tcpFailureDetector.already.disappeared=Verification complete. Member already disappeared[{0}]
 tcpFailureDetector.member.disappeared=Verification complete. Member disappeared[{0}]

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java?rev=1710731&r1=1710730&r2=1710731&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java Tue Oct 27 07:44:11 2015
@@ -20,12 +20,20 @@ import java.util.ArrayList;
 
 import org.apache.catalina.tribes.Channel;
 import org.apache.catalina.tribes.ChannelException;
+import org.apache.catalina.tribes.ChannelInterceptor;
 import org.apache.catalina.tribes.Member;
 import org.apache.catalina.tribes.group.AbsoluteOrder;
 import org.apache.catalina.tribes.group.ChannelInterceptorBase;
+import org.apache.catalina.tribes.util.StringManager;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+
+public class StaticMembershipInterceptor extends ChannelInterceptorBase {
+
+    private static final Log log = LogFactory.getLog(StaticMembershipInterceptor.class);
+    protected static final StringManager sm =
+            StringManager.getManager(StaticMembershipInterceptor.class.getPackage().getName());
 
-public class StaticMembershipInterceptor
-    extends ChannelInterceptorBase {
     protected final ArrayList<Member> members = new ArrayList<>();
     protected Member localMember = null;
 
@@ -119,6 +127,22 @@ public class StaticMembershipInterceptor
         };
         t.start();
         super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));
+
+        // check required interceptors
+        TcpFailureDetector failureDetector = null;
+        TcpPingInterceptor pingInterceptor = null;
+        ChannelInterceptor prev = getPrevious();
+        while (prev != null) {
+            if (prev instanceof TcpFailureDetector ) failureDetector = (TcpFailureDetector) prev;
+            if (prev instanceof TcpPingInterceptor) pingInterceptor = (TcpPingInterceptor) prev;
+            prev = prev.getPrevious();
+        }
+        if (failureDetector == null) {
+            log.warn(sm.getString("staticMembershipInterceptor.no.failureDetector"));
+        }
+        if (pingInterceptor == null) {
+            log.warn(sm.getString("staticMembershipInterceptor.no.pingInterceptor"));
+        }
     }
 
 }
\ No newline at end of file

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1710731&r1=1710730&r2=1710731&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Tue Oct 27 07:44:11 2015
@@ -117,6 +117,12 @@
         clearly. When handling shutdown payload, verification completion message
         is not required. (kfujino)
       </scode>
+      <fix>
+        When starting the <code>StaticMembershipInterceptor</code>,
+        <code>StaticMembershipInterceptor</code> checks  the required
+        Interceptors. If the required Interceptor does not exist, it issues
+        warning logs. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="jdbc-pool">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org