Updating getApplicationContext method to suite scaling order
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4d1504ac Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4d1504ac Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4d1504ac Branch: refs/heads/master Commit: 4d1504acf8f6ada38e6c78450529e382f182d3f3 Parents: 60a87af Author: Lahiru Sandaruwan <[email protected]> Authored: Sat Nov 8 14:23:14 2014 +0530 Committer: Lahiru Sandaruwan <[email protected]> Committed: Sat Nov 8 14:23:14 2014 +0530 ---------------------------------------------------------------------- .../context/ApplicationContextFactory.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/4d1504ac/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationContextFactory.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationContextFactory.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationContextFactory.java index b4d7740..62b2921 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationContextFactory.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/dependency/context/ApplicationContextFactory.java @@ -32,32 +32,32 @@ public class ApplicationContextFactory { private static final Log log = LogFactory.getLog(ApplicationContextFactory.class); /** - * Will return the GroupContext/ClusterContext based on the type in start order + * Will return the GroupContext/ClusterContext based on the type in start order/scaling order * - * @param startOrder reference of group/cluster in the start order + * @param order reference of group/cluster in the start/scaling order * @param component The component which used to build the dependency * @param tree kill dependent behaviour of this component * @return Context */ - public static ApplicationContext getApplicationContext(String startOrder, + public static ApplicationContext getApplicationContext(String order, ParentComponent component, DependencyTree tree) { String id; ApplicationContext applicationContext = null; boolean isDependent = tree.isKillDependent() || tree.isKillAll(); - if (startOrder.startsWith(Constants.GROUP + ".")) { + if (order.startsWith(Constants.GROUP + ".")) { //getting the group alias - id = getGroupFromStartupOrder(startOrder); + id = getGroupFromStartupOrder(order); applicationContext = getGroupContext(id, isDependent); - } else if (startOrder.startsWith(Constants.CARTRIDGE + ".")) { + } else if (order.startsWith(Constants.CARTRIDGE + ".")) { //getting the cluster alias - id = getClusterFromStartupOrder(startOrder); + id = getClusterFromStartupOrder(order); //getting the cluster-id from cluster alias ClusterDataHolder clusterDataHolder = component.getClusterDataMap().get(id); applicationContext = getClusterContext(clusterDataHolder, isDependent); } else { - log.warn("[Startup Order]: " + startOrder + " contains unknown reference"); + log.warn("[Startup Order]: " + order + " contains unknown reference"); } return applicationContext;
