Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-09-03 00:25:47 +0000
committerslewis2008-09-03 00:25:47 +0000
commitde1bf8ed8510dd87139bb630cc7363577b53830f (patch)
tree15d1b47d81f58217603a6f1429a93aea8eec7e3a /providers/bundles/org.eclipse.ecf.provider.datashare
parente741c09d3e755cc422a389f0168c91b0c0ea52d0 (diff)
downloadorg.eclipse.ecf-de1bf8ed8510dd87139bb630cc7363577b53830f.tar.gz
org.eclipse.ecf-de1bf8ed8510dd87139bb630cc7363577b53830f.tar.xz
org.eclipse.ecf-de1bf8ed8510dd87139bb630cc7363577b53830f.zip
Fix for bug 238976.
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.datashare')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java18
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/SharedObjectDatashareContainerAdapter.java13
2 files changed, 31 insertions, 0 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 f164fc076..1c29ebfcf 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
@@ -13,6 +13,7 @@ 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.LogHelper;
import org.eclipse.ecf.core.util.PlatformHelper;
import org.osgi.framework.BundleActivator;
@@ -36,6 +37,8 @@ public class Activator implements BundleActivator {
private ServiceTracker adapterManagerTracker = null;
+ private ServiceTracker containerManagerTracker = null;
+
/**
* The constructor.
*/
@@ -77,6 +80,10 @@ public class Activator implements BundleActivator {
adapterManagerTracker.close();
adapterManagerTracker = null;
}
+ if (containerManagerTracker != null) {
+ containerManagerTracker.close();
+ containerManagerTracker = null;
+ }
this.context = null;
plugin = null;
}
@@ -107,4 +114,15 @@ public class Activator implements BundleActivator {
return adapterManager;
}
+ /**
+ * @return IContainerManager instance
+ */
+ public IContainerManager getContainerManager() {
+ if (containerManagerTracker == null) {
+ containerManagerTracker = new ServiceTracker(this.context, IContainerManager.class.getName(), null);
+ containerManagerTracker.open();
+ }
+ return (IContainerManager) containerManagerTracker.getService();
+ }
+
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/SharedObjectDatashareContainerAdapter.java b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/SharedObjectDatashareContainerAdapter.java
index 8b31226e1..56359d413 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/SharedObjectDatashareContainerAdapter.java
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/SharedObjectDatashareContainerAdapter.java
@@ -13,6 +13,8 @@ package org.eclipse.ecf.provider.datashare;
import java.lang.reflect.Constructor;
import java.util.*;
+import org.eclipse.ecf.core.IContainer;
+import org.eclipse.ecf.core.IContainerManager;
import org.eclipse.ecf.core.identity.*;
import org.eclipse.ecf.core.sharedobject.*;
import org.eclipse.ecf.core.sharedobject.events.ISharedObjectActivatedEvent;
@@ -20,6 +22,7 @@ import org.eclipse.ecf.core.sharedobject.events.ISharedObjectDeactivatedEvent;
import org.eclipse.ecf.core.util.*;
import org.eclipse.ecf.datashare.*;
import org.eclipse.ecf.datashare.events.*;
+import org.eclipse.ecf.internal.provider.datashare.Activator;
import org.eclipse.ecf.internal.provider.datashare.Messages;
import org.eclipse.osgi.util.NLS;
@@ -197,4 +200,14 @@ public class SharedObjectDatashareContainerAdapter extends BaseSharedObject impl
channelContainerListeners.add(listener);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.sharedobject.BaseSharedObject#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter != null && adapter.isAssignableFrom(IContainer.class)) {
+ IContainerManager containerManager = Activator.getDefault().getContainerManager();
+ return containerManager.getContainer(getContext().getLocalContainerID());
+ }
+ return super.getAdapter(adapter);
+ }
}

Back to the top