tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r380936 [1/2] - in /tomcat/container/tc5.5.x/modules: ./ groupcom/ groupcom/src/share/org/apache/catalina/groups/ groupcom/src/share/org/apache/catalina/groups/demos/ groupcom/src/share/org/apache/catalina/groups/group/ groupcom/src/share/o...
Date Sat, 25 Feb 2006 15:26:00 GMT
Author: fhanik
Date: Sat Feb 25 07:25:56 2006
New Revision: 380936

URL: http://svn.apache.org/viewcvs?rev=380936&view=rev
Log:
Completed the refactor of the group stack, still need to clean up all the data senders.
Fixed the replication protocol.
Added in a store config for the ha cluster ( I duplicated this one )
Separated out ClusterMessage (this belongs to replication) from ChannelMessage.
The channel now works with a byte array for its interceptors.


Added:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ManagedChannel.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ClusterData.java
    tomcat/container/tc5.5.x/modules/ha/etc/cluster-server.xml
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterMessage.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterMessageBase.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/Constants.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/Constants.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/util/
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/util/IDynamicProperty.java
      - copied, changed from r380925, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/util/IDynamicProperty.java
    tomcat/container/tc5.5.x/modules/storeconfig-ha/
      - copied from r379923, tomcat/container/tc5.5.x/modules/storeconfig/
Removed:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/SocketObjectReader.java
Modified:
    tomcat/container/tc5.5.x/modules/build.xml
    tomcat/container/tc5.5.x/modules/groupcom/build.xml
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Channel.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelInterceptor.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelMessage.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Constants.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/demos/Draw.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelCoordinator.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelInterceptorBase.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/GroupChannel.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/interceptors/GzipInterceptor.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ListenCallback.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ObjectReader.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ReplicationStream.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/XByteBuffer.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/Constants.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/McastMember.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/AsyncSocketSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/Constants.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSenders.properties
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/FastAsyncSocketSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSenderFactory.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/PooledSocketSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationListener.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationTransmitter.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/util/FastQueue.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/CatalinaCluster.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterDeployer.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterListener.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterRuleSet.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/deploy/FileMessage.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/deploy/UndeployMessage.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/ClusterManagerBase.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/DeltaManager.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/SessionIDMessage.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/SessionMessageImpl.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/SimpleTcpReplicationManager.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SendMessageData.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
    tomcat/container/tc5.5.x/modules/storeconfig-ha/src/share/org/apache/catalina/storeconfig/CatalinaClusterSF.java
    tomcat/container/tc5.5.x/modules/storeconfig-ha/src/share/org/apache/catalina/storeconfig/StoreRegistry.java

Modified: tomcat/container/tc5.5.x/modules/build.xml
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/build.xml?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/build.xml (original)
+++ tomcat/container/tc5.5.x/modules/build.xml Sat Feb 25 07:25:56 2006
@@ -37,13 +37,18 @@
   </target>
   
   
-  <target name="config" >
+  <target name="config" unless="cluster-ha" >
     <ant dir="${basedir}/storeconfig" target="dist"/>
   </target>
 
+  <target name="config-ha" if="cluster-ha" >
+    <ant dir="${basedir}/storeconfig-ha" target="dist"/>
+  </target>
+
+
   <!-- ================= BUILD: Compile Server Components ================= -->
   <!-- Update the depends list for each subproject -->
-  <target name="build" depends="build-prepare,cluster,groupcom,ha,config"/>
+  <target name="build" depends="build-prepare,cluster,groupcom,ha,config-ha"/>
 
 
   <!-- ======================= BUILD: Clean Directory ===================== -->

Modified: tomcat/container/tc5.5.x/modules/groupcom/build.xml
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/build.xml?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/build.xml (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/build.xml Sat Feb 25 07:25:56 2006
@@ -84,18 +84,18 @@
     	>
         <classpath refid="groupcom.classpath" />
     </javac>
-    <copy file="${basedir}/src/share/org/apache/catalina/cluster/LocalStrings.properties"
-    	  tofile="${catalina.build}/classes/org/apache/catalina/cluster/LocalStrings.properties"/>
-    <copy file="${basedir}/src/share/org/apache/catalina/cluster/tcp/LocalStrings.properties"
-    	  tofile="${catalina.build}/classes/org/apache/catalina/cluster/tcp/LocalStrings.properties"/>
-    <copy file="${basedir}/src/share/org/apache/catalina/cluster/tcp/DataSenders.properties"
-    	  tofile="${catalina.build}/classes/org/apache/catalina/cluster/tcp/DataSenders.properties"/>
-    <copy file="${basedir}/src/share/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml"
-    	  tofile="${catalina.build}/classes/org/apache/catalina/cluster/tcp/mbeans-descriptors.xml"/>
-    <copy file="${basedir}/src/share/org/apache/catalina/cluster/mcast/LocalStrings.properties"
-    	  tofile="${catalina.build}/classes/org/apache/catalina/cluster/mcast/LocalStrings.properties"/>
-    <copy file="${basedir}/src/share/org/apache/catalina/cluster/mcast/mbeans-descriptors.xml"
-     	  tofile="${catalina.build}/classes/org/apache/catalina/cluster/mcast/mbeans-descriptors.xml"/>
+    <copy file="${basedir}/src/share/org/apache/catalina/groups/LocalStrings.properties"
+    	  tofile="${catalina.build}/classes/org/apache/catalina/groups/LocalStrings.properties"/>
+    <copy file="${basedir}/src/share/org/apache/catalina/groups/tcp/LocalStrings.properties"
+    	  tofile="${catalina.build}/classes/org/apache/catalina/groups/tcp/LocalStrings.properties"/>
+    <copy file="${basedir}/src/share/org/apache/catalina/groups/tcp/DataSenders.properties"
+    	  tofile="${catalina.build}/classes/org/apache/catalina/groups/tcp/DataSenders.properties"/>
+    <copy file="${basedir}/src/share/org/apache/catalina/groups/tcp/mbeans-descriptors.xml"
+    	  tofile="${catalina.build}/classes/org/apache/catalina/groups/tcp/mbeans-descriptors.xml"/>
+    <copy file="${basedir}/src/share/org/apache/catalina/groups/mcast/LocalStrings.properties"
+    	  tofile="${catalina.build}/classes/org/apache/catalina/groups/mcast/LocalStrings.properties"/>
+    <copy file="${basedir}/src/share/org/apache/catalina/groups/mcast/mbeans-descriptors.xml"
+     	  tofile="${catalina.build}/classes/org/apache/catalina/groups/mcast/mbeans-descriptors.xml"/>
    </target>
 
 
@@ -132,7 +132,7 @@
     
     <jar destfile="${groupcom.dist}/catalina-groups.jar"
          basedir="${catalina.build}/classes">
-       <include name="org/apache/catalina/cluster/**" />
+       <include name="org/apache/catalina/groups/**" />
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
     </jar>

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Channel.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Channel.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Channel.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Channel.java Sat Feb 25 07:25:56 2006
@@ -74,12 +74,8 @@
      * @param options int - sender options, see class documentation
      * @return ClusterMessage[] - the replies from the members, if any. 
      */
-    public ChannelMessage[] send(Member[] destination, Serializable msg, int options) throws ChannelException;
+    public void send(Member[] destination, Serializable msg, int options) throws ChannelException;
 
-    
-    public void setChannelSender(ChannelSender sender);
-    public void setChannelReceiver(ChannelReceiver receiver);
-    public void setMembershipService(MembershipService service);
     
     /**
      * Sends a heart beat through the interceptor stacks

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelInterceptor.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelInterceptor.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelInterceptor.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelInterceptor.java Sat Feb 25 07:25:56 2006
@@ -38,9 +38,9 @@
 
     public ChannelInterceptor getPrevious();
 
-    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload payload) throws IOException;
+    public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws IOException;
     
-    public void messageReceived(ClusterData data);
+    public void messageReceived(ChannelMessage data);
     
     public void heartbeat();
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelMessage.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelMessage.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelMessage.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelMessage.java Sat Feb 25 07:25:56 2006
@@ -60,7 +60,12 @@
      * @return String
      */
     public String getUniqueId();
-
     
+    public void setMessage(byte[] data);
+    
+    public byte[] getMessage();
+    
+    public int getOptions();
+    public void setOptions(int options);
 
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelSender.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelSender.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ChannelSender.java Sat Feb 25 07:25:56 2006
@@ -16,7 +16,6 @@
 
 package org.apache.catalina.groups;
 
-import org.apache.catalina.groups.io.ClusterData;
 
 /**
  * 
@@ -41,8 +40,6 @@
 
     public void sendMessage(ChannelMessage message) throws java.io.IOException;
     
-    public void sendMessageClusterDomain(ChannelMessage message) throws java.io.IOException;
-
     public boolean isWaitForAck();
     public void setWaitForAck(boolean isWaitForAck);
 

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Constants.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Constants.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Constants.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/Constants.java Sat Feb 25 07:25:56 2006
@@ -18,7 +18,7 @@
 package org.apache.catalina.groups;
 
 /**
- * Manifest constants for the <code>org.apache.catalina.cluster</code>
+ * Manifest constants for the <code>org.apache.catalina.groups</code>
  * package.
  *
  * @author Bip Thelin
@@ -26,5 +26,5 @@
  */
 
 public final class Constants {
-    public static final String Package = "org.apache.catalina.cluster";
+    public static final String Package = "org.apache.catalina.groups";
 }

Added: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ManagedChannel.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ManagedChannel.java?rev=380936&view=auto
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ManagedChannel.java (added)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/ManagedChannel.java Sat Feb 25 07:25:56 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 1999,2004-2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.groups;
+
+import java.io.Serializable;
+import java.util.Iterator;
+
+/**
+ * Channel interface
+ * A managed channel interface gives you access to the components of the channels
+ * such as senders, receivers, interceptors etc
+ * @author Filip Hanik
+ * @version $Revision: 304032 $, $Date: 2005-07-27 10:11:55 -0500 (Wed, 27 Jul 2005) $
+ */
+public interface ManagedChannel extends Channel {
+
+
+    public void setChannelSender(ChannelSender sender);
+    public void setChannelReceiver(ChannelReceiver receiver);
+    public void setMembershipService(MembershipService service);
+
+    public ChannelSender getChannelSender();
+    public ChannelReceiver getChannelReceiver();
+    public MembershipService getMembershipService();
+
+    public Iterator getInterceptors();
+}

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/demos/Draw.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/demos/Draw.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/demos/Draw.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/demos/Draw.java Sat Feb 25 07:25:56 2006
@@ -30,18 +30,20 @@
 import org.apache.catalina.groups.tcp.ReplicationTransmitter;
 import org.apache.commons.logging.impl.LogFactoryImpl;
 import org.apache.catalina.groups.Channel;
+import org.apache.catalina.groups.ManagedChannel;
+import org.apache.catalina.groups.ChannelListener;
 /**
  * Shared whiteboard, each new instance joins the same group. Each instance chooses a random color,
  * mouse moves are broadcast to all group members, which then apply them to their canvas<p>
  * @author Bela Ban, Oct 17 2001
  */
-public class Draw extends ChannelInterceptorBase implements ActionListener {
+public class Draw implements ActionListener, ChannelListener {
     static LogFactoryImpl dependencyhack = new LogFactoryImpl();
     static org.apache.commons.logging.impl.SimpleLog depHack2 = new org.apache.commons.logging.impl.SimpleLog("test");
     
     private final ByteArrayOutputStream out = new ByteArrayOutputStream();
     String groupname = "DrawGroupDemo";
-    private Channel channel = null;
+    private ManagedChannel channel = null;
     private int member_size = 1;
     final boolean first = true;
     final boolean cummulative = true;
@@ -87,7 +89,7 @@
         channel.setMembershipService(service);
         channel.start(channel.DEFAULT);
         
-        channel.addInterceptor(this);
+        channel.setChannelListener(this);
 
         if (debug) {
         }
@@ -254,7 +256,7 @@
             msg.setDrawCommand(comm);
             channel.send(null,msg,0);
             //draw on the local picture
-            messageReceived(msg);
+            messageReceived(msg,null);
         } catch (Exception ex) {
             System.err.println(ex);
         }
@@ -295,7 +297,11 @@
         setTitle();
     }
     
-    public void messageReceived(ChannelMessage msg) { 
+    public boolean accept(Serializable msg, Member sender) {
+        return true;
+    }
+    
+    public void messageReceived(Serializable msg, Member sender) {
         if ( msg instanceof DrawMessage ) {
             DrawMessage dmsg = (DrawMessage)msg;
             DrawCommand comm = dmsg.getDrawCommand();
@@ -336,6 +342,8 @@
         public void setOptions(int options) {this.options = options;}
         public DrawCommand getDrawCommand(){return comm;}
         public void setDrawCommand(DrawCommand command) {this.comm = command;}
+        public void setMessage(byte[] b){}
+        public byte[] getMessage() {return null;}
 
     }
     /* --------------------------- End of ChannelListener interface ---------------------- */
@@ -394,7 +402,7 @@
                 DrawMessage msg = parent.getEmptyMessage();
                 msg.setDrawCommand(comm);
                 channel.send(null,msg,0);
-                parent.messageReceived(msg);
+                parent.messageReceived(msg,null);
                 Thread.yield(); // gives the repainter some breath
             } catch (Exception ex) {
                 System.err.println(ex);

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelCoordinator.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelCoordinator.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelCoordinator.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelCoordinator.java Sat Feb 25 07:25:56 2006
@@ -60,12 +60,11 @@
      * @param options int - sender options, see class documentation
      * @return ClusterMessage[] - the replies from the members, if any.
      */
-    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload payload) throws IOException {
+    public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws IOException {
         if ( destination == null ) destination = membershipService.getMembers();
         for ( int i=0; i<destination.length; i++ ) {
             clusterSender.sendMessage(msg,destination[i]);
         }
-        return null;
     }
 
 
@@ -133,7 +132,7 @@
     }
     
     public void messageReceived(ChannelMessage msg) {
-        if ( msg instanceof ClusterData ) this.messageReceived((ClusterData)msg);
+        super.messageReceived(msg);
     }
 
 

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelInterceptorBase.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelInterceptorBase.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelInterceptorBase.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/ChannelInterceptorBase.java Sat Feb 25 07:25:56 2006
@@ -57,12 +57,12 @@
         return previous;
     }
 
-    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload payload) throws IOException {
-        return getNext().sendMessage(destination, msg,payload);
+    public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws IOException {
+        if ( getNext() != null ) getNext().sendMessage(destination, msg, payload);
     }
     
-    public void messageReceived(ClusterData msg) {
-        getPrevious().messageReceived(msg);
+    public void messageReceived(ChannelMessage msg) {
+        if ( getPrevious() != null ) getPrevious().messageReceived(msg);
     }
 
     public boolean accept(ChannelMessage msg) {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/GroupChannel.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/GroupChannel.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/GroupChannel.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/GroupChannel.java Sat Feb 25 07:25:56 2006
@@ -30,6 +30,9 @@
 import org.apache.catalina.groups.io.XByteBuffer;
 import java.io.Serializable;
 import org.apache.catalina.groups.ChannelListener;
+import org.apache.catalina.groups.ManagedChannel;
+import java.util.Iterator;
+import java.util.UUID;
 
 /**
  * The GroupChannel manages the replication channel. It coordinates
@@ -39,7 +42,7 @@
  * @author Filip Hanik
  * @version $Revision: 304032 $, $Date: 2005-07-27 10:11:55 -0500 (Wed, 27 Jul 2005) $
  */
-public class GroupChannel extends ChannelInterceptorBase implements Channel {
+public class GroupChannel extends ChannelInterceptorBase implements ManagedChannel {
     private ChannelCoordinator coordinator = new ChannelCoordinator();
     private ChannelInterceptor interceptors = null;
     private MembershipListener membershipListener;
@@ -56,9 +59,10 @@
      */
     public void addInterceptor(ChannelInterceptor interceptor) { 
         if ( interceptors == null ) {
-            this.interceptors = interceptor;
-            this.interceptors.setNext(coordinator);
-            this.interceptors.setPrevious(null);
+            interceptors = interceptor;
+            interceptors.setNext(coordinator);
+            interceptors.setPrevious(null);
+            coordinator.setPrevious(interceptors);
         } else {
             ChannelInterceptor last = interceptors;
             while ( last.getNext() != coordinator ) {
@@ -82,11 +86,17 @@
      * @param options int - sender options, see class documentation
      * @return ClusterMessage[] - the replies from the members, if any.
      */
-    public ChannelMessage[] send(Member[] destination, Serializable msg, int options) throws ChannelException {
-        if ( msg == null ) return null;
+    public void send(Member[] destination, Serializable msg, int options) throws ChannelException {
+        if ( msg == null ) return;
         try {
-            ClusterData data = XByteBuffer.serialize(msg, options,getMembershipService().getLocalMember());
-            return getFirstInterceptor().sendMessage(destination, data, null);
+            ClusterData data = new ClusterData();
+            data.setAddress(getLocalMember());
+            data.setUniqueId(UUID.randomUUID().toString());
+            data.setTimestamp(System.currentTimeMillis());
+            data.setOptions(options);
+            byte[] b = XByteBuffer.serialize(msg);
+            data.setMessage(b);
+            getFirstInterceptor().sendMessage(destination, data, null);
         }catch ( Exception x ) {
             throw new ChannelException(x);
         }
@@ -94,15 +104,11 @@
     
     public void messageReceived(ChannelMessage msg) {
         if ( msg == null ) return;
-        else if ( msg instanceof ClusterData ) {
-            try {
-                Serializable fwd = XByteBuffer.deserialize( (ClusterData) msg);
-                if ( channelListener != null ) channelListener.messageReceived(fwd,msg.getAddress());
-            }catch ( Exception x ) {
-                log.error("Unable to deserialize channel message.",x);
-            }
-        } else {
-            log.error("Recieved a message that is not a ClusterData instance. class="+msg.getClass().getName()+ " obj="+msg);
+        try {
+            Serializable fwd = XByteBuffer.deserialize(msg.getMessage());
+            if ( channelListener != null ) channelListener.messageReceived(fwd,msg.getAddress());
+        }catch ( Exception x ) {
+            log.error("Unable to deserialize channel message.",x);
         }
     }
     
@@ -151,18 +157,18 @@
         coordinator.stop(svc);
     }
 
-    public ChannelReceiver getClusterReceiver() {
+    public ChannelReceiver getChannelReceiver() {
         return coordinator.getClusterReceiver();
     }
 
-    public ChannelSender getClusterSender() {
+    public ChannelSender getChannelSender() {
         return coordinator.getClusterSender();
     }
 
     public MembershipService getMembershipService() {
         return coordinator.getMembershipService();
     }
-
+    
     public void setChannelReceiver(ChannelReceiver clusterReceiver) {
         coordinator.setClusterReceiver(clusterReceiver);
     }
@@ -187,6 +193,10 @@
     public MembershipListener getMembershipListener() {
         return membershipListener;
     }
+    
+    public Iterator getInterceptors() { 
+        return new InterceptorIterator(this.getNext(),this.coordinator);
+    }
 
     public ChannelListener getChannelListener() {
 
@@ -215,6 +225,32 @@
      */
     public Member getLocalMember() {
         return coordinator.getMembershipService().getLocalMember();
+    }
+    
+    public static class InterceptorIterator implements Iterator {
+        private ChannelInterceptor end;
+        private ChannelInterceptor start;
+        public InterceptorIterator(ChannelInterceptor start, ChannelInterceptor end) {
+            this.end = end;
+            this.start = start;
+        }
+        
+        public boolean hasNext() {
+            return start!=null && start != end;
+        }
+        
+        public Object next() {
+            Object result = null;
+            if ( hasNext() ) {
+                result = start;
+                start = start.getNext();
+            }
+            return result;
+        }
+        
+        public void remove() {
+            //empty operation
+        }
     }
 
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/interceptors/GzipInterceptor.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/interceptors/GzipInterceptor.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/interceptors/GzipInterceptor.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/group/interceptors/GzipInterceptor.java Sat Feb 25 07:25:56 2006
@@ -36,24 +36,23 @@
  */
 public class GzipInterceptor extends ChannelInterceptorBase {
    
-    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload payload) throws IOException {
+    public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws IOException {
         try {
             msg.setMessage(compress(msg.getMessage()));
-            return getNext().sendMessage(destination, msg, payload);
+            getNext().sendMessage(destination, msg, payload);
         } catch ( IOException x ) {
             log.error("Unable to compress byte contents");
             throw x;
         }
     }
 
-    public void messageReceived(ClusterData msg) {
+    public void messageReceived(ChannelMessage msg) {
         try {
             msg.setMessage(decompress(msg.getMessage()));
             getPrevious().messageReceived(msg);
         } catch ( IOException x ) {
-            log.error("Unable to decompress byte contents");
+            log.error("Unable to decompress byte contents",x);
         }
-
     }
     
     public byte[] compress(byte[] data) throws IOException {

Added: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ClusterData.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ClusterData.java?rev=380936&view=auto
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ClusterData.java (added)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ClusterData.java Sat Feb 25 07:25:56 2006
@@ -0,0 +1,163 @@
+/*
+ * Copyright 1999,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.groups.io;
+
+import org.apache.catalina.groups.ChannelMessage;
+import org.apache.catalina.groups.Member;
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import org.apache.catalina.groups.mcast.McastMember;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+
+/**
+ * The cluster data class is used to transport around the byte array from
+ * a ClusterMessage object. This is just a utility class to avoid having to 
+ * serialize and deserialize the ClusterMessage more than once. 
+ * @author Peter Rossbach
+ * @author Filip Hanik
+ * @version $Revision: 377484 $ $Date: 2006-02-13 15:00:05 -0600 (Mon, 13 Feb 2006) $
+ * @since 5.5.10
+ */
+public class ClusterData implements ChannelMessage {
+
+    private int options = 0 ;
+    private byte[] message ;
+    private long timestamp ;
+    private String uniqueId ;
+    private Member address;
+
+    public ClusterData() {}
+    
+    /**
+     * @param type message type (class)
+     * @param uniqueId unique message id
+     * @param message message data
+     * @param timestamp message creation date
+     */
+    public ClusterData(String uniqueId, byte[] message, long timestamp) {
+        this.uniqueId = uniqueId;
+        this.message = message;
+        this.timestamp = timestamp;
+    }
+    
+    /**
+     * @return Returns the message.
+     */
+    public byte[] getMessage() {
+        return message;
+    }
+    /**
+     * @param message The message to set.
+     */
+    public void setMessage(byte[] message) {
+        this.message = message;
+    }
+    /**
+     * @return Returns the timestamp.
+     */
+    public long getTimestamp() {
+        return timestamp;
+    }
+    /**
+     * @param timestamp The timestamp to set.
+     */
+    public void setTimestamp(long timestamp) {
+        this.timestamp = timestamp;
+    }
+    /**
+     * @return Returns the uniqueId.
+     */
+    public String getUniqueId() {
+        return uniqueId;
+    }
+    /**
+     * @param uniqueId The uniqueId to set.
+     */
+    public void setUniqueId(String uniqueId) {
+        this.uniqueId = uniqueId;
+    }
+    /**
+     * @return Returns the compress.
+     */
+    public int getOptions() {
+
+        return options;
+    }
+    /**
+     * @param compress The compress to set.
+     */
+    public void setOptions(int options) {
+
+        this.options = options;
+    }
+    
+    public Member getAddress() {
+
+        return address;
+    }
+
+
+    public void setAddress(Member address) {
+
+        this.address = address;
+    }
+    
+    
+    /**
+     * 
+    private int options = 0 ;
+    private long timestamp ;
+    private String uniqueId ;
+    private Member address;
+    private byte[] message ;
+
+     * @return byte[]
+     */
+    public byte[] getDataPackage() throws IOException {
+        ByteArrayOutputStream bout = new ByteArrayOutputStream(getMessage().length*2);
+        ObjectOutputStream out = new ObjectOutputStream(bout);
+        out.writeInt(options);
+        out.writeLong(timestamp);
+        out.writeUTF(uniqueId);
+        byte[] addr = ((McastMember)address).getData();
+        out.writeInt(addr.length);
+        out.write(addr);
+        out.writeInt(message.length);
+        out.write(message);
+        out.flush();
+        return bout.toByteArray();
+    }
+    
+    public static ClusterData getDataFromPackage(byte[] dataPackage) throws IOException {
+        ByteArrayInputStream bin = new ByteArrayInputStream(dataPackage);
+        ObjectInputStream in = new ObjectInputStream(bin);
+        ClusterData data = new ClusterData();
+        data.setOptions(in.readInt());
+        data.setTimestamp(in.readLong());
+        data.setUniqueId(in.readUTF());
+        byte[] addr = new byte[in.readInt()];
+        in.read(addr);
+        data.setAddress(McastMember.getMember(addr));
+        byte[] message = new byte[in.readInt()];
+        in.read(message);
+        data.setMessage(message);
+        return data;
+    }
+    
+}

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ListenCallback.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ListenCallback.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ListenCallback.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ListenCallback.java Sat Feb 25 07:25:56 2006
@@ -16,6 +16,8 @@
 
 package org.apache.catalina.groups.io;
 
+import org.apache.catalina.groups.ChannelMessage;
+
 
 
 /**
@@ -33,7 +35,7 @@
      * been received from one of the cluster nodes.
      * @param data - the message bytes received from the cluster/replication system
      */
-     public void messageDataReceived(ClusterData data);
+     public void messageDataReceived(ChannelMessage data);
      
     /** receiver must be send ack
       */

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ObjectReader.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ObjectReader.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ObjectReader.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ObjectReader.java Sat Feb 25 07:25:56 2006
@@ -18,6 +18,7 @@
 import java.nio.ByteBuffer;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
+import org.apache.catalina.groups.ChannelMessage;
 
 
 
@@ -89,7 +90,7 @@
      * Send buffer to cluster listener (callback).
      * Is message complete receiver send message to callback?
      *
-     * @see org.apache.catalina.cluster.tcp.ClusterReceiverBase#messageDataReceived(ClusterData)
+     * @see org.apache.catalina.groups.tcp.ClusterReceiverBase#messageDataReceived(ChannelMessage)
      * @see XByteBuffer#doesPackageExist()
      * @see XByteBuffer#extractPackage(boolean)
      *
@@ -100,7 +101,7 @@
         int pkgCnt = 0;
         boolean pkgExists = buffer.doesPackageExist();
         while ( pkgExists ) {
-            ClusterData data = buffer.extractPackage(true);
+            ChannelMessage data = buffer.extractPackage(true);
             getCallback().messageDataReceived(data);
             pkgCnt++;
             pkgExists = buffer.doesPackageExist();

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ReplicationStream.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ReplicationStream.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ReplicationStream.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/ReplicationStream.java Sat Feb 25 07:25:56 2006
@@ -71,7 +71,7 @@
     public Class resolveClass(ObjectStreamClass classDesc)
         throws ClassNotFoundException, IOException {
         String name = classDesc.getName();
-        boolean tryRepFirst = name.startsWith("org.apache.catalina.cluster");
+        boolean tryRepFirst = name.startsWith("org.apache.catalina.groups");
         try {
             try
             {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/XByteBuffer.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/XByteBuffer.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/XByteBuffer.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/io/XByteBuffer.java Sat Feb 25 07:25:56 2006
@@ -171,10 +171,10 @@
             if ( index != start || ((bufSize-start)<14) ) break;
             //next 4 bytes are compress flag not needed for count packages
             //then get the size 4 bytes
-            int size = toInt(buf, pos+4);
+            int size = toInt(buf, pos);
             //now the total buffer has to be long enough to hold
-            //START_DATA.length+8+size+END_DATA.length
-            pos = start + START_DATA.length + 8 + size;
+            //START_DATA.length+4+size+END_DATA.length
+            pos = start + START_DATA.length + 4 + size;
             if ( (pos + END_DATA.length) > bufSize) break;
             //and finally check the footer of the package END_DATA
             int newpos = firstIndexOf(buf, pos, END_DATA);
@@ -207,20 +207,40 @@
             throws java.io.IOException {
         int psize = countPackages();
         if (psize == 0) throw new java.lang.IllegalStateException("No package exists in XByteBuffer");
-        int options = toInt(buf, START_DATA.length);
-        int size = toInt(buf, START_DATA.length +4);
+        int size = toInt(buf, START_DATA.length);
         byte[] data = new byte[size];
-        System.arraycopy(buf, START_DATA.length + 8, data, 0, size);
-        ClusterData cdata = new ClusterData() ;
-        cdata.setMessage(data);
-        cdata.setOptions(options);
+        System.arraycopy(buf, START_DATA.length + 4, data, 0, size);
+        ClusterData cdata = ClusterData.getDataFromPackage(data);
         if (clearFromBuffer) {
-            int totalsize = START_DATA.length + 8 + size + END_DATA.length;
+            int totalsize = START_DATA.length + 4 + size + END_DATA.length;
             bufSize = bufSize - totalsize;
             System.arraycopy(buf, totalsize, buf, 0, bufSize);
         }
         return cdata;
     }
+    
+    /**
+     * Creates a complete data package
+     * @param indata - the message data to be contained within the package
+     * @param compressed - compression flag for the indata buffer
+     * @return - a full package (header,compress,size,data,footer)
+     * 
+     */
+    public static byte[] createDataPackage(ClusterData cdata) throws java.io.IOException {
+        byte[] data = cdata.getDataPackage();
+        int length = 
+            START_DATA.length + //header length
+            4 + //data length indicator
+            data.length + //actual data length
+            END_DATA.length; //footer length
+        byte[] result = new byte[length];
+        System.arraycopy(START_DATA, 0, result, 0, START_DATA.length);
+        System.arraycopy(toBytes(data.length), 0, result, START_DATA.length, 4);
+        System.arraycopy(data, 0, result, START_DATA.length + 4, data.length);
+        System.arraycopy(END_DATA, 0, result, START_DATA.length + 4 + data.length, END_DATA.length);
+        return result;
+    }
+        
 
     /**
      * Convert four bytes to an int
@@ -341,37 +361,12 @@
         return result;
     }
 
-    /**
-     * Creates a complete data package
-     * @param indata - the message data to be contained within the package
-     * @param compressed - compression flag for the indata buffer
-     * @return - a full package (header,compress,size,data,footer)
-     * 
-     */
-    public static byte[] createDataPackage(ClusterData cdata)
-            throws java.io.IOException {
-        byte[] data = cdata.getMessage();
-        byte[] options = XByteBuffer.toBytes(cdata.getOptions());
-        int length = 
-            START_DATA.length + //header length
-            4 + //options flag
-            4 + //data length indicator
-            data.length + //actual data length
-            END_DATA.length; //footer length
-        byte[] result = new byte[length];
-        System.arraycopy(START_DATA, 0, result, 0, START_DATA.length);
-        System.arraycopy(options, 0, result, START_DATA.length, 4);
-        System.arraycopy(toBytes(data.length), 0, result, START_DATA.length + 4, 4);
-        System.arraycopy(data, 0, result, START_DATA.length + 8, data.length);
-        System.arraycopy(END_DATA, 0, result, START_DATA.length + 8 + data.length, END_DATA.length);
-        return result;
-    }
     
-    public static Serializable deserialize(ClusterData data) 
+    public static Serializable deserialize(byte[] data) 
         throws IOException, ClassNotFoundException, ClassCastException {
         Object message = null;
         if (data != null) {
-            InputStream  instream = new ByteArrayInputStream(data.getMessage());
+            InputStream  instream = new ByteArrayInputStream(data);
             ReplicationStream stream = new ReplicationStream(instream,new ClassLoader[] {XByteBuffer.class.getClassLoader()});
             message = stream.readObject();
             instream.close();
@@ -389,25 +384,19 @@
      * Serializes a message into cluster data
      * @param msg ClusterMessage
      * @param compress boolean
-     * @return ClusterData
+     * @return 
      * @throws IOException
      */
-    public static ClusterData serialize(Serializable msg, int options, Member local) throws IOException {
-        ClusterData data = new ClusterData();
-        data.setAddress(local);
-        data.setType(msg.getClass().getName());
-        data.setUniqueId(UUID.randomUUID().toString());
-        data.setTimestamp(System.currentTimeMillis());
-        data.setOptions(options);
+    public static byte[] serialize(Serializable msg) throws IOException {
         ByteArrayOutputStream outs = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream(outs);
         out.writeObject(msg);
         // flush out the gzip stream to byte buffer
-        if(out != null) {
-            out.flush();
-            out.close();
-        }
-        data.setMessage(outs.toByteArray());
+//        if(out != null) {
+//            out.flush();
+//            out.close();
+//        }
+        byte[] data = outs.toByteArray();
         return data;
     }
 

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/Constants.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/Constants.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/Constants.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/Constants.java Sat Feb 25 07:25:56 2006
@@ -18,7 +18,7 @@
 package org.apache.catalina.groups.mcast;
 
 /**
- * Manifest constants for the <code>org.apache.catalina.cluster.mcast</code>
+ * Manifest constants for the <code>org.apache.catalina.groups.mcast</code>
  * package.
  *
  * @author Peter Rossbach
@@ -27,6 +27,6 @@
 
 public class Constants {
 
-    public static final String Package = "org.apache.catalina.cluster.mcast";
+    public static final String Package = "org.apache.catalina.groups.mcast";
 
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/McastMember.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/McastMember.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/McastMember.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/mcast/McastMember.java Sat Feb 25 07:25:56 2006
@@ -132,7 +132,7 @@
      * @return - the bytes for this member deserialized
      * @throws Exception
      */
-    protected byte[] getData() throws IOException {
+    public byte[] getData() throws IOException {
         //package looks like
         //alive - 8 bytes
         //port - 4 bytes
@@ -155,7 +155,7 @@
      * @param data - the bytes received
      * @return a member object.
      */
-    protected static McastMember getMember(byte[] data, McastMember member) {
+    public static McastMember getMember(byte[] data, McastMember member) {
        //package looks like
        //alive - 8 bytes
        //port - 4 bytes
@@ -182,7 +182,7 @@
        return member;
     }
 
-    protected static McastMember getMember(byte[] data) {
+    public static McastMember getMember(byte[] data) {
        return getMember(data,new McastMember());
     }
 
@@ -242,7 +242,7 @@
      * String representation of this object
      */
     public String toString()  {
-        return "org.apache.catalina.cluster.mcast.McastMember["+getName()+","+domain+","+host+","+port+", alive="+memberAliveTime+"]";
+        return "org.apache.catalina.groups.mcast.McastMember["+getName()+","+domain+","+host+","+port+", alive="+memberAliveTime+"]";
     }
 
     /**

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/AsyncSocketSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/AsyncSocketSender.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/AsyncSocketSender.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/AsyncSocketSender.java Sat Feb 25 07:25:56 2006
@@ -20,6 +20,7 @@
 
 import org.apache.catalina.groups.util.SmartQueue;
 import org.apache.catalina.groups.io.*;
+import org.apache.catalina.groups.ChannelMessage;
 
 /**
  * Send cluster messages from a Message queue with only one socket. Ack and keep
@@ -136,7 +137,7 @@
     /*
      * Connect to socket and start background thread to ppush queued messages
      * 
-     * @see org.apache.catalina.cluster.tcp.IDataSender#connect()
+     * @see org.apache.catalina.groups.tcp.IDataSender#connect()
      */
     public void connect() throws java.io.IOException {
         super.connect();
@@ -146,7 +147,7 @@
     /**
      * Disconnect socket ad stop queue thread
      * 
-     * @see org.apache.catalina.cluster.tcp.IDataSender#disconnect()
+     * @see org.apache.catalina.groups.tcp.IDataSender#disconnect()
      */
     public void disconnect() {
         stopThread();
@@ -156,9 +157,9 @@
     /**
      * Send message to queue for later sending
      * 
-     * @see org.apache.catalina.cluster.tcp.DataSender#pushMessage(ClusterData)
+     * @see org.apache.catalina.groups.tcp.DataSender#pushMessage(ChannelMessage)
      */
-    public void sendMessage(ClusterData data)
+    public void sendMessage(ChannelMessage data)
             throws java.io.IOException {
         SmartQueue.SmartEntry entry = new SmartQueue.SmartEntry(data.getUniqueId(), data);
         queue.add(entry);
@@ -266,7 +267,7 @@
                 if (entry != null) {
                     int messagesize = 0;
                     try {
-                        ClusterData data = (ClusterData) entry.getValue();
+                        ChannelMessage data = (ChannelMessage) entry.getValue();
                         messagesize = data.getMessage().length;
                         sender.pushMessage(data);
                     } catch (Exception x) {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/Constants.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/Constants.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/Constants.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/Constants.java Sat Feb 25 07:25:56 2006
@@ -18,7 +18,7 @@
 package org.apache.catalina.groups.tcp;
 
 /**
- * Manifest constants for the <code>org.apache.catalina.cluster.tcp</code>
+ * Manifest constants for the <code>org.apache.catalina.groups.tcp</code>
  * package.
  *
  * @author Peter Rossbach
@@ -27,6 +27,6 @@
 
 public class Constants {
 
-    public static final String Package = "org.apache.catalina.cluster.tcp";
+    public static final String Package = "org.apache.catalina.groups.tcp";
 
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSender.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSender.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSender.java Sat Feb 25 07:25:56 2006
@@ -23,9 +23,9 @@
 import java.net.SocketException;
 
 import org.apache.catalina.groups.ChannelMessage;
+import org.apache.catalina.groups.io.ClusterData;
 import org.apache.catalina.groups.io.XByteBuffer;
 import org.apache.catalina.util.StringManager;
-import org.apache.catalina.groups.io.*;
 
 /**
  * Send cluster messages with only one socket. Ack and keep Alive Handling is
@@ -561,7 +561,7 @@
 
     /**
      * Connect other cluster member receiver 
-     * @see org.apache.catalina.cluster.tcp.IDataSender#connect()
+     * @see org.apache.catalina.groups.tcp.IDataSender#connect()
      */
     public synchronized void connect() throws java.io.IOException {
         if(!isMessageTransferStarted) {
@@ -626,10 +626,10 @@
     /**
      * Send message
      * 
-     * @see org.apache.catalina.cluster.tcp.IDataSender#sendMessage(,
-     *      ClusterData)
+     * @see org.apache.catalina.groups.tcp.IDataSender#sendMessage(,
+     *      ChannelMessage)
      */
-    public synchronized void sendMessage(ClusterData data)
+    public synchronized void sendMessage(ChannelMessage data)
             throws java.io.IOException {
         pushMessage(data);
     }
@@ -784,14 +784,14 @@
      * 
      * @see #closeSocket()
      * @see #openSocket()
-     * @see #writeData(ClusterData)
+     * @see #writeData(ChannelMessage)
      * 
      * @param data
      *            data to send
      * @throws java.io.IOException
      * @since 5.5.10
      */
-    protected void pushMessage( ClusterData data)
+    protected void pushMessage( ChannelMessage data)
             throws java.io.IOException {
         long time = 0 ;
         if(doProcessingStats) {
@@ -810,26 +810,27 @@
              writeData(data);
              messageTransfered = true ;
         } catch (java.io.IOException x) {
-//            if(data.getResend() == ChannelMessage.RESEND_ALLOWED || 
-//                    (data.getResend() == ChannelMessage.RESEND_DEFAULT && isResend() )) {
-//                // second try with fresh connection
-//                dataResendCounter++;
-//                if (log.isTraceEnabled())
-//                    log.trace(sm.getString("IDataSender.send.again", address.getHostAddress(),
-//                            new Integer(port)),x);
-//                synchronized(this) {
-//                    closeSocket();
-//                    openSocket();
-//                }
-//                try {
-//                    writeData(data);
-//                    messageTransfered = true;
-//                } catch (IOException xx) {
-//                    exception = xx;
-//                    throw xx ;
-//                }
-//            } else 
+            if( true ) { //allow resend
+                // second try with fresh connection
+                dataResendCounter++;
+                if (log.isTraceEnabled())
+                    log.trace(sm.getString("IDataSender.send.again", address.getHostAddress(),
+                            new Integer(port)),x);
+                synchronized(this) {
+                    closeSocket();
+                    openSocket();
+                }
+                try {
+                    writeData(data);
+                    messageTransfered = true;
+                } catch (IOException xx) {
+                    xx.fillInStackTrace();
+                    exception = xx;
+                    throw xx ;
+                }
+            } else 
             {
+                
                 synchronized(this) {
                     closeSocket();
                 }
@@ -850,7 +851,7 @@
                 }
             } else {
                 dataFailureCounter++;
-                throw exception;
+                if ( exception != null ) throw exception;
             }
         }
     }
@@ -862,13 +863,13 @@
      * @throws IOException
      * @since 5.5.10
      */
-    protected void writeData(ClusterData data) throws IOException { 
+    protected void writeData(ChannelMessage data) throws IOException { 
         synchronized(this) {
             isMessageTransferStarted = true ;
         }
         try {
             OutputStream out = socket.getOutputStream();
-            out.write(XByteBuffer.createDataPackage(data));
+            out.write(XByteBuffer.createDataPackage((ClusterData)data));
             out.flush();
             if (isWaitForAck())
                 waitForAck(ackTimeout);

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSenders.properties
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSenders.properties?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSenders.properties (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/DataSenders.properties Sat Feb 25 07:25:56 2006
@@ -1,4 +1,4 @@
-fastasyncqueue=org.apache.catalina.cluster.tcp.FastAsyncSocketSender
-asynchronous=org.apache.catalina.cluster.tcp.AsyncSocketSender
-synchronous=org.apache.catalina.cluster.tcp.SocketSender
-pooled=org.apache.catalina.cluster.tcp.PooledSocketSender
+fastasyncqueue=org.apache.catalina.groups.tcp.FastAsyncSocketSender
+asynchronous=org.apache.catalina.groups.tcp.AsyncSocketSender
+synchronous=org.apache.catalina.groups.tcp.SocketSender
+pooled=org.apache.catalina.groups.tcp.PooledSocketSender

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/FastAsyncSocketSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/FastAsyncSocketSender.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/FastAsyncSocketSender.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/FastAsyncSocketSender.java Sat Feb 25 07:25:56 2006
@@ -18,7 +18,7 @@
 
 import java.net.InetAddress;
 
-import org.apache.catalina.groups.io.ClusterData;
+import org.apache.catalina.groups.ChannelMessage;
 import org.apache.catalina.groups.util.FastQueue;
 import org.apache.catalina.groups.util.IQueue;
 import org.apache.catalina.groups.util.LinkObject;
@@ -277,7 +277,7 @@
     /**
      * Connect to socket and start background thread to push queued messages
      * 
-     * @see org.apache.catalina.cluster.tcp.IDataSender#connect()
+     * @see org.apache.catalina.groups.tcp.IDataSender#connect()
      */
     public void connect() throws java.io.IOException {
         super.connect();
@@ -289,7 +289,7 @@
     /**
      * Disconnect socket ad stop queue thread
      * 
-     * @see org.apache.catalina.cluster.tcp.IDataSender#disconnect()
+     * @see org.apache.catalina.groups.tcp.IDataSender#disconnect()
      */
     public void disconnect() {
         stopThread();
@@ -304,9 +304,9 @@
     /**
      * Send message to queue for later sending.
      * 
-     * @see org.apache.catalina.cluster.tcp.DataSender#pushMessage(ClusterData)
+     * @see org.apache.catalina.groups.tcp.DataSender#pushMessage(ChannelMessage)
      */
-    public void sendMessage(ClusterData data)
+    public void sendMessage(ChannelMessage data)
             throws java.io.IOException {
         queue.add(data.getUniqueId(), data);
         synchronized (this) {
@@ -472,7 +472,7 @@
             do {
                 int messagesize = 0;
                 try {
-                    ClusterData data = (ClusterData) entry.data();
+                    ChannelMessage data = (ChannelMessage) entry.data();
                     messagesize = data.getMessage().length;
                     sender.pushMessage(data);
                 } catch (Exception x) {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSender.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSender.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSender.java Sat Feb 25 07:25:56 2006
@@ -16,9 +16,10 @@
 
 package org.apache.catalina.groups.tcp;
 
-import org.apache.catalina.groups.io.*;
+import org.apache.catalina.groups.ChannelMessage;
 
 /**
+ * @author Filip Hanik
  * @author Peter Rossbach
  * @version $Revision: 303993 $ $Date: 2005-07-16 16:05:54 -0500 (Sat, 16 Jul 2005) $
  * @since 5.5.7
@@ -32,7 +33,7 @@
     public int getPort();
     public void connect() throws java.io.IOException;
     public void disconnect();
-    public void sendMessage(ClusterData data) throws java.io.IOException;
+    public void sendMessage(ChannelMessage data) throws java.io.IOException;
     public boolean isConnected();
     public void setSuspect(boolean suspect);
     public boolean getSuspect();

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSenderFactory.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSenderFactory.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSenderFactory.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/IDataSenderFactory.java Sat Feb 25 07:25:56 2006
@@ -28,7 +28,7 @@
 
 /**
  * Create DataSender for different modes. DataSender factory load mode list from 
- * <code>org/apache/catalina/cluster/tcp/DataSenders.properties</code> resource.
+ * <code>org/apache/catalina/groups/tcp/DataSenders.properties</code> resource.
  * 
  * @author Peter Rossbach
  * @version $Revision: 304032 $ $Date: 2005-07-27 10:11:55 -0500 (Wed, 27 Jul 2005) $
@@ -39,7 +39,7 @@
     private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
             .getLog(IDataSenderFactory.class);
     
-    private static final String DATASENDERS_PROPERTIES = "org/apache/catalina/cluster/tcp/DataSenders.properties";
+    private static final String DATASENDERS_PROPERTIES = "org/apache/catalina/groups/tcp/DataSenders.properties";
     public static final String SYNC_MODE = "synchronous";
     public static final String ASYNC_MODE = "asynchronous";
     public static final String POOLED_SYNC_MODE = "pooled";

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/PooledSocketSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/PooledSocketSender.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/PooledSocketSender.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/PooledSocketSender.java Sat Feb 25 07:25:56 2006
@@ -20,6 +20,7 @@
 import java.net.InetAddress;
 import java.util.LinkedList;
 import org.apache.catalina.groups.io.*;
+import org.apache.catalina.groups.ChannelMessage;
 
 /**
  * Send cluster messages with a pool of sockets (25).
@@ -111,7 +112,7 @@
      * @param data Message data
      * @throws java.io.IOException
      */
-    public void sendMessage(ClusterData data) throws IOException {
+    public void sendMessage(ChannelMessage data) throws IOException {
         //get a socket sender from the pool
         if(!isConnected()) {
             synchronized(this) {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationListener.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationListener.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationListener.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationListener.java Sat Feb 25 07:25:56 2006
@@ -29,7 +29,7 @@
 import org.apache.catalina.groups.ChannelMessage;
 import org.apache.catalina.groups.ChannelReceiver;
 import org.apache.catalina.groups.MessageListener;
-import org.apache.catalina.groups.io.ClusterData;
+
 import org.apache.catalina.groups.io.ListenCallback;
 import org.apache.catalina.groups.io.ObjectReader;
 import org.apache.catalina.groups.io.XByteBuffer;
@@ -115,7 +115,7 @@
     /**
      * start cluster receiver
      * @throws Exception
-     * @see org.apache.catalina.cluster.ClusterReceiver#start()
+     * @see org.apache.catalina.groups.ClusterReceiver#start()
      */
     public void start() {
         try {
@@ -222,7 +222,7 @@
     /**
      * Close Selector.
      *
-     * @see org.apache.catalina.cluster.tcp.ClusterReceiverBase#stopListening()
+     * @see org.apache.catalina.groups.tcp.ClusterReceiverBase#stopListening()
      */
     protected void stopListening() {
         // Bugzilla 37529: http://issues.apache.org/bugzilla/show_bug.cgi?id=37529
@@ -241,23 +241,6 @@
         }
     }
 
-    /**
-     * deserialize the receieve cluster message
-     * @param data uncompress data
-     * @return The message
-     * @throws IOException
-     * @throws ClassNotFoundException
-     */
-    //protected ClusterMessage deserialize(byte[] data)
-    protected Serializable deserialize(ClusterData data) throws IOException, ClassNotFoundException {
-        boolean compress = false;
-        Serializable message = null;
-        if (data != null) {
-            message = XByteBuffer.deserialize(data);
-        }
-        return message;
-    }
-
     // ----------------------------------------------------------
 
     /**
@@ -311,20 +294,9 @@
         }
     }
 
-    public void messageDataReceived(ClusterData data) {
+    public void messageDataReceived(ChannelMessage data) {
         if ( this.listener != null ) {
-            try {
-                Serializable msg = deserialize(data);
-                listener.messageReceived((ChannelMessage)msg);
-            }catch ( java.io.IOException x ) {
-                if ( log.isErrorEnabled() ) {
-                    log.error("Unable to receive and deserialize cluster data. IOException.",x);
-                }
-            }catch ( java.lang.ClassNotFoundException cx ) {
-                if ( log.isErrorEnabled() ) {
-                    log.error("Unable to receive and deserialize cluster data. ClassNotFoundException.",cx);
-                }
-            }
+            listener.messageReceived(data);
         }
     }
 
@@ -423,7 +395,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.catalina.cluster.io.ListenCallback#sendAck()
+     * @see org.apache.catalina.groups.io.ListenCallback#sendAck()
      */
     public void sendAck() throws IOException {
         // do nothing

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationTransmitter.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationTransmitter.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationTransmitter.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/tcp/ReplicationTransmitter.java Sat Feb 25 07:25:56 2006
@@ -403,7 +403,7 @@
     
     /**
      * Send data to one member
-     * @see org.apache.catalina.cluster.ClusterSender#sendMessage(org.apache.catalina.cluster.ClusterMessage, org.apache.catalina.cluster.Member)
+     * @see org.apache.catalina.groups.ClusterSender#sendMessage(org.apache.catalina.groups.ClusterMessage, org.apache.catalina.groups.Member)
      */
     public void sendMessage(ChannelMessage message, Member member) throws IOException {       
         long time = 0 ;
@@ -411,12 +411,9 @@
             time = System.currentTimeMillis();
         }
         try {
-            ClusterData data = null;
-            if ( message instanceof ClusterData ) data = (ClusterData)message;
-            else data = serialize(message);
             String key = getKey(member);
             IDataSender sender = (IDataSender) map.get(key);
-            sendMessageData(data, sender);
+            sendMessageData(message, sender);
         } finally {
             if (doTransmitterProcessingStats) {
                 addProcessingStats(time);
@@ -424,23 +421,13 @@
         }
     }
     
-    /**
-     * Send to all senders at same cluster domain as message from address
-     * @param message Cluster message to send
-     * @since 5.5.10
-     */
-    public void sendMessageClusterDomain(ChannelMessage message) throws IOException {
-        sendMessage(message,true);
-    
-    }
-
     public void sendMessage(ChannelMessage message) throws IOException {
         sendMessage(message,false);
     }
 
     /**
      * send message to all senders (broadcast)
-     * @see org.apache.catalina.cluster.ClusterSender#sendMessage(org.apache.catalina.cluster.ClusterMessage)
+     * @see org.apache.catalina.groups.ClusterSender#sendMessage(org.apache.catalina.groups.ClusterMessage)
      */
     public void sendMessage(ChannelMessage message, boolean domainOnly) throws IOException {
         long time = 0;
@@ -448,15 +435,13 @@
             time = System.currentTimeMillis();
         }
         try {
-            ClusterData data = serialize(message);
             IDataSender[] senders = getSenders();
             for (int i = 0; i < senders.length; i++) {
-
                 IDataSender sender = senders[i];
                 //domain filter
                 String domain = message.getAddress().getDomain();
                 if ( domainOnly && !(domain.equals(sender.getDomain())) ) continue;
-                sendMessageData(data, sender);
+                sendMessageData(message, sender);
             }
         } finally {
             if (doTransmitterProcessingStats) {
@@ -470,7 +455,7 @@
     /**
      * start the sender and register transmitter mbean
      * 
-     * @see org.apache.catalina.cluster.ClusterSender#start()
+     * @see org.apache.catalina.groups.ClusterSender#start()
      */
     public void start() throws java.io.IOException {
     }
@@ -478,7 +463,7 @@
     /*
      * stop the sender and deregister mbeans (transmitter, senders)
      * 
-     * @see org.apache.catalina.cluster.ClusterSender#stop()
+     * @see org.apache.catalina.groups.ClusterSender#stop()
      */
     public synchronized void stop() {
         Iterator i = map.entrySet().iterator();
@@ -556,7 +541,7 @@
      * add new cluster member and create sender ( s. replicationMode) transfer
      * current properties to sender
      * 
-     * @see org.apache.catalina.cluster.ClusterSender#add(org.apache.catalina.cluster.Member)
+     * @see org.apache.catalina.groups.ClusterSender#add(org.apache.catalina.groups.Member)
      */
     public synchronized void add(Member member) {
         try {
@@ -575,7 +560,7 @@
     /**
      * remove sender from transmitter. ( deregister mbean and disconnect sender )
      * 
-     * @see org.apache.catalina.cluster.ClusterSender#remove(org.apache.catalina.cluster.Member)
+     * @see org.apache.catalina.groups.ClusterSender#remove(org.apache.catalina.groups.Member)
      */
     public synchronized void remove(Member member) {
         String key = getKey(member);
@@ -628,23 +613,6 @@
         return member.getHost() + ":" + member.getPort();
     }
 
-    
-    
-
-    /**
-     * serialize message and add timestamp from message
-     * handle compression
-     * @see GZIPOutputStream
-     * @param msg cluster message
-     * @return cluster message as byte array
-     * @throws IOException
-     * @since 5.5.10
-     */
-    protected ClusterData serialize(ChannelMessage msg) throws IOException {
-        return XByteBuffer.serialize(msg, 0, msg.getAddress());
-    }
- 
-
     /**
      * Send message to concrete sender. If autoConnect is true, check is
      * connection broken and the reconnect the complete sender.
@@ -659,7 +627,7 @@
      * @return true if the message got sent, false otherwise
      * @throws java.io.IOException If an error occurs
      */
-    protected boolean sendMessageData(ClusterData data,
+    protected boolean sendMessageData(ChannelMessage data,
                                       IDataSender sender) {
         if (sender == null)
             throw new RuntimeException("Sender not available. Make sure sender information is available to the ReplicationTransmitter.");

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/util/FastQueue.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/util/FastQueue.java?rev=380936&r1=380935&r2=380936&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/util/FastQueue.java (original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/groups/util/FastQueue.java Sat Feb 25 07:25:56 2006
@@ -194,7 +194,7 @@
     /**
      * get Max Queue length
      * 
-     * @see org.apache.catalina.cluster.util.IQueue#getMaxQueueLength()
+     * @see org.apache.catalina.groups.util.IQueue#getMaxQueueLength()
      */
     public int getMaxQueueLength() {
         return maxQueueLength;
@@ -413,7 +413,7 @@
 
     /**
      * Add new data to the queue
-     * @see org.apache.catalina.cluster.util.IQueue#add(java.lang.String, java.lang.Object)
+     * @see org.apache.catalina.groups.util.IQueue#add(java.lang.String, java.lang.Object)
      * FIXME extract some method
      */
     public boolean add(String key, Object data) {
@@ -529,7 +529,7 @@
 
     /**
      * remove the complete queued object list
-     * @see org.apache.catalina.cluster.util.IQueue#remove()
+     * @see org.apache.catalina.groups.util.IQueue#remove()
      * FIXME extract some method
      */
     public LinkObject remove() {



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


Mime
View raw message