[jboss-jira] [JBoss JIRA] (WFCORE-731) TransformerAttachmentGrabber always returns null with map operations
Radoslav Husar (JIRA)
issues at jboss.org
Thu Jun 4 05:16:03 EDT 2015
[ https://issues.jboss.org/browse/WFCORE-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13074045#comment-13074045 ]
Radoslav Husar edited comment on WFCORE-731 at 6/4/15 5:15 AM:
---------------------------------------------------------------
Thanks, this is uderstood and this is what I am doing I believe. The only difference is whether im transforming a map operation or any other operation:
{code:java}
org.jboss.as.controller.transform.OperationTransformer clearPropertiesTransformer = new org.jboss.as.controller.transform.OperationTransformer() {
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException {
PropertiesAttachment attachment = context.getAttachment(PropertiesAttachment.KEY);
return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT);
}
};
// attachment = null
builder.addRawOperationTransformationOverride(MapOperations.MAP_CLEAR_DEFINITION.getName(), clearPropertiesTransformer);
// attachment OK
builder.addRawOperationTransformationOverride("undefine-attribute", clearPropertiesTransformer);
{code}
was (Author: rhusar):
Thanks, this is uderstood and this is what I am doing I believe. The only difference is whether im transforming a map operation or any other operation:
{noformat}
org.jboss.as.controller.transform.OperationTransformer clearPropertiesTransformer = new org.jboss.as.controller.transform.OperationTransformer() {
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) throws OperationFailedException {
PropertiesAttachment attachment = context.getAttachment(PropertiesAttachment.KEY);
return new TransformedOperation(operation, OperationResultTransformer.ORIGINAL_RESULT);
}
};
// attachment = null
builder.addRawOperationTransformationOverride(MapOperations.MAP_CLEAR_DEFINITION.getName(), clearPropertiesTransformer);
// attachment OK
builder.addRawOperationTransformationOverride("undefine-attribute", clearPropertiesTransformer);
{noformat}
> TransformerAttachmentGrabber always returns null with map operations
> --------------------------------------------------------------------
>
> Key: WFCORE-731
> URL: https://issues.jboss.org/browse/WFCORE-731
> Project: WildFly Core
> Issue Type: Bug
> Affects Versions: 2.0.0.Alpha3
> Reporter: Radoslav Husar
> Assignee: Kabir Khan
> Fix For: 2.0.0.Alpha4
>
>
> Kabir, this thing seems a bit fragile. IIUC this was deviced primarily to address the issue with map operations not being transformable, but org.jboss.as.subsystem.test.TransformerAttachmentGrabber doesn't work with map operations, the attachment is always null.
> I think the problem is with the step order, in org.jboss.as.subsystem.test.TransformerAttachmentGrabber#execute because the real op being a map operation which does attach(...) happens after the attachment is grabbed, that map ops are runtime only org.jboss.as.controller.operations.global.MapOperations#MAP_CLEAR_DEFINITION
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list