newManagementContext = null;
if (origManagementContext != null) Entities.destroyAll(origManagementContext);
if (mementoDir != null) FileBasedObjectStore.deleteCompletely(mementoDir);
origManagementContext = null;
}
<BUG>protected T rebind() throws Exception {
if (newApp!=null || newManagementContext!=null) throw new IllegalStateException("already rebinded");
newApp = rebind(true);
newManagementContext = newApp.getManagementContext();
return newApp;</BUG>
}

newManagementContext = null;
if (origManagementContext != null) Entities.destroyAll(origManagementContext);
if (mementoDir != null) FileBasedObjectStore.deleteCompletely(mementoDir);
origManagementContext = null;
}
protected T rebind() throws Exception {
return rebind(true);
}
