KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ha > framework > interfaces > FamilyClusterInfo


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.ha.framework.interfaces;
23
24 import java.util.List JavaDoc;
25
26 /**
27  * Maintain information for a given proxy family. Proxies can statically reference
28  * objects implementing this interface: only the content will change as the
29  * cluster topology changes, not the FamilyClusterInfo object itself.
30  * Proxies or LoadBalancing policy implementations can use the cursor and object
31  * attribute to store arbitrary data that is then shared accross all proxies belonging
32  * to the same family.
33  * Initial access to this object is done through the ClusteringTargetsRepository singleton.
34  *
35  * @see org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl
36  * @see org.jboss.ha.framework.interfaces.ClusteringTargetsRepository
37  *
38  * @author <a HREF="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
39  * @version $Revision: 56210 $
40  *
41  * <p><b>Revisions:</b>
42  *
43  * <p><b>2002/08/23, Sacha Labourey:</b>
44  * <ul>
45  * <li> First implementation </li>
46  * </ul>
47  */

48
49 public interface FamilyClusterInfo
50 {
51    public String JavaDoc getFamilyName ();
52    
53    /**
54     * Gets the list of targets for this family.
55     *
56     * <strong>NOTE:</strong> Implementations should synchronize on themselves
57     * when executing this method (see JBAS-2071).
58     */

59    public List JavaDoc getTargets ();
60    public long getCurrentViewId ();
61    
62    /**
63     * Remove the given target from the list of targets.
64     *
65     * <strong>NOTE:</strong> Implementations should synchronize on themselves
66     * when executing this method (see JBAS-2071).
67     *
68     * @param target the target
69     * @return the updated list of targets
70     */

71    public List JavaDoc removeDeadTarget(Object JavaDoc target);
72    
73    /**
74     * Updates the targets and the view id.
75     *
76     * <strong>NOTE:</strong> Implementations should synchronize on themselves
77     * when executing this method (see JBAS-2071).
78     */

79    public List JavaDoc updateClusterInfo (List JavaDoc targets, long viewId);
80    
81    public boolean currentMembershipInSyncWithViewId();
82    
83    /**
84     * Force a reload of the view at the next invocation.
85     *
86     * <strong>NOTE:</strong> Implementations should synchronize on themselves
87     * when executing this method (see JBAS-2071).
88     */

89    public void resetView ();
90    
91    // arbitrary usage by the LoadBalancePolicy implementation
92
// We could have used an HashMap but the lookup would have taken
93
// much more time and we probably don't need as much flexibility
94
// (+ it is slow for a simple int)
95
//
96
public int getCursor();
97    public int setCursor (int cursor);
98    public Object JavaDoc getObject ();
99    public Object JavaDoc setObject (Object JavaDoc whatever);
100    
101    public final static int UNINITIALIZED_CURSOR = 999999999;
102 }
103
Popular Tags