KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > tribe > faultdetection > FaultDetectionListener


1 /**
2  * Tribe: Group communication library.
3  * Copyright (C) 2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: tribe@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.tribe.faultdetection;
26
27 import org.objectweb.tribe.common.Address;
28
29 /**
30  * Call back listener interface for the ping service
31  *
32  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
33  * @version 1.0
34  */

35 public interface FaultDetectionListener
36 {
37
38   /**
39    * UDPPingThread thread was interrupted
40    */

41   public static final int EVENT_INTERRUPTED = 0;
42
43   /**
44    * UDPPingThread thread is quitting
45    */

46   public static final int EVENT_QUIT = 1;
47
48   /**
49    * UDPPingThread thread cannot access local address
50    */

51   public static final int EVENT_ERROR_LOCAL_ADDRESS = 2;
52
53   /** Thread is responding to ping */
54   public static final int THREAD_ALIVE = 10;
55
56   /** Thread did not respond to last ping */
57   public static final int THREAD_SUSPECTED = 11;
58
59   /** Thread contact was lost */
60   public static final int THREAD_LOST = 12;
61
62   /**
63    * Notifify that the <code>Address</code> is suspected of failure
64    *
65    * @param address <code>Address</code> suspected
66    */

67   void suspect(Address address);
68
69   /**
70    * Notify that the <code>Address</code> did not respond to the last ping
71    *
72    * @param address <code>Address</code> that did not respond
73    */

74   void noResponse(Address address);
75
76   /**
77    * Notify that this was the lastPing on the <code>Address</code>
78    *
79    * @param address
80    */

81   void lastPing(Address address);
82
83   /**
84    * Something special has occured to the ping service: the thread was
85    * interrupted, the service was stopped ...
86    *
87    * @param event an id of the event that happened
88    */

89   void pingServiceEvent(int event);
90
91   /**
92    * Notify that the given address is alive
93    *
94    * @param address
95    */

96   void alive(Address address);
97
98 }
Popular Tags