tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r399383 - /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/ChannelCoordinator.java
Date Wed, 03 May 2006 18:55:26 GMT
Author: fhanik
Date: Wed May  3 11:55:20 2006
New Revision: 399383

URL: http://svn.apache.org/viewcvs?rev=399383&view=rev
Log:
Don't pass start levels down that are not valid for the bottom components.
This way, interceptors can add own their own start/stop levels, and the bottom layer would
be 
unaffected. 

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/ChannelCoordinator.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/ChannelCoordinator.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/ChannelCoordinator.java?rev=399383&r1=399382&r2=399383&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/ChannelCoordinator.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/ChannelCoordinator.java
Wed May  3 11:55:20 2006
@@ -120,7 +120,11 @@
     protected synchronized void internalStart(int svc) throws ChannelException {
         try {
             boolean valid = false;
-            if (startLevel == Channel.DEFAULT) return;
+            //make sure we don't pass down any flags that are unrelated to the bottom layer
+            svc = svc & Channel.DEFAULT;
+
+            if (startLevel == Channel.DEFAULT) return; //we have already started up all components
+            if (svc == 0 ) return;//nothing to start
 
             //must start the receiver first so that we can coordinate the port it
             //listens to with the local membership settings
@@ -144,7 +148,8 @@
             if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
                 membershipService.start(MembershipService.MBR_TX);
                 valid = true;
-            }            
+            }
+            
             if ( !valid) {
                 throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
             }
@@ -169,8 +174,13 @@
      */
     protected synchronized void internalStop(int svc) throws ChannelException {
         try {
+            //make sure we don't pass down any flags that are unrelated to the bottom layer
+            svc = svc & Channel.DEFAULT;
+
+            if (startLevel == 0) return; //we have already stopped up all components
+            if (svc == 0 ) return;//nothing to stop
+
             boolean valid = false;
-            if ( startLevel == 0 ) return;
             if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
                 clusterReceiver.stop();
                 clusterReceiver.setMessageListener(null);



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


Mime
View raw message