Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2021-02-15 07:20:05 +0000
committerMatthias Sohn2021-03-11 21:28:07 +0000
commit86708b62d5e4b1d707c4384b0267b60b6d8549a5 (patch)
treed061d1679bde7af80e3b2dee738a7f302716f552 /org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
parent4a415921af6f65bf5eec483aace6088ff820a29c (diff)
downloadegit-86708b62d5e4b1d707c4384b0267b60b6d8549a5.tar.gz
egit-86708b62d5e4b1d707c4384b0267b60b6d8549a5.tar.xz
egit-86708b62d5e4b1d707c4384b0267b60b6d8549a5.zip
[osgi] Disperse the EGit core Activator into OSGi dynamic services
Use OSGi DS to perform most of the setup formerly done in the Activator. Because of interdependencies it's not possible to do this step-by-step. The Activator did a number of unrelated things: * setting up the internal EGit caches (RepositoryCache, IndexDiffCache, RepositoryUtil). * setting up a number of IResourceChangeListeners for auto-sharing projects, auto-ignoring derived resources, and similar things. * setting up HTTP and SSH, and proxy support. * handling debug tracing options. * migrating preferences. * tracking merge strategies contributed via an extension point. Each of these have now become an OSGi DS component: * RepositoryInitializer: EGit caches * WorkspaceConnector: IResourceChangeListeners * TransportConfigurator: HTTP, SSH, and proxies * DebugOptionsHandler: debug tracing options * PreferencesMigrator: preferences migrations; runs as a Job * MergeStrategies: merge strategy tracking; runs a Job to initialize The activator is no longer the central hub from which other classes can obtain the RepositoryCache, IndexDiffCache, or RepositoryUtil. This change was necessary because otherwise an early component activation causes the Activator to run, which then might cause trying to activate org.eclipse.core.resources before the instance location is set, which breaks Eclipse start-up. These central singletons are newly managed in these three classes directly, and are accessible via getInstance() static methods. Likewise, the EGitSecureStore is now such a singleton that will be created on first access to the EGitSecureStore class. The RepositoryInitializer publishes the RepositoryCache as a service, which is consumed by the WorkspaceConnector OSGi component. This ensures correct initialization order. The changes outside the Activator and the six new OSGi components are all simple replacements for using the new instance getters instead of the Activator. Bug: 560412 Change-Id: Id5c7440213ae25a573e84720db7dfcc83a8f5d0a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
index 2c558be48c..4f02ee6126 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
import org.eclipse.egit.ui.UIPreferences;
@@ -57,8 +58,8 @@ class GenerateHistoryJob extends Job {
GenerateHistoryJob(final GitHistoryPage ghp, @NonNull RevWalk walk,
ResourceManager resources) {
- super(NLS.bind(UIText.HistoryPage_refreshJob, Activator.getDefault()
- .getRepositoryUtil().getRepositoryName(
+ super(NLS.bind(UIText.HistoryPage_refreshJob,
+ RepositoryUtil.getInstance().getRepositoryName(
ghp.getInputInternal().getRepository())));
page = ghp;
this.walk = walk;

Back to the top