public abstract class CapabilityResolutionContext extends Object
ModelController and CapabilityScope implementations
can use to temporarily store data during the course of a capability resolution.| Modifier and Type | Class and Description |
|---|---|
static class |
CapabilityResolutionContext.AttachmentKey<T>
An attachment key instance.
|
| Constructor and Description |
|---|
CapabilityResolutionContext() |
| Modifier and Type | Method and Description |
|---|---|
<V> V |
attach(CapabilityResolutionContext.AttachmentKey<V> key,
V value)
Attaches an arbitrary object to this context.
|
<V> V |
attachIfAbsent(CapabilityResolutionContext.AttachmentKey<V> key,
V value)
Attaches an arbitrary object to this context only if the object was not already attached.
|
protected void |
copy(CapabilityResolutionContext source)
Update this context content with the source context.
|
<V> V |
detach(CapabilityResolutionContext.AttachmentKey<V> key)
Detaches or removes the value from this context.
|
<V> V |
getAttachment(CapabilityResolutionContext.AttachmentKey<V> key)
Retrieves an object that has been attached to this context.
|
abstract Resource |
getResourceRoot()
Gets the root resource of the resource tree in effect during this resolution.
|
protected void |
reset()
Resets this object, removing all attachments.
|
public abstract Resource getResourceRoot()
nullpublic <V> V getAttachment(CapabilityResolutionContext.AttachmentKey<V> key)
V - the value type of the attachment.key - the key to the attachment.null.public <V> V attach(CapabilityResolutionContext.AttachmentKey<V> key, V value)
V - the value type of the attachment.key - they attachment key used to ensure uniqueness and used for retrieval of the value.value - the value to store.null if there was no previous value.public <V> V attachIfAbsent(CapabilityResolutionContext.AttachmentKey<V> key, V value)
V - the value type of the attachment.key - they attachment key used to ensure uniqueness and used for retrieval of the value.value - the value to store.null if there was no previous value.public <V> V detach(CapabilityResolutionContext.AttachmentKey<V> key)
V - the value type of the attachment.key - the key to the attachment.null.protected void reset()
protected void copy(CapabilityResolutionContext source)
source - The context to copy.Copyright © 2021 JBoss by Red Hat. All rights reserved.