editModel = factory.createEditModel(resourceSet, primaryFile);
editModel.referenceCount++;
resourceSetToEditModel.put(resourceSet, editModel);
final EditModel finalEditModel = editModel;
resourceSet.eAdapters().add(new AdapterImpl() {
@Override
public void notifyChanged(Notification msg) {
Resource r = (Resource) msg.getNewValue();
finalEditModel.getResourceInfoForLoadedResource(r);