summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-02-25 03:14:47 (EST)
committerEike Stepper2007-02-25 03:14:47 (EST)
commitda4a23cee33fbc44d0a8b7840236052e2d9a7fd0 (patch)
treeed9eb632c3989eed089d0f280e5cfa55326b7ae4
parent746bdeef16b3359802eaf19a660781a0d5256414 (diff)
downloadcdo-da4a23cee33fbc44d0a8b7840236052e2d9a7fd0.zip
cdo-da4a23cee33fbc44d0a8b7840236052e2d9a7fd0.tar.gz
cdo-da4a23cee33fbc44d0a8b7840236052e2d9a7fd0.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/CDOUI.java15
-rw-r--r--plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/bundle/JVM.java15
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/TCP.java15
-rw-r--r--plugins/org.eclipse.net4j/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java11
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/om/OSGiActivator.java64
6 files changed, 91 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/CDOUI.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/CDOUI.java
index 5b79df5..688db5d 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/CDOUI.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/bundle/CDOUI.java
@@ -15,8 +15,7 @@ import org.eclipse.net4j.util.om.OMLogger;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.OMTracer;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
+import org.eclipse.internal.net4j.util.om.OSGiActivator;
/**
* @author Eike Stepper
@@ -38,16 +37,12 @@ public final class CDOUI
/**
* @author Eike Stepper
*/
- public static class Activator implements BundleActivator
+ public static class Activator extends OSGiActivator
{
- public void start(BundleContext context) throws Exception
+ @Override
+ protected OMBundle getOMBundle()
{
- BUNDLE.setBundleContext(context);
- }
-
- public void stop(BundleContext context) throws Exception
- {
- BUNDLE.setBundleContext(null);
+ return BUNDLE;
}
}
}
diff --git a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/bundle/JVM.java b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/bundle/JVM.java
index 0a2abbe..3e03a17 100644
--- a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/bundle/JVM.java
+++ b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/bundle/JVM.java
@@ -15,8 +15,7 @@ import org.eclipse.net4j.util.om.OMLogger;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.OMTracer;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
+import org.eclipse.internal.net4j.util.om.OSGiActivator;
/**
* @author Eike Stepper
@@ -38,16 +37,12 @@ public final class JVM
/**
* @author Eike Stepper
*/
- public static class Activator implements BundleActivator
+ public static class Activator extends OSGiActivator
{
- public void start(BundleContext context) throws Exception
+ @Override
+ protected OMBundle getOMBundle()
{
- BUNDLE.setBundleContext(context);
- }
-
- public void stop(BundleContext context) throws Exception
- {
- BUNDLE.setBundleContext(null);
+ return BUNDLE;
}
}
}
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/TCP.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/TCP.java
index bc92c71..1940119 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/TCP.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/bundle/TCP.java
@@ -15,8 +15,7 @@ import org.eclipse.net4j.util.om.OMLogger;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.OMTracer;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
+import org.eclipse.internal.net4j.util.om.OSGiActivator;
/**
* @author Eike Stepper
@@ -38,16 +37,12 @@ public final class TCP
/**
* @author Eike Stepper
*/
- public static class Activator implements BundleActivator
+ public static class Activator extends OSGiActivator
{
- public void start(BundleContext context) throws Exception
+ @Override
+ protected OMBundle getOMBundle()
{
- BUNDLE.setBundleContext(context);
- }
-
- public void stop(BundleContext context) throws Exception
- {
- BUNDLE.setBundleContext(null);
+ return BUNDLE;
}
}
}
diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
index ddce4d2..4f4b42a 100644
--- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
@@ -16,6 +16,7 @@ Export-Package: org.eclipse.internal.net4j.bundle;version="0.8.0",
org.eclipse.internal.net4j.util;version="0.8.0",
org.eclipse.internal.net4j.util.concurrent;version="0.8.0",
org.eclipse.internal.net4j.util.event;version="0.8.0",
+ org.eclipse.internal.net4j.util.om;version="0.8.0",
org.eclipse.internal.net4j.util.registry;version="0.8.0",
org.eclipse.net4j;version="0.8.0",
org.eclipse.net4j.message;version="0.8.0",
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java
index 5fe69cb..6273879 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.internal.net4j.bundle;
+import org.eclipse.net4j.util.om.log.EclipseLoggingBridge;
import org.eclipse.net4j.util.om.log.PrintLogHandler;
import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
@@ -24,9 +25,19 @@ public class Activator implements BundleActivator
public void start(BundleContext context) throws Exception
{
AbstractOMPlatform.systemContext = context;
+
PrintTraceHandler.CONSOLE.setPattern("{6} [{0}] {5}");
AbstractOMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
AbstractOMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+
+ try
+ {
+ AbstractOMPlatform.INSTANCE.addLogHandler(EclipseLoggingBridge.INSTANCE);
+ }
+ catch (Exception ignore)
+ {
+ }
+
Net4j.BUNDLE.setBundleContext(context);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/om/OSGiActivator.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/om/OSGiActivator.java
new file mode 100644
index 0000000..39d568e
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/om/OSGiActivator.java
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.util.om;
+
+import org.eclipse.net4j.util.om.OMBundle;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class OSGiActivator implements BundleActivator
+{
+ public OSGiActivator()
+ {
+ }
+
+ public final void start(BundleContext context) throws Exception
+ {
+ try
+ {
+ getOMBundle().setBundleContext(context);
+ start();
+ }
+ catch (Exception ex)
+ {
+ getOMBundle().logger().error(ex);
+ throw ex;
+ }
+ }
+
+ public final void stop(BundleContext context) throws Exception
+ {
+ try
+ {
+ stop();
+ getOMBundle().setBundleContext(null);
+ }
+ catch (Exception ex)
+ {
+ getOMBundle().logger().error(ex);
+ throw ex;
+ }
+ }
+
+ protected void start() throws Exception
+ {
+ }
+
+ protected void stop() throws Exception
+ {
+ }
+
+ protected abstract OMBundle getOMBundle();
+}