Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2014-03-27 05:51:41 +0000
committerslewis2014-03-27 05:51:41 +0000
commitaa9b4b319c5b4e3367a23f6b6f0789ddeb92738c (patch)
treeda9f60602a0170ff6570f837830c7b21ff1cc687 /providers
parentf9e6c4a0f113f6a7a42c9cfb30f0bd529318be0c (diff)
downloadorg.eclipse.ecf-aa9b4b319c5b4e3367a23f6b6f0789ddeb92738c.tar.gz
org.eclipse.ecf-aa9b4b319c5b4e3367a23f6b6f0789ddeb92738c.tar.xz
org.eclipse.ecf-aa9b4b319c5b4e3367a23f6b6f0789ddeb92738c.zip
Reused AdapterManagerFactory
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java
index 1c29ebfcf..e2bacf0c4 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java
@@ -14,8 +14,8 @@ package org.eclipse.ecf.internal.provider.datashare;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ecf.core.IContainerManager;
+import org.eclipse.ecf.core.util.AdapterManagerTracker;
import org.eclipse.ecf.core.util.LogHelper;
-import org.eclipse.ecf.core.util.PlatformHelper;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
@@ -35,7 +35,7 @@ public class Activator implements BundleActivator {
private ServiceTracker logServiceTracker = null;
- private ServiceTracker adapterManagerTracker = null;
+ private AdapterManagerTracker adapterManagerTracker = null;
private ServiceTracker containerManagerTracker = null;
@@ -103,15 +103,10 @@ public class Activator implements BundleActivator {
public IAdapterManager getAdapterManager() {
// First, try to get the adapter manager via
if (adapterManagerTracker == null) {
- adapterManagerTracker = new ServiceTracker(this.context, IAdapterManager.class.getName(), null);
+ adapterManagerTracker = new AdapterManagerTracker(this.context);
adapterManagerTracker.open();
}
- IAdapterManager adapterManager = (IAdapterManager) adapterManagerTracker.getService();
- // Then, if the service isn't there, try to get from Platform class via
- // PlatformHelper class
- if (adapterManager == null)
- adapterManager = PlatformHelper.getPlatformAdapterManager();
- return adapterManager;
+ return adapterManagerTracker.getAdapterManager();
}
/**

Back to the top