* @return ProfileAllVm object.
*/
public static ProfileAllVm initializeProfileAllVm()
throws Exception
{
ProfileAllVm profAllVm;
String profAllVmPath = cfgGlobal_.getProfileAllVmPath();
boolean isExist = false;
try {
profAllVm = new ProfileAllVm(profAllVmPath);
isExist = true;
} catch (NotNormalFileException e) {
logger_.info
(String.format
("%s is not found. create it.", profAllVmPath));
profAllVm = new ProfileAllVm();
isExist = false;
}
if (isExist == false) {
profAllVm.write(profAllVmPath);
}
/* Reload the profile to counteract the case where
another processes wrote the profile
during the above initialization. */
try {
profAllVm.lock(60);
profAllVm.reload();
} catch (Exception e) {
throw e;
} finally {
profAllVm.unlock();
}
return profAllVm;
}