String type = nn.getType();
if(type.equals(NetworkNotification.SERVER_ADDED))
{
// found a server
Identity ident = nn.getIdentity();
MBeanServerLocator l = new MBeanServerLocator(ident);
foundMBeanServer(l);
}
else if(type.equals(NetworkNotification.SERVER_REMOVED))
{
// lost a server
Identity ident = nn.getIdentity();
MBeanServerLocator l = new MBeanServerLocator(ident);
lostMBeanServer(l);
}
return;
}
else if(notification instanceof AttributeChangeNotification)
{
AttributeChangeNotification ch = (AttributeChangeNotification) notification;
if(ch.getAttributeName().equals("State") && hasActions())
{
MBeanServerLocator server = (MBeanServerLocator) o;
Object src = ch.getSource();
if(src instanceof ObjectName)
{
ObjectName obj = (ObjectName) src;
// indicate the state changed
fireStateChange(new MBeanLocator(server, obj), ((Integer) ch.getOldValue()).intValue(), ((Integer) ch.getNewValue()).intValue());
return;
}
else if(src instanceof MBeanLocator)
{
fireNotification((MBeanLocator) src, notification, o);
return;
}
}
}
if(wantNotifications && hasActions())
{
// fire notification to listener
MBeanServerLocator server = (MBeanServerLocator) o;
if(server != null)
{
Object src = notification.getSource();
if(src instanceof ObjectName)
{