wildfly/wildfly — pull request #5057 by jmesnil (2013-09-13 14:24:59+00:00)
Title: [WFLY-2069] Switch between alternatives in a batch

* fix AlternativeAttributeCheckHandler as the check depends whether the
operation is :write-attribute (and alternatives must not be defined) or
:undefine-attribute (and an alternative *must* be defined)
* flag discovery-group-name and connector attributes to restart all
services
* skip runtime update on HornetQ control object for these 2 attributes
(that are not part of HornetQ management API)

The fix can be checked manually using the *`standalone-full-ha.xml`* configuration:

[standalone@localhost:9990 /] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:read-resource
{
"outcome" => "success",
"result" => {
...
"connector" => {"netty" => undefined},
...
}
}
[standalone@localhost:9990 / #] batch
[standalone@localhost:9990 / #] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
#1 /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:undefine-attribute(name=connector)
[standalone@localhost:9990 / #] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name, value=dg-group1)
#2 /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=discovery-group-name, value=dg-group1)
[standalone@localhost:9990 / #] run-batch
The batch executed successfully
[standalone@localhost:9990 /] /subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:read-resource
{
"outcome" => "success",
"result" => {
...
"connector" => undefined,
...
"discovery-group-name" => "dg-group1",
...
},
"response-headers" => {
"process-state" => "reload-required"
}
}
[standalone@localhost:9990 /] /:reload
{
"outcome" => "success",
"result" => undefined
}