You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2013/07/07 07:21:15 UTC
git commit: refactoring org.wso2.carbon.load.balance.agent
Updated Branches:
refs/heads/master bff2da51f -> 7037d3546
refactoring org.wso2.carbon.load.balance.agent
Signed-off-by: Lakmal Warusawithana <la...@wso2.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/7037d354
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/7037d354
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/7037d354
Branch: refs/heads/master
Commit: 7037d354691c084f18f453769c45e12c34ab878e
Parents: bff2da5
Author: Pradeep Fernando <pr...@gmail.com>
Authored: Sun Jul 7 10:38:44 2013 +0530
Committer: Lakmal Warusawithana <la...@wso2.com>
Committed: Sun Jul 7 10:50:46 2013 +0530
----------------------------------------------------------------------
.../2.1.0/pom.xml | 76 ++++++++++++++++++++
.../balance/agent/LoadBalanceAgentService.java | 55 ++++++++++++++
.../src/main/resources/META-INF/services.xml | 29 ++++++++
components/pom.xml | 1 +
.../2.1.0/pom.xml | 72 -------------------
.../balance/agent/LoadBalanceAgentService.java | 55 --------------
.../src/main/resources/META-INF/services.xml | 29 --------
7 files changed, 161 insertions(+), 156 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/org.apache.stratos.load.balance.agent/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balance.agent/2.1.0/pom.xml b/components/org.apache.stratos.load.balance.agent/2.1.0/pom.xml
new file mode 100644
index 0000000..2d248c5
--- /dev/null
+++ b/components/org.apache.stratos.load.balance.agent/2.1.0/pom.xml
@@ -0,0 +1,76 @@
+<?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>stratos-components-parent</artifactId>
+ <version>2.0.0</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.apache.stratos.load.balance.agent</artifactId>
+ <packaging>bundle</packaging>
+ <name>Apache Stratos - Load Balance Agent</name>
+ <description>
+ Load Balance Agent - Facilitates Getting the System Properties for Load Balancing and Auto Scaling
+ </description>
+ <url>http://wso2.org</url>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-Vendor>WSO2 Inc</Bundle-Vendor>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>
+ org.apache.stratos.load.balance.agent.*,
+ </Export-Package>
+ <Import-Package>
+ *;resolution:=optional
+ </Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.wso2.carbon</groupId>
+ <artifactId>org.wso2.carbon.stratos.common</artifactId>
+ <version>2.1.0</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java b/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java
new file mode 100644
index 0000000..441eeb9
--- /dev/null
+++ b/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/java/org/apache/stratos/load/balance/agent/LoadBalanceAgentService.java
@@ -0,0 +1,55 @@
+/*
+ * 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.load.balance.agent;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.lang.management.ManagementFactory;
+
+/**
+ * Agent to get the system properties of the instances. Hence will be used in auto scaling, and
+ * also potentially in load balancing. Instances will be scaling up and down based on these params.
+ */
+public class LoadBalanceAgentService {
+
+ private static final Log log = LogFactory.getLog(LoadBalanceAgentService.class);
+
+
+ /**
+ * gets the load average of the system
+ *
+ * @return load average. Returns zero if the load average couldn't be read.
+ * Zero is treated as load-average not read, in the relevant places and ignored in the
+ * load balancer and autoscalar algorithms appropriately.
+ */
+ public double getLoadAverage() {
+ double systemLoadAverage = 0;
+ try {
+ systemLoadAverage =
+ ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
+ } catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Error in retrieving the load average of the instance");
+ }
+ }
+ return systemLoadAverage;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml b/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml
new file mode 100644
index 0000000..02d6052
--- /dev/null
+++ b/components/org.apache.stratos.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ !
+ ! Copyright 2006 The Apache Software Foundation.
+ !
+ ! Licensed 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.
+ !-->
+<serviceGroup>
+ <service name="LoadBalanceAgentService" scope="transportsession">
+ <transports>
+ <transport>https</transport>
+ </transports>
+ <parameter name="ServiceClass" locked="false">
+ org.apache.stratos.load.balance.agent.LoadBalanceAgentService
+ </parameter>
+ <operation name="getLoadAverage"/>
+ </service>
+ <parameter name="hiddenService" locked="true">true</parameter>
+</serviceGroup>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index d316c7f..379b344 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -62,6 +62,7 @@
<!-- ELB -->
<module>lb-endpoint/org.apache.stratos.lb.endpoint/4.1.3</module>
<module>org.apache.stratos.lb.common/4.1.3</module>
+ <module>org.apache.stratos.load.balance.agent/2.1.0</module>
<module>autoscaler/org.apache.stratos.mediator.autoscale/4.1.3</module>
<module>autoscaler-service/org.apache.stratos.autoscaler.service/4.1.0</module>
<!-- COMMON -->
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/pom.xml b/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/pom.xml
deleted file mode 100644
index 4e9db31..0000000
--- a/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ Licensed 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.wso2.carbon</groupId>
- <artifactId>stratos-components</artifactId>
- <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>org.wso2.carbon.load.balance.agent</artifactId>
- <packaging>bundle</packaging>
- <name>WSO2 Stratos - Load Balance Agent</name>
- <description>
- Load Balance Agent - Facilitates Getting the System Properties for Load Balancing and Auto Scaling
- </description>
- <url>http://wso2.org</url>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
-
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Vendor>WSO2 Inc</Bundle-Vendor>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Export-Package>
- org.wso2.carbon.load.balance.agent.*,
- </Export-Package>
- <Import-Package>
- *;resolution:=optional
- </Import-Package>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.stratos.common</artifactId>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/java/org/wso2/carbon/load/balance/agent/LoadBalanceAgentService.java
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/java/org/wso2/carbon/load/balance/agent/LoadBalanceAgentService.java b/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/java/org/wso2/carbon/load/balance/agent/LoadBalanceAgentService.java
deleted file mode 100644
index 2d6bded..0000000
--- a/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/java/org/wso2/carbon/load/balance/agent/LoadBalanceAgentService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2005-2010, 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.wso2.carbon.load.balance.agent;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.lang.management.ManagementFactory;
-
-/**
- * Agent to get the system properties of the instances. Hence will be used in auto scaling, and
- * also potentially in load balancing. Instances will be scaling up and down based on these params.
- */
-public class LoadBalanceAgentService {
-
- private static final Log log = LogFactory.getLog(LoadBalanceAgentService.class);
-
-
- /**
- * gets the load average of the system
- *
- * @return load average. Returns zero if the load average couldn't be read.
- * Zero is treated as load-average not read, in the relevant places and ignored in the
- * load balancer and autoscalar algorithms appropriately.
- */
- public double getLoadAverage() {
- double systemLoadAverage = 0;
- try {
- systemLoadAverage =
- ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
- } catch (Exception e) {
- if (log.isDebugEnabled()) {
- log.debug("Error in retrieving the load average of the instance");
- }
- }
- return systemLoadAverage;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7037d354/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml b/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml
deleted file mode 100644
index d7a29dc..0000000
--- a/components/stratos/org.wso2.carbon.load.balance.agent/2.1.0/src/main/resources/META-INF/services.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- !
- ! Copyright 2006 The Apache Software Foundation.
- !
- ! Licensed 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.
- !-->
-<serviceGroup>
- <service name="LoadBalanceAgentService" scope="transportsession">
- <transports>
- <transport>https</transport>
- </transports>
- <parameter name="ServiceClass" locked="false">
- org.wso2.carbon.load.balance.agent.LoadBalanceAgentService
- </parameter>
- <operation name="getLoadAverage"/>
- </service>
- <parameter name="hiddenService" locked="true">true</parameter>
-</serviceGroup>