You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kf...@apache.org on 2016/04/21 08:17:56 UTC

svn commit: r1740235 - /tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java

Author: kfujino
Date: Thu Apr 21 06:17:56 2016
New Revision: 1740235

URL: http://svn.apache.org/viewvc?rev=1740235&view=rev
Log:
Change timing of add the channel instance to the interceptors.
Add the channel instance to the interceptors when starting the channel.

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java?rev=1740235&r1=1740234&r2=1740235&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Thu Apr 21 06:17:56 2016
@@ -133,14 +133,11 @@ public class GroupChannel extends Channe
      */
     @Override
     public void addInterceptor(ChannelInterceptor interceptor) {
-        if (interceptor instanceof ChannelInterceptorBase)
-            ((ChannelInterceptorBase)interceptor).setChannel(this);
         if ( interceptors == null ) {
             interceptors = interceptor;
             interceptors.setNext(coordinator);
             interceptors.setPrevious(null);
             coordinator.setPrevious(interceptors);
-            coordinator.setChannel(this);
         } else {
             ChannelInterceptor last = interceptors;
             while ( last.getNext() != coordinator ) {
@@ -378,6 +375,13 @@ public class GroupChannel extends Channe
             }
             this.addInterceptor(interceptor);
         }
+        Iterator<ChannelInterceptor> interceptors = getInterceptors();
+        while (interceptors.hasNext()) {
+            ChannelInterceptor channelInterceptor = interceptors.next();
+            if (channelInterceptor instanceof ChannelInterceptorBase)
+                ((ChannelInterceptorBase)channelInterceptor).setChannel(this);
+        }
+        coordinator.setChannel(this);
     }
 
     /**



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