Author: kfujino Date: Thu Apr 21 06:16:26 2016 New Revision: 1740233 URL: http://svn.apache.org/viewvc?rev=1740233&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.5.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Modified: tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java?rev=1740233&r1=1740232&r2=1740233&view=diff ============================================================================== --- tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java (original) +++ tomcat/tc8.5.x/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Thu Apr 21 06:16:26 2016 @@ -134,13 +134,11 @@ public class GroupChannel extends Channe */ @Override public void addInterceptor(ChannelInterceptor interceptor) { - 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 ) { @@ -381,6 +379,12 @@ public class GroupChannel extends Channe ((getFirstInterceptor().getNext() instanceof ChannelCoordinator))) { addInterceptor(new MessageDispatchInterceptor()); } + Iterator<ChannelInterceptor> interceptors = getInterceptors(); + while (interceptors.hasNext()) { + ChannelInterceptor channelInterceptor = interceptors.next(); + channelInterceptor.setChannel(this); + } + coordinator.setChannel(this); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org