org.jboss.ejb.client
Interface ClusterNodeSelector
public interface ClusterNodeSelector
A selector which selects and returns a node from the available nodes in a cluster. The EJBReceiver
corresponding to the selected node will then be used to forward the invocations on a EJB. Typical usage of a
ClusterNodeSelector involve load balancing of calls to various nodes in the cluster
- Author:
- Jaikiran Pai
|
Method Summary |
String |
selectNode(String clusterName,
String[] connectedNodes,
String[] totalAvailableNodes)
Returns a node from among the totalAvailableNodes, as the target node for EJB invocations. |
selectNode
String selectNode(String clusterName,
String[] connectedNodes,
String[] totalAvailableNodes)
- Returns a node from among the
totalAvailableNodes, as the target node for EJB invocations.
The selector can decide whether to pick an already connected node (from the passed connectedNodes)
or decide to select a node to which a connection hasn't yet been established. If a node to which a connection
hasn't been established, is selected then the cluster context will create a connection to it before letting
the corresponding EJBReceiver to handle the EJB invocation.
- Parameters:
clusterName - The name of the cluster to which the nodes belongconnectedNodes - The cluster context auto-connects to only a maximum allowed limit of nodes. This
connectedNodes array contains the node names to which a connection has
been established. This can be an empty array but will not be null.totalAvailableNodes - Total available nodes in the cluster. This even includes the connected nodes.
This array will neither be empty nor null.
- Returns:
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.