[SEBA-593] Register listener to optional services

Change-Id: Iea408beb46b7a027518d52a93be94624c430f77b
diff --git a/src/main/java/org/opencord/kafka/integrations/AaaKafkaIntegration.java b/src/main/java/org/opencord/kafka/integrations/AaaKafkaIntegration.java
index a09cb41..316032e 100644
--- a/src/main/java/org/opencord/kafka/integrations/AaaKafkaIntegration.java
+++ b/src/main/java/org/opencord/kafka/integrations/AaaKafkaIntegration.java
@@ -24,6 +24,7 @@
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.onosproject.net.AnnotationKeys;
 import org.onosproject.net.device.DeviceService;
 import org.opencord.aaa.AuthenticationEvent;
@@ -50,6 +51,7 @@
     protected DeviceService deviceService;
 
     @Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY,
+            policy = ReferencePolicy.DYNAMIC,
             bind = "bindAuthenticationService",
             unbind = "unbindAuthenticationService")
     protected AuthenticationService authenticationService;
@@ -65,6 +67,7 @@
     private static final String AUTHENTICATION_STATE = "authenticationState";
 
     protected void bindAuthenticationService(AuthenticationService authenticationService) {
+        log.info("bindAuthenticationService");
         if (this.authenticationService == null) {
             log.info("Binding AuthenticationService");
             this.authenticationService = authenticationService;
@@ -76,6 +79,7 @@
     }
 
     protected void unbindAuthenticationService(AuthenticationService authenticationService) {
+        log.info("unbindAuthenticationService");
         if (this.authenticationService == authenticationService) {
             log.info("Unbinding AuthenticationService");
             this.authenticationService = null;
@@ -88,12 +92,12 @@
 
     @Activate
     public void activate() {
-        log.info("Started");
+        log.info("Started AaaKafkaIntegration");
     }
 
     @Deactivate
     public void deactivate() {
-        log.info("Stopped");
+        log.info("Stopped AaaKafkaIntegration");
     }
 
     private void handle(AuthenticationEvent event) {