View Javadoc

1   /*
2    * Copyright (c) 1998-2002 The Jgroup Team.
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU Lesser General Public License version 2 as
6    * published by the Free Software Foundation.
7    *
8    * This program is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   * GNU Lesser General Public License for more details.
12   *
13   * You should have received a copy of the GNU Lesser General Public License
14   * along with this program; if not, write to the Free Software
15   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16   *
17   */
18  
19  package jgroup.relacs.mss;
20  
21  import jgroup.core.EndPoint;
22  import jgroup.core.MemberId;
23  import jgroup.relacs.events.Event;
24  import jgroup.util.InMessage;
25  
26  /**
27   *  The <code>MssUser</code> interface should be implemented by layers
28   *  using the Mss to receive callback notifications from the Mss itself.
29   *
30   *  @author Alberto Montresor
31   *  @since  Jgroup 0.1
32   */
33  public interface MssUser
34  {
35  
36    /**
37     *  Invoked to notify the objects implementing this interface that
38     *  a message from a remote member has been received.
39     *  
40     *  @param tag the tag identifying the type of message
41     *  @param stream the message, represented by a <CODE>InMessage</CODE> 
42     *    object
43     *  @param src the sender of the message
44     */
45    public void remoteReceive(byte tag, InMessage data, EndPoint host);
46  
47    /**
48     *  Invoked to notify the objects implementing this interface that
49     *  a message from a local member has been received.
50     *  
51     *  @param event represents the received message
52     */
53    public void localReceive(Event upcall);
54  
55    /**
56     *  Invoked to notify the objects implementing this interface that
57     *  a variation in the perceived reachability set has been perceived.
58     *
59     *  @param trset   set of all (total) reachables hosts
60     *  @param nrset   set of reachable hosts that were unreachable
61     *  @param nuset   set of unreachable hosts that were reachable
62     *  @param newinc  set of hosts who has a new incarnation identifier
63     */
64    public void remoteSuspect(EndPoint[] rset, EndPoint[] nrset, EndPoint[] nuset, EndPoint[] newinc);
65  
66    /**
67     *  Invoked to notify the objects implementing this interface that
68     *  a remote object is not responding to remote method invocations,
69     *  and thus should be crashed.
70     *  
71     *  @param membId a callback object identifying the suspected object;
72     *    this object has been stored in the Mss through the
73     *    <code>addPingListener</code> method invocation on the Mss.
74     */
75    public void localSuspect(MemberId membId);
76    
77  } // END MssUser