1 3 package org.jgroups.protocols; 4 5 6 import org.jgroups.Event; 7 import org.jgroups.Message; 8 import org.jgroups.blocks.MethodCall; 9 import org.jgroups.stack.Protocol; 10 11 12 public class PRINTMETHODS extends Protocol { 13 14 public PRINTMETHODS() {} 15 16 public String getName() {return "PRINTMETHODS";} 17 18 19 public void up(Event evt) { 20 Object obj=null; 21 byte[] buf; 22 Message msg; 23 24 if(evt.getType() == Event.MSG) { 25 msg=(Message)evt.getArg(); 26 if(msg.getLength() > 0) { 27 try { 28 obj=msg.getObject(); 29 if(obj != null && obj instanceof MethodCall) 30 System.out.println("--> PRINTMETHODS: received " + obj); 31 } 32 catch(ClassCastException cast_ex) {} 33 catch(Exception e) {} 34 } 35 } 36 37 passUp(evt); 38 } 39 40 41 42 public void down(Event evt) { 43 Object obj=null; 44 byte[] buf; 45 Message msg; 46 47 if(evt.getType() == Event.MSG) { 48 49 } 50 passDown(evt); 51 } 52 53 54 55 56 } 57 | Popular Tags |