public interface ResolveContext
resolve
operation.
Resolve Contexts:
capabilities that the Resolver can use to
satisfy requirements via the
findProviders(Requirement) methodgetWirings() method. A wiring
consists of a map of existing resources to wiring.isEffective(Requirement).A resolver may call the methods on the resolve context any number of times during a resolve operation using any thread. Implementors should ensure that this class is properly thread safe.
The resolve context methods must be idempotent. This means that resources must have constant capabilities and requirements and the resolve context must return a consistent set of capabilities, wires and effective requirements.
| Modifier and Type | Method and Description |
|---|---|
List<org.jboss.gravia.resource.Capability> |
findProviders(org.jboss.gravia.resource.Requirement requirement)
Find Capabilities that match the given Requirement.
|
Collection<org.jboss.gravia.resource.Resource> |
getMandatoryResources()
Return the resources that must be resolved for this resolve context.
|
Collection<org.jboss.gravia.resource.Resource> |
getOptionalResources()
Return the resources that the resolver should attempt to resolve for this
resolve context.
|
Map<org.jboss.gravia.resource.Resource,org.jboss.gravia.runtime.Wiring> |
getWirings()
Returns the wirings for existing resolved resources.
|
boolean |
isEffective(org.jboss.gravia.resource.Requirement requirement)
Test if a given requirement should be wired in the resolve operation.
|
Collection<org.jboss.gravia.resource.Resource> getMandatoryResources()
The default implementation returns an empty collection.
Collection<org.jboss.gravia.resource.Resource> getOptionalResources()
The default implementation returns an empty collection.
List<org.jboss.gravia.resource.Capability> findProviders(org.jboss.gravia.resource.Requirement requirement)
The returned list contains Capability objects where the Resource
must be the declared Resource of the Capability.
The returned list is in priority order such that the Capabilities with a lower index have a preference over those with a higher index.
Each returned Capability must match the given Requirement.
requirement - The requirement that a resolver is attempting to
satisfy. Must not be null.Capability objects that match the specified
requirement.boolean isEffective(org.jboss.gravia.resource.Requirement requirement)
false, then the resolver should ignore this
requirement during the resolve operation.
The primary use case for this is to test the effective directive
on the requirement, though implementations are free to use any effective
test.
requirement - The Requirement to test. Must not be null.true if the requirement should be considered as part of
the resolve operation.Map<org.jboss.gravia.resource.Resource,org.jboss.gravia.runtime.Wiring> getWirings()
Multiple calls to this method for this resolve context must return the same result.
Copyright © 2015 JBoss by Red Hat. All rights reserved.