Java Code Examples for org.jboss.as.controller.OperationContext#AttachmentKey

The following examples show how to use org.jboss.as.controller.OperationContext#AttachmentKey . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResourceTransformationContextImpl.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public <V> V detach(final OperationContext.AttachmentKey<V> key) {
    if (transformerOperationAttachment == null) {
        return null;
    }
    return transformerOperationAttachment.detach(key);
}
 
Example 2
Source File: ResourceTransformationContextImpl.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public <V> V attach(final OperationContext.AttachmentKey<V> key, final V value) {
    if (transformerOperationAttachment == null) {
        return null;
    }
    return transformerOperationAttachment.attach(key, value);
}
 
Example 3
Source File: TransformerOperationAttachment.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V attachIfAbsent(final OperationContext.AttachmentKey<V> key, final V value) {
    return contextAttachments.attachIfAbsent(key, value);
}
 
Example 4
Source File: TransformationRule.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T detach(OperationContext.AttachmentKey<T> key) {
    return delegate.detach(key);
}
 
Example 5
Source File: TransformationRule.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T attachIfAbsent(OperationContext.AttachmentKey<T> key, T value) {
    return delegate.attachIfAbsent(key, value);
}
 
Example 6
Source File: OperationTransformationTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T attachIfAbsent(OperationContext.AttachmentKey<T> key, T value) {
    return null;
}
 
Example 7
Source File: OperationTransformationTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T getAttachment(OperationContext.AttachmentKey<T> key) {
    return null;
}
 
Example 8
Source File: OperationTransformationTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T detach(OperationContext.AttachmentKey<T> key) {
    return null;
}
 
Example 9
Source File: OperationTransformationTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T attachIfAbsent(OperationContext.AttachmentKey<T> key, T value) {
    return null;
}
 
Example 10
Source File: ContextAttachments.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V detach(final OperationContext.AttachmentKey<V> key) {
    Assert.checkNotNullParam("key", key);
    return key.cast(valueAttachments.remove(key));
}
 
Example 11
Source File: ContextAttachments.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V attachIfAbsent(final OperationContext.AttachmentKey<V> key, final V value) {
    Assert.checkNotNullParam("key", key);
    return key.cast(valueAttachments.putIfAbsent(key, value));
}
 
Example 12
Source File: ContextAttachments.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V attach(final OperationContext.AttachmentKey<V> key, final V value) {
    Assert.checkNotNullParam("key", key);
    return key.cast(valueAttachments.put(key, value));
}
 
Example 13
Source File: ContextAttachments.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V getAttachment(final OperationContext.AttachmentKey<V> key) {
    Assert.checkNotNullParam("key", key);
    return key.cast(valueAttachments.get(key));
}
 
Example 14
Source File: TransformerOperationAttachment.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V getAttachment(final OperationContext.AttachmentKey<V> key) {
    return contextAttachments.getAttachment(key);
}
 
Example 15
Source File: OperationTransformationTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public <T> T getAttachment(OperationContext.AttachmentKey<T> key) {
    return null;
}
 
Example 16
Source File: TransformerOperationAttachment.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public <V> V attach(final OperationContext.AttachmentKey<V> key, final V value) {
    return contextAttachments.attach(key, value);
}
 
Example 17
Source File: TransformationContext.java    From wildfly-core with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Retrieves an object that has been attached to this context.
 *
 * @param key the key to the attachment.
 * @param <T> the value type of the attachment.
 *
 * @return the attachment if found otherwise {@code null}.
 */
<T> T getAttachment(OperationContext.AttachmentKey<T> key);
 
Example 18
Source File: TransformationContext.java    From wildfly-core with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Attaches an arbitrary object to this context.
 *
 * @param key   they attachment key used to ensure uniqueness and used for retrieval of the value.
 * @param value the value to store.
 * @param <T>   the value type of the attachment.
 *
 * @return the previous value associated with the key or {@code null} if there was no previous value.
 */
<T> T attach(OperationContext.AttachmentKey<T> key, T value);
 
Example 19
Source File: TransformationContext.java    From wildfly-core with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * 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.
 *
 * @param key   they attachment key used to ensure uniqueness and used for retrieval of the value.
 * @param value the value to store.
 * @param <T>   the value type of the attachment.
 *
 * @return the previous value associated with the key or {@code null} if there was no previous value.
 */
<T> T attachIfAbsent(OperationContext.AttachmentKey<T> key, T value);
 
Example 20
Source File: TransformationContext.java    From wildfly-core with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Detaches or removes the value from this context.
 *
 * @param key the key to the attachment.
 * @param <T> the value type of the attachment.
 *
 * @return the attachment if found otherwise {@code null}.
 */
<T> T detach(OperationContext.AttachmentKey<T> key);