Author: fhanik
Date: Fri Jul  4 14:30:31 2008
New Revision: 674125

URL: http://svn.apache.org/viewvc?rev=674125&view=rev
Log:
Add in startup options to the cluster channel.
Document the multicast recovery options


Modified:
    tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
    tomcat/trunk/webapps/docs/config/cluster-membership.xml
    tomcat/trunk/webapps/docs/config/cluster-sender.xml
    tomcat/trunk/webapps/docs/config/cluster.xml

Modified: tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java?rev=674125&r1=674124&r2=674125&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java Fri Jul  
4 14:30:31 2008
@@ -179,6 +179,8 @@
     private Map properties = new HashMap();
     
     private int channelSendOptions = Channel.SEND_OPTIONS_ASYNCHRONOUS;
+    
+    private int channelStartOptions = Channel.DEFAULT;
 
     // ------------------------------------------------------------- Properties
 
@@ -673,7 +675,7 @@
             registerClusterValve();
             channel.addMembershipListener(this);
             channel.addChannelListener(this);
-            channel.start(channel.DEFAULT);
+            channel.start(channelStartOptions);
             if (clusterDeployer != null) clusterDeployer.start();
             this.started = true;
             //register JMX objects
@@ -769,7 +771,7 @@
         this.managers.clear();
         try {
             if ( clusterDeployer != null ) clusterDeployer.setCluster(null);
-            channel.stop(Channel.DEFAULT);
+            channel.stop(channelStartOptions);
             channel.removeChannelListener(this);
             channel.removeMembershipListener(this);
             this.unregisterClusterValve();
@@ -951,4 +953,12 @@
     public String getProtocol() {
         return null;
     }
+
+    public int getChannelStartOptions() {
+        return channelStartOptions;
+    }
+
+    public void setChannelStartOptions(int channelStartOptions) {
+        this.channelStartOptions = channelStartOptions;
+    }
 }

Modified: tomcat/trunk/webapps/docs/config/cluster-membership.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-membership.xml?rev=674125&r1=674124&r2=674125&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster-membership.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster-membership.xml Fri Jul  4 14:30:31 
2008
@@ -125,6 +125,28 @@
       If a value smaller or equal to 0 is presented, the code will default 
this value to frequency
       </p>
     </attribute>
+    <attribute name="recoveryEnabled" required="false">
+      <p>
+      In case of a network failure, Java multicast socket don't transparently 
fail over, instead the socket will continously
+      throw IOException upon each receive request. When recoveryEnabled is set 
to true, this will close the multicast socket
+      and open a new socket with the same properties as defined above.<br/>
+      The default is <code>true</code>. <br/>
+      </p>
+    </attribute>
+    <attribute name="recoveryCounter" required="false">
+      <p>
+      When <code>recoveryEnabled==true</code> this value indicates how many 
times we will try recovery.
+      The default is <code>10</code>. <br/>
+      </p>
+    </attribute>
+    <attribute name="recoverySleepTime" required="false">
+      <p>
+      When <code>recoveryEnabled==true</code> this value indicates how long 
time (in milliseconds)
+      the system will sleep in between recovery attempts, until we either 
recovered successfully or we have reached the
+      recoveryCounter limit.
+      The default is <code>5000</code> (5 seconds). <br/>
+      </p>
+    </attribute>
 
 
   </attributes>

Modified: tomcat/trunk/webapps/docs/config/cluster-sender.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-sender.xml?rev=674125&r1=674124&r2=674125&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster-sender.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster-sender.xml Fri Jul  4 14:30:31 2008
@@ -98,10 +98,10 @@
        The send buffer size on the datagram socket.
        Default value is <code>43800</code> bytes.
       </attribute>
-      <attribute name="direct" required="false">
+      <attribute name="directBuffer" required="false">
        Possible values are <code>true</code> or <code>false</code>. 
-       Set to true if you want the receiver to use direct bytebuffers when 
reading data
-       from the sockets. Default value is <code>false</code>
+       Set to true if you want the receiver to use direct bytebuffers when 
writing data
+       to the sockets. Default value is <code>false</code>
       </attribute>
       <attribute name="keepAliveCount" required="false">
        The number of requests that can go through the socket before the socket 
is closed, and reopened
@@ -113,7 +113,10 @@
       </attribute>
       <attribute name="timeout" required="false">
         Sets the SO_TIMEOUT option on the socket. The value is in milliseconds 
and the default value is <code>3000</code> 
-        milliseconds.
+        milliseconds.(3 seconds) This timeout starts when a message send 
attempt is starting, until the transfer has been completed.
+        For the NIO sockets, this will mean, that the caller can guarantee 
that we will not attempt sending the message
+        longer than this timeout value. For the blocking IO implementation, 
this translated directly to the soTimeout.<br/>
+        A timeout will not spawn a retry attempt, in order to guarantee the 
return of the application thread.
       </attribute>
       <attribute name="maxRetryAttempts" required="false">
         How many times do we retry a failed message, that received a 
IOException at the socket level.

Modified: tomcat/trunk/webapps/docs/config/cluster.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster.xml?rev=674125&r1=674124&r2=674125&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster.xml Fri Jul  4 14:30:31 2008
@@ -124,6 +124,18 @@
       So to use ACK and ASYNC messaging, the flag would be <code>10 (8+2) or 
0x000B</code><br/>
       </p>
     </attribute>
+    <attribute name="channelStartOptions" required="false">
+      <p>Sets the start and stop flags for the &lt;Channel&gt; object used by 
the cluster.
+         The default is <code>Channel.DEFAULT</code> which starts all the 
channel services, such as 
+         sender, receiver, multicast sender and multicast receiver.
+         The following flags are available today:
+         <source>
+           Channel.DEFAULT = Channel.SND_RX_SEQ (1)| Channel.SND_TX_SEQ (2)| 
Channel.MBR_RX_SEQ (4)| Channel.MBR_TX_SEQ (8);
+         </source>
+         To start a channel without multicasting, you would want to use the 
value <code>Channel.SND_RX_SEQ | Channel.SND_TX_SEQ</code>
+         that equals to <code>3</code>.
+      </p>
+    </attribute>
 
     <attribute name="heartbeatBackgroundEnabled" required="false">
       <p>Enable this flag don't forget to disable the channel heartbeat thread.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to