List<ObjectName> ons = null;
Target t = null;
try {
t = TargetBuilder.INSTANCE.createTarget(target, vTargets, target, this.acc);
} catch(ConfigException e) {
throw new CustomMBeanException(e);
}
if (TargetType.DAS.equals(t.getType()) || TargetType.SERVER.equals(t.getType())) {
if (TargetType.SERVER.equals(t.getType())) {
EnterpriseCustomMBeanOperations.checkClusteredInstance(this.acc, t.getName());
}
ons = super.listMBeanConfigObjectNamesForServer(t.getName());
}
else if (TargetType.DOMAIN.equals(t.getType())) {
// just list the mbean definitions
ons = this.getMBeanDefinitionObjectNamesInDomain();
}
else {//has to be a cluster
String nameOfAServerInCluster = null;
try {
Server[] servers= ServerHelper.getServersInCluster(this.acc, target);
nameOfAServerInCluster = servers[0].getName();
ons = super.listMBeanConfigObjectNamesForServer(nameOfAServerInCluster);
} catch(ConfigException e) {
throw new CustomMBeanException(e);
}
}
return ( ons ) ;
}