You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pd...@apache.org on 2014/03/05 16:38:03 UTC

svn commit: r1574532 - /felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java

Author: pderop
Date: Wed Mar  5 15:38:03 2014
New Revision: 1574532

URL: http://svn.apache.org/r1574532
Log:
Introduced Activator in order to register ComponentAdmin service

Added:
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java

Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java?rev=1574532&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java Wed Mar  5 15:38:03 2014
@@ -0,0 +1,27 @@
+package dm.impl;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+import dm.admin.ComponentAdmin;
+
+/**
+ * DependencyManager activator, used to register the DM Admin Service.
+ */
+public class Activator implements BundleActivator {
+    // the service registration of the DependencyManager Admin Service.
+    private volatile ServiceRegistration m_adminReg;
+
+    public void start(BundleContext context) throws Exception {
+        context.registerService(ComponentAdmin.class.getName(), new ComponentAdminImpl(), null);
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        final ServiceRegistration adminReg = m_adminReg;
+        m_adminReg = null;
+        if (adminReg != null) {
+            adminReg.unregister();
+        }
+    }
+}