tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r380870 - in /tomcat/container/tc5.5.x/modules: groupcom/src/share/org/apache/catalina/cluster/ groupcom/src/share/org/apache/catalina/cluster/demos/ groupcom/src/share/org/apache/catalina/cluster/group/ groupcom/src/share/org/apache/catali...
Date Fri, 24 Feb 2006 23:56:05 GMT
Author: fhanik
Date: Fri Feb 24 15:56:03 2006
New Revision: 380870

URL: http://svn.apache.org/viewcvs?rev=380870&view=rev
Log:
Compiles correctly

Added:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/Channel.java
      - copied, changed from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterChannel.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelMessage.java
      - copied, changed from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterMessage.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelReceiver.java
      - copied, changed from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterReceiver.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelSender.java
      - copied, changed from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterSender.java
Removed:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterChannel.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterMessage.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterReceiver.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterSender.java
Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelInterceptor.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/MessageListener.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/demos/Draw.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelCoordinator.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelInterceptorBase.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/GroupChannel.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/interceptors/GzipInterceptor.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/io/XByteBuffer.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/DataSender.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.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/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/session/DeltaManager.java
    tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java

Copied: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/Channel.java
(from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterChannel.java)
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/Channel.java?p2=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/Channel.java&p1=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterChannel.java&r1=380865&r2=380870&rev=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterChannel.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/Channel.java
Fri Feb 24 15:56:03 2006
@@ -22,7 +22,7 @@
  * @author Filip Hanik
  * @version $Revision: 304032 $, $Date: 2005-07-27 10:11:55 -0500 (Wed, 27 Jul 2005) $
  */
-public interface ClusterChannel {
+public interface Channel {
     
     /**
      * Start and stop sequences can be controlled by these constants
@@ -72,11 +72,11 @@
      * @param options int - sender options, see class documentation
      * @return ClusterMessage[] - the replies from the members, if any. 
      */
-    public ClusterMessage[] send(Member[] destination, ClusterMessage msg, int options) throws
ChannelException;
+    public ChannelMessage[] send(Member[] destination, ChannelMessage msg, int options) throws
ChannelException;
 
     
-    public void setClusterSender(ClusterSender sender);
-    public void setClusterReceiver(ClusterReceiver receiver);
+    public void setClusterSender(ChannelSender sender);
+    public void setClusterReceiver(ChannelReceiver receiver);
     public void setMembershipService(MembershipService service);
     
     /**
@@ -86,5 +86,24 @@
     
     public void setMembershipListener(MembershipListener listener);
     public void setMessageListener(MessageListener listener);
+    
+    /**
+     * has members
+     */
+    public boolean hasMembers() ;
+
+    /**
+     * Get all current cluster members
+     * @return all members or empty array 
+     */
+    public Member[] getMembers() ;
+
+    /**
+     * Return the member that represents this node.
+     * 
+     * @return Member
+     */
+    public Member getLocalMember() ;
+
     
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelInterceptor.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelInterceptor.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelInterceptor.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelInterceptor.java
Fri Feb 24 15:56:03 2006
@@ -15,7 +15,7 @@
  */
 package org.apache.catalina.cluster;
 
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 import org.apache.catalina.cluster.Member;
 import org.apache.catalina.cluster.MembershipListener;
 import org.apache.catalina.cluster.MessageListener;
@@ -38,7 +38,7 @@
 
     public ChannelInterceptor getPrevious();
 
-    public ClusterMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException;
+    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException;
     
     public void messageReceived(ClusterData data);
     

Copied: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelMessage.java
(from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterMessage.java)
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelMessage.java?p2=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelMessage.java&p1=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterMessage.java&r1=380865&r2=380870&rev=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterMessage.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelMessage.java
Fri Feb 24 15:56:03 2006
@@ -19,10 +19,9 @@
 
 /**
  * @author Filip Hanik
- * @author Peter Rossbach
  * 
  */
-public interface ClusterMessage extends Serializable {
+public interface ChannelMessage extends Serializable {
     
     public final static int RESEND_FORBIDDEN = 0 ;
     public final static int RESEND_ALLOWED = 1 ;

Copied: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelReceiver.java
(from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterReceiver.java)
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelReceiver.java?p2=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelReceiver.java&p1=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterReceiver.java&r1=380865&r2=380870&rev=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterReceiver.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelReceiver.java
Fri Feb 24 15:56:03 2006
@@ -23,7 +23,7 @@
  * @author Peter Rossbach
  * @version $Revision: 379904 $, $Date: 2006-02-22 15:16:25 -0600 (Wed, 22 Feb 2006) $
  */
-public interface ClusterReceiver {
+public interface ChannelReceiver {
     /**
      * Start message listing
      * @throws java.io.IOException

Copied: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelSender.java
(from r380865, tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterSender.java)
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelSender.java?p2=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelSender.java&p1=tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterSender.java&r1=380865&r2=380870&rev=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ClusterSender.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/ChannelSender.java
Fri Feb 24 15:56:03 2006
@@ -24,7 +24,7 @@
  * @version $Revision: 303950 $, $Date: 2005-06-09 15:38:30 -0500 (Thu, 09 Jun 2005) $
  *
  */
-public interface ClusterSender
+public interface ChannelSender
 {
 
     public void add(Member member);
@@ -37,11 +37,11 @@
 
     public void heartbeat() ;
 
-    public void sendMessage(ClusterData message, Member member) throws java.io.IOException;
+    public void sendMessage(ChannelMessage message, Member member) throws java.io.IOException;
 
-    public void sendMessage(ClusterData message) throws java.io.IOException;
+    public void sendMessage(ChannelMessage message) throws java.io.IOException;
     
-    public void sendMessageClusterDomain(ClusterData 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/cluster/MessageListener.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/MessageListener.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/MessageListener.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/MessageListener.java
Fri Feb 24 15:56:03 2006
@@ -26,9 +26,9 @@
      * The response object may be ignored and is not required for the 
      * implementation to send back to the sender.
      */
-    public void messageReceived(ClusterData msg);
+    public void messageReceived(ChannelMessage msg);
     
-    public boolean accept(ClusterData msg);
+    public boolean accept(ChannelMessage msg);
     
     public boolean equals(Object listener);
     

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/demos/Draw.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/demos/Draw.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/demos/Draw.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/demos/Draw.java
Fri Feb 24 15:56:03 2006
@@ -21,7 +21,7 @@
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 import org.apache.catalina.cluster.Member;
 import org.apache.catalina.cluster.group.ChannelInterceptorBase;
 import org.apache.catalina.cluster.group.GroupChannel;
@@ -29,7 +29,7 @@
 import org.apache.catalina.cluster.tcp.ReplicationListener;
 import org.apache.catalina.cluster.tcp.ReplicationTransmitter;
 import org.apache.commons.logging.impl.LogFactoryImpl;
-import org.apache.catalina.cluster.ClusterChannel;
+import org.apache.catalina.cluster.Channel;
 /**
  * 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>
@@ -41,7 +41,7 @@
     
     private final ByteArrayOutputStream out = new ByteArrayOutputStream();
     String groupname = "DrawGroupDemo";
-    private ClusterChannel channel = null;
+    private Channel channel = null;
     private int member_size = 1;
     final boolean first = true;
     final boolean cummulative = true;
@@ -295,7 +295,7 @@
         setTitle();
     }
     
-    public void messageReceived(ClusterMessage msg) { 
+    public void messageReceived(ChannelMessage msg) { 
         if ( msg instanceof DrawMessage ) {
             DrawMessage dmsg = (DrawMessage)msg;
             DrawCommand comm = dmsg.getDrawCommand();
@@ -318,7 +318,7 @@
     }
     
     
-    public static class DrawMessage implements ClusterMessage {
+    public static class DrawMessage implements ChannelMessage {
         private Member address;
         private long timestamp;
         private String id;

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelCoordinator.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelCoordinator.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelCoordinator.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelCoordinator.java
Fri Feb 24 15:56:03 2006
@@ -17,11 +17,11 @@
 
 import org.apache.catalina.cluster.MembershipService;
 import org.apache.catalina.cluster.Member;
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 import org.apache.catalina.cluster.ChannelException;
-import org.apache.catalina.cluster.ClusterSender;
-import org.apache.catalina.cluster.ClusterReceiver;
-import org.apache.catalina.cluster.ClusterChannel;
+import org.apache.catalina.cluster.ChannelSender;
+import org.apache.catalina.cluster.ChannelReceiver;
+import org.apache.catalina.cluster.Channel;
 import java.io.IOException;
 import org.apache.catalina.cluster.InterceptorPayload;
 import org.apache.catalina.cluster.io.ClusterData;
@@ -36,16 +36,16 @@
  * @version $Revision: 304032 $, $Date: 2005-07-27 10:11:55 -0500 (Wed, 27 Jul 2005) $
  */
 public class ChannelCoordinator extends ChannelInterceptorBase implements MessageListener
{
-    private ClusterReceiver clusterReceiver;
-    private ClusterSender clusterSender;
+    private ChannelReceiver clusterReceiver;
+    private ChannelSender clusterSender;
     private MembershipService membershipService;
 
     public ChannelCoordinator() {
         
     }
     
-    public ChannelCoordinator(ClusterReceiver receiver,
-                              ClusterSender sender,
+    public ChannelCoordinator(ChannelReceiver receiver,
+                              ChannelSender sender,
                               MembershipService service) {
         this();
         this.setClusterReceiver(receiver);
@@ -60,7 +60,7 @@
      * @param options int - sender options, see class documentation
      * @return ClusterMessage[] - the replies from the members, if any.
      */
-    public ClusterMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException {
+    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException {
         if ( destination == null ) destination = membershipService.getMembers();
         for ( int i=0; i<destination.length; i++ ) {
             clusterSender.sendMessage(msg,destination[i]);
@@ -88,10 +88,10 @@
             clusterReceiver.setCompress(clusterSender.isCompress());
             //end FIXME
             
-            if ( (svc & ClusterChannel.MBR_RX_SEQ) == ClusterChannel.MBR_RX_SEQ) membershipService.start(MembershipService.MBR_RX);
-            if ( (svc & ClusterChannel.SND_RX_SEQ) == ClusterChannel.SND_RX_SEQ) clusterReceiver.start();
-            if ( (svc & ClusterChannel.SND_TX_SEQ) == ClusterChannel.SND_TX_SEQ) clusterSender.start();
-            if ( (svc & ClusterChannel.MBR_TX_SEQ) == ClusterChannel.MBR_TX_SEQ) membershipService.start(MembershipService.MBR_TX);
+            if ( (svc & Channel.MBR_RX_SEQ) == Channel.MBR_RX_SEQ) membershipService.start(MembershipService.MBR_RX);
+            if ( (svc & Channel.SND_RX_SEQ) == Channel.SND_RX_SEQ) clusterReceiver.start();
+            if ( (svc & Channel.SND_TX_SEQ) == Channel.SND_TX_SEQ) clusterSender.start();
+            if ( (svc & Channel.MBR_TX_SEQ) == Channel.MBR_TX_SEQ) membershipService.start(MembershipService.MBR_TX);
         }catch ( ChannelException cx ) {
             throw cx;
         }catch ( Exception x ) {
@@ -112,10 +112,10 @@
      */
     public void stop(int svc) throws ChannelException {
         try {
-            if ( (svc & ClusterChannel.MBR_RX_SEQ) == ClusterChannel.MBR_RX_SEQ) membershipService.stop();
-            if ( (svc & ClusterChannel.SND_RX_SEQ) == ClusterChannel.SND_RX_SEQ) clusterReceiver.stop();
-            if ( (svc & ClusterChannel.SND_TX_SEQ) == ClusterChannel.SND_TX_SEQ) clusterSender.stop();
-            if ( (svc & ClusterChannel.MBR_TX_SEQ) == ClusterChannel.MBR_RX_SEQ) membershipService.stop();
+            if ( (svc & Channel.MBR_RX_SEQ) == Channel.MBR_RX_SEQ) membershipService.stop();
+            if ( (svc & Channel.SND_RX_SEQ) == Channel.SND_RX_SEQ) clusterReceiver.stop();
+            if ( (svc & Channel.SND_TX_SEQ) == Channel.SND_TX_SEQ) clusterSender.stop();
+            if ( (svc & Channel.MBR_TX_SEQ) == Channel.MBR_RX_SEQ) membershipService.stop();
         }catch ( Exception x ) {
             throw new ChannelException(x);
         }
@@ -132,16 +132,16 @@
         super.memberDisappeared(member);
     }
     
-    public void messageReceived(ClusterMessage msg) {
+    public void messageReceived(ChannelMessage msg) {
         if ( msg instanceof ClusterData ) this.messageReceived((ClusterData)msg);
     }
 
 
-    public ClusterReceiver getClusterReceiver() {
+    public ChannelReceiver getClusterReceiver() {
         return clusterReceiver;
     }
 
-    public ClusterSender getClusterSender() {
+    public ChannelSender getClusterSender() {
         return clusterSender;
     }
 
@@ -149,7 +149,7 @@
         return membershipService;
     }
 
-    public void setClusterReceiver(ClusterReceiver clusterReceiver) {
+    public void setClusterReceiver(ChannelReceiver clusterReceiver) {
         if ( clusterReceiver != null ) {
             this.clusterReceiver = clusterReceiver;
             this.clusterReceiver.setMessageListener(this);
@@ -159,7 +159,7 @@
         }
     }
 
-    public void setClusterSender(ClusterSender clusterSender) {
+    public void setClusterSender(ChannelSender clusterSender) {
         this.clusterSender = clusterSender;
     }
 

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelInterceptorBase.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelInterceptorBase.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelInterceptorBase.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/ChannelInterceptorBase.java
Fri Feb 24 15:56:03 2006
@@ -15,7 +15,7 @@
  */
 package org.apache.catalina.cluster.group;
 
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 import org.apache.catalina.cluster.Member;
 import org.apache.catalina.cluster.MembershipListener;
 import org.apache.catalina.cluster.MessageListener;
@@ -57,7 +57,7 @@
         return previous;
     }
 
-    public ClusterMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException {
+    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException {
         return getNext().sendMessage(destination, msg,payload);
     }
     
@@ -65,7 +65,7 @@
         getPrevious().messageReceived(msg);
     }
 
-    public boolean accept(ClusterMessage msg) {
+    public boolean accept(ChannelMessage msg) {
         return true;
     }
 

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/GroupChannel.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/GroupChannel.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/GroupChannel.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/GroupChannel.java
Fri Feb 24 15:56:03 2006
@@ -18,10 +18,10 @@
 
 import org.apache.catalina.cluster.ChannelException;
 import org.apache.catalina.cluster.ChannelInterceptor;
-import org.apache.catalina.cluster.ClusterChannel;
-import org.apache.catalina.cluster.ClusterMessage;
-import org.apache.catalina.cluster.ClusterReceiver;
-import org.apache.catalina.cluster.ClusterSender;
+import org.apache.catalina.cluster.Channel;
+import org.apache.catalina.cluster.ChannelMessage;
+import org.apache.catalina.cluster.ChannelReceiver;
+import org.apache.catalina.cluster.ChannelSender;
 import org.apache.catalina.cluster.Member;
 import org.apache.catalina.cluster.MembershipListener;
 import org.apache.catalina.cluster.MembershipService;
@@ -37,7 +37,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 ClusterChannel {
+public class GroupChannel extends ChannelInterceptorBase implements Channel {
     private ChannelCoordinator coordinator = new ChannelCoordinator();
     private ChannelInterceptor interceptors = null;
     private MembershipListener membershipListener;
@@ -80,7 +80,7 @@
      * @param options int - sender options, see class documentation
      * @return ClusterMessage[] - the replies from the members, if any.
      */
-    public ClusterMessage[] send(Member[] destination, ClusterMessage msg, int options) throws
ChannelException {
+    public ChannelMessage[] send(Member[] destination, ChannelMessage msg, int options) throws
ChannelException {
         if ( msg == null ) return null;
         msg.setAddress(getMembershipService().getLocalMember());
         msg.setTimestamp(System.currentTimeMillis());
@@ -92,11 +92,11 @@
         }
     }
     
-    public void messageReceived(ClusterMessage msg) {
+    public void messageReceived(ChannelMessage msg) {
         if ( msg == null ) return;
         else if ( msg instanceof ClusterData ) {
             try {
-                ClusterMessage fwd = XByteBuffer.deserialize( (ClusterData) msg, false);
+                ChannelMessage fwd = XByteBuffer.deserialize( (ClusterData) msg, false);
                 if ( messageListener != null ) messageListener.messageReceived(fwd);
             }catch ( Exception x ) {
                 log.error("Unable to deserialize channel message.",x);
@@ -151,11 +151,11 @@
         coordinator.stop(svc);
     }
 
-    public ClusterReceiver getClusterReceiver() {
+    public ChannelReceiver getClusterReceiver() {
         return coordinator.getClusterReceiver();
     }
 
-    public ClusterSender getClusterSender() {
+    public ChannelSender getClusterSender() {
         return coordinator.getClusterSender();
     }
 
@@ -163,11 +163,11 @@
         return coordinator.getMembershipService();
     }
 
-    public void setClusterReceiver(ClusterReceiver clusterReceiver) {
+    public void setClusterReceiver(ChannelReceiver clusterReceiver) {
         coordinator.setClusterReceiver(clusterReceiver);
     }
 
-    public void setClusterSender(ClusterSender clusterSender) {
+    public void setClusterSender(ChannelSender clusterSender) {
         coordinator.setClusterSender(clusterSender);
     }
 
@@ -189,6 +189,30 @@
 
     public MessageListener getMessageListener() {
         return messageListener;
+    }
+
+    /**
+     * has members
+     */
+    public boolean hasMembers() {
+        return coordinator.getMembershipService().hasMembers();
+    }
+
+    /**
+     * Get all current cluster members
+     * @return all members or empty array
+     */
+    public Member[] getMembers() {
+        return coordinator.getMembershipService().getMembers();
+    }
+
+    /**
+     * Return the member that represents this node.
+     *
+     * @return Member
+     */
+    public Member getLocalMember() {
+        return coordinator.getMembershipService().getLocalMember();
     }
 
 }

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/interceptors/GzipInterceptor.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/interceptors/GzipInterceptor.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/interceptors/GzipInterceptor.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/group/interceptors/GzipInterceptor.java
Fri Feb 24 15:56:03 2006
@@ -19,7 +19,7 @@
 import org.apache.catalina.cluster.InterceptorPayload;
 import org.apache.catalina.cluster.Member;
 import java.io.IOException;
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 import org.apache.catalina.cluster.io.ClusterData;
 import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
@@ -36,7 +36,7 @@
  */
 public class GzipInterceptor extends ChannelInterceptorBase {
    
-    public ClusterMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException {
+    public ChannelMessage[] sendMessage(Member[] destination, ClusterData msg, InterceptorPayload
payload) throws IOException {
         try {
             msg.setMessage(compress(msg.getMessage()));
             return getNext().sendMessage(destination, msg, payload);

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/io/XByteBuffer.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/io/XByteBuffer.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/io/XByteBuffer.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/io/XByteBuffer.java
Fri Feb 24 15:56:03 2006
@@ -16,7 +16,7 @@
 
 package org.apache.catalina.cluster.io;
 
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 
 import java.io.ObjectOutputStream;
 import java.util.zip.GZIPOutputStream;
@@ -364,7 +364,7 @@
         return result;
     }
     
-    public static ClusterMessage deserialize(ClusterData data, boolean compress) 
+    public static ChannelMessage deserialize(ClusterData data, boolean compress) 
         throws IOException, ClassNotFoundException, ClassCastException {
         Object message = null;
         if (data != null) {
@@ -380,8 +380,8 @@
         }
         if ( message == null ) {
             return null;
-        } else if (message instanceof ClusterMessage)
-            return (ClusterMessage) message;
+        } else if (message instanceof ChannelMessage)
+            return (ChannelMessage) message;
         else {
             throw new ClassCastException("Message has the wrong class. It should implement
ClusterMessage, instead it is:"+message.getClass().getName());
         }
@@ -394,7 +394,7 @@
      * @return ClusterData
      * @throws IOException
      */
-    public static ClusterData serialize(ClusterMessage msg, int options, boolean compress)
throws IOException {
+    public static ClusterData serialize(ChannelMessage msg, int options, boolean compress)
throws IOException {
         msg.setTimestamp(System.currentTimeMillis());
         ByteArrayOutputStream outs = new ByteArrayOutputStream();
         ObjectOutputStream out;

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/DataSender.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/DataSender.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/DataSender.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/DataSender.java
Fri Feb 24 15:56:03 2006
@@ -22,7 +22,7 @@
 import java.net.Socket;
 import java.net.SocketException;
 
-import org.apache.catalina.cluster.ClusterMessage;
+import org.apache.catalina.cluster.ChannelMessage;
 import org.apache.catalina.cluster.io.XByteBuffer;
 import org.apache.catalina.util.StringManager;
 import org.apache.catalina.cluster.io.*;
@@ -810,8 +810,8 @@
              writeData(data);
              messageTransfered = true ;
         } catch (java.io.IOException x) {
-            if(data.getResend() == ClusterMessage.RESEND_ALLOWED || 
-                    (data.getResend() == ClusterMessage.RESEND_DEFAULT && isResend()
)) {
+            if(data.getResend() == ChannelMessage.RESEND_ALLOWED || 
+                    (data.getResend() == ChannelMessage.RESEND_DEFAULT && isResend()
)) {
                 // second try with fresh connection
                 dataResendCounter++;
                 if (log.isTraceEnabled())

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationListener.java
Fri Feb 24 15:56:03 2006
@@ -26,8 +26,8 @@
 import java.nio.channels.SocketChannel;
 import java.util.Iterator;
 
-import org.apache.catalina.cluster.ClusterMessage;
-import org.apache.catalina.cluster.ClusterReceiver;
+import org.apache.catalina.cluster.ChannelMessage;
+import org.apache.catalina.cluster.ChannelReceiver;
 import org.apache.catalina.cluster.MessageListener;
 import org.apache.catalina.cluster.io.ClusterData;
 import org.apache.catalina.cluster.io.ListenCallback;
@@ -41,7 +41,7 @@
  * @version $Revision: 379904 $ $Date: 2006-02-22 15:16:25 -0600 (Wed, 22 Feb 2006) $
  */
 public class ReplicationListener
-    implements Runnable, ClusterReceiver, ListenCallback {
+    implements Runnable, ChannelReceiver, ListenCallback {
     protected static org.apache.commons.logging.Log log =
         org.apache.commons.logging.LogFactory.getLog(ReplicationListener.class);
 
@@ -248,9 +248,9 @@
      * @throws ClassNotFoundException
      */
     //protected ClusterMessage deserialize(byte[] data)
-    protected ClusterMessage deserialize(ClusterData data) throws IOException, ClassNotFoundException
{
+    protected ChannelMessage deserialize(ClusterData data) throws IOException, ClassNotFoundException
{
         boolean compress = false;
-        ClusterMessage message = null;
+        ChannelMessage message = null;
         if (data != null) {
             message = XByteBuffer.deserialize(data, compress);
         }
@@ -313,7 +313,7 @@
     public void messageDataReceived(ClusterData data) {
         if ( this.listener != null ) {
             try {
-                ClusterMessage msg = deserialize(data);
+                ChannelMessage msg = deserialize(data);
                 listener.messageReceived(msg);
             }catch ( java.io.IOException x ) {
                 if ( log.isErrorEnabled() ) {

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.java
Fri Feb 24 15:56:03 2006
@@ -28,8 +28,8 @@
 import javax.management.ObjectName;
 
 import org.apache.catalina.Container;
-import org.apache.catalina.cluster.ClusterMessage;
-import org.apache.catalina.cluster.ClusterSender;
+import org.apache.catalina.cluster.ChannelMessage;
+import org.apache.catalina.cluster.ChannelSender;
 import org.apache.catalina.cluster.Member;
 import org.apache.catalina.cluster.util.IDynamicProperty;
 import org.apache.catalina.core.StandardHost;
@@ -50,7 +50,7 @@
  * @author Filip Hanik
  * @version $Revision: 379956 $ $Date: 2006-02-22 16:57:35 -0600 (Wed, 22 Feb 2006) $
  */
-public class ReplicationTransmitter implements ClusterSender,IDynamicProperty {
+public class ReplicationTransmitter implements ChannelSender,IDynamicProperty {
     private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
             .getLog(ReplicationTransmitter.class);
 
@@ -405,7 +405,7 @@
      * Send data to one member
      * @see org.apache.catalina.cluster.ClusterSender#sendMessage(org.apache.catalina.cluster.ClusterMessage,
org.apache.catalina.cluster.Member)
      */
-    public void sendMessage(ClusterMessage message, Member member) throws IOException { 
     
+    public void sendMessage(ChannelMessage message, Member member) throws IOException { 
     
         long time = 0 ;
         if(doTransmitterProcessingStats) {
             time = System.currentTimeMillis();
@@ -429,12 +429,12 @@
      * @param message Cluster message to send
      * @since 5.5.10
      */
-    public void sendMessageClusterDomain(ClusterMessage message) throws IOException {
+    public void sendMessageClusterDomain(ChannelMessage message) throws IOException {
         sendMessage(message,true);
     
     }
 
-    public void sendMessage(ClusterMessage message) throws IOException {
+    public void sendMessage(ChannelMessage message) throws IOException {
         sendMessage(message,false);
     }
 
@@ -442,7 +442,7 @@
      * send message to all senders (broadcast)
      * @see org.apache.catalina.cluster.ClusterSender#sendMessage(org.apache.catalina.cluster.ClusterMessage)
      */
-    public void sendMessage(ClusterMessage message, boolean domainOnly) throws IOException
{
+    public void sendMessage(ChannelMessage message, boolean domainOnly) throws IOException
{
         long time = 0;
         if (doTransmitterProcessingStats) {
             time = System.currentTimeMillis();
@@ -640,7 +640,7 @@
      * @throws IOException
      * @since 5.5.10
      */
-    protected ClusterData serialize(ClusterMessage msg) throws IOException {
+    protected ClusterData serialize(ChannelMessage msg) throws IOException {
         return XByteBuffer.serialize(msg, 0, false);
     }
  

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/CatalinaCluster.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/CatalinaCluster.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/CatalinaCluster.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/CatalinaCluster.java
Fri Feb 24 15:56:03 2006
@@ -103,18 +103,6 @@
      */
     public Member getLocalMember();
     
-    public void setClusterSender(ClusterSender sender);
-    
-    public ClusterSender getClusterSender();
-    
-    public void setClusterReceiver(ClusterReceiver receiver);
-    
-    public ClusterReceiver getClusterReceiver();
-    
-    public MembershipService getMembershipService();
-
-    public void setMembershipService(MembershipService service);
-    
     public void addValve(Valve valve);
     
     public void addClusterListener(ClusterListener listener);

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterListener.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterListener.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterListener.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterListener.java
Fri Feb 24 15:56:03 2006
@@ -74,6 +74,14 @@
     }
 
     //--Logic---------------------------------------------------
+    public final void messageReceived(ChannelMessage msg) {
+        if ( msg instanceof ClusterMessage ) messageReceived((ClusterMessage)msg);
+    }
+
+    public final boolean accept(ChannelMessage msg) {
+        if ( msg instanceof ClusterMessage ) return true;
+        return false;
+    }
 
 
     /**

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterRuleSet.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterRuleSet.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterRuleSet.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/ClusterRuleSet.java
Fri Feb 24 15:56:03 2006
@@ -99,7 +99,7 @@
         digester.addSetProperties(prefix + "Sender");
         digester.addSetNext(prefix + "Sender",
                             "setClusterSender",
-                            "org.apache.catalina.cluster.ClusterSender");
+                            "org.apache.catalina.cluster.ChannelSender");
 
         digester.addObjectCreate(prefix + "Receiver",
                                  null, // MUST be specified in the element

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/DeltaManager.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/DeltaManager.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/DeltaManager.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/session/DeltaManager.java
Fri Feb 24 15:56:03 2006
@@ -1034,7 +1034,7 @@
     protected Member findSessionMasterMember() {
         Member mbr = null;
         Member mbrs[] = cluster.getMembers();
-        String localMemberDomain = cluster.getMembershipService().getLocalMember().getDomain();
+        String localMemberDomain = cluster.getLocalMember().getDomain();
         if(isSendClusterDomainOnly()) {
             for (int i = 0; mbr == null && i < mbrs.length; i++) {
                 Member member = mbrs[i];
@@ -1388,7 +1388,7 @@
      * Test that sender and local domain is the same
      */
     protected boolean checkSenderDomain(SessionMessage msg,Member sender) {
-        String localMemberDomain = cluster.getMembershipService().getLocalMember().getDomain();
+        String localMemberDomain = cluster.getLocalMember().getDomain();
         boolean sameDomain= localMemberDomain.equals(sender.getDomain());
         if (!sameDomain && log.isWarnEnabled()) {
                 log.warn(sm.getString("deltaManager.receiveMessage.fromWrongDomain",

Modified: tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java?rev=380870&r1=380869&r2=380870&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
(original)
+++ tomcat/container/tc5.5.x/modules/ha/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
Fri Feb 24 15:56:03 2006
@@ -36,16 +36,13 @@
 import org.apache.catalina.Manager;
 import org.apache.catalina.Valve;
 import org.apache.catalina.cluster.CatalinaCluster;
-import org.apache.catalina.cluster.ClusterChannel;
 import org.apache.catalina.cluster.ClusterListener;
 import org.apache.catalina.cluster.ClusterManager;
 import org.apache.catalina.cluster.ClusterMessage;
-import org.apache.catalina.cluster.ClusterReceiver;
-import org.apache.catalina.cluster.ClusterSender;
+import org.apache.catalina.cluster.ChannelSender;
 import org.apache.catalina.cluster.ClusterValve;
 import org.apache.catalina.cluster.Member;
 import org.apache.catalina.cluster.MembershipService;
-import org.apache.catalina.cluster.group.ChannelInterceptorBase;
 import org.apache.catalina.cluster.group.GroupChannel;
 import org.apache.catalina.cluster.session.DeltaManager;
 import org.apache.catalina.cluster.util.IDynamicProperty;
@@ -54,12 +51,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tomcat.util.IntrospectionUtils;
-import org.apache.catalina.cluster.io.ReplicationStream;
-import java.io.ByteArrayInputStream;
-import org.apache.catalina.Loader;
 import org.apache.catalina.cluster.group.interceptors.GzipInterceptor;
 import org.apache.catalina.cluster.MembershipListener;
 import org.apache.catalina.cluster.MessageListener;
+import org.apache.catalina.cluster.Channel;
+import org.apache.catalina.cluster.ChannelMessage;
 
 /**
  * A <b>Cluster </b> implementation using simple multicast. Responsible for
@@ -110,7 +106,7 @@
     /**
      * Group channel.
      */
-    protected ClusterChannel channel = new GroupChannel();
+    protected Channel channel = new GroupChannel();
 
 
     /**
@@ -263,30 +259,6 @@
         this.managerClassName = managerClassName;
     }
 
-    public void setClusterSender(ClusterSender clusterSender) {
-        this.channel.setClusterSender(clusterSender);
-    }
-    
-    public ClusterSender getClusterSender() {
-        return null;
-    }
-
-    public void setClusterReceiver(ClusterReceiver clusterReceiver) {
-        this.channel.setClusterReceiver(clusterReceiver);
-    }
-
-    public ClusterReceiver getClusterReceiver() {
-        return null;
-    }
-
-    public void setMembershipService(MembershipService membershipService) {
-        this.channel.setMembershipService(membershipService);
-    }
-    
-    public MembershipService getMembershipService() {
-        return ((GroupChannel)channel).getMembershipService();
-    }
-
     /**
      * Add cluster valve 
      * Cluster Valves are only add to container when cluster is started!
@@ -362,7 +334,7 @@
      * has members
      */
     public boolean hasMembers() {
-        return getMembershipService().hasMembers();
+        return channel.hasMembers();
     }
     
     /**
@@ -370,7 +342,7 @@
      * @return all members or empty array 
      */
     public Member[] getMembers() {
-        return getMembershipService().getMembers();
+        return channel.getMembers();
     }
 
     /**
@@ -379,7 +351,7 @@
      * @return Member
      */
     public Member getLocalMember() {
-        return getMembershipService().getLocalMember();
+        return channel.getLocalMember();
     }
 
     // ------------------------------------------------------------- dynamic
@@ -755,7 +727,7 @@
         this.managers.clear();
         try {
             if ( clusterDeployer != null ) clusterDeployer.setCluster(null);
-            channel.stop(ClusterChannel.DEFAULT);
+            channel.stop(Channel.DEFAULT);
             this.unregisterClusterValve();
         } catch (Exception x) {
             log.error("Unable to stop cluster valve.", x);
@@ -779,24 +751,6 @@
     }
 
     /**
-     * send a cluster message to one member (very usefull JMX method for remote scripting)
-     * 
-     * @param msg message to transfer
-     * @param dest Receiver member with name
-     * @see org.apache.catalina.cluster.CatalinaCluster#send(org.apache.catalina.cluster.ClusterMessage,
-     *      org.apache.catalina.cluster.Member)
-     * @see McastService#findMemberByName(String)
-     */
-    public void sendToMember(ClusterMessage msg, String dest) {
-        Member member = getMembershipService().findMemberByName(dest);
-        if (member != null) {
-            send(msg, member);
-        } else {
-            log.error("sendToMember: member " + dest + " not found!");
-        }        
-    }
-    
-    /**
      * send message to all cluster members same cluster domain
      * 
      * @see org.apache.catalina.cluster.CatalinaCluster#send(org.apache.catalina.cluster.ClusterMessage)
@@ -816,9 +770,9 @@
      */
     public void send(ClusterMessage msg, Member dest) {
         try {
-            msg.setAddress(getMembershipService().getLocalMember());
+            msg.setAddress(getLocalMember());
             if (dest != null) {
-                if (!getMembershipService().getLocalMember().equals(dest)) {
+                if (!getLocalMember().equals(dest)) {
                     channel.send(new Member[] {dest}, msg, 0);
                 } else
                     log.error("Unable to send message to local member " + msg);
@@ -876,10 +830,15 @@
      * @param message
      *            receveived Message
      */
-    public boolean accept(ClusterMessage message) {
-        return true;
+    public boolean accept(ChannelMessage msg) {
+        return (msg instanceof ClusterMessage);
     }
     
+    
+    public void messageReceived(ChannelMessage message) {
+        messageReceived((ClusterMessage)message);
+    }
+
     public void messageReceived(ClusterMessage message) {
 
         long start = 0;



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


Mime
View raw message