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.
  • Constructor Details

  • Method Details

    • 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 interface CapabilityReferenceRecorder
      Parameters:
      context - the context
      resource - the resource on which requirements are gathered
      attributeName - the name of the attribute
      attributeValues - 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 interface CapabilityReferenceRecorder
      Parameters:
      context - the context
      resource - the resource on which requirements are gathered
      attributeName - the name of the attribute
      attributeValues - the values of the attribute, which may contain null
    • getBaseDependentName

      public String getBaseDependentName()
      Specified by:
      getBaseDependentName in interface CapabilityReferenceRecorder
      Returns:
      base name of dependant, usually name of the attribute that provides reference to capability
    • getBaseRequirementName

      public String getBaseRequirementName()
      Specified by:
      getBaseRequirementName in interface CapabilityReferenceRecorder
      Returns:
      requirement name of the capability this reference depends on
    • isDynamicDependent

      public boolean isDynamicDependent()
      Specified by:
      isDynamicDependent in interface CapabilityReferenceRecorder
      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 interface CapabilityReferenceRecorder
      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 be PathAddress.EMPTY_ADDRESS.
      Returns:
      the elements to be added to the baseRequirementName to build the capability name pattern.