Fix bug in APEX parameter service 31/57331/1
authorliamfallon <liam.fallon@ericsson.com>
Tue, 24 Jul 2018 13:23:37 +0000 (14:23 +0100)
committerliamfallon <liam.fallon@ericsson.com>
Tue, 24 Jul 2018 13:24:12 +0000 (14:24 +0100)
The parameter calss name was not initialized in the constructor
of the parameter service
The web socket connections() method is depricated and replaced by getConnections()
Fixed order of build in main pom to put packages module last
fixed some comments that were incorrect

Change-Id: I6340655100655e181e2d97fe39def4874873dff5
Issue-ID: POLICY-954
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/messaging/impl/ws/server/MessageServerImpl.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/service/AbstractParameters.java
pom.xml
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexMain.java

index ee6e1a3..389d04d 100644 (file)
@@ -91,7 +91,7 @@ public class MessageServerImpl<MESSAGE> extends InternalMessageBusServer<MESSAGE
         // Stop the web socket server
         try {
             // Close all connections on this web socket server
-            for (final WebSocket connection : connections()) {
+            for (final WebSocket connection : getConnections()) {
                 connection.closeConnection(0, "");
             }
             stop();
@@ -128,7 +128,7 @@ public class MessageServerImpl<MESSAGE> extends InternalMessageBusServer<MESSAGE
     @Override
     public void send(final MessageHolder<MESSAGE> message) {
         // Send the incoming message to all clients connected to this web socket
-        final Collection<WebSocket> connections = connections();
+        final Collection<WebSocket> connections = getConnections();
         for (final WebSocket webSocket : connections) {
             webSocket.send(MessagingUtils.serializeObject(message));
         }
@@ -142,7 +142,7 @@ public class MessageServerImpl<MESSAGE> extends InternalMessageBusServer<MESSAGE
      */
     @Override
     public void send(final String messageString) {
-        final Collection<WebSocket> connections = connections();
+        final Collection<WebSocket> connections = getConnections();
         for (final WebSocket webSocket : connections) {
             webSocket.send(messageString);
         }
index c7ec2d6..cc7c7b0 100644 (file)
@@ -32,7 +32,7 @@ import org.onap.policy.apex.model.utilities.Assertions;
  */
 public abstract class AbstractParameters {
     // The name of the parameter subclass
-    private String parameterClassName = this.getClass().getCanonicalName();
+    private final String parameterClassName;
 
     /**
      * Constructor, creates a parameter class that must be a subclass of {@link AbstractParameters}.
@@ -47,6 +47,8 @@ public abstract class AbstractParameters {
             throw new ApexRuntimeException(
                     "class \"" + parameterClassName + "\" not found or not an instance of \"" + this.getClass().getCanonicalName() + "\"", e);
         }
+        
+        this.parameterClassName = parameterClassName;
     }
 
     /**
diff --git a/pom.xml b/pom.xml
index f8d8a55..8d0f653 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <module>plugins</module>
         <module>examples</module>
         <module>testsuites</module>
-        <module>packages</module>
         <module>client</module>
         <module>tools</module>
+        <module>packages</module>
     </modules>
 </project>
index 1b56034..436225f 100644 (file)
@@ -45,7 +45,7 @@ public class ApexMain {
     private ApexParameters parameters;
 
     /**
-     * Instantiates the Apex Apex service.
+     * Instantiates the Apex service.
      *
      * @param args the commaind line arguments
      */
@@ -138,8 +138,6 @@ public class ApexMain {
     /**
      * The Class ApexMainShutdownHookClass terminates the Apex engine for the Apex service when its
      * run method is called.
-     *
-     * @author Liam Fallon (liam.fallon@ericsson.com)
      */
     private class ApexMainShutdownHookClass extends Thread {
         /*