Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-09-10 14:42:43 -0400
committerSteffen Pingel2012-09-10 14:42:43 -0400
commit2d49eec5ec62ff293744ed90aff1cd6c978e0a1b (patch)
treeccf3269b544466cecbf462d1acf0481eb0c3ede8 /org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal
parent6fd180ca8ac0895713f59853d3535c8b05dfeb62 (diff)
downloadorg.eclipse.mylyn.tasks-2d49eec5ec62ff293744ed90aff1cd6c978e0a1b.tar.gz
org.eclipse.mylyn.tasks-2d49eec5ec62ff293744ed90aff1cd6c978e0a1b.tar.xz
org.eclipse.mylyn.tasks-2d49eec5ec62ff293744ed90aff1cd6c978e0a1b.zip
389103: prevent concurrent updates of repository configuration
Change-Id: Ib20537dd92e03edda72ffefc6e0b221f21ceb37b Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389103
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactory.java35
1 files changed, 5 insertions, 30 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactory.java
index d87d52b2a..5f4aa9933 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactory.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactory.java
@@ -21,18 +21,19 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.mylyn.commons.core.ExtensionPointReader;
import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants.ObjectSchedulingRule;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.internal.tasks.core.sync.SubmitTaskAttachmentJob;
import org.eclipse.mylyn.internal.tasks.core.sync.SubmitTaskJob;
import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob;
import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeRepositoriesJob;
import org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeTasksJob;
+import org.eclipse.mylyn.internal.tasks.core.sync.UpdateRepositoryConfigurationJob;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.core.IRepositoryModel;
@@ -159,36 +160,10 @@ public class TaskJobFactory implements ITaskJobFactory {
public TaskJob createUpdateRepositoryConfigurationJob(final AbstractRepositoryConnector connector,
final TaskRepository taskRepository, final ITask task) {
- TaskJob updateJob = new TaskJob(Messages.TaskJobFactory_Refreshing_repository_configuration) {
- private IStatus error;
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- monitor = SubMonitor.convert(monitor);
- monitor.beginTask(Messages.TaskJobFactory_Receiving_configuration, IProgressMonitor.UNKNOWN);
- try {
- try {
- connector.updateRepositoryConfiguration(taskRepository, task, monitor);
- } catch (CoreException e) {
- error = e.getStatus();
- }
- } finally {
- monitor.done();
- }
- return Status.OK_STATUS;
- }
-
- @Override
- public boolean belongsTo(Object family) {
- return family == taskRepository;
- }
-
- @Override
- public IStatus getStatus() {
- return error;
- }
- };
+ UpdateRepositoryConfigurationJob updateJob = new UpdateRepositoryConfigurationJob(
+ Messages.TaskJobFactory_Refreshing_repository_configuration, taskRepository, connector);
updateJob.setPriority(Job.INTERACTIVE);
+ updateJob.setRule(new ObjectSchedulingRule(taskRepository));
return updateJob;
}

Back to the top