public interface DiscoveredURISelector
DiscoveredURISelector
involves load balancing
calls to multiple targets which can all handle the same deployment. This allows the application to have a deterministic
target selection policy while dealing with multiple targets with same deployment.
Target selection is only used when discovery yields more than one URI as a result of its query to locate an EJB.
Modifier and Type | Field and Description |
---|---|
static DiscoveredURISelector |
FIRST
A deployment URI selector which prefers the first URI always.
|
static DiscoveredURISelector |
RANDOM
A deployment URI selector which randomly chooses the next URI.
|
static DiscoveredURISelector |
ROUND_ROBIN
A deployment URI selector which uses an approximate round-robin policy among all of the eligible URIs.
|
Modifier and Type | Method and Description |
---|---|
static DiscoveredURISelector |
favorite(Collection<URI> favorites,
DiscoveredURISelector fallback)
Create a deployment URI selector that prefers one or more favorite nodes, falling back to another selector if
none of the favorites are found.
|
URI |
selectNode(List<URI> eligibleUris,
EJBLocator<?> locator)
Selects and returns a URI from among the
eligibleUris to handle the invocation on a deployment
represented by the passed in locator . |
static final DiscoveredURISelector FIRST
static final DiscoveredURISelector RANDOM
static final DiscoveredURISelector ROUND_ROBIN
URI selectNode(List<URI> eligibleUris, EJBLocator<?> locator)
eligibleUris
to handle the invocation on a deployment
represented by the passed in locator
. Implementations of this method must not return
null
or any other node name which isn't in the eligibleUris
list.
Note that the list sent in for eligibleUris
is indexed, meaning that the contains
operation
is guaranteed to run in constant time.
eligibleUris
- an indexed list of the eligible nodes which can handle the deployment; not null
, will not be emptylocator
- the locator of the EJB being invoked uponnull
, must be one of the URIs from eligibleUris
)static DiscoveredURISelector favorite(Collection<URI> favorites, DiscoveredURISelector 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.