Class NextMemberBuddyLocator

  extended by org.jboss.cache.buddyreplication.NextMemberBuddyLocator
All Implemented Interfaces:

public class NextMemberBuddyLocator
extends java.lang.Object
implements BuddyLocator

This buddy locator uses a next-in-line algorithm to select buddies for a buddy group. This algorithm allows for the following properties, all of which are optional.

Manik Surtani (

Constructor Summary
Method Summary
 void init(java.util.Properties props)
          Initialize this BuddyLocator.
 java.util.List locateBuddies(java.util.Map buddyPoolMap, java.util.List currentMembership, org.jgroups.stack.IpAddress dataOwner)
          Choose a set of buddies for the given node.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public NextMemberBuddyLocator()
Method Detail


public void init(java.util.Properties props)
Description copied from interface: BuddyLocator
Initialize this BuddyLocator.

Specified by:
init in interface BuddyLocator
props - an implementation-specific set of configuration properties. May be null.


public java.util.List locateBuddies(java.util.Map buddyPoolMap,
                                    java.util.List currentMembership,
                                    org.jgroups.stack.IpAddress dataOwner)
Description copied from interface: BuddyLocator
Choose a set of buddies for the given node. Invoked when a change in cluster membership is detected.

Specified by:
locateBuddies in interface BuddyLocator
buddyPoolMap - Map mapping nodes in the cluster to the "buddy pool" they have identified themselves as belonging too. A BuddyLocator implementation can use this information to preferentially assign buddies from the same buddy pool as dataOwner. May be null if buddy pools aren't configured.
currentMembership - List of the current cluster members
dataOwner - IpAddress of the node for which buddies should be selected
List of the nodes that should serve as buddies for dataOwner. Will not be null, may be empty.

Copyright © 1998-2005 JBoss Inc . All Rights Reserved.