01: // $Id: MessageProtocolEXAMPLE.java,v 1.2 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.stack.MessageProtocol;
08:
09: /**
10:
11: */
12: public class MessageProtocolEXAMPLE extends MessageProtocol {
13:
14: public String getName() {
15: return "MessageProtocolEXAMPLE";
16: }
17:
18: /**
19: <b>Callback</b>. Called when a request for this protocol layer is received.
20: */
21: public Object handle(Message req) {
22: System.out
23: .println("MessageProtocolEXAMPLE.handle(): this method should be overridden !");
24: return null;
25: }
26:
27: /**
28: <b>Callback</b>. Called by superclass when event may be handled.<p>
29: <b>Do not use <code>PassUp</code> in this method as the event is passed up
30: by default by the superclass after this method returns !</b>
31: @return boolean Defaults to true. If false, event will not be passed up the stack.
32: */
33: public boolean handleUpEvent(Event evt) {
34: return true;
35: }
36:
37: /**
38: <b>Callback</b>. Called by superclass when event may be handled.<p>
39: <b>Do not use <code>PassDown</code> in this method as the event is passed down
40: by default by the superclass after this method returns !</b>
41: @return boolean Defaults to true. If false, event will not be passed down the stack.
42: */
43: public boolean handleDownEvent(Event evt) {
44: return true;
45: }
46:
47: }
|