tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1387073 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java webapps/docs/changelog.xml webapps/docs/config/cluster-interceptor.xml
Date Tue, 18 Sep 2012 09:45:17 GMT
Author: kfujino
Date: Tue Sep 18 09:45:17 2012
New Revision: 1387073

URL: http://svn.apache.org/viewvc?rev=1387073&view=rev
Log:
Fix a behavior of TcpPingInterceptor#useThread.
If set to false, ping thread is never started. 

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
    tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-interceptor.xml

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java?rev=1387073&r1=1387072&r2=1387073&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java
Tue Sep 18 09:45:17 2012
@@ -64,8 +64,8 @@ public class TcpPingInterceptor extends 
     @Override
     public synchronized void start(int svc) throws ChannelException {
         super.start(svc);
-        running = true;
-        if ( thread == null ) {
+        if ( thread == null && useThread) {
+            running = true;
             thread = new PingThread();
             thread.setDaemon(true);
             thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1));
@@ -86,9 +86,11 @@ public class TcpPingInterceptor extends 
     
     @Override
     public void stop(int svc) throws ChannelException {
-        running = false;
-        if ( thread != null ) thread.interrupt();
-        thread = null;
+        if ( thread != null ) {
+            running = false;
+            thread.interrupt();
+            thread = null;
+        }
         super.stop(svc);
     }
     

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=1387073&r1=1387072&r2=1387073&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Sep 18 09:45:17 2012
@@ -100,6 +100,10 @@
         Make the cluster members and the cluster deployer associated with the
         cluster accessible via JMX. (markt)
       </add>
+      <fix>
+        Fix a behavior of TcpPingInterceptor#useThread. If set to false, ping
+        thread is never started. (kfujino)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">

Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-interceptor.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-interceptor.xml?rev=1387073&r1=1387072&r2=1387073&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-interceptor.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/config/cluster-interceptor.xml Tue Sep 18 09:45:17 2012
@@ -55,6 +55,7 @@
     <li><code>org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor</code></li>
     <li><code>org.apache.catalina.tribes.group.interceptors.FragmentationInterceptor</code></li>
     <li><code>org.apache.catalina.tribes.group.interceptors.GzipInterceptor</code></li>
+    <li><code>org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor</code></li>
    </ul>
  </p>
 </section>
@@ -143,6 +144,20 @@
    <attributes>
    </attributes>
   </subsection>
+  <subsection name="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor Attributes">
+   <attributes>
+     <attribute name="interval" required="false">
+       If useThread == true, defines the interval of sending a ping message.
+       default is 1000 ms.
+     </attribute>
+     <attribute name="useThread" required="false">
+       Flag of whether to start a thread for sending a ping message.
+       If set to true, this interceptor will start a local thread for sending a ping message.
+       if set to false, channel heartbeat will send a ping message.
+       default is false.
+     </attribute>
+   </attributes>
+  </subsection>
   <subsection name="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor
Attributes">
    <attributes>
      <attribute name="interval" required="false">



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


Mime
View raw message