You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by is...@apache.org on 2013/07/05 12:33:00 UTC

[23/34] committing refactoered adc components and top level pom in components

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/ServiceRequestsInFlightAutoscaler.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/ServiceRequestsInFlightAutoscaler.java b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/ServiceRequestsInFlightAutoscaler.java
deleted file mode 100644
index 05f987d..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/ServiceRequestsInFlightAutoscaler.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- * 
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.mediator.autoscale.lbautoscale.task;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.clustering.ClusteringFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.stratos.mediator.autoscale.lbautoscale.callables.InstanceCountCallable;
-import org.apache.stratos.mediator.autoscale.lbautoscale.util.AutoscalerTaskDSHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.ManagedLifecycle;
-import org.apache.synapse.core.SynapseEnvironment;
-import org.apache.synapse.core.axis2.Axis2SynapseEnvironment;
-import org.apache.synapse.task.Task;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.mediator.autoscale.lbautoscale.callables.AppNodeSanityCheckCallable;
-import org.apache.stratos.mediator.autoscale.lbautoscale.callables.AutoscaleDeciderCallable;
-import org.apache.stratos.mediator.autoscale.lbautoscale.clients.CloudControllerClient;
-import org.apache.stratos.mediator.autoscale.lbautoscale.clients.CloudControllerOsgiClient;
-import org.apache.stratos.mediator.autoscale.lbautoscale.clients.CloudControllerStubClient;
-import org.apache.stratos.mediator.autoscale.lbautoscale.context.AppDomainContext;
-import org.apache.stratos.mediator.autoscale.lbautoscale.context.LoadBalancerContext;
-import org.apache.stratos.lb.common.replication.RequestTokenReplicationCommand;
-import org.apache.stratos.mediator.autoscale.lbautoscale.util.AutoscaleConstants;
-import org.apache.stratos.mediator.autoscale.lbautoscale.util.AutoscaleUtil;
-
-/**
- * Service request in flight autoscaler task for Stratos service level auto-scaling
- */
-public class ServiceRequestsInFlightAutoscaler implements Task, ManagedLifecycle {
-
-    private static final Log log = LogFactory.getLog(ServiceRequestsInFlightAutoscaler.class);
-
-    /**
-     * This instance holds the loadbalancer configuration
-     */
-    private LoadBalancerConfiguration loadBalancerConfig;
-
-    /**
-     * Autoscaler service client instance
-     */
-    private CloudControllerClient autoscalerService;
-
-    /**
-     * AppDomainContexts for each domain
-     * Key - domain
-     * Value - Map of key - sub domain
-     * value - {@link AppDomainContext}
-     */
-    private Map<String, Map<String, ?>> appDomainContexts =
-        new HashMap<String, Map<String, ?>>();
-
-    /**
-     * LB Context for LB cluster
-     */
-    private final LoadBalancerContext lbContext = new LoadBalancerContext();
-
-    /**
-     * Attribute to keep track whether this instance is the primary load balancer.
-     */
-    private boolean isPrimaryLoadBalancer;
-
-    /**
-     * Keeps track whether this task is still running
-     */
-    private boolean isTaskRunning;
-    
-    /**
-     * Thread pool used in this task to execute parallel tasks.
-     */
-    private ExecutorService executor = Executors.newFixedThreadPool(100);
-
-    /**
-     * Check that all app nodes in all clusters meet the minimum configuration
-     */
-    private void appNodesSanityCheck() {
-        
-        List<Future<Boolean>> jobList = new ArrayList<Future<Boolean>>();
-        
-        for (String serviceDomain : loadBalancerConfig.getServiceDomains()) {
-            
-            String msg =
-                    "Sanity check is failed to run. No Appdomain context is generated for the" +
-                        " domain " + serviceDomain;
-            
-            // get the list of service sub_domains specified in loadbalancer config
-            String[] serviceSubDomains = loadBalancerConfig.getServiceSubDomains(serviceDomain);
-
-            for (String serviceSubDomain : serviceSubDomains) {
-                log.debug("Sanity check has started for: "+AutoscaleUtil.domainSubDomainString(serviceDomain, serviceSubDomain));
-                AppDomainContext appCtxt;
-                if (appDomainContexts.get(serviceDomain) != null) {
-                    appCtxt = (AppDomainContext) appDomainContexts.get(serviceDomain).get(serviceSubDomain);
-                    
-                    if (appCtxt != null) {
-                        // Concurrently perform the application node sanity check.
-                        Callable<Boolean> worker =
-                            new AppNodeSanityCheckCallable(serviceDomain, serviceSubDomain, autoscalerService, appCtxt);
-                        Future<Boolean> appNodeSanityCheck = executor.submit(worker);
-                        jobList.add(appNodeSanityCheck);
-
-                    } else{
-                        log.error(msg + " and sub domain " + serviceSubDomain + " combination.");
-                    }
-                } else{
-                    log.error(msg);
-                }
-            }
-        }
-        
-        // Retrieve the results of the concurrently performed sanity checks.
-        for (Future<Boolean> job : jobList) {
-            try {
-                job.get();
-            } catch (Exception ignore) {
-                log.error(ignore.getMessage(), ignore);
-                // no need to throw
-            } 
-        }
-
-    }
-
-    /**
-     * Autoscale the entire system, analyzing the requests in flight of each domain - sub domain
-     */
-    private void autoscale() {
-        List<Future<Boolean>> jobList = new ArrayList<Future<Boolean>>();
-
-        for (String serviceDomain : loadBalancerConfig.getServiceDomains()) {
-
-            String msg =
-                "Autoscaler check is failed to run. No Appdomain context is generated for the" +
-                    " domain " + serviceDomain;
-
-            // get the list of service sub_domains specified in loadbalancer config
-            String[] serviceSubDomains = loadBalancerConfig.getServiceSubDomains(serviceDomain);
-
-            for (String serviceSubDomain : serviceSubDomains) {
-
-                log.debug("Autoscaling analysis is starting to run for domain: " + serviceDomain +
-                    " and sub domain: " + serviceSubDomain);
-
-                AppDomainContext appCtxt;
-                if (appDomainContexts.get(serviceDomain) != null) {
-                    appCtxt = (AppDomainContext) appDomainContexts.get(serviceDomain).get(serviceSubDomain);
-
-                    if (appCtxt != null) {
-
-                        // Concurrently make the auto-scaling decisions
-                        Callable<Boolean> worker =
-                            new AutoscaleDeciderCallable(serviceDomain, serviceSubDomain, autoscalerService, appCtxt);
-                        Future<Boolean> autoscalerDeciderCheck = executor.submit(worker);
-                        jobList.add(autoscalerDeciderCheck);
-
-                    } else {
-                        log.error(msg + " and sub domain " + serviceSubDomain + " combination.");
-                    }
-                } else {
-                    log.error(msg);
-                }
-            }
-        }
-
-        // Retrieve the results of the concurrently performed sanity checks.
-        for (Future<Boolean> job : jobList) {
-            try {
-                job.get();
-            } catch (Exception ignore) {
-                log.error(ignore.getMessage(), ignore);
-                // no need to throw
-            }
-        }
-    }
-
-    /**
-     * We compute the number of running instances of a particular domain using clustering agent.
-     */
-    private void computeRunningAndPendingInstances() {
-
-        int runningInstances = 0, pendingInstances = 0;
-
-        List<Future<Boolean>> jobList = new ArrayList<Future<Boolean>>();
-
-        for (String serviceDomain : loadBalancerConfig.getServiceDomains()) {
-
-            // get the list of service sub_domains specified in loadbalancer config
-            String[] serviceSubDomains = loadBalancerConfig.getServiceSubDomains(serviceDomain);
-
-            for (String serviceSubDomain : serviceSubDomains) {
-
-                AppDomainContext appCtxt;
-                if (appDomainContexts.get(serviceDomain) != null) {
-                    appCtxt = (AppDomainContext) appDomainContexts.get(serviceDomain).get(serviceSubDomain);
-                    
-                    log.debug("Values in App domain context: " +
-                        appCtxt.getPendingInstanceCount() +
-                            " - " +
-                            appCtxt.getRunningInstanceCount() +
-                            " - Ctxt: " +
-                            appCtxt.hashCode());
-
-                    if (appCtxt != null) {
-                        Callable<Boolean> worker =
-                            new InstanceCountCallable(serviceDomain, serviceSubDomain, autoscalerService, appCtxt);
-                        Future<Boolean> countInstancesJob = executor.submit(worker);
-                        jobList.add(countInstancesJob);
-                    }
-                }
-            }
-        }
-
-        for (Future<Boolean> job : jobList) {
-            try {
-                job.get();
-            } catch (Exception ignore) {
-                log.error(ignore.getMessage(), ignore);
-                // no need to throw
-            }
-        }
-
-        /* Calculate running load balancer instances */
-
-        // count this LB instance in.
-        runningInstances = 1;
-
-        runningInstances += AutoscalerTaskDSHolder.getInstance().getAgent().getAliveMemberCount();
-
-        lbContext.setRunningInstanceCount(runningInstances);
-
-        if (AutoscalerTaskDSHolder.getInstance().getAgent().getParameter("domain") == null) {
-            String msg = "Clustering Agent's domain parameter is null. Please specify a domain" +
-                " name in axis2.xml of Elastic Load Balancer.";
-            log.error(msg);
-            throw new RuntimeException(msg);
-        }
-
-        String lbDomain = AutoscalerTaskDSHolder.getInstance().getAgent().getParameter("domain").getValue().toString();
-
-        String lbSubDomain = null;
-
-        if (AutoscalerTaskDSHolder.getInstance().getAgent().getParameter("subDomain") != null) {
-            lbSubDomain =
-                AutoscalerTaskDSHolder.getInstance().getAgent().getParameter("subDomain").getValue().toString();
-        }
-
-        // reset
-        pendingInstances = 0;
-        try {
-            pendingInstances = lbContext.getPendingInstanceCount();
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            // no need to throw
-        }
-
-        lbContext.setPendingInstanceCount(pendingInstances);
-
-        log.debug("Load Balancer members of domain: " +
-            lbDomain +
-            " and sub domain: " +
-            lbSubDomain +
-            " running instances (including this): " +
-            runningInstances +
-            " - pending instances: "
-            +
-            pendingInstances);
-
-    }
-
-    @Override
-    public void destroy() {
-        appDomainContexts.clear();
-        log.debug("Cleared AppDomainContext Map.");
-    }
-
-    /**
-     * This is method that gets called periodically when the task runs.
-     * <p/>
-     * The exact sequence of execution is shown in this method.
-     */
-    @Override
-    public void execute() {
-
-        appDomainContexts =
-            AutoscaleUtil.getAppDomainContexts(
-                AutoscalerTaskDSHolder.getInstance().getConfigCtxt(),
-                loadBalancerConfig);
-
-        if (isTaskRunning) {
-            log.debug("Task is already running!");
-            return;
-        }
-        try {
-            isTaskRunning = true;
-            setIsPrimaryLB();
-            if (!isPrimaryLoadBalancer) {
-                log.debug("This is not the primary load balancer, hence will not " +
-                        "perform any sanity check.");
-                return;
-            }
-            sanityCheck();
-            autoscale();
-        } finally {
-            // if there are any changes in the request length
-            if (Boolean.parseBoolean(System.getProperty(AutoscaleConstants.IS_TOUCHED))) {
-                // primary LB will send out replication message to all load balancers
-                sendReplicationMessage();
-            }
-            isTaskRunning = false;
-            log.debug("Task finished a cycle.");
-        }
-    }
-
-    @Override
-    public void init(final SynapseEnvironment synEnv) {
-
-        String msg = "Autoscaler Service initialization failed and cannot proceed.";
-
-        loadBalancerConfig = AutoscalerTaskDSHolder.getInstance().getWholeLoadBalancerConfig();
-
-        if (loadBalancerConfig == null) {
-            log.error(msg + "Reason: Load balancer configuration is null.");
-            throw new RuntimeException(msg);
-        }
-
-        ConfigurationContext configCtx = ((Axis2SynapseEnvironment) synEnv).getAxis2ConfigurationContext();
-        AutoscalerTaskDSHolder.getInstance().setConfigCtxt(configCtx);
-
-        appDomainContexts = AutoscaleUtil.getAppDomainContexts(configCtx, loadBalancerConfig);
-        
-        AutoscalerTaskDSHolder.getInstance().setAgent(configCtx.getAxisConfiguration().getClusteringAgent());
-
-        boolean useEmbeddedAutoscaler = loadBalancerConfig.getLoadBalancerConfig().useEmbeddedAutoscaler();
-        
-        try {
-
-            if(useEmbeddedAutoscaler){
-                autoscalerService = new CloudControllerOsgiClient();
-            } else{
-                autoscalerService = new CloudControllerStubClient();
-            }
-            // let's initialize the auto-scaler service
-            autoscalerService.init();
-
-        }catch (Exception e) {
-            log.error(msg, e);
-            throw new RuntimeException(msg, e);
-        }
-
-        if (log.isDebugEnabled()) {
-
-            log.debug("Autoscaler task is initialized.");
-
-        }
-    }
-
-    /**
-     * Sanity check to see whether the number of LBs is the number specified in the LB config
-     */
-    private void loadBalancerSanityCheck() {
-
-        log.debug("Load balancer sanity check has started.");
-
-        // get current LB instance count
-        int currentLBInstances = lbContext.getInstances();
-
-        LoadBalancerConfiguration.LBConfiguration lbConfig =
-            loadBalancerConfig.getLoadBalancerConfig();
-
-        // get minimum requirement of LB instances
-        int requiredInstances = lbConfig.getInstances();
-
-        if (currentLBInstances < requiredInstances) {
-            log.debug("LB Sanity check failed. Running/Pending LB instances: " + currentLBInstances +
-                ". Required LB instances: " + requiredInstances);
-            int diff = requiredInstances - currentLBInstances;
-
-            // gets the domain of the LB
-            String lbDomain =
-                AutoscalerTaskDSHolder
-                    .getInstance()
-                    .getAgent()
-                    .getParameter("domain")
-                    .getValue()
-                    .toString();
-            String lbSubDomain =
-                AutoscalerTaskDSHolder
-                    .getInstance()
-                    .getAgent()
-                    .getParameter("subDomain")
-                    .getValue()
-                    .toString();
-
-            // Launch diff number of LB instances
-            log.debug("Launching " + diff + " LB instances.");
-
-            runInstances(lbContext, lbDomain, lbSubDomain, diff);
-        }
-    }
-
-    private int runInstances(final LoadBalancerContext context, final String domain,
-        final String subDomain,
-        int diff) {
-
-        int successfullyStartedInstanceCount = diff;
-
-        while (diff > 0) {
-            // call autoscaler service and ask to spawn an instance
-            // and increment pending instance count only if autoscaler service returns
-            // true.
-            try {
-                String ip = autoscalerService.startInstance(domain, subDomain);
-
-                if (ip == null || ip.isEmpty()) {
-                    log.debug("Instance start up failed. domain: " +
-                        domain +
-                            ", sub domain: " +
-                            subDomain);
-                    successfullyStartedInstanceCount--;
-                } else {
-                    log.debug("An instance of domain: " +
-                        domain +
-                            " and sub domain: " +
-                            subDomain +
-                            " is started up.");
-                    if (context != null) {
-                        context.incrementPendingInstances(1);
-                    }
-                }
-            } catch (Exception e) {
-                log.error("Failed to start an instance of sub domain: " + subDomain +
-                    " of domain : " + domain + ".\n", e);
-                successfullyStartedInstanceCount--;
-            }
-
-            diff--;
-        }
-
-        return successfullyStartedInstanceCount;
-    }
-
-    /**
-     * This method makes sure that the minimum configuration of the clusters in the system is
-     * maintained
-     */
-    private void sanityCheck() {
-
-        if (!isPrimaryLoadBalancer) {
-            log.debug("This is not the primary load balancer, hence will not " +
-                "perform any sanity check.");
-            return;
-        }
-
-        log.debug("This is the primary load balancer, starting to perform sanity checks.");
-
-        computeRunningAndPendingInstances();
-        loadBalancerSanityCheck();
-        appNodesSanityCheck();
-    }
-
-    /**
-     * Replicate information needed to take autoscaling decision for other ELBs
-     * in the cluster.
-     */
-    private void sendReplicationMessage() {
-
-        ClusteringAgent clusteringAgent = AutoscalerTaskDSHolder.getInstance().getAgent();
-        if (clusteringAgent != null) {
-            RequestTokenReplicationCommand msg = new RequestTokenReplicationCommand();
-            msg.setAppDomainContexts(appDomainContexts);
-            try {
-                clusteringAgent.sendMessage(msg, true);
-                System.setProperty(AutoscaleConstants.IS_TOUCHED, "false");
-                log.debug("Request token replication messages sent out successfully!!");
-
-            } catch (ClusteringFault e) {
-                log.error("Failed to send the request token replication message.", e);
-            }
-        }
-        else {
-            log
-                .debug("Clustering Agent is null. Hence, unable to send out the replication message.");
-        }
-    }
-
-    /**
-     * This method will check whether this LB is the primary LB or not and set
-     * attribute accordingly.
-     */
-    private void setIsPrimaryLB() {
-
-        ClusteringAgent clusteringAgent = AutoscalerTaskDSHolder.getInstance().getAgent();
-        if (clusteringAgent != null) {
-
-            isPrimaryLoadBalancer = clusteringAgent.isCoordinator();
-
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/TaskSchedulingManager.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/TaskSchedulingManager.java b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/TaskSchedulingManager.java
deleted file mode 100644
index b97deb4..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/task/TaskSchedulingManager.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.stratos.mediator.autoscale.lbautoscale.task;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.task.TaskDescription;
-import org.apache.synapse.task.TaskDescriptionRepository;
-import org.apache.synapse.task.TaskScheduler;
-import org.wso2.carbon.task.TaskManager;
-
-import java.util.Iterator;
-import java.util.Map;
-
-public class TaskSchedulingManager {
-
-    private static final Log log = LogFactory.getLog(TaskSchedulingManager.class);
-
-    private static TaskSchedulingManager thisInstance = new TaskSchedulingManager();
-
-    public static TaskSchedulingManager getInstance() {
-        return thisInstance;
-    }
-
-    /**
-     * This method adds a particular Task to the Task Description Repository and schedule it
-     * for the execution.
-     *
-     * @param taskDescription      TaskDescription
-     * @param resources            Map containing require meta data for the task execution.
-     * @param configurationContext ConfigurationContext
-     */
-    public void scheduleTask(TaskDescription taskDescription, Map<String, Object> resources,
-                             ConfigurationContext configurationContext) {
-        if (log.isDebugEnabled()) {
-            log.debug("Adding a Task Description to the Task Description Repository");
-        }
-
-        getTaskDescriptionRepository(configurationContext).addTaskDescription(taskDescription);
-        getTaskScheduler(configurationContext).scheduleTask(
-                taskDescription, resources, AutoscalingJob.class);
-
-        if (log.isDebugEnabled()) {
-            log.debug("Task Description " + taskDescription.getName() +
-                    " added to the Task Description Repository");
-        }
-    }
-
-    /**
-     * Returns a Task Description with a given name from the Task Description Repository.
-     *
-     * @param taskName             taskName
-     * @param configurationContext ConfigurationContext
-     * @return TaskDescription
-     */
-    public TaskDescription getTaskDescription(
-            String taskName, ConfigurationContext configurationContext) {
-        if (log.isDebugEnabled()) {
-            log.debug("Returning a Start up : " + taskName + " from the configuration");
-        }
-
-        TaskDescription taskDescription = getTaskDescriptionRepository(
-                configurationContext).getTaskDescription(taskName);
-
-        if (taskDescription != null) {
-            if (log.isDebugEnabled()) {
-                log.debug("Returning a Task Description : " + taskDescription);
-
-            }
-            return taskDescription;
-        } else {
-            if (log.isDebugEnabled()) {
-                log.debug("No Task Description can be found with name :" + taskName);
-            }
-            return null;
-        }
-    }
-
-    /**
-     * This method search for a given Task which has already been added to the Task Description
-     * Repository and removes it.
-     *
-     * @param taskDescription             TaskDescription
-     * @param configurationContext ConfigurationContext
-     */
-    public void deleteTaskDescription(TaskDescription taskDescription, ConfigurationContext configurationContext) {
-        String taskName = null;
-        if (taskDescription != null) {
-            taskName = taskDescription.getName();
-            getTaskDescriptionRepository(configurationContext).removeTaskDescription(taskName);
-            getTaskScheduler(configurationContext).deleteTask(taskName, taskDescription.getGroup());
-
-            if (log.isDebugEnabled()) {
-                log.debug("Deleted TaskDescription : " + taskName + " from the configuration");
-            }
-        } else {
-            log.warn("Unable to delete the Task " + taskName
-                    + ",as it doesn't exist in the Repository");
-        }
-    }
-
-    /**
-     * Retrieves all Task Descriptions added to the Task Description Repository at a given instance.
-     *
-     * @param configurationContext ConfigurationContext
-     * @return TaskDescription Iterator
-     */
-    public Iterator<TaskDescription> getAllTaskDescriptions(
-            ConfigurationContext configurationContext) {
-        if (log.isDebugEnabled()) {
-            log.debug("Returning a All TaskDescription from the configuration");
-        }
-        return getTaskDescriptionRepository(configurationContext).getAllTaskDescriptions();
-    }
-
-    /**
-     * This method checks whether a particular Task has already been added to the Task Description
-     * Repository associated with the context of this execution and returns a flag indicating the
-     * existence.
-     *
-     * @param taskName             Name of the task to be searched
-     * @param configurationContext ConfigurationContext
-     * @return a boolean depending on the existence of a task
-     */
-    public boolean isContains(String taskName, ConfigurationContext configurationContext) {
-        return !getTaskDescriptionRepository(configurationContext).isUnique(taskName);
-    }
-
-    /**
-     * Returns the Carbon TaskDescriptionRepository instance that carries details of the added
-     * tasks for execution.
-     *
-     * @param configurationContext ConfigurationContext
-     * @return TaskDescriptionRepository
-     */
-    private synchronized TaskDescriptionRepository getTaskDescriptionRepository(
-            ConfigurationContext configurationContext) {
-        if (log.isDebugEnabled()) {
-            log.debug("Retrieving access to Task Description Repository");
-        }
-        return (TaskDescriptionRepository) configurationContext.getProperty(
-                TaskManager.CARBON_TASK_REPOSITORY);
-    }
-
-    /**
-     * Returns the carbon TaskScheduler associated with the context of scheduling the task execution
-     *
-     * @param configurationContext ConfigurationContext
-     * @return TaskScheduler
-     */
-    private synchronized TaskScheduler getTaskScheduler(ConfigurationContext configurationContext) {
-        if (log.isDebugEnabled()) {
-            log.debug("Retrieving access to Task Scheduler");
-        }
-        return (TaskScheduler) configurationContext.getProperty(
-                TaskManager.CARBON_TASK_SCHEDULER);
-    }
-
-    public void shutDown(ConfigurationContext configurationContext) {
-        if (log.isDebugEnabled()) {
-            log.debug("Starting to shut down tasks");
-        }
-
-//        getTaskDescriptionRepository(configurationContext).addTaskDescription(taskDescription);
-        getTaskScheduler(configurationContext).shutDown();
-
-        if (log.isDebugEnabled()) {
-            log.debug("All tasks shut down");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleConstants.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleConstants.java b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleConstants.java
deleted file mode 100644
index ed549c3..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleConstants.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.stratos.mediator.autoscale.lbautoscale.util;
-
-/**
- * Constants
- */
-public final class AutoscaleConstants {
-    public static final String REQUEST_ID = "request.id";
-    public static final String APP_DOMAIN_CONTEXTS = "autoscale.app.domain.contexts";
-    public static final String TARGET_DOMAIN = "autoscale.target.domain";
-    public static final String TARGET_SUB_DOMAIN = "autoscale.target.sub.domain";
-    public static final String LOAD_BALANCER_CONFIG = "loadbalancer.conf";
-    
-    /**
-     * we use this to track the changes happen to request token list lengths.
-     */
-    public static final String IS_TOUCHED = "is_touched";
-    
-    /**
-     * We'll check whether a server is started up in every this much of time.
-     * (in milliseconds)
-     */
-    public static final int SERVER_START_UP_CHECK_TIME = 30000;
-    
-    /**
-     * We'll check whether an instance is left the cluster in every this much of time.
-     * (in milliseconds)
-     */
-    public static final int INSTANCE_REMOVAL_CHECK_TIME = 5000;
-
-    /**
-     * Name of the EC2 instance tag which if set on an instance, the autoscaler will not
-     * terminate such instance
-     */
-    public static final String AVOID_TERMINATION = "avoidTermination";
-
-    public static enum InstanceState {
-        RUNNING("running"), PENDING("pending"), TERMINATED("terminated"), SHUTTING_DOWN("shutting-down");
-
-        private String state;
-
-        InstanceState(String state) {
-            this.state = state;
-        }
-
-        public String getState() {
-            return state;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleUtil.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleUtil.java b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleUtil.java
deleted file mode 100644
index 747d3a2..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscaleUtil.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.stratos.mediator.autoscale.lbautoscale.util;
-
-import org.apache.axiom.om.util.Base64;
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.http.protocol.HTTP;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.mediator.autoscale.lbautoscale.clients.CloudControllerClient;
-import org.apache.stratos.mediator.autoscale.lbautoscale.context.AppDomainContext;
-import org.apache.stratos.mediator.autoscale.lbautoscale.context.LoadBalancerContext;
-import org.apache.stratos.mediator.autoscale.lbautoscale.state.check.PendingInstancesStateChecker;
-import org.apache.synapse.MessageContext;
-import org.apache.synapse.SynapseException;
-import org.apache.synapse.core.axis2.Axis2MessageContext;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Utility methods for Autoscale mediator
- */
-public final class AutoscaleUtil {
-
-    private static final Log log = LogFactory.getLog(AutoscaleUtil.class);
-
-    private AutoscaleUtil() {
-    }
-
-    /**
-     * handles the exception
-     *
-     * @param msg exception message
-     */
-    public static void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
-    /**
-     * handles the exception
-     *
-     * @param msg exception message
-     * @param e   exception
-     */
-    public static void handleException(String msg, Exception e) {
-        log.error(msg, e);
-        throw new SynapseException(msg, e);
-    }
-
-    /**
-     * Returns the contents of the file in a byte array
-     *
-     * @param file - Input File
-     * @return Bytes from the file
-     * @throws java.io.IOException, if retrieving the file contents failed.
-     */
-    public static byte[] getBytesFromFile(File file) throws IOException {
-        if (!file.exists()) {
-            log.error("Payload file " + file.getAbsolutePath() + " does not exist");
-            return null;
-        }
-        InputStream is = new FileInputStream(file);
-        byte[] bytes;
-
-        try {
-            // Get the size of the file
-            long length = file.length();
-
-            // You cannot create an array using a long type.
-            // It needs to be an int type.
-            // Before converting to an int type, check
-            // to ensure that file is not larger than Integer.MAX_VALUE.
-            if (length > Integer.MAX_VALUE) {
-                if (log.isDebugEnabled()) {
-                    log.debug("File is too large");
-                }
-            }
-
-            // Create the byte array to hold the data
-            bytes = new byte[(int) length];
-
-            // Read in the bytes
-            int offset = 0;
-            int numRead;
-            while (offset < bytes.length
-                   && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
-                offset += numRead;
-            }
-
-            // Ensure all the bytes have been read in
-            if (offset < bytes.length) {
-                throw new IOException("Could not completely read file " + file.getName());
-            }
-        } finally {
-            // Close the input stream and return bytes
-            is.close();
-        }
-
-        return bytes;
-    }
-
-    /**
-     * Replaces the variables
-     *
-     * @param text input string
-     * @return output String
-     */
-    public static String replaceVariables(String text) {
-        int indexOfStartingChars;
-        int indexOfClosingBrace;
-
-        // The following condition deals with properties.
-        // Properties are specified as ${system.property},
-        // and are assumed to be System properties
-        if ((indexOfStartingChars = text.indexOf("${")) != -1 &&
-            (indexOfClosingBrace = text.indexOf("}")) != -1) { // Is a property used?
-            String var = text.substring(indexOfStartingChars + 2,
-                                        indexOfClosingBrace);
-
-            String propValue = System.getProperty(var);
-            if (propValue == null) {
-                propValue = System.getenv(var);
-            }
-            if (propValue != null) {
-                text = text.substring(0, indexOfStartingChars) + propValue +
-                       text.substring(indexOfClosingBrace + 1);
-            }
-        }
-        return text;
-    }
-
-/*    public static InstanceManager createEC2InstanceManager(String accessKey,
-                                                              String secretKey,
-                                                              String instanceMgtEPR) {
-        AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
-        AmazonEC2Client ec2Client = new AmazonEC2Client(awsCredentials);
-        ec2Client.setEndpoint(instanceMgtEPR);
-        return new InstanceManager(ec2Client);
-    }*/
-
-    public static String getUserData(String payloadFileName) {
-        String userData = null;
-        try {
-            File file = new File(payloadFileName);
-            if (!file.exists()) {
-                handleException("Payload file " + payloadFileName + " does not exist");
-            }
-            if (!file.canRead()) {
-                handleException("Payload file " + payloadFileName + " does cannot be read");
-            }
-            byte[] bytes = AutoscaleUtil.getBytesFromFile(file);
-            if (bytes != null) {
-//                /BASE64.e encoder = new BASE64Encoder();
-                userData = Base64.encode(bytes);
-            }
-        } catch (IOException e) {
-            AutoscaleUtil.handleException("Cannot read data from payload file " + payloadFileName,
-                                          e);
-        }
-        return userData;
-    }
-
-    /*public static boolean areEqual(List<GroupIdentifier> securityGroups1, String[] sourceGroups2) {
-        for (String sourceGroup : sourceGroups2) {
-            boolean isSourceGroupFound = false;
-            for (GroupIdentifier securityGroup : securityGroups1) {
-                if (securityGroup.getGroupName().equals(sourceGroup)) {
-                    isSourceGroupFound = true;
-                }
-            }
-            if (!isSourceGroupFound) {
-                return false;
-            }
-        }
-        return true;
-    } */
-
-    /**
-     * TODO These methods should use to common place since these are using endpoints and mediators
-     */
-    public static int getTenantId(String url) {
-        String address = url;
-        String servicesPrefix = "/t/";
-        if (address != null && address.contains(servicesPrefix)) {
-            int domainNameStartIndex =
-                    address.indexOf(servicesPrefix) + servicesPrefix.length();
-            int domainNameEndIndex = address.indexOf('/', domainNameStartIndex);
-            String domainName = address.substring(domainNameStartIndex,
-                    domainNameEndIndex == -1 ? address.length() : domainNameEndIndex);
-            // return tenant id if domain name is not null
-            if (domainName != null) {
-                try {
-                    return AutoscalerTaskDSHolder.getInstance().getRealmService().getTenantManager().getTenantId(domainName);
-                } catch (org.wso2.carbon.user.api.UserStoreException e) {
-                    log.error("An error occurred while obtaining the tenant id.", e);
-                }
-            }
-        }
-        // return 0 if the domain name is null
-        return 0;
-    }
-
-    /**
-     * TODO These methods should use to common place since these are using endpoints and mediators
-     */
-    @SuppressWarnings("unchecked")
-    public static String getTargetHost(MessageContext synCtx) {
-        org.apache.axis2.context.MessageContext axis2MessageContext =
-                ((Axis2MessageContext) synCtx).getAxis2MessageContext();
-        Map<String, String> headers =
-                (Map<String, String>) axis2MessageContext.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
-        String address = headers.get(HTTP.TARGET_HOST);
-        if (address.contains(":")) {
-            address = address.substring(0, address.indexOf(":"));
-        }
-        return address;
-    }
-
-    @SuppressWarnings("unchecked")
-    public static Map<String, Map<String, ?>> getAppDomainContexts(ConfigurationContext configCtx,
- LoadBalancerConfiguration lbConfig) {
-        Map<String, Map<String, ?>> oldAppDomainContexts =
-        	(Map<String, Map<String, ?>>) configCtx.getPropertyNonReplicable(AutoscaleConstants.APP_DOMAIN_CONTEXTS);
-        Map<String, Map<String, ?>> newAppDomainContexts = new HashMap<String, Map<String, ?>>();
-        
-            ClusteringAgent clusteringAgent = configCtx.getAxisConfiguration().getClusteringAgent();
-
-            for (String domain : lbConfig.getServiceDomains()) {
-
-                for (String subDomain : lbConfig.getServiceSubDomains(domain)) {
-                    if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
-                        throw new SynapseException("Axis2 clustering GroupManagementAgent for domain: " + domain +
-                                                   ", sub-domain: " + subDomain +
-                                                   " has not been defined");
-                    }
-
-                    if(oldAppDomainContexts == null || oldAppDomainContexts.get(domain) == null || 
-                    		(oldAppDomainContexts.get(domain) != null && oldAppDomainContexts.get(domain).get(subDomain) == null)){
-                    	
-                    	AppDomainContext appCtxt = new AppDomainContext(lbConfig.getServiceConfig(domain,
-                                subDomain));
-
-                    	addAppDomainContext(newAppDomainContexts, domain, subDomain, appCtxt);
-                    	
-                    } else {
-                        addAppDomainContext(newAppDomainContexts, domain, subDomain, (AppDomainContext) oldAppDomainContexts.get(domain).get(subDomain));
-                    }
-                    
-                }
-
-            }
-//        }
-        configCtx.setNonReplicableProperty(AutoscaleConstants.APP_DOMAIN_CONTEXTS,
-                                           newAppDomainContexts);
-
-        return newAppDomainContexts;
-    }
-    
-    
-    private static void addAppDomainContext(Map<String, Map<String, ?>> appDomainContexts,
-                                     String domain, String subDomain, AppDomainContext appCtxt) {
-
-        Map<String, AppDomainContext> map ;
-        
-        if(appDomainContexts.containsKey(domain)){
-            map = (Map<String, AppDomainContext>) appDomainContexts.get(domain);
-        }
-        else{
-            map = new HashMap<String, AppDomainContext>();
-        }
-        // put this appDomainContext
-        map.put(subDomain, appCtxt);
-        
-        // update the parent map
-        appDomainContexts.put(domain, map);
-        
-    }
-    
-    public static String domainSubDomainString(String domain, String subDomain){
-        return "Domain: "+domain+" - Sub Domain: "+subDomain;
-    }
-    
-    public static int runInstances(final CloudControllerClient client, final LoadBalancerContext context, final String domain,
-        final String subDomain, int diff) {
-
-        int successfullyStartedInstanceCount = diff;
-
-        if(context == null){
-            // can't help
-            return 0;
-        }
-        
-        while (diff > 0) {
-            // call autoscaler service and ask to spawn an instance
-            // and increment pending instance count only if autoscaler service returns
-            // true.
-            try {
-                String ip = client.startInstance(domain, subDomain);
-
-                if (ip == null || ip.isEmpty()) {
-                    log.debug("Instance start up failed for " + domainSubDomainString(domain, subDomain));
-                    successfullyStartedInstanceCount--;
-                    
-                } else {
-                    log.debug("An instance of " + domainSubDomainString(domain, subDomain) +
-                        " is started up.");
-                    if (context != null) {
-                        context.incrementPendingInstances(1);
-                    }
-                }
-            } catch (Exception e) {
-                log.error("Failed to start an instance of " + domainSubDomainString(domain, subDomain) + ".\n", e);
-                successfullyStartedInstanceCount--;
-            }
-
-            diff--;
-        }
-
-        if (successfullyStartedInstanceCount > 0) {
-            
-            Thread stateChecker =
-                new Thread(new PendingInstancesStateChecker(
-                    context,
-                    domain,
-                    subDomain,
-                    successfullyStartedInstanceCount,
-                    context.getRunningInstanceCount(),
-                    client));
-            stateChecker.start();
-        }
-
-        return successfullyStartedInstanceCount;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscalerTaskDSHolder.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscalerTaskDSHolder.java b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscalerTaskDSHolder.java
deleted file mode 100644
index 7e27b83..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/java/org/apache/stratos/mediator/autoscale/lbautoscale/util/AutoscalerTaskDSHolder.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.stratos.mediator.autoscale.lbautoscale.util;
-
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.LBConfiguration;
-import org.apache.stratos.lb.common.service.LoadBalancerConfigurationService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.stratos.cloud.controller.interfaces.CloudControllerService;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-/**
- * Singleton class to hold Agent Management Service
- */
-public class AutoscalerTaskDSHolder {
-    
-    private ConfigurationContextService configurationContextService;
-    private LoadBalancerConfiguration wholeLbConfig;
-    private CloudControllerService cloudControllerService;  
-
-    private RealmService realmService;
-    private ClusteringAgent agent;
-    private ConfigurationContext configCtxt;
-    private UserRegistry configRegistry;
-    private UserRegistry governanceRegistry;
-
-    private static AutoscalerTaskDSHolder instance = new AutoscalerTaskDSHolder();
-
-    private AutoscalerTaskDSHolder(){
-
-    }
-
-    public static AutoscalerTaskDSHolder getInstance(){
-        return instance;
-    }
-
-    public ConfigurationContextService getConfigurationContextServiceService(){
-        return this.configurationContextService;
-    }
-
-    public void setConfigurationContextService(ConfigurationContextService cCtxService){
-        this.configurationContextService = cCtxService;
-    }
-    
-    public LoadBalancerConfiguration getWholeLoadBalancerConfig() {
-        return wholeLbConfig;
-    }
-    
-    public LBConfiguration getLoadBalancerConfig() {
-        return wholeLbConfig.getLoadBalancerConfig();
-    }
-
-    public ClusteringAgent getAgent() {
-        return agent;
-    }
-
-    public void setAgent(ClusteringAgent agent) {
-        this.agent = agent;
-    }
-
-
-    public void setRealmService(RealmService realmService) {
-        this.realmService = realmService;
-    }
-
-    public RealmService getRealmService() {
-        return realmService;
-    }
-    
-    public void setLbConfigService(LoadBalancerConfigurationService lbConfigSer) {
-        if (lbConfigSer != null) {
-            this.wholeLbConfig = (LoadBalancerConfiguration) lbConfigSer.getLoadBalancerConfig();
-        } else {
-            this.wholeLbConfig = null;
-        }
-    }
-
-	public void setConfigCtxt(ConfigurationContext configCtxt) {
-		this.configCtxt = configCtxt;
-	}
-
-	public ConfigurationContext getConfigCtxt() {
-		return configCtxt;
-	}
-
-	public void setCloudControllerService(CloudControllerService cc) {
-        this.cloudControllerService = cc;
-    }
-	
-	public CloudControllerService getCloudControllerService() {
-        return cloudControllerService;
-    }
-
-	public UserRegistry getConfigRegistry() {
-        return configRegistry;
-    }
-
-    public void setConfigRegistry(UserRegistry configRegistry) {
-        this.configRegistry = configRegistry;
-    }
-    
-    public UserRegistry getGovernanceRegistry() {
-        return governanceRegistry;
-    }
-
-    public void setGovernanceRegistry(UserRegistry governanceRegistry) {
-        this.governanceRegistry = governanceRegistry;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorFactory
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorFactory b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorFactory
deleted file mode 100644
index 399d502..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorFactory
+++ /dev/null
@@ -1,2 +0,0 @@
-org.wso2.carbon.mediator.autoscale.ec2autoscale.mediators.AutoscaleInMediatorFactory
-org.wso2.carbon.mediator.autoscale.ec2autoscale.mediators.AutoscaleOutMediatorFactory

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorSerializer
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorSerializer b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorSerializer
deleted file mode 100644
index 05fce78..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/META-INF/services/org.apache.synapse.config.xml.MediatorSerializer
+++ /dev/null
@@ -1,2 +0,0 @@
-org.wso2.carbon.mediator.autoscale.ec2autoscale.mediators.AutoscaleInMediatorSerializer
-org.wso2.carbon.mediator.autoscale.ec2autoscale.mediators.AutoscaleOutMediatorSerializer
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-load-average.xml
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-load-average.xml b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-load-average.xml
deleted file mode 100644
index f8ecf6f..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-load-average.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~  Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved.
-  ~
-  ~  WSO2 Inc. licenses this file to you under the Apache License,
-  ~  Version 2.0 (the "License"); you may not use this file except
-  ~  in compliance with the License.
-  ~  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~  Unless required by applicable law or agreed to in writing,
-  ~  software distributed under the License is distributed on an
-  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  KIND, either express or implied.  See the License for the
-  ~  specific language governing permissions and limitations
-  ~  under the License.
-  -->
-
-<!-- The default synapse configuration shipped with the WSO2 Load Balancer
-     This handles the load balancing and the autoscaling of the stratos services
- -->
-
-<definitions xmlns="http://ws.apache.org/ns/synapse">
-
-    <!-- You can add any flat sequences, endpoints, etc.. to this synapse-messages-in-flight.xml file if you do
-         *not* want to have the defaults given below, specific to WSO2 LB and auto-scaler
-    -->
-
-
-    <!-- Given below is the auto-scale mediator specific task. Uncomment it, if you want to
-         auto-scale your applications.
-    -->
-
-    <task class="org.wso2.carbon.mediator.autoscale2.LoadAverageBasedEC2LoadAnalyzerTask"
-          name="LoadAnalyzer">
-
-
-        <!--
-            The private key for the ec2
-        -->
-        <property name="ec2PrivateKey" value="/mnt/payload/pk.pem"/>
-
-        <!--
-            The certificate for the ec2
-        -->
-        <property name="ec2Cert" value="/mnt/payload/cert.pem"/>
-
-        <!--
-            The amazon instance type for the load balanced service instances.
-            Recommended and the default is m1.large.
-        -->
-        <property name="instanceType" value="m1.large"/>
-
-        <!--
-            The amazon instance type for the instances of the load balancer itself.
-            Default is m1.large. Can be changed to m1.small too.
-        -->
-        <property name="loadBalancerInstanceType" value="m1.large"/>
-
-        <!--
-            The group of the service being load balanced.
-        -->
-        <property name="applicationGroup" value="as-2011-02-23,cloud-mysql,default"/>
-
-        <!--
-            The group of the load balancer.
-        -->
-        <property name="loadBalancerGroup" value="stratos-appserver-lb,cloud-mysql,default"/>
-
-        <!--
-            The Amazon availability zone for the instances. 1-c is given as the default
-        -->
-        <property name="availabilityZone" value="us-east-1c"/>
-
-        <!--
-            Additional information for the amazon instances
-        -->
-        <property name="instanceAdditionalInfo" value="EC2 autoscale instance"/>
-
-        <!--
-            The key pair
-        -->
-        <property name="key" value="stratos-1.0.0-keypair"/>
-
-        <!--
-            The service payload file which should be loaded to the bucket
-        -->
-        <property name="applicationPayload" value="resources/cluster_node.zip"/>
-
-        <!--
-            The load balancer payload file which should be loaded to the bucket
-        -->
-        <property name="loadBalancerPayload" value="/mnt/payload.zip"/>
-
-        <!--
-            The elasticIP property can be overriden by the ELASTIC_IP environment var,
-             which is set in the payload
-        -->
-        <property name="elasticIP" value="${ELASTIC_IP}"/>
-
-        <!--
-            The minimum and maximum limits of the load balanced service instances
-        -->
-        <property name="minAppInstances" value="1"/>
-        <property name="maxAppInstances" value="5"/>
-
-        <!--
-            The minimum and maximum limits of the load balancer instances
-        -->
-        <property name="minLoadBalancerInstances" value="1"/>
-
-        <property name="roundsToAverage" value="10"/>
-
-        <!--
-            The instances spawned at once, per scaling up decision.
-	    Default and the recommended value is 1
-        -->
-        <property name="instancesPerScaleUp" value="1"/>
-
-        <!--
-            The low and high limits of the load average
-        -->
-        <property name="loadAverageLowerLimit" value="2"/>
-        <property name="loadAverageHigherLimit" value="5"/>
-
-        <!--
-            The Load Balanced Service Ports
-        -->
-        <property name="serviceHttpPort" value="9763"/>
-        <property name="serviceHttpsPort" value="9443"/>
-
-        <!--
-            The interval to trigger the task in seconds
-        -->
-        <trigger interval="5"/>
-    </task>
-</definitions>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-messages-in-flight.xml
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-messages-in-flight.xml b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-messages-in-flight.xml
deleted file mode 100644
index 3e66066..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-messages-in-flight.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~  Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved.
-  ~
-  ~  WSO2 Inc. licenses this file to you under the Apache License,
-  ~  Version 2.0 (the "License"); you may not use this file except
-  ~  in compliance with the License.
-  ~  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~  Unless required by applicable law or agreed to in writing,
-  ~  software distributed under the License is distributed on an
-  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  KIND, either express or implied.  See the License for the
-  ~  specific language governing permissions and limitations
-  ~  under the License.
-  -->
-
-<!-- The default synapse configuration shipped with the WSO2 Load Balancer
-     This handles the load balancing and the autoscaling of the stratos services
- -->
-
-<definitions xmlns="http://ws.apache.org/ns/synapse">
-
-    <!-- You can add any flat sequences, endpoints, etc.. to this synapse-messages-in-flight.xml file if you do
-         *not* want to have the defaults given below, specific to WSO2 LB and auto-scaler
-    -->
-
-
-    <!-- Given below is the auto-scale mediator specific task. Uncomment it, if you want to
-         auto-scale your applications.
-    -->
-
-    <task class="org.wso2.carbon.mediator.autoscale2.MessagesInFlightBasedEC2LoadAnalyzerTask"
-          name="LoadAnalyzer">
-
-
-        <!--
-            The private key for the ec2
-        -->
-        <property name="ec2PrivateKey" value="/mnt/payload/pk.pem"/>
-
-        <!--
-            The certificate for the ec2
-        -->
-        <property name="ec2Cert" value="/mnt/payload/cert.pem"/>
-
-        <!--
-            The amazon instance type for the load balanced service instances.
-            Recommended and the default is m1.large.
-        -->
-        <property name="instanceType" value="m1.large"/>
-
-        <!--
-            The amazon instance type for the instances of the load balancer itself.
-            Default is m1.large. Can be changed to m1.small too.
-        -->
-        <property name="loadBalancerInstanceType" value="m1.large"/>
-
-        <!--
-            The group of the service being load balanced.
-        -->
-        <property name="applicationGroup" value="as-2011-02-23,cloud-mysql,default"/>
-
-        <!--
-            The group of the load balancer.
-        -->
-        <property name="loadBalancerGroup" value="stratos-appserver-lb,cloud-mysql,default"/>
-
-        <!--
-            The Amazon availability zone for the instances. 1-c is given as the default
-        -->
-        <property name="availabilityZone" value="us-east-1c"/>
-
-        <!--
-            Additional information for the amazon instances
-        -->
-        <property name="instanceAdditionalInfo" value="EC2 autoscale instance"/>
-
-        <!--
-            The key pair
-        -->
-        <property name="key" value="stratos-1.0.0-keypair"/>
-
-        <!--
-            The service payload file which should be loaded to the bucket
-        -->
-        <property name="applicationPayload" value="resources/cluster_node.zip"/>
-
-        <!--
-            The load balancer payload file which should be loaded to the bucket
-        -->
-        <property name="loadBalancerPayload" value="/mnt/payload.zip"/>
-
-        <!--
-            The elasticIP property can be overriden by the ELASTIC_IP environment var,
-             which is set in the payload
-        -->
-        <property name="elasticIP" value="${ELASTIC_IP}"/>
-
-        <!--
-            The time in milliseconds which the message takes to expire
-        -->
-        <property name="messageExpiryTime" value="60000"/>
-
-        <!--
-            The minimum and maximum limits of the load balanced service instances
-        -->
-        <property name="minAppInstances" value="1"/>
-        <property name="maxAppInstances" value="5"/>
-
-        <!--
-            The number of load balancer instances
-        -->
-        <property name="loadBalancerInstances" value="1"/>
-
-        <!--
-            The given queue length per node, for the calculation in scaling up
-        -->
-        <property name="queueLengthPerNode" value="400"/>
-        <property name="roundsToAverage" value="10"/>
-
-        <!--
-            The instances spawned at once, per scaling up decision.
-	    Default and the recommended value is 1
-        -->
-        <property name="instancesPerScaleUp" value="1"/>
-
-        <!--
-            The interval to trigger the task in seconds
-        -->
-        <trigger interval="5"/>
-    </task>
-</definitions>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-service-messages-in-flight.xml
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-service-messages-in-flight.xml b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-service-messages-in-flight.xml
deleted file mode 100644
index 7332d38..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/main/resources/synapse-service-messages-in-flight.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~  Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved.
-  ~
-  ~  WSO2 Inc. licenses this file to you under the Apache License,
-  ~  Version 2.0 (the "License"); you may not use this file except
-  ~  in compliance with the License.
-  ~  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~  Unless required by applicable law or agreed to in writing,
-  ~  software distributed under the License is distributed on an
-  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  KIND, either express or implied.  See the License for the
-  ~  specific language governing permissions and limitations
-  ~  under the License.
-  -->
-
-<!-- The default synapse configuration shipped with the WSO2 Load Balancer
-     This handles the load balancing and the autoscaling of the stratos services
- -->
-
-<definitions xmlns="http://ws.apache.org/ns/synapse">
-
-    <!-- You can add any flat sequences, endpoints, etc.. to this synapse-messages-in-flight.xml file if you do
-         *not* want to have the defaults given below, specific to WSO2 LB and auto-scaler
-    -->
-
-
-    <!-- Given below is the auto-scale mediator specific task. Uncomment it, if you want to
-         auto-scale your applications.
-    -->
-    <task class="org.wso2.carbon.mediator.autoscale.lbautoscale.ServiceRequestsInFlightAutoscaler"
-          name="LoadAnalyzer">
-
-        <!--
-            The private key for ec2
-        -->
-        <property name="ec2PrivateKey" value="/mnt/payload/pk.pem"/>
-
-        <!--
-            The certificate for ec2
-        -->
-        <property name="ec2Cert" value="/mnt/payload/cert.pem"/>
-        <!--
-            The key pair
-        -->
-        <property name="sshKey" value="stratos-1.0.0-keypair"/>
-
-        <property name="loadBalancer">
-            <loadBalancer>
-                <property name="securityGroup" value="stratos-appserver-lb"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="instances" value="1"/>
-                <property name="elasticIP" value="${ELASTIC_IP}"/>
-                <property name="availabilityZone" value="us-east-1c"/>
-                <property name="payload" value="/mnt/payload.zip"/>
-            </loadBalancer>
-        </property>
-
-        <property name="services">
-            <services>
-                <defaults>
-                    <property name="payload" value="resources/cluster_node.zip"/>
-                    <property name="availabilityZone" value="us-east-1c"/>
-                    <property name="securityGroup" value="as-2011-02-23"/>
-                    <property name="instanceType" value="m1.large"/>
-                    <property name="minAppInstances" value="1"/>
-                    <property name="maxAppInstances" value="5"/>
-                    <property name="queueLengthPerNode" value="400"/>
-                    <property name="roundsToAverage" value="10"/>
-                    <property name="instancesPerScaleUp" value="1"/>
-                    <property name="messageExpiryTime" value="60000"/>
-                </defaults>
-                <service domain="wso2.as.domain">
-                    <property name="payload" value="resources/cluster_node.zip"/>
-                    <property name="availabilityZone" value="us-east-1c"/>
-                </service>
-                <service domain="wso2.ds.domain">
-                    <property name="payload" value="resources/cluster_node.zip"/>
-                    <property name="minAppInstances" value="1"/>
-                    <property name="maxAppInstances" value="5"/>
-                    <property name="queueLengthPerNode" value="400"/>
-                    <property name="roundsToAverage" value="10"/>
-                    <property name="instancesPerScaleUp" value="1"/>
-                    <property name="availabilityZone" value="us-east-1c"/>
-                    <property name="securityGroup" value="ds-2011-02-23"/>
-                </service>
-                <service domain="wso2.bps.domain">
-                    <property name="payload" value="resources/cluster_node.zip"/>
-                    <property name="minAppInstances" value="1"/>
-                    <property name="maxAppInstances" value="5"/>
-                    <property name="queueLengthPerNode" value="400"/>
-                    <property name="roundsToAverage" value="10"/>
-                    <property name="instancesPerScaleUp" value="1"/>
-                    <property name="availabilityZone" value="us-east-1c"/>
-                    <property name="securityGroup" value="bps-2011-02-23"/>
-                </service>
-            </services>
-        </property>
-
-        <!--
-            The interval to trigger the task in seconds
-        -->
-        <trigger interval="5"/>
-    </task>
-</definitions>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/java/org/apache/stratos/mediator/autoscale/lbautoscale/AppDomainContextsTest.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/java/org/apache/stratos/mediator/autoscale/lbautoscale/AppDomainContextsTest.java b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/java/org/apache/stratos/mediator/autoscale/lbautoscale/AppDomainContextsTest.java
deleted file mode 100644
index 7d0d9fa..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/java/org/apache/stratos/mediator/autoscale/lbautoscale/AppDomainContextsTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.stratos.mediator.autoscale.lbautoscale;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.clustering.tribes.TribesClusteringAgent;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration;
-import org.apache.stratos.lb.common.group.mgt.SubDomainAwareGroupManagementAgent;
-import org.apache.stratos.mediator.autoscale.lbautoscale.util.AutoscaleUtil;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-public class AppDomainContextsTest extends TestCase {
-
-    private static Map<String, Map<String, ?>> map;
-    private LoadBalancerConfiguration lbConfig;
-    ConfigurationContext configCtx;
-    ClusteringAgent clusteringAgent;
-    
-    protected void setUp() throws Exception {
-        super.setUp();
-        configCtx = ConfigurationContextFactory.createEmptyConfigurationContext();
-        clusteringAgent = new TribesClusteringAgent();
-        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
-                    "worker"),
-                    "wso2.as1.domain", "worker", -1);
-        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
-                "mgt"),
-                "wso2.as1.domain", "mgt", -1);
-        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
-                "mgt"),
-                "wso2.as2.domain", "mgt", -1);
-        configCtx.getAxisConfiguration().setClusteringAgent(clusteringAgent);
-        
-        File f = new File("src/test/resources/loadbalancer.conf");
-        System.setProperty("loadbalancer.conf", f.getAbsolutePath());
-        lbConfig = LoadBalancerConfiguration.getInstance();
-        
-        map = AutoscaleUtil.getAppDomainContexts(configCtx, lbConfig);
-        
-    }
-    
-    
-    public void testRemoval(){
-        // removing a cluster domain with only 1 sub domain 
-        lbConfig.removeServiceConfiguration("wso2.as2.domain", "mgt");
-        map = AutoscaleUtil.getAppDomainContexts(configCtx, lbConfig);
-        
-        Assert.assertEquals(true, !map.containsKey("wso2.as2.domain"));
-        
-        // removing a cluster domain with more than 1 sub domain
-        lbConfig.removeServiceConfiguration("wso2.as1.domain", "mgt");
-        map = AutoscaleUtil.getAppDomainContexts(configCtx, lbConfig);
-        
-        Assert.assertEquals(true, map.containsKey("wso2.as1.domain"));
-        Assert.assertEquals(true, map.get("wso2.as1.domain").get("mgt") == null);
-        Assert.assertEquals(true, map.get("wso2.as1.domain").get("worker") != null);
-    }
-    
-    public void testAddition(){
-        ServiceConfiguration config1 = lbConfig.new ServiceConfiguration();
-        config1.setDomain("wso2.as3.domain");
-        config1.setSub_domain("mgt");
-        lbConfig.addServiceConfiguration(config1);
-        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
-                "mgt"),
-                "wso2.as3.domain", "mgt", -1);
-        map = AutoscaleUtil.getAppDomainContexts(configCtx, lbConfig);
-        
-        Assert.assertEquals(true, map.containsKey("wso2.as3.domain"));
-        Assert.assertEquals(true, map.get("wso2.as3.domain").get("mgt") != null);
-    }
-
-    @Deprecated // use only for writing test cases
-    void printKeys(Map<?,?> map){
-        for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
-            Object type = iterator.next();
-            System.out.println(type);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/resources/loadbalancer.conf
----------------------------------------------------------------------
diff --git a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/resources/loadbalancer.conf b/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/resources/loadbalancer.conf
deleted file mode 100644
index 7b2a80a..0000000
--- a/components/load-balancer/autoscaler/org.apache.stratos.mediator.autoscale/4.1.3/src/test/resources/loadbalancer.conf
+++ /dev/null
@@ -1,50 +0,0 @@
-loadbalancer {
-    instances	1;
-    enable_autoscaler	true;
-    # interval between two task executions in milliseconds
-    autoscaler_task_interval	5000;
-    # after an instance booted up, task will wait till this much of time and let the server started up
-    server_startup_delay		15000; #default will be 60000ms
-}
-
-services {
-    defaults {
-        min_app_instances 1;
-        max_app_instances       5;
-        max_requests_per_second   400;
-        alarming_upper_rate 0.65;
-        alarming_lower_rate 0.2;
-        scale_down_factor 0.25;
-        rounds_to_average       10;
-        instances_per_scale_up  1;
-        message_expiry_time     60000;
-    }
-
-    appserver {
-        hosts                   appserver.cloud-test.wso2.com, as.cloud-test.wso2.com;
-        sub_domain      worker1;
-        domains   {
-            wso2.as1.domain {
-            	hosts as1.cloud-test.wso2.com;
-            	  min_app_instances   0;
-            	  sub_domain      worker;
-                tenant_range    1-5;
-            }
-            wso2.as1.domain {
-            	hosts mgt.as1.cloud-test.wso2.com;
-            	  min_app_instances   0;
-            	  sub_domain      mgt;
-                tenant_range    1-5;
-            }
-            wso2.as2.domain {
-            	hosts mgt.as2.cloud-test.wso2.com;
-            	  min_app_instances   0;
-            	  sub_domain      mgt;
-                tenant_range    1-5;
-            }
-            
-        }
-    }
-    
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml b/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
deleted file mode 100644
index 000bc99..0000000
--- a/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/pom.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>loadbalancer-components</artifactId>
-        <version>4.1.0</version>
-        <relativePath>../../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.stratos</groupId>
-    <artifactId>org.apache.stratos.lb.endpoint</artifactId>
-    <packaging>bundle</packaging>
-    <version>4.1.3</version>
-    <name>Apache Stratos - Tenant Aware LoadBalance Endpoint</name>
-    <url>http://apache.org</url>
-    
-    <dependencies>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.mediation.initializer</artifactId>
-            <version>${wso2carbon.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.mediation.dependency.mgt</artifactId>
-            <version>${wso2carbon.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.synapse</groupId>
-            <artifactId>synapse-core</artifactId>
-            <version>${synapse.core.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.logging</artifactId>
-            <version>${wso2carbon.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.lb.common</artifactId>
-            <version>4.1.3</version>
-        </dependency>
-	<dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-            <version>${axis2.wso2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-kernel</artifactId>
-            <version>1.6.1-wso2v9</version>
-        </dependency>
-        <dependency>
-           <groupId>org.wso2.carbon</groupId>
-           <artifactId>org.wso2.carbon.cartridge.messages</artifactId>
-           <version>2.1.1</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            org.apache.stratos.lb.endpoint.endpoint,
-                            org.apache.stratos.lb.endpoint,
-                            org.apache.stratos.lb.endpoint.util,
-                        </Export-Package>
-                        <Import-Package>
-                            !org.apache.stratos.lb.endpoint.endpoint,
-                            !org.apache.stratos.lb.endpoint,
-                            org.apache.stratos.lb.common.*; version=${project.version},
-                            org.apache.stratos.registry.core.service; version=1.0.1,
-                            *;resolution:=optional
-                        </Import-Package>
-                        <DynamicImport-Package>*</DynamicImport-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ca25b1f7/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java
----------------------------------------------------------------------
diff --git a/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java b/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java
deleted file mode 100644
index 60efed5..0000000
--- a/components/load-balancer/lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
-
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.stratos.lb.endpoint;
-
-/**
- * The <code>EndpointConstants</code> class defined the endpoint constants.
- */
-public class EndpointConstants {
-
-    public static final String ADDRESS_ENDPOINT = "Address Endpoint";
-    public static final String WSDL_ENDPOINT = "WSDL Endpoint";
-    public static final String FAILOVER_ENDPOINT = "Failover Group";
-    public static final String LOADBALANCE_ENDPOINT = "Loadbalance Endpoint";
-}