Author: kfujino Date: Thu Apr 21 06:15:29 2016 New Revision: 1740232 URL: http://svn.apache.org/viewvc?rev=1740232&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/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java?rev=1740232&r1=1740231&r2=1740232&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/group/GroupChannel.java Thu Apr 21 06:15:29 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