Package org.apache.stratos.lb.agent.stub

Examples of org.apache.stratos.lb.agent.stub.LoadBalanceAgentServiceStub


     * @return the load average of the given instance.
     * @throws java.sql.SQLException, if exception in writing to the database.
     */
    public static double getLoadAverageFromInstances(String hostName, int serviceID) throws SQLException {
        double loadAverage = -1;
        LoadBalanceAgentServiceStub stub;
        String serviceUrl;

        // gets the instance and the service
        try {
            serviceUrl = "https://" + hostName + services + serviceName;
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("Unable to get the running application instances to get the " +
                        "load average", e);
            }
            return loadAverage;
        }

        // gets the load average of the service instance
        try {
            stub = new LoadBalanceAgentServiceStub(serviceUrl);
            loadAverage = stub.getLoadAverage();
        } catch (AxisFault e) {
            MySQLConnector.insertStats(serviceID, false);
            MySQLConnector.insertState(serviceID, false, e.getMessage());
            String msg = "Invoking the Load Balance Agent Client Failed";
            log.warn(msg, e);
View Full Code Here

TOP

Related Classes of org.apache.stratos.lb.agent.stub.LoadBalanceAgentServiceStub

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.