Use registerAbstractHandlerService consistently 07/34907/3
authorStephen Kitt <skitt@redhat.com>
Thu, 18 Feb 2016 14:38:03 +0000 (15:38 +0100)
committerStephen Kitt <skitt@redhat.com>
Thu, 18 Feb 2016 15:20:21 +0000 (16:20 +0100)
NeutronL3Adapter is an AbstractHandler service yet was registered
"manually"; this patch converts it to use
registerAbstractHandlerService.

DistributedArpService is registered following the same pattern but
isn't an AbstractHandler service...

Change-Id: I06cf3c9167d1b2bcb1c08d5ec462beb4d3ac1a38
Signed-off-by: Stephen Kitt <skitt@redhat.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/ConfigActivator.java

index eb71acc94b160fdd141fda8203bb459bbe68262e..44fa6d07df0da9a1246d832b2625a4f551e69ac7 100644 (file)
@@ -196,21 +196,18 @@ public class ConfigActivator implements BundleActivator {
         registerService(context,
                 new String[]{EventDispatcher.class.getName()}, null, eventDispatcher);
 
-        Dictionary<String, Object> neutronL3AdapterProperties = new Hashtable<>();
-        neutronL3AdapterProperties.put(Constants.EVENT_HANDLER_TYPE_PROPERTY,
-                AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER);
         final NeutronL3Adapter neutronL3Adapter = new NeutronL3Adapter(
                 new NeutronModelsDataStoreHelper(this.providerContext.getSALService(DataBroker.class)));
-        registerService(context,
-                new String[]{NeutronL3Adapter.class.getName(), GatewayMacResolverListener.class.getName()},
-                neutronL3AdapterProperties, neutronL3Adapter);
+        registerAbstractHandlerService(context, new Class[] {NeutronL3Adapter.class, GatewayMacResolverListener.class},
+                AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER, neutronL3Adapter);
 
+        // TODO Why is DistributedArpService registered as an event handler without being an AbstractHandlerService?
         Dictionary<String, Object> distributedArpServiceProperties = new Hashtable<>();
         distributedArpServiceProperties.put(Constants.EVENT_HANDLER_TYPE_PROPERTY,
                 AbstractEvent.HandlerType.DISTRIBUTED_ARP_SERVICE);
         final DistributedArpService distributedArpService = new DistributedArpService();
         registerService(context,
-                new String[]{DistributedArpService.class.getName()},
+                new String[] {DistributedArpService.class.getName()},
                 distributedArpServiceProperties, distributedArpService);
 
         OpenstackRouter openstackRouter = new OpenstackRouter();