Revert "Remove felix.dm usage in aaa-filterchain" 29/65229/1
authorRyan Goulding <ryandgoulding@gmail.com>
Mon, 6 Nov 2017 20:16:11 +0000 (20:16 +0000)
committerRyan Goulding <ryandgoulding@gmail.com>
Mon, 6 Nov 2017 20:16:11 +0000 (20:16 +0000)
This reverts commit 822554dcc7cfd59034622a0f41df5b25a2ae2520.

Change-Id: I0ea057fa13784849849020906c81add04cebad01
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
aaa-filterchain/pom.xml
aaa-filterchain/src/main/java/org/opendaylight/aaa/filterchain/Activator.java

index c046ab986178f77d2d42222e3a45a522a467739c..00612a5ec4e3137c512d88c8ebe60dc83d9d3a09 100644 (file)
 
   <dependencies>
     <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.dependencymanager</artifactId>
     </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>
index d052ec5755cacef165d26f969d83ecb89cad58a3..0b83b27dfe364d3cd261351eb7c7d65a9e7b7871 100644 (file)
@@ -8,8 +8,9 @@
 
 package org.opendaylight.aaa.filterchain;
 
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
 import org.opendaylight.aaa.filterchain.configuration.CustomFilterAdapterConfiguration;
-import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.cm.ManagedService;
@@ -28,24 +29,24 @@ import org.slf4j.LoggerFactory;
  *
  * @author Ryan Goulding (ryandgoulding@gmail.com)
  */
-public class Activator implements BundleActivator {
+public class Activator extends DependencyActivatorBase {
 
     private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
 
     private ServiceRegistration<ManagedService> managedServiceServiceRegistration;
 
     @Override
-    public void stop(BundleContext context) throws Exception {
+    public void destroy(final BundleContext bc, final DependencyManager dm) throws Exception {
         LOG.debug("Destroying the aaa-filterchain bundle");
         managedServiceServiceRegistration.unregister();
     }
 
     @Override
-    public void start(BundleContext context) throws Exception {
+    public void init(final BundleContext bc, final DependencyManager dm) throws Exception {
         LOG.debug("Initializing the aaa-filterchain bundle");
         // Register the CustomFilterAdapterConfiguration ManagedService with the
         // BundleContext so config values can be loaded from the config admin
-        managedServiceServiceRegistration = context.registerService(ManagedService.class,
+        managedServiceServiceRegistration = bc.registerService(ManagedService.class,
                 CustomFilterAdapterConfiguration.getInstance(),
                 CustomFilterAdapterConfiguration.getInstance().getDefaultProperties());
     }