public static synchronized FamilyClusterInfo initTarget(String familyName,
ArrayList targets,
long viewId) {
// this method must be somehow synchronized to avoid multiple FamilyClusterInfoImpl
// for the same familyName in multi-threaded app accessing the same bean
//
FamilyClusterInfoImpl family = (FamilyClusterInfoImpl)families.get (familyName);
if (family == null)
{
family = new FamilyClusterInfoImpl (familyName, targets, viewId);
families.put (familyName, family);
}
else
{
// no need to initialize: it is already done: we keep the same object
//
family.updateClusterInfo (targets, viewId); // should not happen: possible if redeploy after undeploy fails
}
return family;
}
|