Attempt to fix ONOS-3460

Restart UDP listener thread and create a new RADIUS server socket
when the AAA app configuration changes.

Change-Id: If81479ee54609f56cf86e21aa5c5d83732c6a9fe
diff --git a/apps/aaa/src/main/java/org/onosproject/aaa/AaaManager.java b/apps/aaa/src/main/java/org/onosproject/aaa/AaaManager.java
index 4567f01..afacff2 100755
--- a/apps/aaa/src/main/java/org/onosproject/aaa/AaaManager.java
+++ b/apps/aaa/src/main/java/org/onosproject/aaa/AaaManager.java
@@ -166,6 +166,19 @@
         return eth;
     }
 
+    private void initializeLocalState() {
+        try {
+            radiusSocket = new DatagramSocket(radiusServerPort);
+        } catch (Exception ex) {
+            log.error("Can't open RADIUS socket", ex);
+        }
+
+        executor = Executors.newSingleThreadExecutor(
+                new ThreadFactoryBuilder()
+                        .setNameFormat("AAA-radius-%d").build());
+        executor.execute(radiusListener);
+    }
+
     @Activate
     public void activate() {
         netCfgService.addListener(cfgListener);
@@ -182,16 +195,7 @@
 
         StateMachine.initializeMaps();
 
-        try {
-            radiusSocket = new DatagramSocket(radiusServerPort);
-        } catch (Exception ex) {
-            log.error("Can't open RADIUS socket", ex);
-        }
-
-        executor = Executors.newSingleThreadExecutor(
-                new ThreadFactoryBuilder()
-                        .setNameFormat("AAA-radius-%d").build());
-        executor.execute(radiusListener);
+        initializeLocalState();
         log.info("Started");
     }
 
@@ -568,6 +572,9 @@
 
                 AaaConfig cfg = netCfgService.getConfig(appId, AaaConfig.class);
                 reconfigureNetwork(cfg);
+                radiusSocket.close();
+                executor.shutdownNow();
+                initializeLocalState();
                 log.info("Reconfigured");
             }
         }