Author: fhanik Date: Fri Apr 28 12:11:17 2006 New Revision: 397984 URL: http://svn.apache.org/viewcvs?rev=397984&view=rev Log: If no interceptor stack is defined, then by minimum, support async messaging
Modified: tomcat/container/tc5.5.x/modules/groupcom/VERSION tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java Modified: tomcat/container/tc5.5.x/modules/groupcom/VERSION URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/VERSION?rev=397984&r1=397983&r2=397984&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/VERSION (original) +++ tomcat/container/tc5.5.x/modules/groupcom/VERSION Fri Apr 28 12:11:17 2006 @@ -1,3 +1,6 @@ +0.9.2.0 + - message dispatch interceptor is included if no other interceptors are added so that + async messaging is enabled in the default stack 0.9.1.2 - 1.4 compatibility 0.9.1.1 Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java?rev=397984&r1=397983&r2=397984&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java Fri Apr 28 12:11:17 2006 @@ -40,6 +40,7 @@ import java.io.IOException; import java.io.ObjectOutput; import org.apache.catalina.tribes.Channel; +import org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor; /** * The GroupChannel manages the replication channel. It coordinates @@ -189,6 +190,27 @@ } } + protected synchronized void setupDefaultStack() throws ChannelException { + + if ( getFirstInterceptor() != null && + (!(getFirstInterceptor() instanceof ChannelCoordinator))) { + ChannelInterceptor interceptor = null; + Class clazz = null; + try { + clazz = Class.forName("org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor", + true,GroupChannel.class.getClassLoader()); + } catch ( Exception x ) { + clazz = MessageDispatchInterceptor.class; + }//catch + try { + interceptor = (ChannelInterceptor) clazz.newInstance(); + } catch (Exception x) { + throw new ChannelException("Unable to add MessageDispatchInterceptor to interceptor chain.",x); + } + this.addInterceptor(interceptor); + } + } + protected void checkOptionFlags() throws ChannelException { StringBuffer conflicts = new StringBuffer(); ChannelInterceptor first = interceptors; @@ -219,6 +241,7 @@ } public void start(int svc) throws ChannelException { + setupDefaultStack(); if (optionCheck) checkOptionFlags(); super.start(svc); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]