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:12 UTC

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

Author: kfujino
Date: Thu Apr 21 06:17:12 2016
New Revision: 1740234

URL: http://svn.apache.org/viewvc?rev=1740234&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/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java

Modified: tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java?rev=1740234&r1=1740233&r2=1740234&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Thu Apr 21 06:17:12 2016
@@ -135,14 +135,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 ) {
@@ -383,6 +380,13 @@ public class GroupChannel extends Channe
                 ((getFirstInterceptor().getNext() instanceof ChannelCoordinator))) {
             addInterceptor(new MessageDispatchInterceptor());
         }
+        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