Class CapabilityResolutionContext
java.lang.Object
org.jboss.as.controller.capability.registry.CapabilityResolutionContext
Contextual object that the
ModelController and CapabilityScope implementations
can use to temporarily store data during the course of a capability resolution.- Author:
- Brian Stansberry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAn attachment key instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<V> Vattach(CapabilityResolutionContext.AttachmentKey<V> key, V value) Attaches an arbitrary object to this context.<V> VattachIfAbsent(CapabilityResolutionContext.AttachmentKey<V> key, V value) Attaches an arbitrary object to this context only if the object was not already attached.protected voidcopy(CapabilityResolutionContext source) Update this context content with the source context.<V> VDetaches or removes the value from this context.<V> VRetrieves an object that has been attached to this context.abstract ResourceGets the root resource of the resource tree in effect during this resolution.protected voidreset()Resets this object, removing all attachments.
-
Constructor Details
-
CapabilityResolutionContext
public CapabilityResolutionContext()
-
-
Method Details
-
getResourceRoot
Gets the root resource of the resource tree in effect during this resolution.- Returns:
- the root resource. Will not return
null
-
getAttachment
Retrieves an object that has been attached to this context.- Type Parameters:
V- the value type of the attachment.- Parameters:
key- the key to the attachment.- Returns:
- the attachment if found otherwise
null.
-
attach
Attaches an arbitrary object to this context.- Type Parameters:
V- the value type of the attachment.- Parameters:
key- they attachment key used to ensure uniqueness and used for retrieval of the value.value- the value to store.- Returns:
- the previous value associated with the key or
nullif there was no previous value.
-
attachIfAbsent
Attaches an arbitrary object to this context only if the object was not already attached. If a value has already been attached with the key provided, the current value associated with the key is returned.- Type Parameters:
V- the value type of the attachment.- Parameters:
key- they attachment key used to ensure uniqueness and used for retrieval of the value.value- the value to store.- Returns:
- the previous value associated with the key or
nullif there was no previous value.
-
detach
Detaches or removes the value from this context.- Type Parameters:
V- the value type of the attachment.- Parameters:
key- the key to the attachment.- Returns:
- the attachment if found otherwise
null.
-
reset
protected void reset()Resets this object, removing all attachments. -
copy
Update this context content with the source context.- Parameters:
source- The context to copy.
-