org.jboss.cache.buddyreplication
Interface BuddyLocator

All Known Implementing Classes:
NextMemberBuddyLocator

public interface BuddyLocator

Buddy Locators help the BuddyManager select buddies for its buddy group.

Implementations of this class must declare a public no-arguments constructor.

Author:
Manik Surtani (manik@jboss.org)

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.
 

Method Detail

init

void init(java.util.Properties props)
Initialize this BuddyLocator.

Parameters:
props - an implementation-specific set of configuration properties. May be null.

locateBuddies

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. Invoked when a change in cluster membership is detected.

Parameters:
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
Returns:
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.