X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fstd%2FAutoClientEnd.java;h=342af2c0f4b3b09d7724fb24a3179d3bcb9ea44d;hb=HEAD;hp=00c8c5f0a6334d7d5a075e27e89ca46c54d4741c;hpb=3eab022023bd68eee6743e30dd7db21c256bf00b;p=policy%2Fengine.git diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/std/AutoClientEnd.java b/PolicyEngineAPI/src/main/java/org/onap/policy/std/AutoClientEnd.java index 00c8c5f0a..342af2c0f 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/std/AutoClientEnd.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/std/AutoClientEnd.java @@ -35,18 +35,18 @@ import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.xacml.api.XACMLErrorConstants; public class AutoClientEnd extends WebSocketClient { - private static StdPDPNotification notification = null; - private static StdPDPNotification oldNotification = null; - private static AutoClientEnd client = null; - private static NotificationScheme scheme = null; - private static NotificationHandler handler = null; - private static String url = null; - private static boolean status = false; - private static boolean stop = false; - private static boolean error = false; - private static boolean restartNeeded = false; - private static ScheduledExecutorService restartExecutorService = null; - private static Logger logger = FlexLogger.getLogger(AutoClientEnd.class.getName()); + private static volatile StdPDPNotification notification = null; + private static volatile StdPDPNotification oldNotification = null; + private static volatile AutoClientEnd client = null; + private static volatile NotificationScheme scheme = null; + private static volatile NotificationHandler handler = null; + private static volatile String url = null; + private static volatile boolean status = false; + private static volatile boolean stop = false; + private static volatile boolean error = false; + private static volatile boolean restartNeeded = false; + private static volatile ScheduledExecutorService restartExecutorService = null; + private static final Logger logger = FlexLogger.getLogger(AutoClientEnd.class.getName()); private AutoClientEnd(URI serverUri) { super(serverUri); @@ -148,6 +148,7 @@ public class AutoClientEnd extends WebSocketClient { try { logger.info("Starting Auto Notification with the PDP server : " + url); client = new AutoClientEnd(new URI(url + "notifications")); + client.setConnectionLostTimeout(0); client.connect(); status = true; restartExecutorService = Executors.newSingleThreadScheduledExecutor(); @@ -212,6 +213,7 @@ public class AutoClientEnd extends WebSocketClient { } private static void callHandler() { + logger.info("AutoClientEnd: In callHandler"); if (handler == null || scheme == null) { return; } @@ -245,4 +247,4 @@ public class AutoClientEnd extends WebSocketClient { } } } -} +} \ No newline at end of file