Skip to content
Browse files

added up(MessageBatch)

  • Loading branch information...
1 parent b324da8 commit 052f4d4e7beaad066b851da2be620f12dd9d697c @belaban committed Feb 4, 2013
View
6 src/org/jgroups/protocols/STATS.java
@@ -7,6 +7,7 @@
import org.jgroups.Address;
import org.jgroups.View;
import org.jgroups.annotations.ManagedAttribute;
+import org.jgroups.util.MessageBatch;
import java.util.*;
@@ -75,6 +76,11 @@ else if(evt.getType() == Event.VIEW_CHANGE) {
}
+ public void up(MessageBatch batch) {
+ for(Message msg: batch)
+ updateStats(msg, UP);
+ up_prot.up(batch);
+ }
public Object down(Event evt) {
if(evt.getType() == Event.MSG) {
View
10 src/org/jgroups/protocols/TRACE.java
@@ -1,11 +1,10 @@
package org.jgroups.protocols;
import org.jgroups.Event;
-import org.jgroups.annotations.Unsupported;
import org.jgroups.stack.Protocol;
+import org.jgroups.util.MessageBatch;
-@Unsupported
public class TRACE extends Protocol {
public TRACE() {}
@@ -18,6 +17,13 @@ public Object up(Event evt) {
}
+ public void up(MessageBatch batch) {
+ System.out.println("---------------- TRACE (received) ----------------------");
+ System.out.println("message batch (" + batch.size() + " messages");
+ System.out.println("--------------------------------------------------------");
+ up_prot.up(batch);
+ }
+
public Object down(Event evt) {
System.out.println("------------------- TRACE (sent) -----------------------");
System.out.println(evt);
View
26 src/org/jgroups/protocols/TUNNEL.java
@@ -1,33 +1,27 @@
package org.jgroups.protocols;
-import java.io.DataInputStream;
-import java.net.DatagramSocket;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
import org.jgroups.Address;
import org.jgroups.Event;
-import org.jgroups.Global;
import org.jgroups.Message;
import org.jgroups.PhysicalAddress;
import org.jgroups.annotations.Experimental;
import org.jgroups.annotations.Property;
-import org.jgroups.stack.GossipData;
-import org.jgroups.stack.GossipRouter;
-import org.jgroups.stack.RouterStubManager;
-import org.jgroups.stack.IpAddress;
-import org.jgroups.stack.Protocol;
-import org.jgroups.stack.RouterStub;
+import org.jgroups.stack.*;
import org.jgroups.util.Buffer;
import org.jgroups.util.ExposedByteArrayOutputStream;
import org.jgroups.util.ExposedDataOutputStream;
import org.jgroups.util.Util;
+import java.io.DataInputStream;
+import java.net.DatagramSocket;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
/**
* Replacement for UDP. Instead of sending packets via UDP, a TCP connection is opened to a Router
* (using the RouterStub client-side stub), the IP address/port of which was given using channel

0 comments on commit 052f4d4

Please sign in to comment.
Something went wrong with that request. Please try again.