KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > protocols > MessageProtocolEXAMPLE


1 // $Id: MessageProtocolEXAMPLE.java,v 1.2 2004/03/30 06:47:21 belaban Exp $
2

3 package org.jgroups.protocols;
4
5
6
7
8 import org.jgroups.Event;
9 import org.jgroups.Message;
10 import org.jgroups.stack.MessageProtocol;
11
12
13
14
15
16
17 /**
18
19  */

20 public class MessageProtocolEXAMPLE extends MessageProtocol {
21
22     public String JavaDoc getName() {return "MessageProtocolEXAMPLE";}
23
24
25     /**
26        <b>Callback</b>. Called when a request for this protocol layer is received.
27      */

28     public Object JavaDoc handle(Message req) {
29     System.out.println("MessageProtocolEXAMPLE.handle(): this method should be overridden !");
30     return null;
31     }
32
33
34
35     
36     /**
37        <b>Callback</b>. Called by superclass when event may be handled.<p>
38        <b>Do not use <code>PassUp</code> in this method as the event is passed up
39        by default by the superclass after this method returns !</b>
40        @return boolean Defaults to true. If false, event will not be passed up the stack.
41      */

42     public boolean handleUpEvent(Event evt) {return true;}
43
44
45     /**
46        <b>Callback</b>. Called by superclass when event may be handled.<p>
47        <b>Do not use <code>PassDown</code> in this method as the event is passed down
48        by default by the superclass after this method returns !</b>
49        @return boolean Defaults to true. If false, event will not be passed down the stack.
50     */

51     public boolean handleDownEvent(Event evt) {return true;}
52
53
54
55 }
56
Popular Tags