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:46:43 UTC
svn commit: r1710732 - in /tomcat/tc7.0.x/trunk:
java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
webapps/docs/changelog.xml
Author: kfujino
Date: Tue Oct 27 07:46:42 2015
New Revision: 1710732
URL: http://svn.apache.org/viewvc?rev=1710732&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/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java?rev=1710732&r1=1710731&r2=1710732&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/StaticMembershipInterceptor.java Tue Oct 27 07:46:42 2015
@@ -20,12 +20,17 @@ 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.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+
+public class StaticMembershipInterceptor extends ChannelInterceptorBase {
+
+ private static final Log log = LogFactory.getLog(StaticMembershipInterceptor.class);
-public class StaticMembershipInterceptor
- extends ChannelInterceptorBase {
protected ArrayList<Member> members = new ArrayList<Member>();
protected Member localMember = null;
@@ -119,6 +124,26 @@ 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("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.");
+ }
+ if (pingInterceptor == null) {
+ log.warn("There is no TcpPingInterceptor. The health check of static member does"
+ + " not work properly. By defining the TcpPingInterceptor, the health check of"
+ + " static member will work.");
+ }
}
}
\ No newline at end of file
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=1710732&r1=1710731&r2=1710732&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Oct 27 07:46:42 2015
@@ -116,6 +116,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