org.jboss.ha.framework.interfaces
Interface FamilyClusterInfo

All Known Implementing Classes:
FamilyClusterInfoImpl

public interface FamilyClusterInfo

Maintain information for a given proxy family. Proxies can statically reference objects implementing this interface: only the content will change as the cluster topology changes, not the FamilyClusterInfo object itself. Proxies or LoadBalancing policy implementations can use the cursor and object attribute to store arbitrary data that is then shared accross all proxies belonging to the same family. Initial access to this object is done through the ClusteringTargetsRepository singleton.

Version:
$Revision: 75661 $

Revisions:

2002/08/23, Sacha Labourey:

Author:
Sacha Labourey.
See Also:
FamilyClusterInfoImpl, ClusteringTargetsRepository

Field Summary
static int UNINITIALIZED_CURSOR
          Initial value returned by getCursor().
 
Method Summary
 boolean currentMembershipInSyncWithViewId()
          Gets whether this object believes its current target list matches what the server-side used to generate the view id.
 long getCurrentViewId()
          Gets a shorthand identifier for the current cluster topology for the clustered service represented by this object.
 int getCursor()
          Gets a cursor indicating a position in the current list of targets.
 String getFamilyName()
           
 Object getObject()
          Gets an object that may be one of the members of the current list of targets.
 List getTargets()
          Gets the list of targets for this family.
 List removeDeadTarget(Object target)
          Remove the given target from the list of targets.
 void resetView()
          Force a reload of the view at the next invocation.
 int setCursor(int cursor)
          Sets a cursor indicating a position in the current list of targets.
 Object setObject(Object whatever)
          Sets the member of the current list of targets that "sticky" load balancing strategies that wish to coordinate between instances should use.
 List updateClusterInfo(List targets, long viewId)
          Updates the targets and the view id.
 

Field Detail

UNINITIALIZED_CURSOR

static final int UNINITIALIZED_CURSOR
Initial value returned by getCursor().

See Also:
Constant Field Values
Method Detail

getFamilyName

String getFamilyName()

getTargets

List getTargets()
Gets the list of targets for this family. NOTE: Implementations should synchronize on themselves when executing this method (see JBAS-2071).


getCurrentViewId

long getCurrentViewId()
Gets a shorthand identifier for the current cluster topology for the clustered service represented by this object. The identifer is generated on the server side; clients can pass this view id to the server side to check whether their current view of the service topology matches what the server sees.


removeDeadTarget

List removeDeadTarget(Object target)
Remove the given target from the list of targets. NOTE: Implementations should synchronize on themselves when executing this method (see JBAS-2071).

Parameters:
target - the target
Returns:
the updated list of targets

updateClusterInfo

List updateClusterInfo(List targets,
                       long viewId)
Updates the targets and the view id. NOTE: Implementations should synchronize on themselves when executing this method (see JBAS-2071).


currentMembershipInSyncWithViewId

boolean currentMembershipInSyncWithViewId()
Gets whether this object believes its current target list matches what the server-side used to generate the view id.

Generally, a call to removeDeadTarget(Object) would cause this method to return false until a subsequent call to updateClusterInfo(List, long) is made.


resetView

void resetView()
Force a reload of the view at the next invocation. NOTE: Implementations should synchronize on themselves when executing this method (see JBAS-2071).


getCursor

int getCursor()
Gets a cursor indicating a position in the current list of targets. Useful for round-robin load balancing strategies that wish to coordinate between instances.

It is not guaranteed that the returned value will be less than the size of the target list; callers need to verify that themselves.

See Also:
UNINITIALIZED_CURSOR, RoundRobin

setCursor

int setCursor(int cursor)
Sets a cursor indicating a position in the current list of targets. Useful for round-robin load balancing strategies that wish to coordinate between instances.

Parameters:
the - cursor

getObject

Object getObject()
Gets an object that may be one of the members of the current list of targets. Useful for "sticky" load balancing strategies that wish to coordinate between instances.

It is not guaranteed that the returned object will be a current member of the target list; callers need to verify that themselves.

Returns:
an object that *may* be an element in the target list, or may be null
See Also:
FirstAvailableIdenticalAllProxies

setObject

Object setObject(Object whatever)
Sets the member of the current list of targets that "sticky" load balancing strategies that wish to coordinate between instances should use.

Parameters:
whatever - *should* be a member of the current list of targets, or null. However, this requirement is not enforced.


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.