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.core;
20  
21  /**
22   *  In order to be notified of state merging events, an object must
23   *  implement this interface.  Two methods are declared; the first,
24   *  <code>getState</code>, is invoked when the member has been selected
25   *  as coordinator for the reconciliation protocol.  As coordinator, the
26   *  member must prepare a status message containing the information
27   *  needed by members that needs to be updated with the state maintained
28   *  by servers in the partition of the coordinator.  The method
29   *  <code>putState</code> is invoked to inform the member about the
30   *  state of other members belonging to different partitions.
31   *
32   *  @author Alberto Montresor
33   *  @since 0.7
34   */
35  public interface MergingListener
36  {
37  
38    /**
39     *  Method <code>getState</code> is invoked when the member has been
40     *  selected as coordinator for the reconciliation protocol.
41     *
42     *  @param dests
43     *    The destination set of the reconciliation message;
44     *  @return 
45     *    The reconciliation message
46     */
47    public Object getState(MemberId[] dests);
48  
49  
50    /**
51     *  Method <code>putState</code> is invoked to inform the member about
52     *  the state of other members belonging to different partitions.
53     *
54     *  @param status
55     *    The reconciliation message
56     *  @param sources
57     *    The state contained in <code>status</code> is already known by
58     *    members in <code>sources</code>.
59     */
60    public void putState(Object status, MemberId[] sources);
61  
62  } // END MergingListener