01: // $Id: PRINTMETHODS.java,v 1.3 2004/03/30 06:47:21 belaban Exp $
02:
03: package org.jgroups.protocols;
04:
05: import org.jgroups.Event;
06: import org.jgroups.Message;
07: import org.jgroups.blocks.MethodCall;
08: import org.jgroups.stack.Protocol;
09:
10: public class PRINTMETHODS extends Protocol {
11:
12: public PRINTMETHODS() {
13: }
14:
15: public String getName() {
16: 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
31: .println("--> PRINTMETHODS: received "
32: + obj);
33: } catch (ClassCastException cast_ex) {
34: } catch (Exception e) {
35: }
36: }
37: }
38:
39: passUp(evt);
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: }
|