stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isu...@apache.org
Subject [1/2] git commit: fixing STRATOS-399
Date Mon, 03 Feb 2014 13:02:36 GMT
Updated Branches:
  refs/heads/master 639f229e1 -> 85ac579e3


fixing STRATOS-399


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

Branch: refs/heads/master
Commit: 673ffd38d3340442b5793ed39531866f4d8f1591
Parents: 32e63db
Author: Isuru <isuruh@wso2.com>
Authored: Mon Feb 3 18:32:10 2014 +0530
Committer: Isuru <isuruh@wso2.com>
Committed: Mon Feb 3 18:32:10 2014 +0530

----------------------------------------------------------------------
 .../service/ServiceDeploymentManager.java       | 37 ++++++++++++-----
 .../rest/endpoint/services/ServiceUtils.java    | 42 ++++++++++++++------
 2 files changed, 55 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/673ffd38/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java
index 534e4c3..b955c30 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/deploy/service/ServiceDeploymentManager.java
@@ -109,17 +109,6 @@ public class ServiceDeploymentManager {
 
             Service lbService;
 
-            CartridgeInfo lbCartridgeInfo;
-            String lbCartridgeType = lbConfig.getType();
-            try {
-                // retrieve lb Cartridge info
-                lbCartridgeInfo = CloudControllerServiceClient.getServiceClient().getCartridgeInfo(lbCartridgeType);
-            } catch (Exception e) {
-                String msg = "Cannot get cartridge info: " + type;
-                log.error(msg, e);
-                throw new ADCException(msg, e);
-            }
-
             Properties lbReferenceProperties = lbConfig.getProperties();
 
             Property property = new Property();
@@ -167,7 +156,20 @@ public class ServiceDeploymentManager {
                     break;
 
                 } else if (Constants.DEFAULT_LOAD_BALANCER.equals(name)) {
+
                     if ("true".equals(value)) {
+
+                        CartridgeInfo lbCartridgeInfo;
+                        String lbCartridgeType = lbConfig.getType();
+                        try {
+                            // retrieve lb Cartridge info
+                            lbCartridgeInfo = CloudControllerServiceClient.getServiceClient().getCartridgeInfo(lbCartridgeType);
+                        } catch (Exception e) {
+                            String msg = "Cannot get cartridge info: " + type;
+                            log.error(msg, e);
+                            throw new ADCException(msg, e);
+                        }
+
                         property.setValue(name);
                         if (log.isDebugEnabled()) {
                             log.debug("This cartridge uses default load balancer. " + "[Type]
" +
@@ -220,7 +222,20 @@ public class ServiceDeploymentManager {
                         break;
                     }
                 } else if (Constants.SERVICE_AWARE_LOAD_BALANCER.equals(name)) {
+
                     if ("true".equals(value)) {
+
+                        CartridgeInfo lbCartridgeInfo;
+                        String lbCartridgeType = lbConfig.getType();
+                        try {
+                            // retrieve lb Cartridge info
+                            lbCartridgeInfo = CloudControllerServiceClient.getServiceClient().getCartridgeInfo(lbCartridgeType);
+                        } catch (Exception e) {
+                            String msg = "Cannot get cartridge info: " + type;
+                            log.error(msg, e);
+                            throw new ADCException(msg, e);
+                        }
+
                         property.setValue(name);
                         if (log.isDebugEnabled()) {
                             log.debug("This cartridge uses a service aware load balancer.
" +

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/673ffd38/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index 1ecd048..c80f47c 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -665,19 +665,6 @@ public class ServiceUtils {
             }
         } else {
 
-            CartridgeInfo lbCartridgeInfo = null;
-            String lbCartridgeType = lbConfig.getType();
-            try {
-                // retrieve lb Cartridge info
-                if(lbCartridgeType != null) {
-                    lbCartridgeInfo = cloudControllerServiceClient.getCartridgeInfo(lbCartridgeType);
-                }
-            } catch (Exception e) {
-                String msg = "Cannot get cartridge info: " + cartridgeType;
-                log.error(msg, e);
-                throw new ADCException(msg, e);
-            }
-
             Properties lbReferenceProperties = lbConfig.getProperties();
 
             Property property = new Property();
@@ -725,7 +712,22 @@ public class ServiceUtils {
                     break;
 
                 } else if (Constants.DEFAULT_LOAD_BALANCER.equals(name)) {
+
                     if ("true".equals(value)) {
+
+                        CartridgeInfo lbCartridgeInfo = null;
+                        String lbCartridgeType = lbConfig.getType();
+                        try {
+                            // retrieve lb Cartridge info
+                            if(lbCartridgeType != null) {
+                                lbCartridgeInfo = cloudControllerServiceClient.getCartridgeInfo(lbCartridgeType);
+                            }
+                        } catch (Exception e) {
+                            String msg = "Cannot get cartridge info: " + cartridgeType;
+                            log.error(msg, e);
+                            throw new ADCException(msg, e);
+                        }
+
                         property.setValue(name);
                         if (log.isDebugEnabled()) {
                             log.debug("This cartridge uses default load balancer. " + "[Type]
" +
@@ -775,8 +777,22 @@ public class ServiceUtils {
                     }
 
                 } else if (Constants.SERVICE_AWARE_LOAD_BALANCER.equals(name)) {
+
                     if ("true".equals(value)) {
 
+                        CartridgeInfo lbCartridgeInfo = null;
+                        String lbCartridgeType = lbConfig.getType();
+                        try {
+                            // retrieve lb Cartridge info
+                            if(lbCartridgeType != null) {
+                                lbCartridgeInfo = cloudControllerServiceClient.getCartridgeInfo(lbCartridgeType);
+                            }
+                        } catch (Exception e) {
+                            String msg = "Cannot get cartridge info: " + cartridgeType;
+                            log.error(msg, e);
+                            throw new ADCException(msg, e);
+                        }
+
                         // add a property for the service type
                         Property loadBalancedServiceTypeProperty = new Property();
                         loadBalancedServiceTypeProperty.setName(Constants.LOAD_BALANCED_SERVICE_TYPE);


Mime
View raw message