[wildfly-dev] How can I add a subsystem model step to a different context?
Kabir Khan
kabir.khan at jboss.com
Mon Oct 17 16:20:06 EDT 2016
Try in your operation's execute():
public void execute(OperationContext context, ModelNode operation) {
ModelNode operation = Util.createEmptyOperation("whatever", context.getCurrentAddress().getParent().getParent());
context.addStep(final ModelNode operation, new OperationStepHandler{
public void execute(OperationContext context, ModelNode operation) {
}
}, MODEL);
}
> On 17 Oct 2016, at 13:30, Michael Musgrove <mmusgrov at redhat.com> wrote:
>
> I have subsystem model operation that removes a model node:
>
> {
> "address" => [
> ("subsystem" => "transactions"),
> ("log-store" => "log-store"),
> ("transactions" => "0:ffffac11829d:83bb:57f3b02a:1e"),
> ("participants" => "1")
> ],
> "operation" => "delete",
> "operation-headers" => {
> "caller-type" => "user",
> "access-mechanism" => "NATIVE"
> }
> }
>
> After removing the node (which can result in removing the participant and transaction) I need to add a step that will refresh the model. I cannot do the refresh from the current context (which will be the node I am deleting) so I need to refresh from a context that is "higher up the tree". Ideally I want to do
>
> PathAddress logStoreAddress = context.getCurrentAddress().getParent().getParent();
>
> and then do a refresh from logStoreAddress.
>
> My question is how can I trigger a refresh when I am in the "wrong context"?
>
> Mike
>
>
> --
> Michael Musgrove
> Transactions Team
> e: mmusgrov at redhat.com
> t: +44 191 243 0870
>
> Registered in England and Wales under Company Registration No. 03798903
> Directors: Michael Cunningham (US), Paul Hickey (Ireland), Matt Parson
> (US), Charles Peters (US)
>
> Michael Cunningham (US), Charles Peters (US), Matt Parson (US), Michael O'Neill(Ireland)
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
More information about the wildfly-dev
mailing list