public IList getServers()
{
IList result = new List<ResinConfServer>();
XPathNodeIterator ids = _docNavigator.Select("caucho:resin/caucho:cluster/caucho:server/@id", _xmlnsMgr);
while (ids.MoveNext()) {
ResinConfServer server = new ResinConfServer();
server.ID = ids.Current.Value;
//cluster@id
XPathNodeIterator it = ids.Current.SelectAncestors("cluster", "http://caucho.com/ns/resin", false);
it.MoveNext();
server.Cluster = it.Current.GetAttribute("id", "");
result.Add(server);
}
XPathNodeIterator multi = _docNavigator.Select("caucho:resin/caucho:cluster/caucho:server-multi", _xmlnsMgr);
while (multi.MoveNext()) {
String idPrefix = multi.Current.GetAttribute("id-prefix", "");
String addressList = multi.Current.GetAttribute("address-list", "");
XPathNodeIterator it = multi.Current.SelectAncestors("cluster", "http://caucho.com/ns/resin", false);
it.MoveNext();
String cluster = it.Current.GetAttribute("id", "");
String[] addresses = null;
if (addressList.StartsWith("${")) {
String addressListKey = addressList.Substring(2, addressList.Length - 3);
addressList = (String)getProperties()[addressListKey];
}
if (addressList == null)
continue;
addresses = addressList.Split(new Char[] { ';', ' ' });
for (int i = 0; i < addresses.Length; i++) {
ResinConfServer server = new ResinConfServer();
server.ID = idPrefix + i;
server.Cluster = cluster;
result.Add(server);
}
}
return result;
}