//System.out.println( "setAttributesInConfigBean: " + amxAttrs);
final AttributeList successfulAttrs = new AttributeList();
final Transactions transactions = mConfigBean.getHabitat().getComponent(Transactions.class);
if (xmlAttrs.size() != 0)
{
//cdebug( "DelegateToConfigBeanDelegate.setAttributes(): " + attrsIn.size() + " attributes: {" +
// CollectionUtil.toString(amxAttrs.keySet()) + "} mapped to xml names {" + CollectionUtil.toString(xmlAttrs.keySet()) + "}");
final MyTransactionListener myListener = new MyTransactionListener(mConfigBean);
transactions.addTransactionsListener(myListener);
// results should contain only those that succeeded which will be all or none
// depending on whether the transaction worked or not
try
{
final MakeChangesApplyer mca = new MakeChangesApplyer(mConfigBean, xmlAttrs);
mca.apply();
// use 'attrsIn' vs 'attrs' in case not all values are 'String'
successfulAttrs.addAll(attrsIn);
}
catch (final TransactionFailure tf)
{
// empty results -- no Exception should be thrown per JMX spec
cdebug(ExceptionUtil.toString(tf));
throw(tf);
}
finally
{
transactions.waitForDrain();
transactions.removeTransactionsListener(myListener);
}
}
return successfulAttrs;
}