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;
}
/**
+ * 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.
*
* 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();
}
/**
<attribute name="notifyLifecycleListenerOnFailure"
description="notify lifecycleListener from message transfer failure"
is="true"
- type="boolean"/>
- <attribute name="clusterName"
+ type="boolean"/>
+ <attribute name="heartbeatBackgroundEnabled"
+ description="enable that container background thread call channel heartbeat, default is that channel mangage heartbeat itself."
+ is="true"
+ type="boolean"/>
+ <attribute name="clusterName"
description="name of cluster"
type="java.lang.String"/>
<attribute name="managerClassName"
type="org.apache.catalina.ha.ClusterMessage"/>
</operation>
- <operation name="sendToMember"
- description="send message to one cluster member"
- impact="ACTION"
- returnType="void">
- <parameter name="message"
- description="replication message"
- type="org.apache.catalina..cluster.ClusterMessage"/>
- <parameter name="member"
- description="cluster member"
- type="java.lang.String"/>
- </operation>
-
<operation name="start"
description="Start the cluster"
impact="ACTION"
</properties>
<body>
+<section name="Tomcat 6.0.13 (remm)">
+ <subsection name="Cluster">
+ <changelog>
+ <fix>
+ Add heartbeatBackgroundEnabled flag to SimpleTcpCluster.
+ Enable this flag don't forget to disable the channel heartbeat thread (pero)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
<section name="Tomcat 6.0.12 (remm)">
<subsection name="General">
<changelog>
</p>
</attribute>
+ <attribute name="heartbeatBackgroundEnabled" required="false">
+ <p>Enable this flag don't forget to disable the channel heartbeat thread.
+ </p>
+ </attribute>
+
<attribute name="doClusterLog" required="false">
<p><b>Deprecated since 6.0.0</b></p>
<p>Possible values are <code>true</code> or <code>false</code><br/>