From: pero
Date: Thu, 26 Apr 2007 21:09:41 +0000 (+0000)
Subject: Add heartbeatBackgroundEnabled to enable channel heartbeat call.
X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=86feff6f58da59739d4823ea616bd7f4916b8834;p=tomcat7.0
Add heartbeatBackgroundEnabled to enable channel heartbeat call.
Don't forget to disable the GroupChannel heartbeat thread.
Default is false.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@532865 13f79535-47bb-0310-9956-ffa450edef68
---
diff --git a/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java b/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
index 3da502383..6673ab35f 100644
--- a/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
+++ b/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
@@ -126,6 +126,12 @@ public class SimpleTcpCluster
protected String clusterName ;
/**
+ * call Channel.heartbeat() at container background thread
+ * @see org.apache.catalina.tribes.group.GroupChannel#heartbeat()
+ */
+ protected boolean heartbeatBackgroundEnabled =false ;
+
+ /**
* The Container associated with this Cluster.
*/
protected Container container = null;
@@ -188,6 +194,22 @@ public class SimpleTcpCluster
}
/**
+ * Return heartbeat enable flag (default false)
+ * @return the heartbeatBackgroundEnabled
+ */
+ public boolean isHeartbeatBackgroundEnabled() {
+ return heartbeatBackgroundEnabled;
+ }
+
+ /**
+ * enabled that container backgroundThread call heartbeat at channel
+ * @param heartbeatBackgroundEnabled the heartbeatBackgroundEnabled to set
+ */
+ public void setHeartbeatBackgroundEnabled(boolean heartbeatBackgroundEnabled) {
+ this.heartbeatBackgroundEnabled = heartbeatBackgroundEnabled;
+ }
+
+ /**
* Set the name of the cluster to join, if no cluster with this name is
* present create one.
*
@@ -584,12 +606,15 @@ public class SimpleTcpCluster
* invoked inside the classloading context of this container. Unexpected
* throwables will be caught and logged.
* @see org.apache.catalina.ha.deploy.FarmWarDeployer#backgroundProcess()
- * @see ReplicationTransmitter#backgroundProcess()
+ * @see org.apache.catalina.tribes.group.GroupChannel#heartbeat()
+ * @see org.apache.catalina.tribes.group.GroupChannel.HeartbeatThread#run()
+ *
*/
public void backgroundProcess() {
if (clusterDeployer != null) clusterDeployer.backgroundProcess();
- //send a heartbeat through the channel
- if ( channel !=null ) channel.heartbeat();
+
+ //send a heartbeat through the channel
+ if ( isHeartbeatBackgroundEnabled() && channel !=null ) channel.heartbeat();
}
/**
diff --git a/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml b/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml
index ac0414079..e051aee3e 100644
--- a/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml
@@ -16,8 +16,12 @@
-
+
+
-
-
-
-
-
+
+
+
+
+ Add heartbeatBackgroundEnabled flag to SimpleTcpCluster.
+ Enable this flag don't forget to disable the channel heartbeat thread (pero)
+
+
+
+
diff --git a/webapps/docs/config/cluster.xml b/webapps/docs/config/cluster.xml
index 5a1622022..e4451f58c 100644
--- a/webapps/docs/config/cluster.xml
+++ b/webapps/docs/config/cluster.xml
@@ -109,6 +109,11 @@
+
+ Enable this flag don't forget to disable the channel heartbeat thread.
+
+
+
Deprecated since 6.0.0
Possible values are true or false