* @param attrs Array of attributes
*
* @return A Host object
*/
public static Host getHost(final Entry[] attrs) {
Host host = null;
for (Entry attr : attrs) {
if (attr.getClass().getName().equals(
Host.class.getName())) {
if (attr instanceof Host) {
host = (Host) attr;
break;
} else {
/*
* This addresses the issue where the discovered service
* has a Host but there is a class loading
* problem, which results in the classes being loaded by
* sibling class loaders, and assignability doesnt work.
*/
host = new Host();
try {
Field hn = attr.getClass().getDeclaredField("hostName");
host.hostName = (String) hn.get(attr);
break;
} catch (Exception e) {