You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/03/08 18:19:21 UTC

stratos git commit: Adding null conditions to thread termination logic in mock instance

Repository: stratos
Updated Branches:
  refs/heads/master b7840d8ee -> 1d3924f3e


Adding null conditions to thread termination logic in mock instance


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1d3924f3
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1d3924f3
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1d3924f3

Branch: refs/heads/master
Commit: 1d3924f3e7c807f3b79022827c15abbce6c73018
Parents: b7840d8
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Mar 8 22:49:08 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 22:49:08 2015 +0530

----------------------------------------------------------------------
 .../apache/stratos/mock/iaas/services/impl/MockInstance.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/1d3924f3/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockInstance.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockInstance.java b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockInstance.java
index 1a7d93f..5aa8066 100644
--- a/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockInstance.java
+++ b/components/org.apache.stratos.mock.iaas/src/main/java/org/apache/stratos/mock/iaas/services/impl/MockInstance.java
@@ -146,11 +146,15 @@ public class MockInstance implements Runnable, Serializable {
     }
 
     private void stopHealthStatisticsPublisher() {
-		healthStatNotifierScheduledFuture.cancel(true);
+        if(healthStatNotifierScheduledFuture != null) {
+            healthStatNotifierScheduledFuture.cancel(true);
+        }
 	}
     
     private void stopInstanceNotifierReceiver() {
-        instanceNotifierEventReceiver.terminate();
+        if(instanceNotifierEventReceiver != null) {
+            instanceNotifierEventReceiver.terminate();
+        }
     }
 
     private void sleep(long time) {