Package org.jboss.as.controller
Class CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder
java.lang.Object
org.jboss.as.controller.CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder
- All Implemented Interfaces:
CapabilityReferenceRecorder,Feature
- Enclosing interface:
- CapabilityReferenceRecorder
public static class CapabilityReferenceRecorder.ResourceCapabilityReferenceRecorder
extends Object
implements CapabilityReferenceRecorder
CapabilityReferenceRecorder that determines the dependent and required capability from the
PathAddress 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
ConstructorsConstructorDescriptionResourceCapabilityReferenceRecorder(String baseDependentName, Function<PathAddress, String[]> dynamicRequirementNameMapper, String baseRequirementName) ResourceCapabilityReferenceRecorder(Function<PathAddress, String[]> dynamicDependentNameMapper, String baseDependentName, Function<PathAddress, String[]> dynamicRequirementNameMapper, String baseRequirementName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues) Registers capability requirement information to the given context.String[]getRequirementPatternSegments(String dynamicElement, PathAddress registrationAddress) Returns the elements to be added to the baseRequirementName to build the capability name pattern.booleanvoidremoveCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... attributeValues) Deregisters capability requirement information from the given context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.controller.Feature
getStability
-
Constructor Details
-
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 Details
-
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
- Specified by:
getBaseDependentNamein interfaceCapabilityReferenceRecorder- Returns:
- base name of dependant, usually name of the attribute that provides reference to capability
-
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. N.B. This parameter is only specified in association with a ResourcDefinition. When associated with an AttributeDefinition, address will always bePathAddress.EMPTY_ADDRESS.- Returns:
- the elements to be added to the baseRequirementName to build the capability name pattern.
-