com.sun.sgs.impl.service.nodemap.policy
Class RoundRobinPolicy

java.lang.Object
  extended by com.sun.sgs.impl.service.nodemap.policy.AbstractNodePolicy
      extended by com.sun.sgs.impl.service.nodemap.policy.RoundRobinPolicy
All Implemented Interfaces:
NodeAssignPolicy
Direct Known Subclasses:
LocalNodePolicy

public class RoundRobinPolicy
extends AbstractNodePolicy

A very simple round robin assignment policy.


Field Summary
 
Fields inherited from class com.sun.sgs.impl.service.nodemap.policy.AbstractNodePolicy
availableNodes
 
Fields inherited from interface com.sun.sgs.impl.service.nodemap.NodeAssignPolicy
SERVER_NODE
 
Constructor Summary
RoundRobinPolicy(Properties props)
          Creates a new instance of RoundRobinPolicy.
 
Method Summary
 long chooseNode(long requestingNode)
          Choose a node to assign an identity, or set of identities to.
 
Methods inherited from class com.sun.sgs.impl.service.nodemap.policy.AbstractNodePolicy
chooseNode, nodeAvailable, nodeUnavailable, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinPolicy

public RoundRobinPolicy(Properties props)
Creates a new instance of RoundRobinPolicy.

Parameters:
props - service properties
Method Detail

chooseNode

public long chooseNode(long requestingNode)
                throws NoNodesAvailableException
Choose a node to assign an identity, or set of identities to.

Parameters:
requestingNode - the id of the node making the request, or SERVER_NODE if the system is making the request
Returns:
the chosen node's id
Throws:
NoNodesAvailableException - if there are no live nodes to assign to

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved