com.sun.sgs.impl.service.nodemap.policy
Class LocalNodePolicy
java.lang.Object
com.sun.sgs.impl.service.nodemap.policy.AbstractNodePolicy
com.sun.sgs.impl.service.nodemap.policy.RoundRobinPolicy
com.sun.sgs.impl.service.nodemap.policy.LocalNodePolicy
- All Implemented Interfaces:
- NodeAssignPolicy
public class LocalNodePolicy
- extends RoundRobinPolicy
The simpliest node policy possible: always assign to the local requesting
node. Round robin assignment is used when the server is making the
request due to node failure.
|
Constructor Summary |
LocalNodePolicy(Properties props)
Creates a new instance of the LocalNodePolicy, which always assigns
an identity to the node which requested an assignment be made. |
|
Method Summary |
long |
chooseNode(long requestingNode)
Choose a node to assign an identity, or set of identities to. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalNodePolicy
public LocalNodePolicy(Properties props)
- Creates a new instance of the LocalNodePolicy, which always assigns
an identity to the node which requested an assignment be made.
- Parameters:
props - service properties
chooseNode
public long chooseNode(long requestingNode)
throws NoNodesAvailableException
- Choose a node to assign an identity, or set of identities to.
This implementation simply assigns to the node making the request.
Round robin assignment is used if the server is making the request
(due to reassigning identities from a failed node).
- Specified by:
chooseNode in interface NodeAssignPolicy- Overrides:
chooseNode in class RoundRobinPolicy
- 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
Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved