Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylyn-integrators] Handling IRepositoryListener.repositorySettingsChanged

Hi,

As part managing the task repositories I have implemented
IRepositoryListener in my MantisClientManager. Following the example
of the Bugzilla connector, I clear the caches whenever I am notified
of:

- repositoryAdded
- repositoryRemoved
- repositorySetttingsChanged

The last one seems to be problematic, since it is also fired when the
synchronisation timestamp is changed ( see stack trace ), which does
not actually affect my client-side caches, but I can't see what
settings have changed. Dropping these caches is quite expensive, since
a full sync can take in excess of 30 seconds for a repository with
many projects or a slow connection.

java.lang.RuntimeException
	at com.itsolut.mantis.core.MantisClientManager.repositorySettingsChanged(MantisClientManager.java:129)
	at org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager$4.run(TaskRepositoryManager.java:382)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager.notifyRepositorySettingsChanged(TaskRepositoryManager.java:372)
	at org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager$1.propertyChange(TaskRepositoryManager.java:72)
	at org.eclipse.mylyn.tasks.core.TaskRepository.notifyChangeListeners(TaskRepository.java:835)
	at org.eclipse.mylyn.tasks.core.TaskRepository.setProperty(TaskRepository.java:828)
	at org.eclipse.mylyn.tasks.core.TaskRepository.setSynchronizationTimeStamp(TaskRepository.java:821)
	at com.itsolut.mantis.core.MantisRepositoryConnector.postSynchronization(MantisRepositoryConnector.java:465)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.postSynchronization(SynchronizeQueriesJob.java:279)
	at org.eclipse.mylyn.internal.tasks.core.sync.SynchronizeQueriesJob.run(SynchronizeQueriesJob.java:243)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I have several possibilities:

1) Live with the performance drop
2) Ignore the repository changes
3) Implement IRepositoryChangeListener like the JiraClientFactory
4) Clone the task repository and generate the changes myself.

I really don't like 1) so I'm going to rule it out.
I'm not sure what 2) entails. If I'm missing out of e.g. credentials
changes ( although I use AbstractWebLocation ) this can be a problem.
As for 3), besides using internals - which I'm not very happy about,
but can live with - I don't think that the TaskRepositorDelta.Type can
signal a sync timestamp change - although I have not verified it. At
the time it seems to notify of

ALL, CREDENTIALS, PROPERTY, PROYX, OFFLINE

which is not enough.
By looking at the task repository class for 4) I see that I get call
getProperties() , but it seems really shaky.

What would be the best approach in this case?

Thanks,

Robert


-- 
Sent from my (old) computer


Back to the top