Author: pero Date: Thu Apr 26 14:09:41 2007 New Revision: 532865 URL: http://svn.apache.org/viewvc?view=rev&rev=532865 Log: Add heartbeatBackgroundEnabled to enable channel heartbeat call. Don't forget to disable the GroupChannel heartbeat thread. Default is false.
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java?view=diff&rev=532865&r1=532864&r2=532865 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java Thu Apr 26 14:09:41 2007 @@ -126,6 +126,12 @@ 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 @@ } /** + * 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 @@ * 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(); } /** Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml?view=diff&rev=532865&r1=532864&r2=532865 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/tcp/mbeans-descriptors.xml Thu Apr 26 14:09:41 2007 @@ -16,8 +16,12 @@ <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" @@ -60,18 +64,6 @@ 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" Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?view=diff&rev=532865&r1=532864&r2=532865 ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Apr 26 14:09:41 2007 @@ -14,6 +14,16 @@ </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> Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml?view=diff&rev=532865&r1=532864&r2=532865 ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/config/cluster.xml Thu Apr 26 14:09:41 2007 @@ -109,6 +109,11 @@ </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/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]