public interface DeploymentNodeSelector
DeploymentNodeSelector involves load balancing
calls to multiple nodes which can all handle the same deployment. This allows the application to have a deterministic
node selection policy while dealing with multiple nodes with same deployment.
Node selection is only used when discovery yields nodes as a result of its query to locate an EJB. If discovery yields a URI or cluster, this mechanism is not used.
| Modifier and Type | Field and Description |
|---|---|
static DeploymentNodeSelector |
FIRST
A deployment node selector which prefers the first node always.
|
static DeploymentNodeSelector |
RANDOM
A deployment node selector which randomly chooses the next node.
|
static DeploymentNodeSelector |
ROUND_ROBIN
A deployment node selector which uses an approximate round-robin policy among all of the eligible nodes.
|
| Modifier and Type | Method and Description |
|---|---|
static DeploymentNodeSelector |
favorite(Collection<String> favorites,
DeploymentNodeSelector fallback)
Create a deployment node selector that prefers one or more favorite nodes, falling back to another selector if
none of the favorites are found.
|
String |
selectNode(String[] eligibleNodes,
String appName,
String moduleName,
String distinctName)
Selects and returns a node from among the
eligibleNodes to handle the invocation on a deployment
represented by the passed appName, moduleName and distinctName combination. |
static final DeploymentNodeSelector FIRST
static final DeploymentNodeSelector RANDOM
static final DeploymentNodeSelector ROUND_ROBIN
String selectNode(String[] eligibleNodes, String appName, String moduleName, String distinctName)
eligibleNodes to handle the invocation on a deployment
represented by the passed appName, moduleName and distinctName combination.
Implementations of this method must not return null or any other node name which isn't in the
eligibleNodeseligibleNodes - the eligible nodes which can handle the deployment; not null, will not be emptyappName - the app name of the deploymentmoduleName - the module name of the deploymentdistinctName - the distinct name of the deploymentnull)static DeploymentNodeSelector favorite(Collection<String> favorites, DeploymentNodeSelector fallback)
favorites - the favorite nodes, in decreasing order of preference (must not be null)fallback - the fallback selector (must not be null)null)Copyright © 2017 JBoss by Red Hat. All rights reserved.