try{
for(Map oneRow : selectedRows){
String name = (String)oneRow.get("name");
// see if the cluster is running...
boolean running = true;
J2EECluster j2eeCluster = AMXUtil.getJ2EEDomain().getJ2EEClusterMap().get(name);
// try to stop the cluster.
if(j2eeCluster.getstate() == StateManageable.STATE_RUNNING){
j2eeCluster.stop();
}
// get the list of instances of the cluster
Map<String,ClusteredServerConfig> serverMap = AMXUtil.getDomainConfig().getClusterConfigMap().get(name).getClusteredServerConfigMap();
if(serverMap != null){
// delete the instances one by one. Need to use JMX. AMX API not working correctly.