felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1574532 - /felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java
Date Wed, 05 Mar 2014 15:38:03 GMT
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();
+        }
+    }
+}



Mime
View raw message