{
public void run()
{
if (hermesMap.containsKey(hermes.getId()))
{
final HermesTreeNode cfNode = (HermesTreeNode) hermesMap.get(hermes.getId());
final DestinationConfigTreeNode dNode = new DestinationConfigTreeNode(cfNode, destinationConfig, cfNode.isCascadeNamespace());
final DestinationConfigKeyWrapper key = new DestinationConfigKeyWrapper(hermes, destinationConfig);
if (destinationMap.containsKey(key))
{
cat.error("duplicate destination key=" + key);
}
else
{
destinationMap.put(key, dNode);
if (cfNode.isCascadeNamespace())
{
try
{
if (cfNode.getHermes().getConnectionFactory() instanceof JNDIConnectionFactory)
{
TreeUtils.add(BrowserTreeModel.this, cfNode.getHermes(), destinationConfig.getName(), "/", cfNode, dNode);
}
else
{
TreeUtils.add(BrowserTreeModel.this, cfNode.getHermes(), destinationConfig.getName(), ".", cfNode, dNode);
}
}
catch (JMSException ex)
{
HermesBrowser.getBrowser().showErrorDialog(ex);
}
}
else
{
cfNode.add(dNode);
nodesWereInserted(cfNode, new int[] { cfNode.getIndex(dNode) });
}
}
}
}
});