Package org.jboss.as.controller
Class CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder
- java.lang.Object
-
- org.jboss.as.controller.CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder
-
- All Implemented Interfaces:
CapabilityReferenceRecorder
- Enclosing interface:
- CapabilityReferenceRecorder
public static class CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder extends Object implements CapabilityReferenceRecorder
CapabilityReferenceRecorder
that determines the dependent and required capability from thePathAddress
of the resource registration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.controller.CapabilityReferenceRecorder
CapabilityReferenceRecorder.CompositeAttributeDependencyRecorder, CapabilityReferenceRecorder.ContextDependencyRecorder, CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder, CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder
-
-
Constructor Summary
Constructors Constructor Description ResourceCapabilityReferenceRecorder(String baseDependentName, Function<PathAddress,String[]> dynamicRequirementNameMapper, String baseRequirementName)
ResourceCapabilityReferenceRecorder(Function<PathAddress,String[]> dynamicDependentNameMapper, String baseDependentName, Function<PathAddress,String[]> dynamicRequirementNameMapper, String baseRequirementName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)
Registers capability requirement information to the given context.String
getBaseDependentName()
String
getBaseRequirementName()
String[]
getRequirementPatternSegments(String dynamicElement, PathAddress registrationAddress)
Returns the elements to be added to the baseRequirementName to build the capability name pattern.boolean
isDynamicDependent()
void
removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)
Deregisters capability requirement information from the given context.
-
-
-
Constructor Detail
-
ResourceCapabilityReferenceRecorder
public ResourceCapabilityReferenceRecorder(Function<PathAddress,String[]> dynamicDependentNameMapper, String baseDependentName, Function<PathAddress,String[]> dynamicRequirementNameMapper, String baseRequirementName)
-
ResourceCapabilityReferenceRecorder
public ResourceCapabilityReferenceRecorder(String baseDependentName, Function<PathAddress,String[]> dynamicRequirementNameMapper, String baseRequirementName)
-
-
Method Detail
-
addCapabilityRequirements
public void addCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)
Description copied from interface:CapabilityReferenceRecorder
Registers capability requirement information to the given context.- Specified by:
addCapabilityRequirements
in interfaceCapabilityReferenceRecorder
- Parameters:
context
- the contextresource
- the resource on which requirements are gatheredattributeName
- the name of the attributeattributeValues
- the values of the attribute, which may contain null
-
removeCapabilityRequirements
public void removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)
Description copied from interface:CapabilityReferenceRecorder
Deregisters capability requirement information from the given context.- Specified by:
removeCapabilityRequirements
in interfaceCapabilityReferenceRecorder
- Parameters:
context
- the contextresource
- the resource on which requirements are gatheredattributeName
- the name of the attributeattributeValues
- the values of the attribute, which may contain null
-
getBaseDependentName
public String getBaseDependentName()
- Specified by:
getBaseDependentName
in interfaceCapabilityReferenceRecorder
- Returns:
- base name of dependant, usually name of the attribute that provides reference to capability
-
getBaseRequirementName
public String getBaseRequirementName()
- Specified by:
getBaseRequirementName
in interfaceCapabilityReferenceRecorder
- Returns:
- requirement name of the capability this reference depends on
-
isDynamicDependent
public boolean isDynamicDependent()
- Specified by:
isDynamicDependent
in interfaceCapabilityReferenceRecorder
- Returns:
- tells is reference is dynamic or static, in case where it is dynamic it uses base name + name of dependent attribute to construct name of capability
-
getRequirementPatternSegments
public String[] getRequirementPatternSegments(String dynamicElement, PathAddress registrationAddress)
Description copied from interface:CapabilityReferenceRecorder
Returns the elements to be added to the baseRequirementName to build the capability name pattern. It will return an array of the form `segment[.segment]` where each segment represents either the name of one of the resource's attributes or one of the keys in the resource's address. In the actual name the attribute name or address key will be replaced by the value associated with that attribute or key.- Specified by:
getRequirementPatternSegments
in interfaceCapabilityReferenceRecorder
- Parameters:
dynamicElement
- the name of the attribute.registrationAddress
- the registration address of the resource definition that has the capability and its requirement.- Returns:
- the elements to be added to the baseRequirementName to build the capability name pattern.
-
-