public static class CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder extends Object implements CapabilityReferenceRecorder
CapabilityReferenceRecorder
.
Derives the required capability name from the baseRequirementName
provided to the constructor and from
the attribute value. Derives the dependent capability name from the baseDependentName
provided to the
constructor, and, if the dependent name is dynamic, from the address of the resource currently being processed.CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder
Constructor and Description |
---|
DefaultCapabilityReferenceRecorder(String baseRequirementName,
String baseDependentName,
boolean dynamicDependent) |
Modifier and Type | Method and Description |
---|---|
void |
addCapabilityRequirements(OperationContext context,
String attributeName,
String... attributeValues)
Registers capability requirement information to the given context.
|
String |
getBaseDependentName() |
String |
getBaseRequirementName() |
protected String |
getDynamicDependentName(PathAddress currentAddress)
Determines the dynamic portion of the dependent capability's name.
|
boolean |
isDynamicDependent() |
void |
removeCapabilityRequirements(OperationContext context,
String attributeName,
String... attributeValues)
Deregisters capability requirement information from the given context.
|
public final void addCapabilityRequirements(OperationContext context, String attributeName, String... attributeValues)
CapabilityReferenceRecorder
addCapabilityRequirements
in interface CapabilityReferenceRecorder
context
- the contextattributeName
- the name of the attributeattributeValues
- the values of the attribute, which may contain nullpublic final void removeCapabilityRequirements(OperationContext context, String attributeName, String... attributeValues)
CapabilityReferenceRecorder
removeCapabilityRequirements
in interface CapabilityReferenceRecorder
context
- the contextattributeName
- the name of the attributeattributeValues
- the values of the attribute, which may contain nullprotected String getDynamicDependentName(PathAddress currentAddress)
dynamicDependent
is set to true
in the constructor.
This base implementation returns the value of the last element in currentAddress
. Subclasses that
wish to extract the relevant name from some other element in the address may override this.
currentAddress
- the address of the resource currently being processed. Will not be null
null
public String getBaseDependentName()
getBaseDependentName
in interface CapabilityReferenceRecorder
public String getBaseRequirementName()
getBaseRequirementName
in interface CapabilityReferenceRecorder
public boolean isDynamicDependent()
isDynamicDependent
in interface CapabilityReferenceRecorder
Copyright © 2023 JBoss by Red Hat. All rights reserved.