org.jgroups.protocols.TRACE Maven / Gradle / Ivy
Go to download
This artifact provides a single jar that contains all classes required to use remote EJB and JMS, including
all dependencies. It is intended for use by those not using maven, maven users should just import the EJB and
JMS BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up
with different versions on classes on the class path).
package org.jgroups.protocols;
import org.jgroups.Event;
import org.jgroups.Message;
import org.jgroups.stack.Protocol;
import org.jgroups.util.MessageBatch;
public class TRACE extends Protocol {
public TRACE() {}
public Object up(Event evt) {
System.out.println("---------------- TRACE (received) ----------------------");
System.out.println(evt);
System.out.println("--------------------------------------------------------");
return up_prot.up(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);
System.out.println("--------------------------------------------------------");
return down_prot.down(evt);
}
public Object down(Message msg) {
System.out.println("------------------- TRACE (sent) -----------------------");
System.out.printf("msg from %s to %s (%d bytes): hdrs=%s\n", msg.getSrc(), msg.getDest(), msg.getLength(), msg.printHeaders());
System.out.println("--------------------------------------------------------");
return down_prot.down(msg);
}
public String toString() {
return "TRACE";
}
}