Properties depends = new Properties();
depends.put("", "jboss:service=Naming");
// Set up the MBean configuration bean, this time with the attributes
// in the order in which they appear when asking the mbean for the name
MBeanData data = new MBeanData();
data
.setName("jboss.mq:alias=UIL2XAConnectionFactory,service=InvocationLayer,type=UIL2XA");
data.setTemplateName("mbean-update");
data.setAttributes(attrs);
data.setDepends(depends);
// Update and verify the mbean:
if (!updateMBean(data))
{
String msg = "Failed to update mbean: " + data;
log.error(msg);
fail(msg);
}
verifyMBean(data, null);
// Try again, but with the name attributes in a different order. This
// time in the order in which they appear in the xml file:
attrs = new Properties();
attrs.put("FromName", "RRRRRRRRRRR");
attrs.put("ToName", "QQQQQQQQQQQQQ");
data
.setName("jboss.mq:service=InvocationLayer,type=UIL2XA,alias=UIL2XAConnectionFactory");
data.setAttributes(attrs);
// Update and verify the mbean:
if (!updateMBean(data))
{
String msg = "Failed to update mbean: " + data;
log.error(msg);
fail(msg);
}
verifyMBean(data, null);
// Try again, but with the name attributes in another order. This
// time in the order is different that the mbean name or xml file:
attrs = new Properties();
attrs.put("FromName", "LLLLLLLLLLLL");
attrs.put("ToName", "KKKKKKKKKKKK");
data
.setName("jboss.mq:type=UIL2XA,alias=UIL2XAConnectionFactory,service=InvocationLayer");
data.setAttributes(attrs);
// Update and verify the mbean:
if (!updateMBean(data))
{
String msg = "Failed to update mbean: " + data;