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
CapabilityReferenceRecorderthat determines the dependent and required capability from thePathAddressof 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 voidaddCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues)Registers capability requirement information to the given context.StringgetBaseDependentName()StringgetBaseRequirementName()String[]getRequirementPatternSegments(String dynamicElement, PathAddress registrationAddress)Returns the elements to be added to the baseRequirementName to build the capability name pattern.booleanisDynamicDependent()voidremoveCapabilityRequirements(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:CapabilityReferenceRecorderRegisters capability requirement information to the given context.- Specified by:
addCapabilityRequirementsin 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:CapabilityReferenceRecorderDeregisters capability requirement information from the given context.- Specified by:
removeCapabilityRequirementsin 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:
getBaseDependentNamein interfaceCapabilityReferenceRecorder- Returns:
- base name of dependant, usually name of the attribute that provides reference to capability
-
getBaseRequirementName
public String getBaseRequirementName()
- Specified by:
getBaseRequirementNamein interfaceCapabilityReferenceRecorder- Returns:
- requirement name of the capability this reference depends on
-
isDynamicDependent
public boolean isDynamicDependent()
- Specified by:
isDynamicDependentin 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:CapabilityReferenceRecorderReturns 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:
getRequirementPatternSegmentsin 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.
-
-