{
String s =_strMgr.getString("CSCMB.nohosts");
getLogger().log(Level.WARNING, s);
// s has everything we need in it now...
throw new MBeanException(new HADBSetupException(s));
}
boolean configha = haRequired;
ret = createCluster(clusterName, configName, props);
if(configha)
{
try
{
HadbConfigMBean mbean = new HadbConfigMBean();
Object[] objs = mbean.createHACluster(
hosts,
haagentport,
haadminpassword,
haadminpasswordfile,
devicesize,
autohadb,
portbase,
clusterName,
haprops);
String s =_strMgr.getString("CSCMB.createhadbOK", new Object[] { clusterName, Arrays.toString(objs)});
getLogger().log(Level.INFO, s);
}
catch(Exception e)
{
// Kludge-fest.
// I tried "throw new MBeanException(e, s);" but CLI totally ignored "s".
// there also is no MBeanException(String) constructor.
// So I'm bending CLI to my will by reconstructing the original Exception
// note: YARRRGGGHHH!!
String s =_strMgr.getString("CSCMB.createhadberror", new Object[] { clusterName, e});
getLogger().log(Level.WARNING, s);
// never call a method that can throw an Exception from a catch block!!
try
{
deleteCluster("false", clusterName);
}
catch(Exception e2)
{
s += e2.getMessage();
}
// s has everything we need in it now...
throw new MBeanException(new HADBSetupException(s));
}
}
return ret;
}