mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Bug 153446 - wrapped the persistence provider save operation inside a WorkspaceJob instead of a regular Job. This should delay any build requests and other resource change listeners triggered as a result of writing profiles that happens during delete.
Also fixed problems with broken filter pool references that occurred during duplication of profiles while testing.
This commit is contained in:
parent
2a5311d432
commit
f8b631b8d4
6 changed files with 38 additions and 38 deletions
|
@ -121,8 +121,6 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
|||
*/
|
||||
public boolean saveRSEDOM(RSEDOM dom, IProgressMonitor monitor) {
|
||||
IFolder providerFolder = getProviderFolder();
|
||||
// String profileName = dom.getName();
|
||||
// System.out.println("saving profile " + profileName + " to " + providerFolder.getFullPath().toString() + "...");
|
||||
try {
|
||||
int n = countNodes(dom);
|
||||
if (monitor != null) monitor.beginTask("Saving DOM", n);
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
|
||||
package org.eclipse.rse.internal.persistence;
|
||||
|
||||
import org.eclipse.core.resources.WorkspaceJob;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.rse.persistence.IRSEPersistenceProvider;
|
||||
import org.eclipse.rse.persistence.dom.RSEDOM;
|
||||
|
||||
public class SaveRSEDOMJob extends Job {
|
||||
public class SaveRSEDOMJob extends WorkspaceJob {
|
||||
|
||||
private RSEDOM _dom;
|
||||
private IRSEPersistenceProvider _provider;
|
||||
|
@ -34,7 +34,7 @@ public class SaveRSEDOMJob extends Job {
|
|||
_provider = provider;
|
||||
}
|
||||
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
public IStatus runInWorkspace(IProgressMonitor monitor) {
|
||||
IStatus result = Status.OK_STATUS;
|
||||
synchronized (_dom) { // synchronize on the DOM to prevent its update while writing
|
||||
if (_dom.needsSave()) {
|
||||
|
|
|
@ -404,7 +404,8 @@ public class RSEDOMExporter implements IRSEDOMExporter {
|
|||
|
||||
if (clean || node.isDirty()) {
|
||||
ISystemFilterPool filterPool = filterPoolReference.getReferencedFilterPool();
|
||||
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_REF_ID, filterPool.getId());
|
||||
String refId = (filterPool != null) ? filterPool.getId() : "unknown";
|
||||
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_REF_ID, refId);
|
||||
}
|
||||
|
||||
createPropertySetNodes(node, filterPoolReference, clean);
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.filters;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.rse.core.filters.ISystemFilter;
|
||||
import org.eclipse.rse.core.filters.ISystemFilterContainer;
|
||||
|
@ -107,11 +109,12 @@ public class SystemFilterContainerReferenceCommonMethods
|
|||
// return a complete list. However, to save memory we try to only
|
||||
// re-gen the list if something has changed.
|
||||
ISystemFilterContainer parent = parentRef.getReferencedSystemFilterContainer();
|
||||
java.util.List mofList = null;
|
||||
List mofList = null;
|
||||
if (parent instanceof ISystemFilterPool)
|
||||
mofList = ((ISystemFilterPool)parent).getFilters();
|
||||
else
|
||||
else if (parent instanceof ISystemFilter) {
|
||||
mofList = ((ISystemFilter)parent).getNestedFilters();
|
||||
}
|
||||
boolean needToReGen = compareFilters(mofList);
|
||||
//System.out.println("In getSFRefs for " + getName() + ": regen? " + needToReGen);
|
||||
|
||||
|
@ -122,6 +125,9 @@ public class SystemFilterContainerReferenceCommonMethods
|
|||
// second, build new references...
|
||||
referencedFilters = generateFilterReferences(subSystem, mofList);
|
||||
}
|
||||
if (referencedFilters == null) {
|
||||
referencedFilters = new ISystemFilterReference[0];
|
||||
}
|
||||
return referencedFilters;
|
||||
}
|
||||
|
||||
|
|
|
@ -1617,12 +1617,6 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
|
||||
public void performOperation(IProgressMonitor mon) throws InterruptedException, Exception
|
||||
{
|
||||
String msg = null;
|
||||
int totalWorkUnits = IProgressMonitor.UNKNOWN;
|
||||
|
||||
msg = SubSystemConfiguration.getDisconnectingMessage(getHostName(), getConnectorService().getPort());
|
||||
|
||||
if (!implicitConnect(false, mon, msg, totalWorkUnits)) throw new Exception(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED).makeSubstitution(getHostName()).getLevelOneText());
|
||||
internalDisconnect(mon);
|
||||
_disconnecting = false;
|
||||
_connectionError = false;
|
||||
|
|
|
@ -1293,6 +1293,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
{
|
||||
ISystemFilterPoolReference poolRef = oldReferences[idx];
|
||||
ISystemFilterPool pool = poolRef.getReferencedFilterPool();
|
||||
if (pool != null) {
|
||||
// if just copying a connnection, then copy references to pools as-is
|
||||
if (!copyProfileOperation)
|
||||
{
|
||||
|
@ -1319,6 +1320,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newRefMgr.setProviderEventNotification(true);
|
||||
}
|
||||
try
|
||||
|
@ -2220,7 +2222,6 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
// CASE 1: FILTER IS NOT NESTED, SO SIMPLY GET ITS FILTER POOL REFERENCE AND USE AS A PARENT...
|
||||
if (!nested)
|
||||
{
|
||||
|
||||
// SPECIAL CASE 1A: it makes a difference if we are showing filter pools or not...
|
||||
if (showFilterPools())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue