stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [17/32] stratos git commit: Corrected the location of adding shutdown hook.
Date Fri, 09 Oct 2015 14:35:30 GMT
Corrected the location of adding shutdown hook.


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

Branch: refs/heads/gsoc-projects-2015
Commit: e16cf0d06887d63997cd063323a5f57d499f43c2
Parents: da1963a
Author: swapnilpatilRajaram <swapnil.patil@students.iiit.ac.in>
Authored: Sat Jul 25 04:50:03 2015 +0000
Committer: swapnilpatilRajaram <swapnil.patil@students.iiit.ac.in>
Committed: Sat Jul 25 04:50:03 2015 +0000

----------------------------------------------------------------------
 .../stratos/aws/extension/AWSLoadBalancer.java  |  6 ++---
 .../org/apache/stratos/aws/extension/Main.java  | 26 ++++++++++----------
 2 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e16cf0d0/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/AWSLoadBalancer.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/AWSLoadBalancer.java
b/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/AWSLoadBalancer.java
index 2d4f40c..f53562e 100644
--- a/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/AWSLoadBalancer.java
+++ b/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/AWSLoadBalancer.java
@@ -82,10 +82,10 @@ public class AWSLoadBalancer implements LoadBalancer {
 						List<Instance> attachedInstances = awsHelper
 								.getAttachedInstances(loadBalancerName, region);
 
-						Collection<Member> clusterInstances = cluster
+						Collection<Member> clusterMembers = cluster
 								.getMembers();
 
-						if (clusterInstances.size() > 0) {
+						if (clusterMembers.size() > 0) {
 							activeClusters.add(cluster.getClusterId());
 						} else {
 							break;
@@ -94,7 +94,7 @@ public class AWSLoadBalancer implements LoadBalancer {
 						List<Instance> instancesToAddToLoadBalancer = new ArrayList<Instance>();
 						List<Instance> awsInstancesInCluster = new ArrayList<Instance>();
 
-						for (Member member : clusterInstances) {
+						for (Member member : clusterMembers) {
 							// if instance id of member is not in
 							// attachedInstances
 							// add this to instancesToAddToLoadBalancer

http://git-wip-us.apache.org/repos/asf/stratos/blob/e16cf0d0/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/Main.java
b/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/Main.java
index ee2bdb7..73fa971 100644
--- a/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/Main.java
+++ b/extensions/load-balancer/aws-extension/src/main/java/org/apache/stratos/aws/extension/Main.java
@@ -48,6 +48,19 @@ public class Main {
 				log.info("AWS extension started");
 			}
 
+			executorService = StratosThreadPool.getExecutorService(
+					"aws.extension.thread.pool", 10);
+			// Validate runtime parameters
+			AWSExtensionContext.getInstance().validate();
+			TopologyProvider topologyProvider = new TopologyProvider();
+			AWSStatisticsReader statisticsReader = AWSExtensionContext
+					.getInstance().isCEPStatsPublisherEnabled() ? new AWSStatisticsReader(
+					topologyProvider) : null;
+			extension = new LoadBalancerExtension(new AWSLoadBalancer(),
+					statisticsReader, topologyProvider);
+			extension.setExecutorService(executorService);
+			extension.execute();
+
 			// Add shutdown hook
 			final Thread mainThread = Thread.currentThread();
 			final LoadBalancerExtension finalExtension = extension;
@@ -64,19 +77,6 @@ public class Main {
 					}
 				}
 			});
-
-			executorService = StratosThreadPool.getExecutorService(
-					"aws.extension.thread.pool", 10);
-			// Validate runtime parameters
-			AWSExtensionContext.getInstance().validate();
-			TopologyProvider topologyProvider = new TopologyProvider();
-			AWSStatisticsReader statisticsReader = AWSExtensionContext
-					.getInstance().isCEPStatsPublisherEnabled() ? new AWSStatisticsReader(
-					topologyProvider) : null;
-			extension = new LoadBalancerExtension(new AWSLoadBalancer(),
-					statisticsReader, topologyProvider);
-			extension.setExecutorService(executorService);
-			extension.execute();
 		} catch (Exception e) {
 			if (log.isErrorEnabled()) {
 				log.error(e);


Mime
View raw message