Examples of LoadBalanceAgentServiceStub


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

Examples of org.wso2.carbon.load.balance.agent.stub.LoadBalanceAgentServiceStub

     * @return the load average of the given instance.
     */
    public double getLoadAverageFromInstances(int instanceIndex) {
        double loadAverage = -1;
        Instance instance;
        LoadBalanceAgentServiceStub stub;
        String serviceUrl;

        // gets the instance and the service
        try {
            instance = loadAnalyzerTask.getRunningApplicationInstances().get(instanceIndex);
            String externalName = instance.getExternalName();
            serviceUrl = "https://" + externalName + ":" + loadAnalyzerTask.getServiceHttpsPort() +
                         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(loadAnalyzerTask.getConfigCtx(), serviceUrl);
            loadAverage = stub.getLoadAverage();
        } catch (AxisFault axisFault) {
            if (log.isDebugEnabled()) {
                log.debug("Unable to create the object from the service stub");
            }
        } catch (RemoteException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.