Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-03-14 23:10:29 +0000
committerslewis2007-03-14 23:10:29 +0000
commit30e55c8950c11d2849ba0569dfe10f9230317a30 (patch)
treea92db6ebd541d317c43d65cb41df0c77fad151a9 /providers/bundles/org.eclipse.ecf.provider.datashare
parent2a4868f35ff54ceb50d9d6972e32aa02f02337db (diff)
downloadorg.eclipse.ecf-30e55c8950c11d2849ba0569dfe10f9230317a30.tar.gz
org.eclipse.ecf-30e55c8950c11d2849ba0569dfe10f9230317a30.tar.xz
org.eclipse.ecf-30e55c8950c11d2849ba0569dfe10f9230317a30.zip
Changes to remove references to Plugin class.
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.datashare')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF8
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/internal/provider/datashare/Activator.java38
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/DatashareContainerAdapter.java4
3 files changed, 40 insertions, 10 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF
index b3d868253..6736de98c 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/META-INF/MANIFEST.MF
@@ -14,10 +14,12 @@ Export-Package: org.eclipse.ecf.internal.provider.datashare;x-internal:=true,
org.eclipse.ecf.provider.datashare
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
CDC-1.1/Foundation-1.1
-Require-Bundle: org.eclipse.ecf,
+Require-Bundle: org.eclipse.equinox.common,
+ org.eclipse.ecf,
org.eclipse.ecf.sharedobject,
org.eclipse.ecf.datashare,
org.eclipse.ecf.provider
-Import-Package: org.eclipse.core.runtime,
- org.osgi.framework;version="1.3.0"
+Import-Package: org.osgi.framework;version="1.3.0",
+ org.osgi.service.log;version="1.3.0",
+ org.osgi.util.tracker;version="1.3.2"
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 e45805e11..1f4c62da0 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
@@ -11,19 +11,27 @@
package org.eclipse.ecf.internal.provider.datashare;
-import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.ecf.core.util.LogHelper;
+import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* The main plugin class to be used in the desktop.
*/
-public class Activator extends Plugin {
+public class Activator implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.ecf.provider.datashare";
//The shared instance.
private static Activator plugin;
+ private BundleContext context = null;
+
+ private ServiceTracker logServiceTracker = null;
+
/**
* The constructor.
*/
@@ -31,18 +39,40 @@ public class Activator extends Plugin {
plugin = this;
}
+ protected LogService getLogService() {
+ if (logServiceTracker == null) {
+ logServiceTracker = new ServiceTracker(this.context,
+ LogService.class.getName(), null);
+ logServiceTracker.open();
+ }
+ return (LogService) logServiceTracker.getService();
+ }
+
+ public void log(IStatus status) {
+ LogService logService = getLogService();
+ if (logService != null) {
+ logService.log(LogHelper.getLogCode(status), LogHelper
+ .getLogMessage(status), status.getException());
+ }
+ }
+
+
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
- super.start(context);
+ this.context = context;
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
- super.stop(context);
+ this.context = null;
+ if (logServiceTracker != null) {
+ logServiceTracker.close();
+ logServiceTracker = null;
+ }
plugin = null;
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/DatashareContainerAdapter.java b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/DatashareContainerAdapter.java
index 96b22e3a6..94b337793 100644
--- a/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/DatashareContainerAdapter.java
+++ b/providers/bundles/org.eclipse.ecf.provider.datashare/src/org/eclipse/ecf/provider/datashare/DatashareContainerAdapter.java
@@ -60,9 +60,7 @@ public class DatashareContainerAdapter implements IChannelContainerAdapter {
DatashareContainerAdapter.class,
"DatashareContainerAdapter.initialize", e);
Activator
- .getDefault()
- .getLog()
- .log(
+ .getDefault().log(
new Status(
IStatus.ERROR,
Activator.PLUGIN_ID,

Back to the top