public interface ClusterNodeSelector
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 clusterModifier and Type | Method and Description |
---|---|
String |
selectNode(String clusterName,
String[] connectedNodes,
String[] totalAvailableNodes)
Returns a node from among the
totalAvailableNodes , as the target node for EJB invocations. |
String selectNode(String clusterName, String[] connectedNodes, String[] totalAvailableNodes)
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.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.Copyright © 2016 JBoss by Red Hat. All rights reserved.