You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/08/30 20:16:54 UTC

[01/50] [abbrv] stratos git commit: Read project version from filters in Stratos integration test

Repository: stratos
Updated Branches:
  refs/heads/master eefef717b -> 08dac042e


Read project version from filters in Stratos integration test


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/57ecc648
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/57ecc648
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/57ecc648

Branch: refs/heads/master
Commit: 57ecc648ed6d0b96fc85d1a20aa2e048c9c4fa90
Parents: 71481d3
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 09:08:59 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 09:08:59 2015 +0530

----------------------------------------------------------------------
 .../distribution/src/main/assembly/bin.xml      |  84 ++++----
 .../modules/distribution/src/assembly/bin.xml   | 216 +++++++++----------
 .../tests/StratosTestServerManager.java         |  67 ++++--
 .../test-conf/integration-test.properties       |   9 +-
 4 files changed, 206 insertions(+), 170 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/57ecc648/products/load-balancer/modules/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/distribution/src/main/assembly/bin.xml b/products/load-balancer/modules/distribution/src/main/assembly/bin.xml
index e96c930..6628f41 100755
--- a/products/load-balancer/modules/distribution/src/main/assembly/bin.xml
+++ b/products/load-balancer/modules/distribution/src/main/assembly/bin.xml
@@ -26,7 +26,7 @@
     <fileSets>
         <fileSet>
             <directory>target/wso2carbon-core-${carbon.kernel.version}</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}</outputDirectory>
             <excludes>
                 <exclude>**/*.sh</exclude>
                 <exclude>**/*.bat</exclude>
@@ -69,7 +69,7 @@
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/components
             </directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components</outputDirectory>
             <excludes>
                 <exclude>**/eclipse.ini</exclude>
                 <exclude>**/*.lock</exclude>
@@ -85,23 +85,23 @@
         </fileSet>
         <fileSet>
             <directory>src/main/conf/synapse-configs</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/deployment/server/synapse-configs
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/deployment/server/synapse-configs
             </outputDirectory>
         </fileSet>
         <fileSet>
             <directory>src/main/cartridges</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/deployment/server/cartridges
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/deployment/server/cartridges
             </outputDirectory>
         </fileSet>
         <fileSet>
             <directory>src/main/services</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/deployment/server/services
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/deployment/server/services
             </outputDirectory>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/
             </directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf/etc</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf/etc</outputDirectory>
             <includes>
                 <include>*.xsd</include>
             </includes>
@@ -110,56 +110,56 @@
         <!-- Kernel Patches-->
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0001</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0001/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gentarget/WSO2-CARBON-PATCH-4.2.0-0002</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0002/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0003</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0003/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0004</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0004/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0005</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0005/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0006</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0006/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0007</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0007/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0008</directory>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0008/*.*</include>
             </includes>
@@ -169,13 +169,13 @@
     <dependencySets>
         <!-- use the new tool to create a bundles -->
         <dependencySet>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/lib/core/WEB-INF/lib</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/lib/core/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>org.wso2.carbon:org.wso2.carbon.mediator.bridge:jar</include>
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/axis2/client/lib</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/axis2/client/lib</outputDirectory>
             <includes>
                 <include>bouncycastle:bcprov-jdk15:jar</include>
             </includes>
@@ -183,7 +183,7 @@
             </outputFileNameMapping>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/deployment/client/modules
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/deployment/client/modules
             </outputDirectory>
             <includes>
                 <include>org.apache.rampart:rampart:mar</include>
@@ -191,14 +191,14 @@
         </dependencySet>
         <!-- MB Client libs -->
         <dependencySet>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/dropins</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/dropins</outputDirectory>
             <includes>
                 <include>org.wso2.andes.wso2:andes-client:jar</include>
                 <include>org.apache.geronimo.specs.wso2:geronimo-jms_1.1_spec:jar</include>
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/components/lib</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/components/lib</outputDirectory>
             <includes>
                 <include>org.apache.activemq:activemq-client:jar</include>
                 <include>org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar</include>
@@ -211,14 +211,14 @@
     <files>
         <file>
             <source>src/main/bin/stratos.sh</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/bin</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/bin</outputDirectory>
             <destName>stratos.sh</destName>
             <fileMode>755</fileMode>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/bin/stratos.bat</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/bin</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/bin</outputDirectory>
             <destName>stratos.bat</destName>
             <fileMode>755</fileMode>
             <filtered>true</filtered>
@@ -227,96 +227,96 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/event-broker.xml
             </source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
         </file>
         <file>
             <source>src/main/conf/embedded-ldap.xml</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>embedded-ldap.xml</destName>
         </file>
         <file>
             <source>src/main/conf/axis2.xml</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf/axis2</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf/axis2</outputDirectory>
             <destName>axis2.xml</destName>
         </file>
         <file>
             <source>src/main/conf/loadbalancer.conf</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>loadbalancer.conf</destName>
         </file>
         <file>
             <source>src/main/conf/jndi.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>jndi.properties</destName>
         </file>
         <file>
             <source>src/main/conf/mqtttopic.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>mqtttopic.properties</destName>
         </file>
         <file>
             <source>src/main/conf/log4j.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>log4j.properties</destName>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/synapse.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>synapse.properties</destName>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/nhttp.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>nhttp.properties</destName>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/passthru-http.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>passthru-http.properties</destName>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/datasources.properties</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>datasources.properties</destName>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/thrift-client-config.xml</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <destName>thrift-client-config.xml</destName>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/license/LICENSE</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>src/main/notice/NOTICE</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>${project.basedir}/README.txt</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>${project.basedir}/INSTALL.txt</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>target/wso2carbon-core-${carbon.kernel.version}/bin/version.txt</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/bin/</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/bin/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
@@ -324,26 +324,26 @@
         <!--Copying config files from kernel patches -->
         <file>
             <source>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0001/dbscripts/mysql.sql</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/dbscripts</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/dbscripts</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>
                 ../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0002/repository/conf/security/cipher-text.properties
             </source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf/security/</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf/security/</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>
                 ../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0002/repository/conf/security/cipher-tool.properties
             </source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf/security/</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf/security/</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0004/repository/conf/carbon.xml</source>
-            <outputDirectory>apache-stratos-load-balancer-${project.version}/repository/conf/</outputDirectory>
+            <outputDirectory>${load.balancer.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <filtered>true</filtered>
         </file>
     </files>

http://git-wip-us.apache.org/repos/asf/stratos/blob/57ecc648/products/stratos/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/assembly/bin.xml b/products/stratos/modules/distribution/src/assembly/bin.xml
index 06ec14a..8f8b4f3 100755
--- a/products/stratos/modules/distribution/src/assembly/bin.xml
+++ b/products/stratos/modules/distribution/src/assembly/bin.xml
@@ -26,7 +26,7 @@
     <fileSets>
         <fileSet>
             <directory>target/wso2carbon-core-${carbon.kernel.version}</directory>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}</outputDirectory>
             <excludes>
                 <exclude>**/*.sh</exclude>
                 <exclude>**/wso2server.bat</exclude>
@@ -62,7 +62,7 @@
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/components
             </directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components</outputDirectory>
             <excludes>
                 <exclude>**/eclipse.ini</exclude>
                 <exclude>**/*.lock</exclude>
@@ -84,7 +84,7 @@
         <!-- Exclude non-Apache2 compliant dependency from lib/endorsed/ directory-->
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/endorsed</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/lib/endorsed</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/lib/endorsed</outputDirectory>
             <excludes>
                 <exclude>**/jboss-transaction-api_1.1_spec-1.0.0.Final.jar</exclude>
             </excludes>
@@ -93,7 +93,7 @@
             <directory>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/jaggeryapps
             </directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/jaggeryapps</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/jaggeryapps</outputDirectory>
             <excludes>
                 <exclude>**/publisher/**</exclude>
                 <exclude>**/store/**</exclude>
@@ -105,7 +105,7 @@
         </fileSet>
         <fileSet>
             <directory>target/shopping-cart-global-${shoppingcart.global.version}</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/samples/bin</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/samples/bin</outputDirectory>
             <includes>
                 <include>**/*.car</include>
                 <include>**/*.properties</include>
@@ -113,7 +113,7 @@
         </fileSet>
         <fileSet>
             <directory>../../../../components/org.apache.stratos.manager.console/console</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/jaggeryapps/console
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/jaggeryapps/console
             </outputDirectory>
             <excludes>
                 <exclude>**/README</exclude>
@@ -121,16 +121,16 @@
         </fileSet>
         <fileSet>
             <directory>../../../../components/org.apache.stratos.manager.console/sso</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/jaggeryapps/sso
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/jaggeryapps/sso
             </outputDirectory>
         </fileSet>
         <fileSet>
             <directory>../../../../components/org.apache.stratos.manager.console/modules/console</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/modules/console</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/modules/console</outputDirectory>
         </fileSet>
         <fileSet>
             <directory>target/wso2carbon-core-${carbon.kernel.version}</directory>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}</outputDirectory>
             <excludes>
                 <exclude>**/daemon.sh</exclude>
                 <exclude>**/log4j.properties</exclude>
@@ -148,7 +148,7 @@
         <!-- Copying themes, cloud icons-->
         <fileSet>
             <directory>src/main/resources</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/resources</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/resources</outputDirectory>
             <fileMode>755</fileMode>
             <includes>
                 <include>allthemes/**</include>
@@ -159,7 +159,7 @@
         <!-- ADC management related files -->
         <fileSet>
             <directory>src/main/conf/</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <includes>
                 <include>cartridge-config.properties</include>
                 <include>policies.xml</include>
@@ -167,7 +167,7 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/etc</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/etc</outputDirectory>
             <includes>
                 <include>policies.xsd</include>
             </includes>
@@ -175,14 +175,14 @@
 
         <fileSet>
             <directory>../p2-profile/target/wso2carbon-core-${carbon.platform.version}/repository/conf/etc/</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/etc</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/etc</outputDirectory>
             <includes>
                 <include>**/cassandra.yaml</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <includes>
                 <include>**/rule-engine-config.xml</include>
             </includes>
@@ -190,7 +190,7 @@
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/multitenancy/
             </directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/multitenancy/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/multitenancy/</outputDirectory>
             <includes>
                 <include>**/multitenancy-packages.xml</include>
                 <include>**/stratos.xml</include>
@@ -199,7 +199,7 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/dbscripts</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/dbscripts</outputDirectory>
             <excludes>
                 <exclude>**/identity/**</exclude>
                 <!-- Patched in WSO2-CARBON-PATCH-4.2.0-0001, WSO2-CARBON-PATCH-4.2.0-0012 and WSO2-CARBON-PATCH-4.2.0-0003
@@ -215,7 +215,7 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/identity</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/dbscripts/identity</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/dbscripts/identity</outputDirectory>
             <includes>
                 <include>**/**.sql</include>
             </includes>
@@ -224,7 +224,7 @@
         <!-- copy cxf runtime -->
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/runtimes</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/lib/runtimes/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/lib/runtimes/</outputDirectory>
             <includes>
                 <include>*/**</include>
             </includes>
@@ -232,7 +232,7 @@
         <!-- copy jaggery modules -->
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/modules</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/modules</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/modules</outputDirectory>
             <excludes>
                 <exclude>**/carbon/**</exclude>
             </excludes>
@@ -242,40 +242,40 @@
         </fileSet>
         <fileSet>
             <directory>src/main/conf/multitenancy</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/multitenancy</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/multitenancy</outputDirectory>
         </fileSet>
 
         <!-- copy the billing h2 db -->
         <fileSet>
             <directory>target/database</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/database</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/database</outputDirectory>
         </fileSet>
 
         <!-- Apply Kernel Patches-->
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0001</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0001/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0002</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0002/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0003</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0003/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0004</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <excludes>
                 <exclude>**/org.wso2.carbon.ui_4.2.0.jar</exclude>
             </excludes>
@@ -285,21 +285,21 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0005</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0005/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0006</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0006/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0007</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <excludes>
                 <exclude>**/org.wso2.carbon.ui_4.2.0.jar</exclude>
             </excludes>
@@ -309,14 +309,14 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0008</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <includes>
                 <include>**/patch0008/*.*</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0009</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <excludes>
                 <exclude>**/org.wso2.carbon.ui_4.2.0.jar</exclude>
             </excludes>
@@ -326,7 +326,7 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0010</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <excludes>
                 <exclude>**/org.wso2.carbon.ui_4.2.0.jar</exclude>
             </excludes>
@@ -336,7 +336,7 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0011</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <excludes>
                 <exclude>**/org.wso2.carbon.ui-4.2.0.jar</exclude>
             </excludes>
@@ -346,7 +346,7 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0012</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/patches</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/patches</outputDirectory>
             <excludes>
                 <exclude>**/org.wso2.carbon.ui_4.2.0.jar</exclude>
             </excludes>
@@ -358,7 +358,7 @@
         <!-- Additional configuration for kernel patches -->
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0001/dbscripts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/dbscripts</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/dbscripts</outputDirectory>
             <includes>
                 <include>**/db2.sql</include>
                 <include>**/mysql.sql</include>
@@ -366,35 +366,35 @@
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0003/dbscripts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/dbscripts</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/dbscripts</outputDirectory>
             <includes>
                 <include>**/mysql_cluster.sql</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0009/bin</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/bin</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/bin</outputDirectory>
             <includes>
                 <include>**/org.wso2.carbon.bootstrap_4.2.0.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0010/lib</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/lib</outputDirectory>
             <includes>
                 <include>**/org.wso2.ciphertool-1.0.0-wso2v2.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0012/lib</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/lib</outputDirectory>
             <includes>
                 <include>**/org.wso2.carbon.server-4.2.0.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../p2-profile-gen/target/WSO2-CARBON-PATCH-4.2.0-0012/dbscripts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/dbscripts</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/dbscripts</outputDirectory>
             <includes>
                 <include>**/oracle_rac.sql</include>
             </includes>
@@ -403,22 +403,22 @@
         <!-- Jaggery modules -->
         <fileSet>
             <directory>src/main/temp-artifacts/sso</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/modules/sso</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/modules/sso</outputDirectory>
         </fileSet>
         <fileSet>
             <directory>src/main/temp-artifacts/carbon</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/modules/carbon</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/modules/carbon</outputDirectory>
         </fileSet>
         <fileSet>
             <directory>src/main/temp-artifacts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/plugins</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/plugins</outputDirectory>
             <includes>
                 <include>org.wso2.store.sso.common_1.0.0.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>src/main/temp-artifacts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/plugins</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/plugins</outputDirectory>
             <includes>
                 <include>org.wso2.stratos.identity.saml2.sso.mgt_2.2.0.jar</include>
             </includes>
@@ -426,7 +426,7 @@
         <!-- autoscaler -->
         <fileSet>
             <directory>src/main/temp-artifacts</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/plugins</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/plugins</outputDirectory>
             <includes>
                 <include>org.jaggeryjs.hostobjects.xhr_0.9.0.ALPHA4_wso2v1.jar</include>
             </includes>
@@ -436,70 +436,70 @@
         <!--creating an empty input event adaptors directory-->
         <fileSet>
             <directory>../../../../extensions/cep/artifacts/inputeventadaptors</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/inputeventadaptors
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/inputeventadaptors
             </outputDirectory>
         </fileSet>
         <!--creating an empty output event adaptors directory-->
         <fileSet>
             <directory>../../../../extensions/cep/artifacts/outputeventadaptors</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/outputeventadaptors
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/outputeventadaptors
             </outputDirectory>
         </fileSet>
         <!--creating an empty event builders directory-->
         <fileSet>
             <directory>../../../../extensions/cep/artifacts/eventbuilders</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/eventbuilders
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/eventbuilders
             </outputDirectory>
         </fileSet>
         <!--creating an empty event formatters directory-->
         <fileSet>
             <directory>../../../../extensions/cep/artifacts/eventformatters</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/eventformatters
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/eventformatters
             </outputDirectory>
         </fileSet>
         <!--creating an empty execution plans directory-->
         <fileSet>
             <directory>../../../../extensions/cep/artifacts/executionplans</directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/executionplans
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/executionplans
             </outputDirectory>
         </fileSet>
         <!--customization scripts-->
         <fileSet>
             <directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/scripts
             </directory>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/scripts</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/scripts</outputDirectory>
         </fileSet>
     </fileSets>
 
     <dependencySets>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/lib</outputDirectory>
             <includes>
                 <include>bouncycastle:bcprov-jdk15:jar</include>
             </includes>
         </dependencySet>
         <!-- use the new tool to create a bundles -->
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/lib/core/WEB-INF/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/lib/core/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>org.wso2.carbon:org.wso2.carbon.mediator.bridge:jar</include>
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/axis2/client/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/axis2/client/lib</outputDirectory>
             <includes>
                 <include>bouncycastle:bcprov-jdk15:jar</include>
             </includes>
             <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/client/modules</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/client/modules</outputDirectory>
             <includes>
                 <include>org.apache.rampart:rampart:mar</include>
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/lib</outputDirectory>
             <includes>
                 <include>org.apache.activemq:activemq-client:jar</include>
                 <include>org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar</include>
@@ -508,19 +508,19 @@
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/lib</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/lib</outputDirectory>
             <includes>
                 <include>org.apache.stratos:org.apache.stratos.cep.extension:jar</include>
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/lib/endorsed</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/lib/endorsed</outputDirectory>
             <includes>
                 <include>org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar</include>
             </includes>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/components/dropins</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/components/dropins</outputDirectory>
             <includes>
                 <include>org.apache.stratos:org.wso2.carbon.ui:jar</include>
             </includes>
@@ -530,81 +530,81 @@
     <files>
         <file>
             <source>src/main/conf/carbon.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/security/authenticators.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/security</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/security</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/security/cipher-text.properties</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/security</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/security</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/security/cipher-tool.properties</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/security</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/security</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>src/main/conf/log4j.properties</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/jndi.properties</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/tenant-mgt.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/registry.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/user-mgt.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/mqtttopic.properties</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/event-broker.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/sso-idp-config.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <!-- cep -->
         <file>
             <source>src/main/conf/siddhi/siddhi.extension</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/siddhi/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/siddhi/</outputDirectory>
             <filtered>true</filtered>
         </file>
         <file>
             <source>../../../../extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <filtered>true</filtered>
         </file>
         <!-- cloud-controller -->
@@ -612,111 +612,111 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cloud-controller.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
         </file>
         <!-- cloud-controller -->
         <!-- autoscaler -->
         <file>
             <source>src/main/conf/autoscaler.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/mock-iaas.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <!-- identity.xml and application-authentication.xml for oAuth feature -->
         <file>
             <source>src/main/conf/identity.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/security/application-authentication.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/security/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/security/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/application-authenticators.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/security/client-truststore.jks</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/resources/security/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/resources/security/</outputDirectory>
             <filtered>false</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/axis2/axis2.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/axis2/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/axis2/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/axis2/axis2_client.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/axis2/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/axis2/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/axis2/tenant-axis2.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/axis2/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/axis2/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/drools/mincheck.drl</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/drools</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/drools/maxcheck.drl</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/drools</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/drools/obsoletecheck.drl</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/drools</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/drools/scaling.drl</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/drools</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/drools/dependent-scaling.drl</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/drools</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <file>
             <source>src/main/conf/drools/terminateall.drl</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/drools</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>
             <fileMode>600</fileMode>
         </file>
         <!-- autoscaler -->
         <file>
             <source>${project.basedir}/INSTALL.txt</source>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>src/main/conf/etc/launch.ini</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/etc</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/etc</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
@@ -737,7 +737,7 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/tomcat</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/tomcat</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
@@ -745,7 +745,7 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/tomcat</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/tomcat</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
@@ -753,25 +753,25 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/context.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/tomcat</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/tomcat</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>${project.basedir}/README.txt</source>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>target/wso2carbon-core-${carbon.kernel.version}/bin/README.txt</source>
-            <outputDirectory>${project.artifactId}-${project.version}/bin/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/bin/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>target/wso2carbon-core-${carbon.kernel.version}/bin/version.txt</source>
-            <outputDirectory>${project.artifactId}-${project.version}/bin/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/bin/</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
@@ -779,7 +779,7 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/resources/security/userRP.jks
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/resources/security/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/resources/security/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <!-- Including logging-config.xml file -->
@@ -787,7 +787,7 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/logging-config.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/etc/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/etc/</outputDirectory>
         </file>
         <file>
             <source>src/bin/stratos.sh</source>
@@ -804,7 +804,7 @@
         <file>
             <source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/claim-config.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf</outputDirectory>
             <filtered>true</filtered>
             <fileMode>644</fileMode>
         </file>
@@ -812,14 +812,14 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/tasks-config.xml
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/etc</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/etc</outputDirectory>
         </file>
         <!-- REST endpoint webapp -->
         <file>
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps/api.war
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <!-- Mock iaas webapp -->
@@ -827,7 +827,7 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps/mock-iaas.war
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <!--oauth2.war and authenticationendpoint.war is related to oAuth feature  -->
@@ -835,14 +835,14 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps/oauth2.war
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps/authenticationendpoint.war
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <!-- End of REST endpoint webapp -->
@@ -851,23 +851,23 @@
             <source>
                 ../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps/metadata.war
             </source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/webapps/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <!-- End of Meta data service webapp -->
         <file>
             <source>src/main/conf/data-bridge/data-bridge-config.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/data-bridge/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/data-bridge/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>src/main/conf/data-bridge/thrift-agent-config.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/data-bridge/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/data-bridge/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
         <file>
             <source>src/main/conf/thrift-client-config.xml</source>
-            <outputDirectory>${project.artifactId}-${project.version}/repository/conf/</outputDirectory>
+            <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <fileMode>644</fileMode>
         </file>
     </files>

http://git-wip-us.apache.org/repos/asf/stratos/blob/57ecc648/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
index 99596dd..ea3d8f9 100755
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
@@ -26,7 +26,6 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.stratos.common.test.TestLogAppender;
-import org.apache.stratos.integration.tests.application.SampleApplicationsTest;
 import org.apache.stratos.integration.tests.rest.IntegrationMockClient;
 import org.apache.stratos.integration.tests.rest.RestClient;
 import org.testng.annotations.AfterSuite;
@@ -39,6 +38,7 @@ import org.wso2.carbon.integration.framework.utils.TestUtil;
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.util.Properties;
 
 import static org.testng.Assert.assertNotNull;
 
@@ -46,20 +46,27 @@ import static org.testng.Assert.assertNotNull;
  * Prepare activemq, Stratos server for tests, enables mock iaas, starts servers and stop them after the tests.
  */
 public class StratosTestServerManager extends TestServerManager {
-
     private static final Log log = LogFactory.getLog(StratosTestServerManager.class);
-
-    private final static String CARBON_ZIP = SampleApplicationsTest.class.getResource("/").getPath() +
-            "/../../../distribution/target/apache-stratos-4.1.2.zip";
-    private final static int PORT_OFFSET = 0;
-    private static final String ACTIVEMQ_BIND_ADDRESS = "tcp://localhost:61617";
-    private static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
-    private static final String SCALING_DROOL_FILE = "scaling.drl";
-    private static final String JNDI_PROPERTIES_FILE = "jndi.properties";
-    private static final String JMS_OUTPUT_ADAPTER_FILE = "JMSOutputAdaptor.xml";
+    private static Properties integrationProperties;
+    public static final String BASE_PATH = StratosTestServerManager.class.getResource("/").getPath();
+    public static final String STRATOS_DISTRIBUTION_NAME = "distribution.path";
+    public final static String PORT_OFFSET = "carbon.port.offset";
+    public static final String ACTIVEMQ_BIND_ADDRESS = "activemq.bind.address";
+    public static final String STRATOS_ENDPOINT = "stratos.endpoint";
+    public static final String ADMIN_USERNAME = "stratos.admin.username";
+    public static final String ADMIN_PASSWORD = "stratos.admin.password";
+    public static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
+    public static final String SCALING_DROOL_FILE = "scaling.drl";
+    public static final String JNDI_PROPERTIES_FILE = "jndi.properties";
+    public static final String JMS_OUTPUT_ADAPTER_FILE = "JMSOutputAdaptor.xml";
+
+    protected String distributionName;
+    protected int portOffset;
+    protected String adminUsername;
+    protected String adminPassword;
+    protected String stratosEndpoint;
+    protected String activemqBindAddress;
     protected RestClient restClient;
-    private String endpoint = "http://localhost:9763";
-
     private BrokerService broker = new BrokerService();
     private TestLogAppender testLogAppender = new TestLogAppender();
     private ServerUtils serverUtils;
@@ -67,10 +74,34 @@ public class StratosTestServerManager extends TestServerManager {
     protected IntegrationMockClient mockIaasApiClient;
 
     public StratosTestServerManager() {
-        super(CARBON_ZIP, PORT_OFFSET);
+        super(BASE_PATH + getIntegrationTestProperty(STRATOS_DISTRIBUTION_NAME),
+                Integer.parseInt(getIntegrationTestProperty(PORT_OFFSET)));
+
+        distributionName = integrationProperties.getProperty(STRATOS_DISTRIBUTION_NAME);
+        portOffset = Integer.parseInt(integrationProperties.getProperty(PORT_OFFSET));
+        adminUsername = integrationProperties.getProperty(ADMIN_USERNAME);
+        adminPassword = integrationProperties.getProperty(ADMIN_PASSWORD);
+        stratosEndpoint = integrationProperties.getProperty(STRATOS_ENDPOINT);
+        activemqBindAddress = integrationProperties.getProperty(ACTIVEMQ_BIND_ADDRESS);
         serverUtils = new ServerUtils();
-        restClient = new RestClient(endpoint, "admin", "admin");
-        mockIaasApiClient = new IntegrationMockClient(endpoint + "/mock-iaas/api");
+        restClient = new RestClient(stratosEndpoint, adminUsername, adminPassword);
+        mockIaasApiClient = new IntegrationMockClient(stratosEndpoint + "/mock-iaas/api");
+    }
+
+    private static String getIntegrationTestProperty(String key) {
+        if (integrationProperties == null) {
+            integrationProperties = new Properties();
+            try {
+                integrationProperties
+                        .load(StratosTestServerManager.class.getResourceAsStream("/integration-test.properties"));
+                log.info("Stratos integration properties: " + integrationProperties.toString());
+            }
+            catch (IOException e) {
+                log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
+                        "exists in classpath.", e);
+            }
+        }
+        return integrationProperties.getProperty(key);
     }
 
     @Override
@@ -86,7 +117,7 @@ public class StratosTestServerManager extends TestServerManager {
             broker.setDataDirectory(StratosTestServerManager.class.getResource("/").getPath() +
                     File.separator + ".." + File.separator + "activemq-data");
             broker.setBrokerName("testBroker");
-            broker.addConnector(ACTIVEMQ_BIND_ADDRESS);
+            broker.addConnector(activemqBindAddress);
             broker.start();
             long time2 = System.currentTimeMillis();
             log.info(String.format("ActiveMQ started in %d sec", (time2 - time1) / 1000));
@@ -112,7 +143,7 @@ public class StratosTestServerManager extends TestServerManager {
                 log.info("Stratos server setup completed");
 
                 log.info("Starting Stratos server...");
-                this.serverUtils.startServerUsingCarbonHome(carbonHome, carbonHome, "stratos", PORT_OFFSET, null);
+                this.serverUtils.startServerUsingCarbonHome(carbonHome, carbonHome, "stratos", portOffset, null);
                 FrameworkSettings.init();
 
                 while (!serverStarted()) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/57ecc648/products/stratos/modules/integration/src/test/resources/test-conf/integration-test.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/test-conf/integration-test.properties b/products/stratos/modules/integration/src/test/resources/test-conf/integration-test.properties
index 5913b98..a26383c 100644
--- a/products/stratos/modules/integration/src/test/resources/test-conf/integration-test.properties
+++ b/products/stratos/modules/integration/src/test/resources/test-conf/integration-test.properties
@@ -16,6 +16,11 @@
 # under the License.
 
 # Stratos distribution properties added via filters during the build
-distribution.file=${stratos.distribution.name}-${project.version}.zip
+distribution.path=/../../../distribution/target/${stratos.distribution.name}-${project.version}.zip
 distribution.version=${project.version}
-distribution.name=${stratos.distribution.name}
\ No newline at end of file
+distribution.name=${stratos.distribution.name}
+carbon.port.offset=0
+activemq.bind.address=tcp://localhost:61617
+stratos.endpoint=http://localhost:9763
+stratos.admin.username=admin
+stratos.admin.password=admin
\ No newline at end of file


[45/50] [abbrv] stratos git commit: Adding gitignore for cartridge-agent.log

Posted by ra...@apache.org.
Adding gitignore for cartridge-agent.log


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/100a70fc
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/100a70fc
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/100a70fc

Branch: refs/heads/master
Commit: 100a70fc772de7568314a685a07484db5ea9864a
Parents: d97d9c7
Author: Akila Perera <ra...@gmail.com>
Authored: Sun Aug 30 14:11:21 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 14:11:21 2015 +0530

----------------------------------------------------------------------
 products/python-cartridge-agent/integration/.gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/100a70fc/products/python-cartridge-agent/integration/.gitignore
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/.gitignore b/products/python-cartridge-agent/integration/.gitignore
new file mode 100644
index 0000000..4d01b31
--- /dev/null
+++ b/products/python-cartridge-agent/integration/.gitignore
@@ -0,0 +1 @@
+cartridge-agent.log


[33/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/license/LICENSE b/extensions/load-balancer/nginx-extension/src/main/license/LICENSE
deleted file mode 100644
index 60e7f41..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/license/LICENSE
+++ /dev/null
@@ -1,481 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-===================================================================================
-
-===================================================================================
-The Apache Stratos distribution includes a number of run time dependencies with 
-separate copyright notices and license terms. Your use of the Apache Stratos code
-is subject to the terms and conditions of the following licenses.
-===================================================================================
-
-===============================================================================
-The following components come under Apache Software License 2.0
-===============================================================================
-
-org.wso2.carbon.base-4.2.0.jar
-org.wso2.carbon.bootstrap-4.2.0.jar
-org.wso2.carbon.core-4.2.0.jar
-org.wso2.carbon.core.common-4.2.0.jar
-org.wso2.carbon.databridge.agent.thrift-4.2
-org.wso2.carbon.databridge.commons-4.2.
-org.wso2.carbon.databridge.commons.thrif
-org.wso2.carbon.logging-4.2.0.jar
-org.wso2.carbon.ndatasource.common-4.2.
-org.wso2.carbon.ndatasource.rdbms-4.2.0.j
-org.wso2.carbon.queuing-4.2.0.jar
-org.wso2.carbon.registry.api-4.2.0.jar
-org.wso2.carbon.registry.core-4.2.0.jar
-org.wso2.carbon.registry.xboot-4.2.0.jar
-org.wso2.carbon.securevault-4.2.0.jar
-org.wso2.carbon.user.api-4.2.0.jar
-org.wso2.carbon.user.core-4.2.0.jar
-org.wso2.carbon.user.mgt-4.2.0.jar
-org.wso2.carbon.user.mgt.common-4.2.0.ja
-org.wso2.carbon.utils-4.2.0.jar
-org.wso2.securevault-1.0.0-wso2v2.jar
-abdera-1.0.0.wso2v3.jar
-andes-client-0.13.wso2v8.jar
-annotations-1.3.2.jar
-ant-1.7.0.jar
-ant-launcher-1.7.0.jar
-axiom-1.2.11.wso2v4.jar
-axiom-api-1.2.11.jar
-axiom-impl-1.2.11.jar
-axis2-1.6.1.wso2v10.jar
-commons-cli-1.0.jar
-commons-codec-1.2.jar
-commons-collections-3.2.0.wso2v
-commons-collections-3.2.1.jar
-commons-dbcp-1.4.0.wso2v1.jar
-commons-fileupload-1.2.0.wso2v1
-commons-fileupload-1.2.jar
-commons-httpclient-3.1.0.wso2v2.
-commons-httpclient-3.1.jar
-commons-io-2.0.0.wso2v2.jar
-commons-io-2.0.jar
-commons-lang-2.4.jar
-commons-lang-2.6.0.wso2v1.jar
-commons-lang3-3.1.jar
-commons-logging-1.1.1.jar
-commons-pool-1.5.6.jar
-commons-pool-1.5.6.wso2v1.jar
-compass-2.0.1.wso2v2.jar
-geronimo-activation_1.1_spec-1.0.2.jar
-geronimo-javamail_1.4_spec-1.6.jar
-geronimo-jms_1.1_spec-1.1.jar
-geronimo-stax-api_1.0_spec-1.0.1.jar
-gson-2.2.4.jar
-hazelcast-3.0.1.jar
-hazelcast-3.0.1.wso2v1.jar
-httpclient-4.1.1-wso2v1.jar
-httpclient-4.2.5.jar
-httpcore-4.1.0-wso2v1.jar
-httpcore-4.2.4.jar
-javax.cache.wso2-4.2.0.jar
-java-xmlbuilder-0.6.jar
-javax.servlet-3.0.0.v201112011016.jar
-jdbc-pool-7.0.34.wso2v1.jar
-jdom-1.0.jar
-tomcat-catalina-ha-7.0.34.jar
-tomcat-ha-7.0.34.wso2v1.jar
-tomcat-jdbc-7.0.34.jar
-tomcat-juli-7.0.34.jar
-tomcat-tribes-7.0.34.jar
-tomcat-util-7.0.34.jar
-velocity-1.7.jar
-json-2.0.0.wso2v1.jar
-libthrift-0.7.wso2v1.jar
-libthrift-0.9.1.jar
-log4j-1.2.17.jar
-neethi-2.0.4.wso2v4.jar
-not-yet-commons-ssl-0.3.9.jar
-opencsv-1.8.wso2v1.jar
-org.apache.log4j-1.2.13.v200706111418.jar
-org.apache.stratos.common-4.1.2.jar
-org.apache.stratos.load.balancer.common-4.1.2.jar
-org.apache.stratos.load.balancer.extension.api-4.1.2.jar
-org.apache.stratos.messaging-4.1.2.jar
-poi-3.9.jar
-poi-ooxml-3.9.0.wso2v1.jar
-poi-ooxml-3.9.jar
-poi-ooxml-schemas-3.9.jar
-poi-scratchpad-3.9.0.wso2v1.jar
-poi-scratchpad-3.9.jar
-smack-3.0.4.wso2v1.jar
-smackx-3.0.4.wso2v1.jar
-stax-api-1.0.1.jar
-tomcat-annotations-api-7.0.34.jar
-tomcat-api-7.0.34.jar
-tomcat-catalina-7.0.34.jar
-
-
-===============================================================================
-The following components come under Public Domain License
-===============================================================================
-
-For base64-2.3.8.jar
-
-===============================================================================
-The following components come under BouncyCastle License
-===============================================================================
-
-For bcprov-jdk15-132.jar
-
-Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-===============================================================================
-The following components are Licensed under BSD license
-===============================================================================
-
-For dom4j-1.6.1.jar, 
-jline-0.9.94.jar, 
-jsch-0.1.49.jar
-jaxen-1.1.1.jar
-
-Copyright (c) 2010 Terence Parr
-All rights reserved.
-
-[The BSD License]
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of JiBX nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=============================================================================== 
-The following components are licensed under EPL
-=============================================================================== 
-
-For junit-3.8.1.jar,
-org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
-org.eclipse.osgi-3.8.1.v20120830-144521.jar,
-org.eclipse.osgi.services-3.3.100.v20120522-1822.jar
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of the Program.
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-
-=============================================================================== 
-The following components are licensed under MIT license
-=============================================================================== 
-
-For slf4j-1.5.10.wso2v1.jar,
-slf4j-api-1.7.5.jar,
-slf4j-log4j12-1.7.5.jar
-
-The MIT License (MIT)
-
-Copyright (c) 2004-2013 QOS.ch
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/notice/NOTICE b/extensions/load-balancer/nginx-extension/src/main/notice/NOTICE
deleted file mode 100644
index ba9e5bd..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/notice/NOTICE
+++ /dev/null
@@ -1,402 +0,0 @@
-Apache Stratos NGINX Extension
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-================================================================================
-Apache Software
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-================================================================================
-Apache Abdera Notice:
-
-Portions of Abdera were orginally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Abdera CLA".
-
-This software's test suite contains data files derived from the
-Universal Feed Parser, Copyright (c) 2002-2005, Mark Pilgrim.
-
-This software's extensions module contains a JSON writer for Atom XML
-that utilizes a JSON parser, Copyright (c) 2002, json.org. The code was 
-licensed using Apache License by the author Douglas Crockford and made 
-available at http://json.org/java/apache.zip We have included portions 
-of the code in the extensions module.
-
-===============================================================================
-Apache Ant Notice:
-
-The <sync> task is based on code Copyright (c) 2002, Landmark
-Graphics Corp that has been kindly donated to the Apache Software
-Foundation.
-
-================================================================================
-Apache Axiom Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-
-================================================================================
-Apache Axis2 Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems,
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-================================================================================
-Apache Commons-Lang Notice:
-
-This product includes software from the Spring Framework,
-under the Apache License 2.0 (see: StringUtils.containsWhitespace())
-
-================================================================================
-Apache Commons-Pool Notice:
-
-The LinkedBlockingDeque implementation is based on an implementation written by
-Doug Lea with assistance from members of JCP JSR-166 Expert Group and released
-to the public domain, as explained at
-http://creativecommons.org/licenses/publicdomain
-
-================================================================================
-Apache Commons-httpclient Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache Tomcat Notice:
-
-The Windows Installer is built with the Nullsoft
-Scriptable Install System (NSIS), which is
-open source software.  The original software and
-related information is available at
-http://nsis.sourceforge.net.
-
-Java compilation software for JSP pages is provided by Eclipse,
-which is open source software.  The original software and
-related information is available at
-http://www.eclipse.org.
-
-For the bayeux implementation
-The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation
-* Copyright 2007-2008 Guy Molinari
-* Copyright 2007-2008 Filip Hanik
-* Copyright 2007 Dojo Foundation
-* Copyright 2007 Mort Bay Consulting Pty. Ltd.
-
-The original XML Schemas for Java EE Deployment Descriptors:
- - javaee_5.xsd
- - javaee_web_services_1_2.xsd
- - javaee_web_services_client_1_2.xsd
- - javaee_6.xsd
- - javaee_web_services_1_3.xsd
- - javaee_web_services_client_1_3.xsd
- - jsp_2_2.xsd
- - web-app_3_0.xsd
- - web-common_3_0.xsd
- - web-fragment_3_0.xsd
- - javaee_7.xsd
- - javaee_web_services_1_4.xsd
- - javaee_web_services_client_1_4.xsd
- - jsp_2_3.xsd
- - web-app_3_1.xsd
- - web-common_3_1.xsd
- - web-fragment_3_1.xsd
-
-may be obtained from:
-http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
-
-================================================================================
-Apache Geranimo Notice:
-
-Apache Geronimo
-Copyright 2003-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-Portions of the Web Console were orginally developed by International
-Business Machines Corporation and are licensed to the Apache Software
-Foundation under the "Software Grant and Corporate Contribution
-License Agreement", informally known as the "IBM Console CLA".
-
-Portions of the ASN1 codec implementation in
-framework/modules/geronimo-crypto/ were developed by the Bouncy Castle
-project (http://www.bouncycastle.org/).
-
-Copyright (c) 2000-2005
-The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
-
-ORB Portions of this software were developed at IONA Technologies.
-
-Object Management Group (OMG) classes used by the orb.
-The original classes are available from www.org.omg.
-
-The RMI over IIOP implementation were developed at Trifork Technologies.
-
-Copyright 2004-2009 Tranql project committers
-This product includes software developed at
-Tranql (http://tranql.codehaus.org/).
-
-This product includes software developed by the Protocol Buffers
-project (http://code.google.com/apis/protocolbuffers).
-
-This product includes also software developed by :
-  - the W3C consortium (http://www.w3c.org) ,
-  - the SAX project (http://www.saxproject.org)
-
-The <sync> task is based on code Copyright (c) 2002, Landmark
-Graphics Corp that has been kindly donated to the Apache Software
-Foundation.
-
-Portions of this software were originally based on the following:
-  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-  - voluntary contributions made by Paul Eng on behalf of the
-    Apache Software Foundation that were originally developed at iClick, Inc.,
-    software copyright (c) 1999.
-
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems,
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-This product also includes schemas and specification developed by:
-      - the W3C consortium (http://www.w3c.org)
-      (http://www.w3.org/XML/1998/namespace)
-
-This product also includes WS-* schemas developed by International
-   Business Machines Corporation, Microsoft Corporation, BEA Systems,
-   TIBCO Software, SAP AG, Sonic Software, and VeriSign
-   (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)
-   (http://schemas.xmlsoap.org/ws/2004/08/addressing/)
-   (http://schemas.xmlsoap.org/wsdl/http)
-   (http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm.xsd)
-   (http://www.w3.org/2005/08/addressing/ws-addr.xsd)
-
-Portions of Derby were originally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Derby CLA".
-The following copyright notice(s) were affixed to portions of the code
-with which this file is now or was at one time distributed
-and are placed here unaltered.
-
-(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
-
-(C) Copyright IBM Corp. 2003.
-
-The portion of the functionTests under 'nist' was originally
-developed by the National Institute of Standards and Technology (NIST),
-an agency of the United States Department of Commerce, and adapted by
-International Business Machines Corporation in accordance with the NIST
-Software Acknowledgment and Redistribution document at
-http://www.itl.nist.gov/div897/ctg/sql_form.htm
-
-* OpenJPA includes software written by Miroslav Nachev.
-
-* OpenJPA uses test code written by Charles Tillman.
-
-XMLSec was originally based on software copyright (c) 2001, Institute for
-Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
-
-The development of XMLSec was partly funded by the European
-Commission in the <WebSig> project in the ISIS Programme.
-
-This product also includes software developed by :
-
-  - IBM Corporation (http://www.ibm.com),
-      WSDL4J was the initial code contribution for the Apache Woden
-      project and some of the WSDL4J design and code has been reused.
-  - The W3C Consortium (http://www.w3c.org),
-      Common W3C XML Schema and DTD files are packaged with Apache Woden.
-
-Portions Copyright 2006 International Business Machines Corp.
-
-Portions of this software were originally based on the following:
-  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-Aside from contributions to the Apache XMLBeans project, this
-software also includes:
-
- - one or more source files from the Apache Xerces-J and Apache Axis
-   products, Copyright (c) 1999-2003 Apache Software Foundation
-
- - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
-   Consortium (Massachusetts Institute of Technology, European Research
-   Consortium for Informatics and Mathematics, Keio University)
-
- - resolver.jar from Apache Xml Commons project,
-   Copyright (c) 2001-2003 Apache Software Foundation
-
- - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
-   Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
-
- - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
-   Copyright 2005 BEA under the terms of the Apache Software License 2.0
-
-This product includes software developed by the Simple XML Compiler (SXC)
-project (http://sxc.codehaus.org/project-info.html)
-
-This product includes software developed for the JAXB Reference
-Implementation project. (https://jaxb.dev.java.net/).  Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes software developed for SOAP with Attachments
-API for Java (SAAJ). The software is available from the GlassFish project
-(https://saaj.dev.java.net/).  Apache Geronimo elects to include this
-software in this distribution under the CDDL license.
-
-This product includes software developed for Java API for XML Web Services
-project (JAX-WS) (https://jax-ws.dev.java.net/).  Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes software developed for the Java Server Pages Tag
-Library project (https://jstl.dev.java.net/).   Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes schema files developed for the Glassfish Java EE
-reference implementation (http://java.sun.com/xml/ns/j2ee/).
-Apache Geronimo elects to include this software in this distribution
-under the CDDL license.  You can obtain a copy of the License at:
-    https://glassfish.dev.java.net/public/CDDL+GPL.html
-The source code is available at:
-    https://glassfish.dev.java.net/source/browse/glassfish/
-
-The following schemas are included:
-
-----------------------------------
-  application-client_1_4.xsd
-  application_1_4.xsd
-  connector_1_5.xsd
-  datatypes.dtd
-  ejb-jar_2_1.xsd
-  j2ee_1_4.xsd
-  j2ee_jaxrpc_mapping_1_1.xsd
-  j2ee_web_services_1_1.xsd
-  j2ee_web_services_client_1_1.xsd
-  jsp_2_0.xsd
-  web-app_2_4.xsd
-  web-jsptaglibrary_2_0.xsd
-  application-client_5.xsd
-  application_5.xsd
-  ejb-jar_3_0.xsd
-  handler-chain.xsd
-  javaee_5.xsd
-  javaee_web_services_1_2.xsd
-  javaee_web_services_client_1_2.xsd
-  jsp_2_1.xsd
-  persistence_1_0.xsd
-  web-app_2_5.xsd
-  web-facelettaglibrary_2_0.xsd
-  web-facesconfig_2_0.xsd
-  web-partialresponse_2_0.xsd
-  web-jsptaglibrary_2_1.xsd
-  application_6.xsd
-  application-client_6.xsd
-  connector_1_6.xsd
-  ejb-jar_3_1.xsd
-  javaee_6.xsd
-  javaee_web_services_1_3.xsd
-  javaee_web_services_client_1_3.xsd
-  jsp_2_2.xsd
-  persistence_2_0.xsd
-  web-app_3_0.xsd
-  web-common_3_0.xsd
-  web-fragment_3_0.xsd
---------------------------------
-
-This product includes software developed at
-the OSGi Alliance (http://www.osgi.org/).
-
- This product includes software developed at
- OPS4J (http://www.ops4j.org/).
--------------------------------------------------------------------------------
-
-The product contains the software developed in javassist.org (http://www.javassist.org) 
-which is released under both the Mozilla Public License 
-(http://www.mozilla.org/MPL/MPL-1.1.html) and the GNU Lesser General Public 
-License (http://www.gnu.org/licenses/lgpl-2.1.html).  
-
-The Apache Geronimo project elects to distribute this software under the terms of 
-the Mozilla Public License. 
-
--------------------------------------------------------------------------------
-
-The product contains the software developed in json.org which released under the following license.
-
-http://www.json.org/license.html
-
-Copyright (c) 2002 JSON.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-================================================================================
-Apache Httpclient Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-================================================================================
-Apache Httpcore Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache POI Notice:
-
-This product contains the DOM4J library (http://www.dom4j.org).
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-This product contains parts that were originally based on software from BEA.
-Copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
-World Wide Web Consortium (Massachusetts Institute of Technology, European
-Research Consortium for Informatics and Mathematics, Keio University)
-
-This product contains the Piccolo XML Parser for Java
-(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
-
-This product contains the chunks_parse_cmds.tbl file from the vsdump program.
-Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/resources/velocity.properties b/extensions/load-balancer/nginx-extension/src/main/resources/velocity.properties
deleted file mode 100644
index 437aec5..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/resources/velocity.properties
+++ /dev/null
@@ -1,26 +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.
-#
-
-resource.loader=class, file
-class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
-file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
-runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
-runtime.log.logsystem.log4j.category=velocity
-input.encoding=UTF-8
-output.encoding=UTF-8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/security/client-truststore.jks
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/security/client-truststore.jks b/extensions/load-balancer/nginx-extension/src/main/security/client-truststore.jks
deleted file mode 100644
index be441f3..0000000
Binary files a/extensions/load-balancer/nginx-extension/src/main/security/client-truststore.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/templates/nginx.cfg.template
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/templates/nginx.cfg.template b/extensions/load-balancer/nginx-extension/src/main/templates/nginx.cfg.template
deleted file mode 100644
index 54f9648..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/templates/nginx.cfg.template
+++ /dev/null
@@ -1,8 +0,0 @@
-events {
-    worker_connections  1024;
-}
-
-$configuration
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/pom.xml b/extensions/load-balancer/pom.xml
index 490a623..71137dc 100644
--- a/extensions/load-balancer/pom.xml
+++ b/extensions/load-balancer/pom.xml
@@ -33,8 +33,8 @@
     <description>Apache Stratos extensions for third party load balancers.</description>
 
     <modules>
-        <module>haproxy-extension</module>
-        <module>nginx-extension</module>
-        <module>lvs-extension</module>
+        <module>modules/haproxy-extension</module>
+        <module>modules/nginx-extension</module>
+        <module>modules/lvs-extension</module>
     </modules>
-</project>
\ No newline at end of file
+</project>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 9b628e1..5fa09df 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -32,8 +32,7 @@
     <description>Apache Stratos Extensions</description>
 
     <modules>
-        <module>cep/stratos-cep-extension</module>
-        <module>cep/distribution/</module>
+        <module>cep</module>
         <module>load-balancer</module>
     </modules>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/INSTALL.txt
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/INSTALL.txt b/products/stratos-cli/distribution/INSTALL.txt
deleted file mode 100644
index 46ad852..0000000
--- a/products/stratos-cli/distribution/INSTALL.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-================================================================================
-                        Apache Stratos CLI Installation
-================================================================================
-
-
-1. Extract the zip and go to the extracted directory
-
-Add execute permission to the script in Linux.
-chmod +x ./stratos.sh
-
-2. Export the host and port of the SC as environment variables
-
-Linux:
-export STRATOS_URL=https://stratosmanager.apache.org:9445
-
-Windows:
-set STRATOS_URL=https://stratosmanager.apache.org:9445
-
-3. Run the stratos.sh or stratos.bat as appropriate
-
-4. Export the following environment variables.
-
-Linux: (Add to your bashrc file)
-export JAVA_HOME=/opt/jdk1.6.0_24
-export PATH=$JAVA_HOME/bin:$PATH
-
-Windows: (Set in System Properties)
-set JAVA_HOME=C:\Java\jdk1.6.0_24
-set PATH=%JAVA_HOME%\bin;%PATH%
-
-4. Use the tentant username and password to login
-
-If you wish, you can also export your username and password as environment variables.
-If you export only the username, you will be prompted to enter the password.
-
-Linux:
-export STRATOS_USERNAME=<username>
-export STRATOS_PASSWORD=<password>
-
-Windows:
-set STRATOS_USERNAME=<username>
-set STRATOS_PASSWORD=<password>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/README.txt
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/README.txt b/products/stratos-cli/distribution/README.txt
deleted file mode 100755
index 42044ed..0000000
--- a/products/stratos-cli/distribution/README.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-================================================================================
-                        Apache Stratos CLI
-================================================================================
-
-Welcome to the Apache Stratos CLI.
-
-The command line interface (CLI) is a powerful tool that clients can use
-to communicate with Stratos services. The CLI distribution only includes one
-jar file containing all dependent java libraries.
-
-The tenant can use the CLI tool on two separate modes if needed, which 
-are namely single command line mode and interactive mode. 
-
-If the user executes with a command as an argument, the CLI tool 
-will execute that command and exit with a status code. 
-
-However, if there is no command as an argument, the CLI tool will 
-enter into an interactive mode.
-
-A user will be able to carryout all the following functions via the
-CLI, with the exception of registering tenants and viewing logs.
-
-The CLI tool also supports command history and auto-completing features 
-in the interactive mode.
-
-Configuring CLI Tool
-==================================
-Configuration guide can be found at https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Configuring+CLI+Tool
-
-Help
-==================================
-usage: stratos [-debug] [-h] [-p <password>] [-trace] [-u <username>]
- -debug                     Enable debug logging
- -h,--help                  Display this help
- -p,--password <password>   Password
- -trace                     Enable trace logging
- -u,--username <username>   Username
-
-
-Available Commands:
-create-tenant             	Add new tenant
-list-autoscale-policies   	List available autoscale policies
-subscribe-cartridge       	Subscribe to a cartridge
-exit                      	Exit from Stratos Client Tool
-list-available-cartridges 	List available cartridges
-help                      	Help for commands
-list-available-partitions 	List available partitions
-deploy-cartridge          	Add new cartridge deployment
-unsubscribe-cartridge     	Unsubscribe from a subscribed cartridge
-list-subscribe-cartridges 	List subscribed cartridges with details
-deploy-partition          	Add new partition deployment
-deploy-autoscaling-policy 	Add new autoscaling policy deployment
-deploy-deployment-policy  	Add new deployment policy
-
-
-Support
-==================================
-
-Any problem with this release can be reported to Apache Stratos mailing list
-or in the JIRA issue tracker. If you are sending an email to the mailing
-list make sure to add the [Apache Stratos] prefix to the subject.
-
-Mailing list subscription:
-    dev-subscribe@stratos.apache.org
-
-
-Issue Tracker
-==================================
-
-Jira:
-    https://issues.apache.org/jira/browse/stratos
-
-
-Thank you for using Apache Stratos!
-The Stratos Team

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/pom.xml b/products/stratos-cli/distribution/pom.xml
deleted file mode 100644
index 98b1a94..0000000
--- a/products/stratos-cli/distribution/pom.xml
+++ /dev/null
@@ -1,84 +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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>apache-stratos-cli-parent</artifactId>
-        <version>4.1.2</version>
-    </parent>
-
-    <artifactId>apache-stratos-cli</artifactId>
-    <packaging>pom</packaging>
-    <name>Apache Stratos - CLI</name>
-    <description>Apache Stratos CLI Distribution</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.cli</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-
-    <profiles>
-        <profile>
-            <id>default</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-jar-plugin</artifactId>
-                        <configuration>
-                            <archive>
-                                <manifest>
-                                    <mainClass>org.apache.stratos.cli.Main</mainClass>
-                                </manifest>
-                            </archive>
-                        </configuration>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-assembly-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>1-pre_dist</id>
-                                <phase>test</phase>
-                                <goals>
-                                    <goal>attached</goal>
-                                </goals>
-                                <configuration>
-                                    <descriptors>
-                                        <descriptor>src/main/assembly/bin.xml</descriptor>
-                                    </descriptors>
-                                    <appendAssemblyId>false</appendAssemblyId>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/src/main/assembly/bin.xml b/products/stratos-cli/distribution/src/main/assembly/bin.xml
deleted file mode 100644
index 4ea0bd0..0000000
--- a/products/stratos-cli/distribution/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,88 +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.
-  -->
-<assembly>
-    <id>bin</id>
-    <formats>
-        <format>zip</format>
-    </formats>
-    <fileSets>
-        <fileSet>
-            <directory>${project.basedir}/src/main/bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <includes>
-                <include>stratos.sh</include>
-            </includes>
-            <fileMode>0755</fileMode>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <includes>
-                <include>stratos.bat</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/conf</directory>
-            <outputDirectory>/conf</outputDirectory>
-            <includes>
-                <include>log4j.properties</include>
-            </includes>
-            <fileMode>0600</fileMode>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}</directory>
-            <outputDirectory>/</outputDirectory>
-            <includes>
-                <include>INSTALL.txt</include>
-                <include>README.txt</include>
-            </includes>
-        </fileSet>
-    </fileSets>
-    <files>
-        <file>
-            <source>${project.basedir}/src/main/notice/NOTICE</source>
-            <outputDirectory>/</outputDirectory>
-            <filtered>true</filtered>
-            <fileMode>644</fileMode>
-        </file>
-        <file>
-            <source>${project.basedir}/src/main/license/LICENSE</source>
-            <outputDirectory>/</outputDirectory>
-            <filtered>true</filtered>
-            <fileMode>644</fileMode>
-        </file>
-    </files>
-    <dependencySets>
-        <dependencySet>
-            <excludes>
-                <exclude>*:annotations*</exclude>
-                <exclude>*:icu4j*</exclude>
-                <exclude>*:jaxen*</exclude>
-                <exclude>*:jboss-transaction-api*</exclude>
-                <exclude>*:wrapper*</exclude>
-                <exclude>*:xom*</exclude>
-                <exclude>slf4j.wso2:slf4j</exclude>
-            </excludes>
-            <outputDirectory>/lib</outputDirectory>
-            <useProjectArtifact>true</useProjectArtifact>
-            <scope>runtime</scope>
-        </dependencySet>
-    </dependencySets>
-</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/src/main/bin/stratos.bat
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/src/main/bin/stratos.bat b/products/stratos-cli/distribution/src/main/bin/stratos.bat
deleted file mode 100644
index a63c43c..0000000
--- a/products/stratos-cli/distribution/src/main/bin/stratos.bat
+++ /dev/null
@@ -1,80 +0,0 @@
-@echo off
-
-rem ---------------------------------------------------------------------------
-rem  Licensed to the Apache Software Foundation (ASF) under one
-rem  or more contributor license agreements.  See the NOTICE file
-rem  distributed with this work for additional information
-rem  regarding copyright ownership.  The ASF licenses this file
-rem  to you under the Apache License, Version 2.0 (the
-rem  "License"); you may not use this file except in compliance
-rem  with the License.  You may obtain a copy of the License at
-rem
-rem      http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem  Unless required by applicable law or agreed to in writing,
-rem  software distributed under the License is distributed on an
-rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem  KIND, either express or implied.  See the License for the
-rem  specific language governing permissions and limitations
-rem  under the License.
-rem ---------------------------------------------------------------------------
-rem  Main Script for Apache Stratos CLI
-rem
-rem  Environment Variable Prequisites
-rem
-rem   JAVA_HOME          Java home path
-rem
-rem   STRATOS_URL        The URL of the Stratos Controller
-rem ---------------------------------------------------------------------------
-
-:checkStratoURL
-if "%STRATOS_URL%" == "" goto noStratosURL
-goto checkJava
-
-:noStratosURL
-echo "You must set the STRATOS_URL variable before running the CLI"
-goto end
-
-:checkJava
-if "%JAVA_HOME%" == "" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto checkServer
-
-:noJavaHome
-echo "You must set the JAVA_HOME variable before running CLI."
-goto end
-
-:checkServer
-rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
-if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
-SET curDrive=%cd:~0,1%
-SET wsasDrive=%CARBON_HOME:~0,1%
-if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:
-
-rem ----- update classpath -----------------------------------------------------
-:updateClasspath
-
-setlocal EnableDelayedExpansion
-cd %CARBON_HOME%
-set CARBON_CLASSPATH=
-FOR %%C in ("%CARBON_HOME%\lib\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nC%%~xC"
-
-set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;
-
-set CMD=RUN %*
-
-rem ----------------- Execute The Requested Command ----------------------------
-
-:runServer
-cd %CARBON_HOME%
-set JAVA_ENDORSED="%JAVA_HOME%jre\lib\endorsed";"%JAVA_HOME%lib\endorsed"
-
-:runJava
-"%JAVA_HOME%\bin\java" -cp %CARBON_CLASSPATH% org.apache.stratos.cli.Main
-
-:end
-goto endlocal
-
-:endlocal
-:END
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/src/main/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/src/main/bin/stratos.sh b/products/stratos-cli/distribution/src/main/bin/stratos.sh
deleted file mode 100755
index 97b88df..0000000
--- a/products/stratos-cli/distribution/src/main/bin/stratos.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-#  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.
-# ----------------------------------------------------------------------------
-#  Main Script for the Apache Stratos CLI Tool
-#
-#  Environment Variable Prerequisites
-#
-#   STRATOS_URL: The URL of the Stratos Manager
-#   Example: https://<hostname>:9443
-# ----------------------------------------------------------------------------
-
-set -e
-
-if [ -z "$STRATOS_URL" ]; then
-    echo "STRATOS_URL environment variable is not set"
-fi
-
-script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-lib_path=${script_path}/../lib/
-class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
-
-properties="-Dlog4j.configuration=file://${script_path}/../conf/log4j.properties"
-# Uncomment following line to enable remote debugging
-#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
-
-java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.cli.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/src/main/conf/log4j.properties b/products/stratos-cli/distribution/src/main/conf/log4j.properties
deleted file mode 100644
index ec18740..0000000
--- a/products/stratos-cli/distribution/src/main/conf/log4j.properties
+++ /dev/null
@@ -1,37 +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.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-#log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=logs/stratos-cli.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.cli=INFO


[32/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/src/main/license/LICENSE b/products/stratos-cli/distribution/src/main/license/LICENSE
deleted file mode 100644
index fa362b0..0000000
--- a/products/stratos-cli/distribution/src/main/license/LICENSE
+++ /dev/null
@@ -1,836 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-
-
-===================================================================================
-The Apache Stratos distribution includes a number of run time dependencies with 
-separate copyright notices and license terms. Your use of the Apache Stratos code
-is subject to the terms and conditions of the following licenses.
-===================================================================================
-
-===============================================================================
-The following components come under Apache Software License 2.0
-===============================================================================
-
-For abdera-1.0.0.wso2v3.jar,
-activemq-client-5.10.0.jar,
-ant-1.7.0.jar,
-ant-1.7.0.wso2v1.jar,
-ant-launcher-1.7.0.jar,
-axiom-1.2.11.wso2v4.jar,
-axiom-api-1.2.11.jar,
-axiom-impl-1.2.11.jar,
-axis2-1.6.1.wso2v10.jar,
-axis2-client-1.6.1.wso2v10.jar,
-axis2-json-1.6.1.wso2v10.jar,
-commons-beanutils-1.8.3.jar,
-commons-cli-1.2.jar,
-commons-codec-1.2.jar,
-commons-codec-1.3.0.wso2v1.jar,
-commons-collections-3.2.0.wso2v1.jar,
-commons-collections-3.2.1.jar,
-commons-configuration-1.9.jar,
-commons-dbcp-1.4.0.wso2v1.jar,
-commons-digester-1.8.jar,
-commons-fileupload-1.2.0.wso2v1.jar,
-commons-httpclient-3.0.1.jar,
-commons-httpclient-3.1.0.wso2v1.jar,
-commons-io-2.0.0.wso2v2.jar,
-commons-io-2.0.jar,
-commons-lang-2.6.0.wso2v1.jar,
-commons-lang3-3.3.1.jar,
-commons-logging-1.0.3.jar,
-commons-pool-1.5.6.jar,
-commons-pool-1.5.6.wso2v1.jar,
-commons-validator-1.4.0.jar,
-geronimo-activation_1.1_spec-1.0.2.jar,
-geronimo-j2ee-management_1.1_spec-1.0.1.jar,
-geronimo-javamail_1.4_spec-1.6.jar,
-geronimo-jms_1.1_spec-1.1.jar,
-geronimo-stax-api_1.0_spec-1.0.1.jar,
-geronimo-stax-api_1.0_spec-1.0.1.wso2v1.jar,
-gson-2.2.4.jar,
-hawtbuf-1.10.jar,
-hazelcast-3.0.1.jar,
-hazelcast-3.0.1.wso2v1.jar,
-httpclient-4.1.1-wso2v1.jar,
-httpclient-4.3.3.jar,
-httpcore-4.3.0.wso2v1.jar,
-httpcore-4.3.2.jar,
-java-xmlbuilder-0.6.jar,
-javax.cache.wso2-4.2.0.jar,
-javax.servlet-3.0.0.v201112011016.jar,
-jdbc-pool-7.0.34.wso2v1.jar,
-json-2.0.0.wso2v1.jar,
-libthrift-0.7.wso2v1.jar,
-neethi-2.0.4.wso2v4.jar,
-not-yet-commons-ssl-0.3.9.jar,
-opencsv-1.8.wso2v1.jar,
-org.apache.log4j-1.2.13.v200706111418.jar,
-org.apache.stratos.autoscaler.service.stub-4.1.2.jar,
-org.apache.stratos.cli-4.1.2.jar,
-org.apache.stratos.cloud.controller.service.stub-4.1.2.jar,
-org.apache.stratos.common-4.1.2.jar,
-org.apache.stratos.manager-4.1.2.jar,
-org.apache.stratos.manager.service.stub-4.1.2.jar,
-org.apache.stratos.messaging-4.1.2.jar,
-org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
-org.eclipse.osgi-3.8.1.v20120830-144521.jar,
-org.eclipse.osgi.services-3.3.100.v20120522-1822.jar,
-org.wso2.carbon.admin.mgt-4.2.0.jar,
-org.wso2.carbon.authenticator.proxy-4.2.0.jar,
-org.wso2.carbon.authenticator.stub-4.2.0.jar,
-org.wso2.carbon.base-4.2.0.jar,
-org.wso2.carbon.bootstrap-4.2.0.jar,
-org.wso2.carbon.captcha.mgt-4.2.0.jar,
-org.wso2.carbon.core-4.2.0.jar,
-org.wso2.carbon.core.common-4.2.0.jar,
-org.wso2.carbon.databridge.agent.thrift-4.2.0.jar,
-org.wso2.carbon.databridge.commons-4.2.0.jar,
-org.wso2.carbon.databridge.commons.thrift-4.2.0.jar,
-org.wso2.carbon.email.verification-4.2.0.jar,
-org.wso2.carbon.logging-4.2.0.jar,
-org.wso2.carbon.ndatasource.common-4.2.0.jar,
-org.wso2.carbon.ndatasource.rdbms-4.2.0.jar,
-org.wso2.carbon.ntask.common-4.2.0.jar,
-org.wso2.carbon.ntask.core-4.2.0.jar,
-org.wso2.carbon.queuing-4.2.0.jar,
-org.wso2.carbon.registry.api-4.2.0.jar,
-org.wso2.carbon.registry.core-4.2.0.jar,
-org.wso2.carbon.registry.xboot-4.2.0.jar,
-org.wso2.carbon.remote-tasks.stub-4.2.0.jar,
-org.wso2.carbon.securevault-4.2.0.jar,
-org.wso2.carbon.stratos.common-2.2.0.jar,
-org.wso2.carbon.tenant.mgt-2.2.2.jar,
-org.wso2.carbon.tenant.mgt.core-2.2.0.jar,
-org.wso2.carbon.um.ws.api-4.2.0.jar,
-org.wso2.carbon.um.ws.api.stub-4.2.0.jar,
-org.wso2.carbon.user.api-4.2.0.jar,
-org.wso2.carbon.user.core-4.2.0.jar,
-org.wso2.carbon.user.mgt-4.2.0.jar,
-org.wso2.carbon.user.mgt.common-4.2.0.jar,
-org.wso2.carbon.utils-4.2.0.jar,
-org.wso2.securevault-1.0.0-wso2v2.jar,
-poi-3.9.jar,
-poi-ooxml-3.9.0.wso2v1.jar,
-poi-ooxml-3.9.jar,
-poi-ooxml-schemas-3.9.jar,
-poi-scratchpad-3.9.0.wso2v1.jar,
-poi-scratchpad-3.9.jar,
-quartz-2.1.1.jar,
-quartz-2.1.1.wso2v1.jar,
-rampart-core-1.6.1.wso2v9.jar,
-rampart-policy-1.6.1.wso2v9.jar,
-smack-3.0.4.wso2v1.jar,
-smackx-3.0.4.wso2v1.jar,
-stax-api-1.0.1.jar,
-tomcat-annotations-api-7.0.34.jar,
-tomcat-api-7.0.34.jar,
-tomcat-catalina-7.0.34.jar,
-tomcat-catalina-ha-7.0.34.jar,
-tomcat-ha-7.0.34.wso2v1.jar,
-tomcat-jdbc-7.0.34.jar,
-tomcat-juli-7.0.34.jar,
-tomcat-tribes-7.0.34.jar,
-tomcat-util-7.0.34.jar,
-woden-1.0.0.M8-wso2v1.jar,
-wss4j-1.5.11.wso2v3.jar,
-wss4j-1.5.11.wso2v3.jar,
-wstx-asl-3.2.9.jar,
-xml-apis-1.0.b2.jar,
-xmlbeans-2.3.0.jar,
-XmlSchema-1.4.7.wso2v2.jar
-
-
-====================================================================== 
-The following components are CDDL based License 
-======================================================================
-
-For :   wsdl4j-1.6.2.wso2v4.jar
-
-
-    COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-    1. Definitions.
-
-    1.1. Contributor means each individual or entity that creates or
-    contributes to the creation of Modifications.
-
-    1.2. Contributor Version means the combination of the Original Software,
-    prior Modifications used by a Contributor (if any), and the Modifications
-    made by that particular Contributor.
-
-    1.3. Covered Software means (a) the Original Software, or
-    (b) Modifications, or (c) the combination of files containing Original
-    Software with files containing Modifications, in each case including
-    portions thereof.
-
-    1.4. Executable means the Covered Software in any form other than Source
-    Code.
-
-    1.5. Initial Developer means the individual or entity that first makes
-    Original Software available under this License.
-
-    1.6. Larger Work means a work which combines Covered Software or portions
-    thereof with code not governed by the terms of this License.
-
-    1.7. License means this document.
-
-    1.8. Licensable means having the right to grant, to the maximum extent
-    possible, whether at the time of the initial grant or subsequently
-    acquired, any and all of the rights conveyed herein.
-
-    1.9. Modifications means the Source Code and Executable form of any of
-    the following: A. Any file that results from an addition to, deletion
-    from or modification of the contents of a file containing Original
-    Software or previous Modifications; B. Any new file that contains any
-    part of the Original Software or previous Modification; or C. Any new
-    file that is contributed or otherwise made available under the terms of
-    this License.
-
-    1.10. Original Software means the Source Code and Executable form of
-    computer software code that is originally released under this License.
-
-    1.11. Patent Claims means any patent claim(s), now owned or hereafter
-    acquired, including without limitation, method, process, and apparatus
-    claims, in any patent Licensable by grantor.
-
-    1.12. Source Code means (a) the common form of computer software code in
-    which modifications are made and (b) associated documentation included in
-    or with such code.
-
-    1.13. You (or Your) means an individual or a legal entity exercising
-    rights under, and complying with all of the terms of, this License. For
-    legal entities, You includes any entity which controls, is controlled by,
-    or is under common control with You. For purposes of this definition,
-    control means (a) the power, direct or indirect, to cause the direction
-    or management of such entity, whether by contract or otherwise, or
-    (b) ownership of more than fifty percent (50%) of the outstanding shares
-    or beneficial ownership of such entity.
-
-    2. License Grants.
-
-    2.1. The Initial Developer Grant. Conditioned upon Your compliance with
-    Section 3.1 below and subject to third party intellectual property
-    claims, the Initial Developer hereby grants You a world-wide,
-    royalty-free, non-exclusive license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by Initial Developer, to use, reproduce, modify, display,
-        perform, sublicense and distribute the Original Software (or portions
-        thereof), with or without Modifications, and/or as part of a Larger
-        Work; and
-
-    (b) under Patent Claims infringed by the making, using or selling of
-        Original Software, to make, have made, use, practice, sell, and offer
-        for sale, and/or otherwise dispose of the Original Software (or
-        portions thereof);
-
-    (c) The licenses granted in Sections 2.1(a) and (b) are effective on the
-        date Initial Developer first distributes or otherwise makes the
-        Original Software available to a third party under the terms of
-        this License;
-
-    (d) Notwithstanding Section 2.1(b) above, no patent license is granted:
-        (1) for code that You delete from the Original Software, or (2) for
-        infringements caused by: (i) the modification of the Original
-        Software, or (ii) the combination of the Original Software with other
-        software or devices.
-
-    2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1
-    below and subject to third party intellectual property claims, each
-    Contributor hereby grants You a world-wide, royalty-free, non-exclusive
-    license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by Contributor to use, reproduce, modify, display, perform,
-        sublicense and distribute the Modifications created by such
-        Contributor (or portions thereof), either on an unmodified basis,
-        with other Modifications, as Covered Software and/or as part of a
-        Larger Work; and
-
-    (b) under Patent Claims infringed by the making, using, or selling of
-        Modifications made by that Contributor either alone and/or in
-        combination with its Contributor Version (or portions of such
-        combination), to make, use, sell, offer for sale, have made, and/or
-        otherwise dispose of: (1) Modifications made by that Contributor (or
-        portions thereof); and (2) the combination of Modifications made by
-        that Contributor with its Contributor Version (or portions of such
-        combination).
-
-    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on
-        the date Contributor first distributes or otherwise makes the
-        Modifications available to a third party.
-
-    (d) Notwithstanding Section 2.2(b) above, no patent license is granted:
-        (1) for any code that Contributor has deleted from the Contributor
-        Version; (2) for infringements caused by: (i) third party
-        modifications of Contributor Version, or (ii) the combination of
-        Modifications made by that Contributor with other software (except
-        as part of the Contributor Version) or other devices; or (3) under
-        Patent Claims infringed by Covered Software in the absence of
-        Modifications made by that Contributor.
-
-    3. Distribution Obligations.
-
-    3.1. Availability of Source Code. Any Covered Software that You distribute
-    or otherwise make available in Executable form must also be made available
-    in Source Code form and that Source Code form must be distributed only
-    under the terms of this License. You must include a copy of this License
-    with every copy of the Source Code form of the Covered Software You
-    distribute or otherwise make available. You must inform recipients of any
-    such Covered Software in Executable form as to how they can obtain such
-    Covered Software in Source Code form in a reasonable manner on or through
-    a medium customarily used for software exchange.
-
-    3.2. Modifications. The Modifications that You create or to which You
-    contribute are governed by the terms of this License. You represent that
-    You believe Your Modifications are Your original creation(s) and/or You
-    have sufficient rights to grant the rights conveyed by this License.
-
-    3.3. Required Notices. You must include a notice in each of Your
-    Modifications that identifies You as the Contributor of the Modification.
-    You may not remove or alter any copyright, patent or trademark notices
-    contained within the Covered Software, or any notices of licensing or any
-    descriptive text giving attribution to any Contributor or the Initial
-    Developer.
-
-    3.4. Application of Additional Terms. You may not offer or impose any
-    terms on any Covered Software in Source Code form that alters or restricts
-    the applicable version of this License or the recipients rights hereunder.
-    You may choose to offer, and to charge a fee for, warranty, support,
-    indemnity or liability obligations to one or more recipients of Covered
-    Software. However, you may do so only on Your own behalf, and not on
-    behalf of the Initial Developer or any Contributor. You must make it
-    absolutely clear that any such warranty, support, indemnity or liability
-    obligation is offered by You alone, and You hereby agree to indemnify the
-    Initial Developer and every Contributor for any liability incurred by the
-    Initial Developer or such Contributor as a result of warranty, support,
-    indemnity or liability terms You offer.
-
-    3.5. Distribution of Executable Versions. You may distribute the
-    Executable form of the Covered Software under the terms of this License or
-    under the terms of a license of Your choice, which may contain terms
-    different from this License, provided that You are in compliance with the
-    terms of this License and that the license for the Executable form does
-    not attempt to limit or alter the recipients rights in the Source Code
-    form from the rights set forth in this License. If You distribute the
-    Covered Software in Executable form under a different license, You must
-    make it absolutely clear that any terms which differ from this License
-    are offered by You alone, not by the Initial Developer or Contributor.
-    You hereby agree to indemnify the Initial Developer and every Contributor
-    for any liability incurred by the Initial Developer or such Contributor as
-    a result of any such terms You offer.
-
-    3.6. Larger Works. You may create a Larger Work by combining Covered
-    Software with other code not governed by the terms of this License and
-    distribute the Larger Work as a single product. In such a case, You must
-    make sure the requirements of this License are fulfilled for the Covered
-    Software.
-
-    4. Versions of the License.
-
-    4.1. New Versions. Sun Microsystems, Inc. is the initial license steward
-    and may publish revised and/or new versions of this License from time to
-    time. Each version will be given a distinguishing version number. Except
-    as provided in Section 4.3, no one other than the license steward has the
-    right to modify this License.
-
-    4.2. Effect of New Versions. You may always continue to use, distribute
-    or otherwise make the Covered Software available under the terms of the
-    version of the License under which You originally received the Covered
-    Software. If the Initial Developer includes a notice in the Original
-    Software prohibiting it from being distributed or otherwise made
-    available under any subsequent version of the License, You must
-    distribute and make the Covered Software available under the terms of
-    the version of the License under which You originally received the
-    Covered Software. Otherwise, You may also choose to use, distribute or
-    otherwise make the Covered Software available under the terms of any
-    subsequent version of the License published by the license steward.
-
-    4.3. Modified Versions. When You are an Initial Developer and You want
-    to create a new license for Your Original Software, You may create and
-    use a modified version of this License if You: (a) rename the license and
-    remove any references to the name of the license steward (except to note
-    that the license differs from this License); and (b) otherwise make it
-    clear that the license contains terms which differ from this License.
-
-    5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE
-    ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-    IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
-    SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
-    OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
-    THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE
-    DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
-    CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
-    CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF
-    THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER
-    EXCEPT UNDER THIS DISCLAIMER.
-
-    6. TERMINATION.
-
-    6.1. This License and the rights granted hereunder will terminate
-    automatically if You fail to comply with terms herein and fail to cure
-    such breach within 30 days of becoming aware of the breach. Provisions
-    which, by their nature, must remain in effect beyond the termination of
-    this License shall survive.
-
-    6.2. If You assert a patent infringement claim (excluding declaratory
-    judgment actions) against Initial Developer or a Contributor (the Initial
-    Developer or Contributor against whom You assert such claim is referred
-    to as Participant) alleging that the Participant Software (meaning the
-    Contributor Version where the Participant is a Contributor or the
-    Original Software where the Participant is the Initial Developer)
-    directly or indirectly infringes any patent, then any and all rights
-    granted directly or indirectly to You by such Participant, the Initial
-    Developer (if the Initial Developer is not the Participant) and all
-    Contributors under Sections 2.1 and/or 2.2 of this License shall, upon
-    60 days notice from Participant terminate prospectively and automatically
-    at the expiration of such 60 day notice period, unless if within such
-    60 day period You withdraw Your claim with respect to the Participant
-    Software against such Participant either unilaterally or pursuant to a
-    written agreement with Participant.
-
-    6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
-    user licenses that have been validly granted by You or any distributor
-    hereunder prior to termination (excluding licenses granted to You by any
-    distributor) shall survive termination.
-
-    7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
-    THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
-    YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
-    COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY
-    PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF
-    ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS,
-    LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY
-    AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
-    BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
-    LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-    RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW
-    PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
-    OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
-    AND LIMITATION MAY NOT APPLY TO YOU.
-
-    8. U.S. GOVERNMENT END USERS. The Covered Software is a commercial item,
-    as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
-    commercial computer software (as that term is defined at 48 C.F.R.
-    252.227-7014(a)(1)) and commercial computer software documentation as such
-    terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
-    12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
-    Government End Users acquire Covered Software with only those rights set
-    forth herein. This U.S. Government Rights clause is in lieu of, and
-    supersedes, any other FAR, DFAR, or other clause or provision that
-    addresses Government rights in computer software under this License.
-
-    9. MISCELLANEOUS. This License represents the complete agreement
-    concerning subject matter hereof. If any provision of this License is
-    held to be unenforceable, such provision shall be reformed only to the
-    extent necessary to make it enforceable. This License shall be governed
-    by the law of the jurisdiction specified in a notice contained within
-    the Original Software (except to the extent applicable law, if any,
-    provides otherwise), excluding such jurisdictions conflict-of-law
-    provisions. Any litigation relating to this License shall be subject to
-    the jurisdiction of the courts located in the jurisdiction and venue
-    specified in a notice contained within the Original Software, with the
-    losing party responsible for costs, including, without limitation, court
-    costs and reasonable attorneys fees and expenses. The application of the
-    United Nations Convention on Contracts for the International Sale of
-    Goods is expressly excluded. Any law or regulation which provides that
-    the language of a contract shall be construed against the drafter shall
-    not apply to this License. You agree that You alone are responsible for
-    compliance with the United States export administration regulations (and
-    the export control laws and regulation of any other countries) when You
-    use, distribute or otherwise make available any Covered Software.
-
-    10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the
-    Contributors, each party is responsible for claims and damages arising,
-    directly or indirectly, out of its utilization of rights under this
-    License and You agree to work with Initial Developer and Contributors
-    to distribute such responsibility on an equitable basis. Nothing herein
-    is intended or shall be deemed to constitute any admission of liability.
-
-    NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
-    LICENSE (CDDL) The code released under the CDDL shall be governed by the
-    laws of the State of California (excluding conflict-of-law provisions).
-    Any litigation relating to this License shall be subject to the
-    jurisdiction of the Federal Courts of the Northern District of California
-    and the state courts of the State of California, with venue lying in
-    Santa Clara County, California.
-
-==============================================================================
-
-For :   log4j-1.2.14.jar,
-slf4j-api-1.7.6.jar,
-slf4j-log4j12-1.7.6.jar
-
-
- All rights reserved.
-
- Permission is hereby granted, free  of charge, to any person obtaining
- a  copy  of this  software  and  associated  documentation files  (the
- "Software"), to  deal in  the Software without  restriction, including
- without limitation  the rights to  use, copy, modify,  merge, publish,
- distribute,  sublicense, and/or sell  copies of  the Software,  and to
- permit persons to whom the Software  is furnished to do so, subject to
- the following conditions:
- 
- The  above  copyright  notice  and  this permission  notice  shall  be
- included in all copies or substantial portions of the Software.
- 
- THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
- EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
- MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-==============================================================================
-For :   jline:2.11
-
-Copyright (c) 2002-2006, Marc Prud'hommeaux <mw...@cornell.edu>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or
-without modification, are permitted provided that the following
-conditions are met:
-
-Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with
-the distribution.
-
-Neither the name of JLine nor the names of its contributors
-may be used to endorse or promote products derived from this
-software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-===============================================================================
-The following components are licensed under EPL
-=============================================================================== 
-
-For c3p0-0.9.1.1.jar
-
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of the Program.
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-
-===============================================================================
-The following components are Licensed under BSD license
-===============================================================================
-
-For dom4j-1.6.1.jar
-
-[The BSD License]
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of JiBX nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/distribution/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/products/stratos-cli/distribution/src/main/notice/NOTICE b/products/stratos-cli/distribution/src/main/notice/NOTICE
deleted file mode 100644
index 073b0f0..0000000
--- a/products/stratos-cli/distribution/src/main/notice/NOTICE
+++ /dev/null
@@ -1,85 +0,0 @@
-Apache Stratos CLI
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-===============================================================================
-Apache Axiom Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-	
-Please read the different LICENSE files present in the licenses directory of
-this distribution.
-
-===============================================================================
-Apache Axis2 Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems, 
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-Please read the different LICENSE files present in the lib directory of
-this distribution.
-
-===============================================================================
-Apache Commons Codec Notice:
-
---------------------------------------------------------------------------------
-src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java contains 
-test data from http://aspell.sourceforge.net/test/batch0.tab.
-
-Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org). Verbatim copying
-and distribution of this entire article is permitted in any medium,
-provided this notice is preserved.
---------------------------------------------------------------------------------
-
-===============================================================================
-Apache HttpComponents Client Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache Neethi Notice:
-
-This product is tested with testcases developed at W3C under the license:
-http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
-The source distribution of this product includes those testcases.
-
-
-===============================================================================
-SLF4J Notice:
-
-This product contains a modified portion of 'SLF4J', a simple logging
-facade for Java, which can be obtained at:
-
-  * LICENSE:
-    * license/LICENSE.slf4j.txt (MIT License)
-  * HOMEPAGE:
-    * http://www.slf4j.org/
-
-===============================================================================
-Woodstox Notice:
-
-This product currently only contains code developed by authors
-of specific components, as identified by the source code files.
-
-Since product implements StAX API, it has dependencies to StAX API
-classes.
-
-For additional credits (generally to people who reported problems)
-see CREDITS file.
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/INSTALL.txt
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/INSTALL.txt b/products/stratos-cli/modules/distribution/INSTALL.txt
new file mode 100644
index 0000000..46ad852
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/INSTALL.txt
@@ -0,0 +1,42 @@
+================================================================================
+                        Apache Stratos CLI Installation
+================================================================================
+
+
+1. Extract the zip and go to the extracted directory
+
+Add execute permission to the script in Linux.
+chmod +x ./stratos.sh
+
+2. Export the host and port of the SC as environment variables
+
+Linux:
+export STRATOS_URL=https://stratosmanager.apache.org:9445
+
+Windows:
+set STRATOS_URL=https://stratosmanager.apache.org:9445
+
+3. Run the stratos.sh or stratos.bat as appropriate
+
+4. Export the following environment variables.
+
+Linux: (Add to your bashrc file)
+export JAVA_HOME=/opt/jdk1.6.0_24
+export PATH=$JAVA_HOME/bin:$PATH
+
+Windows: (Set in System Properties)
+set JAVA_HOME=C:\Java\jdk1.6.0_24
+set PATH=%JAVA_HOME%\bin;%PATH%
+
+4. Use the tentant username and password to login
+
+If you wish, you can also export your username and password as environment variables.
+If you export only the username, you will be prompted to enter the password.
+
+Linux:
+export STRATOS_USERNAME=<username>
+export STRATOS_PASSWORD=<password>
+
+Windows:
+set STRATOS_USERNAME=<username>
+set STRATOS_PASSWORD=<password>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/README.txt
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/README.txt b/products/stratos-cli/modules/distribution/README.txt
new file mode 100755
index 0000000..42044ed
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/README.txt
@@ -0,0 +1,75 @@
+================================================================================
+                        Apache Stratos CLI
+================================================================================
+
+Welcome to the Apache Stratos CLI.
+
+The command line interface (CLI) is a powerful tool that clients can use
+to communicate with Stratos services. The CLI distribution only includes one
+jar file containing all dependent java libraries.
+
+The tenant can use the CLI tool on two separate modes if needed, which 
+are namely single command line mode and interactive mode. 
+
+If the user executes with a command as an argument, the CLI tool 
+will execute that command and exit with a status code. 
+
+However, if there is no command as an argument, the CLI tool will 
+enter into an interactive mode.
+
+A user will be able to carryout all the following functions via the
+CLI, with the exception of registering tenants and viewing logs.
+
+The CLI tool also supports command history and auto-completing features 
+in the interactive mode.
+
+Configuring CLI Tool
+==================================
+Configuration guide can be found at https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Configuring+CLI+Tool
+
+Help
+==================================
+usage: stratos [-debug] [-h] [-p <password>] [-trace] [-u <username>]
+ -debug                     Enable debug logging
+ -h,--help                  Display this help
+ -p,--password <password>   Password
+ -trace                     Enable trace logging
+ -u,--username <username>   Username
+
+
+Available Commands:
+create-tenant             	Add new tenant
+list-autoscale-policies   	List available autoscale policies
+subscribe-cartridge       	Subscribe to a cartridge
+exit                      	Exit from Stratos Client Tool
+list-available-cartridges 	List available cartridges
+help                      	Help for commands
+list-available-partitions 	List available partitions
+deploy-cartridge          	Add new cartridge deployment
+unsubscribe-cartridge     	Unsubscribe from a subscribed cartridge
+list-subscribe-cartridges 	List subscribed cartridges with details
+deploy-partition          	Add new partition deployment
+deploy-autoscaling-policy 	Add new autoscaling policy deployment
+deploy-deployment-policy  	Add new deployment policy
+
+
+Support
+==================================
+
+Any problem with this release can be reported to Apache Stratos mailing list
+or in the JIRA issue tracker. If you are sending an email to the mailing
+list make sure to add the [Apache Stratos] prefix to the subject.
+
+Mailing list subscription:
+    dev-subscribe@stratos.apache.org
+
+
+Issue Tracker
+==================================
+
+Jira:
+    https://issues.apache.org/jira/browse/stratos
+
+
+Thank you for using Apache Stratos!
+The Stratos Team

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/pom.xml b/products/stratos-cli/modules/distribution/pom.xml
new file mode 100644
index 0000000..790055c
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/pom.xml
@@ -0,0 +1,85 @@
+<?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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>apache-stratos-cli-parent</artifactId>
+        <version>4.1.2</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>apache-stratos-cli</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache Stratos - CLI</name>
+    <description>Apache Stratos CLI Distribution</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.cli</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-jar-plugin</artifactId>
+                        <configuration>
+                            <archive>
+                                <manifest>
+                                    <mainClass>org.apache.stratos.cli.Main</mainClass>
+                                </manifest>
+                            </archive>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>1-pre_dist</id>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>attached</goal>
+                                </goals>
+                                <configuration>
+                                    <descriptors>
+                                        <descriptor>src/main/assembly/bin.xml</descriptor>
+                                    </descriptors>
+                                    <appendAssemblyId>false</appendAssemblyId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/assembly/bin.xml b/products/stratos-cli/modules/distribution/src/main/assembly/bin.xml
new file mode 100644
index 0000000..4ea0bd0
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/src/main/assembly/bin.xml
@@ -0,0 +1,88 @@
+<?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.
+  -->
+<assembly>
+    <id>bin</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/src/main/bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <includes>
+                <include>stratos.sh</include>
+            </includes>
+            <fileMode>0755</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <includes>
+                <include>stratos.bat</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/conf</directory>
+            <outputDirectory>/conf</outputDirectory>
+            <includes>
+                <include>log4j.properties</include>
+            </includes>
+            <fileMode>0600</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>INSTALL.txt</include>
+                <include>README.txt</include>
+            </includes>
+        </fileSet>
+    </fileSets>
+    <files>
+        <file>
+            <source>${project.basedir}/src/main/notice/NOTICE</source>
+            <outputDirectory>/</outputDirectory>
+            <filtered>true</filtered>
+            <fileMode>644</fileMode>
+        </file>
+        <file>
+            <source>${project.basedir}/src/main/license/LICENSE</source>
+            <outputDirectory>/</outputDirectory>
+            <filtered>true</filtered>
+            <fileMode>644</fileMode>
+        </file>
+    </files>
+    <dependencySets>
+        <dependencySet>
+            <excludes>
+                <exclude>*:annotations*</exclude>
+                <exclude>*:icu4j*</exclude>
+                <exclude>*:jaxen*</exclude>
+                <exclude>*:jboss-transaction-api*</exclude>
+                <exclude>*:wrapper*</exclude>
+                <exclude>*:xom*</exclude>
+                <exclude>slf4j.wso2:slf4j</exclude>
+            </excludes>
+            <outputDirectory>/lib</outputDirectory>
+            <useProjectArtifact>true</useProjectArtifact>
+            <scope>runtime</scope>
+        </dependencySet>
+    </dependencySets>
+</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/src/main/bin/stratos.bat
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/bin/stratos.bat b/products/stratos-cli/modules/distribution/src/main/bin/stratos.bat
new file mode 100644
index 0000000..a63c43c
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/src/main/bin/stratos.bat
@@ -0,0 +1,80 @@
+@echo off
+
+rem ---------------------------------------------------------------------------
+rem  Licensed to the Apache Software Foundation (ASF) under one
+rem  or more contributor license agreements.  See the NOTICE file
+rem  distributed with this work for additional information
+rem  regarding copyright ownership.  The ASF licenses this file
+rem  to you under the Apache License, Version 2.0 (the
+rem  "License"); you may not use this file except in compliance
+rem  with the License.  You may obtain a copy of the License at
+rem
+rem      http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem  Unless required by applicable law or agreed to in writing,
+rem  software distributed under the License is distributed on an
+rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem  KIND, either express or implied.  See the License for the
+rem  specific language governing permissions and limitations
+rem  under the License.
+rem ---------------------------------------------------------------------------
+rem  Main Script for Apache Stratos CLI
+rem
+rem  Environment Variable Prequisites
+rem
+rem   JAVA_HOME          Java home path
+rem
+rem   STRATOS_URL        The URL of the Stratos Controller
+rem ---------------------------------------------------------------------------
+
+:checkStratoURL
+if "%STRATOS_URL%" == "" goto noStratosURL
+goto checkJava
+
+:noStratosURL
+echo "You must set the STRATOS_URL variable before running the CLI"
+goto end
+
+:checkJava
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto checkServer
+
+:noJavaHome
+echo "You must set the JAVA_HOME variable before running CLI."
+goto end
+
+:checkServer
+rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
+if "%CARBON_HOME%"=="" set CARBON_HOME=%~sdp0..
+SET curDrive=%cd:~0,1%
+SET wsasDrive=%CARBON_HOME:~0,1%
+if not "%curDrive%" == "%wsasDrive%" %wsasDrive%:
+
+rem ----- update classpath -----------------------------------------------------
+:updateClasspath
+
+setlocal EnableDelayedExpansion
+cd %CARBON_HOME%
+set CARBON_CLASSPATH=
+FOR %%C in ("%CARBON_HOME%\lib\*.jar") DO set CARBON_CLASSPATH=!CARBON_CLASSPATH!;".\lib\%%~nC%%~xC"
+
+set CARBON_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%CARBON_CLASSPATH%;
+
+set CMD=RUN %*
+
+rem ----------------- Execute The Requested Command ----------------------------
+
+:runServer
+cd %CARBON_HOME%
+set JAVA_ENDORSED="%JAVA_HOME%jre\lib\endorsed";"%JAVA_HOME%lib\endorsed"
+
+:runJava
+"%JAVA_HOME%\bin\java" -cp %CARBON_CLASSPATH% org.apache.stratos.cli.Main
+
+:end
+goto endlocal
+
+:endlocal
+:END
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/src/main/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/bin/stratos.sh b/products/stratos-cli/modules/distribution/src/main/bin/stratos.sh
new file mode 100755
index 0000000..97b88df
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/src/main/bin/stratos.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+#  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.
+# ----------------------------------------------------------------------------
+#  Main Script for the Apache Stratos CLI Tool
+#
+#  Environment Variable Prerequisites
+#
+#   STRATOS_URL: The URL of the Stratos Manager
+#   Example: https://<hostname>:9443
+# ----------------------------------------------------------------------------
+
+set -e
+
+if [ -z "$STRATOS_URL" ]; then
+    echo "STRATOS_URL environment variable is not set"
+fi
+
+script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
+lib_path=${script_path}/../lib/
+class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
+
+properties="-Dlog4j.configuration=file://${script_path}/../conf/log4j.properties"
+# Uncomment following line to enable remote debugging
+#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
+
+java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.cli.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/conf/log4j.properties b/products/stratos-cli/modules/distribution/src/main/conf/log4j.properties
new file mode 100644
index 0000000..ec18740
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/src/main/conf/log4j.properties
@@ -0,0 +1,37 @@
+#
+# 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.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+#log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=logs/stratos-cli.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.cli=INFO


[13/50] [abbrv] stratos git commit: Adding integration tests to PCA

Posted by ra...@apache.org.
Adding integration tests to PCA


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ba20168a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ba20168a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ba20168a

Branch: refs/heads/master
Commit: ba20168aba44c8d93a0afdb6d4e5ca82ae36af19
Parents: 4b3491d
Author: Akila Perera <ra...@gmail.com>
Authored: Thu Aug 27 10:48:59 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Thu Aug 27 10:48:59 2015 +0530

----------------------------------------------------------------------
 .../test/PythonCartridgeAgentTest.java          | 530 -----------------
 .../src/test/resources/agent.conf               |  46 --
 .../src/test/resources/jndi.properties          |  22 -
 .../src/test/resources/log4j.properties         |  41 --
 .../src/test/resources/logging.ini              |  52 --
 .../src/test/resources/payload/launch-params    |   1 -
 .../src/test/resources/payload/launch-params2   |  18 -
 .../python-cartridge-agent/integration/pom.xml  | 161 ++++++
 .../python.cartridge.agent/test/ADCTest.java    |  21 +
 .../test/PythonCartridgeAgentTest.java          | 578 +++++++++++++++++++
 .../src/test/resources/log4j.properties         |  41 ++
 .../src/test/resources/pca-testing1.xml         |  29 +
 .../src/test/resources/pca-testing2.xml         |  29 +
 .../src/test/resources/suite-1/agent.conf       |  46 ++
 .../src/test/resources/suite-1/jndi.properties  |  22 +
 .../src/test/resources/suite-1/logging.ini      |  52 ++
 .../resources/suite-1/payload/launch-params     |   1 +
 .../src/test/resources/suite-2/agent.conf       |  46 ++
 .../src/test/resources/suite-2/jndi.properties  |  22 +
 .../src/test/resources/suite-2/logging.ini      |  52 ++
 .../resources/suite-2/payload/launch-params     |  18 +
 .../test-conf/integration-test.properties       |  26 +
 products/python-cartridge-agent/pom.xml         |   5 +-
 23 files changed, 1146 insertions(+), 713 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
deleted file mode 100644
index 9705228..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
+++ /dev/null
@@ -1,530 +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.python.cartridge.agent.test;
-
-import org.apache.activemq.broker.BrokerService;
-import org.apache.commons.exec.*;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.output.ByteArrayOutputStream;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.domain.LoadBalancingIPType;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.messaging.broker.publish.EventPublisher;
-import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
-import org.apache.stratos.messaging.domain.topology.*;
-import org.apache.stratos.messaging.event.Event;
-import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
-import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
-import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
-import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
-import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
-import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
-import org.apache.stratos.messaging.util.MessagingUtil;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-
-import static junit.framework.Assert.assertTrue;
-
-@RunWith(Parameterized.class)
-public class PythonCartridgeAgentTest {
-
-    private static final Log log = LogFactory.getLog(PythonCartridgeAgentTest.class);
-
-    private static final String NEW_LINE = System.getProperty("line.separator");
-    //    private static final long TIMEOUT = 1440000;
-    private static final long TIMEOUT = 120000;
-    private static final String CLUSTER_ID = "php.php.domain";
-    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
-    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
-    private static final String APP_ID = "application-1";
-    private static final String MEMBER_ID = "php.member-1";
-    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
-    private static final String NETWORK_PARTITION_ID = "network-partition-1";
-    private static final String PARTITION_ID = "partition-1";
-    private static final String TENANT_ID = "-1234";
-    private static final String SERVICE_NAME = "php";
-    public static final String SOURCE_PATH = "/tmp/stratos-pca-test-app-path/";
-
-    private static List<ServerSocket> serverSocketList;
-    private static Map<String, Executor> executorList;
-    private final ArtifactUpdatedEvent artifactUpdatedEvent;
-    private final Boolean expectedResult;
-    private boolean instanceStarted;
-    private boolean instanceActivated;
-    private ByteArrayOutputStreamLocal outputStream;
-    private boolean eventReceiverInitiated = false;
-    private TopologyEventReceiver topologyEventReceiver;
-    private InstanceStatusEventReceiver instanceStatusEventReceiver;
-    private int cepPort = 7712;
-    private BrokerService broker = new BrokerService();
-    private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "tcp://localhost:61617";
-    private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "mqtt://localhost:1885";
-    private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
-
-    public PythonCartridgeAgentTest(ArtifactUpdatedEvent artifactUpdatedEvent, Boolean expectedResult) {
-        this.artifactUpdatedEvent = artifactUpdatedEvent;
-        this.expectedResult = expectedResult;
-    }
-
-    /**
-     * Setup method for test class
-     */
-    @BeforeClass
-    public static void oneTimeSetUp() {
-        // Set jndi.properties.dir system property for initializing event publishers and receivers
-        System.setProperty("jndi.properties.dir", getResourcesFolderPath());
-    }
-
-    /**
-     * Setup method for test method testPythonCartridgeAgent
-     */
-    @Before
-    public void setup() {
-        serverSocketList = new ArrayList<ServerSocket>();
-        executorList = new HashMap<String, Executor>();
-        try {
-            broker.addConnector(ACTIVEMQ_AMQP_BIND_ADDRESS);
-            broker.addConnector(ACTIVEMQ_MQTT_BIND_ADDRESS);
-            broker.setBrokerName("testBroker");
-            broker.setDataDirectory(PythonCartridgeAgentTest.class.getResource("/").getPath() +
-                    File.separator + ".." + File.separator + PYTHON_AGENT_DIR_NAME + File.separator + "activemq-data");
-            broker.start();
-            log.info("Broker service started!");
-        }
-        catch (Exception e) {
-            log.error("Error while setting up broker service", e);
-        }
-        if (!this.eventReceiverInitiated) {
-            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
-            topologyEventReceiver = new TopologyEventReceiver();
-            topologyEventReceiver.setExecutorService(executorService);
-            topologyEventReceiver.execute();
-
-            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
-            instanceStatusEventReceiver.setExecutorService(executorService);
-            instanceStatusEventReceiver.execute();
-
-            this.instanceStarted = false;
-            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
-                @Override
-                protected void onEvent(Event event) {
-                    log.info("Instance started event received");
-                    instanceStarted = true;
-                }
-            });
-
-            this.instanceActivated = false;
-            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
-                @Override
-                protected void onEvent(Event event) {
-                    log.info("Instance activated event received");
-                    instanceActivated = true;
-                }
-            });
-
-            this.eventReceiverInitiated = true;
-        }
-        // Simulate CEP server socket
-        startServerSocket(cepPort);
-        String agentPath = setupPythonAgent();
-        log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
-        log.info("Starting python cartridge agent...");
-        this.outputStream = executeCommand(
-                "python " + agentPath + "/agent.py > " + getResourcesFolderPath() + File.separator + ".." +
-                        File.separator + PYTHON_AGENT_DIR_NAME + File.separator + "cartridge-agent.log");
-    }
-
-    /**
-     * TearDown method for test method testPythonCartridgeAgent
-     */
-    @After
-    public void tearDown() {
-        for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
-            try {
-                String commandText = entry.getKey();
-                Executor executor = entry.getValue();
-                ExecuteWatchdog watchdog = executor.getWatchdog();
-                if (watchdog != null) {
-                    log.info("Terminating process: " + commandText);
-                    watchdog.destroyProcess();
-                }
-            }
-            catch (Exception ignore) {
-            }
-        }
-        for (ServerSocket serverSocket : serverSocketList) {
-            try {
-                log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
-                serverSocket.close();
-            }
-            catch (IOException ignore) {
-            }
-        }
-
-        try {
-            log.info("Deleting source checkout folder...");
-            FileUtils.deleteDirectory(new File(SOURCE_PATH));
-        }
-        catch (Exception ignore) {
-
-        }
-
-        this.instanceStatusEventReceiver.terminate();
-        this.topologyEventReceiver.terminate();
-
-        this.instanceActivated = false;
-        this.instanceStarted = false;
-        try {
-            broker.stop();
-        }
-        catch (Exception e) {
-            log.error("Error while stopping the broker service", e);
-        }
-    }
-
-
-    /**
-     * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
-     * objects as parameters to the test
-     *
-     * @return
-     */
-    @Parameterized.Parameters
-    public static Collection getArtifactUpdatedEventsAsParams() {
-        ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
-
-        ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
-        privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
-        privateRepoEvent.setRepoUserName("testapache2211");
-        privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
-
-        ArtifactUpdatedEvent privateRepoEvent2 = createTestArtifactUpdatedEvent();
-        privateRepoEvent2.setRepoURL("https://testapache2211@bitbucket.org/testapache2211/testrepo.git");
-        privateRepoEvent2.setRepoUserName("testapache2211");
-        privateRepoEvent2.setRepoPassword("iF7qT+BKKPE3PGV1TeDsJA==");
-
-        return Arrays.asList(new Object[][]{
-                {publicRepoEvent, true},
-                {privateRepoEvent, true},
-                {privateRepoEvent2, true}
-        });
-
-//        return Arrays.asList(new Object[][]{
-//                {publicRepoEvent, true}
-//        });
-
-    }
-
-    /**
-     * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
-     * repository URL
-     *
-     * @return
-     */
-    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
-        ArtifactUpdatedEvent publicRepoEvent = new ArtifactUpdatedEvent();
-        publicRepoEvent.setClusterId(CLUSTER_ID);
-        publicRepoEvent.setTenantId(TENANT_ID);
-        publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
-        publicRepoEvent.setCommitEnabled(true);
-        return publicRepoEvent;
-    }
-
-    @Test(timeout = TIMEOUT)
-    public void testPythonCartridgeAgent() {
-        Thread communicatorThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                List<String> outputLines = new ArrayList<String>();
-                while (!outputStream.isClosed()) {
-                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
-                    if (newLines.size() > 0) {
-                        for (String line : newLines) {
-                            if (line.contains("Subscribed to 'topology/#'")) {
-                                sleep(1000);
-                                // Send complete topology event
-                                log.info("Publishing complete topology event...");
-                                Topology topology = createTestTopology();
-                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
-                                publishEvent(completeTopologyEvent);
-                                log.info("Complete topology event published");
-
-                                sleep(3000);
-                                // Publish member initialized event
-                                log.info("Publishing member initialized event...");
-                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
-                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
-                                        PARTITION_ID
-                                );
-                                publishEvent(memberInitializedEvent);
-                                log.info("Member initialized event published");
-
-                                // Simulate server socket
-                                startServerSocket(8080);
-                            }
-                            if (line.contains("Artifact repository found")) {
-                                // Send artifact updated event
-                                publishEvent(artifactUpdatedEvent);
-                            }
-
-                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
-                                //throw new RuntimeException(line);
-                            }
-                            log.info(line);
-                        }
-                    }
-                    sleep(100);
-                }
-            }
-        });
-
-        communicatorThread.start();
-
-        while (!instanceActivated) {
-            // wait until the instance activated event is received.
-            sleep(2000);
-        }
-
-        assertTrue("Instance started event was not received", instanceStarted);
-        assertTrue("Instance activated event was not received", instanceActivated == this.expectedResult);
-    }
-
-    /**
-     * Publish messaging event
-     *
-     * @param event
-     */
-    private void publishEvent(Event event) {
-        String topicName = MessagingUtil.getMessageTopicName(event);
-        EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
-        eventPublisher.publish(event);
-    }
-
-    /**
-     * Start server socket
-     *
-     * @param port
-     */
-    private void startServerSocket(final int port) {
-        Thread socketThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    ServerSocket serverSocket = new ServerSocket(port);
-                    serverSocketList.add(serverSocket);
-                    log.info("Server socket started on port: " + port);
-                    serverSocket.accept();
-                }
-                catch (IOException e) {
-                    String message = "Could not start server socket: [port] " + port;
-                    log.error(message, e);
-                    throw new RuntimeException(message, e);
-                }
-            }
-        });
-        socketThread.start();
-    }
-
-    /**
-     * Create test topology
-     *
-     * @return
-     */
-    private Topology createTestTopology() {
-        Topology topology = new Topology();
-        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
-        topology.addService(service);
-
-        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
-                AUTOSCALING_POLICY_NAME, APP_ID);
-        service.addCluster(cluster);
-
-        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
-                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
-                System.currentTimeMillis());
-
-        member.setDefaultPrivateIP("10.0.0.1");
-        member.setDefaultPublicIP("20.0.0.1");
-        Properties properties = new Properties();
-        properties.setProperty("prop1", "value1");
-        member.setProperties(properties);
-        member.setStatus(MemberStatus.Created);
-        cluster.addMember(member);
-
-        return topology;
-    }
-
-    /**
-     * Return new lines found in the output
-     *
-     * @param currentOutputLines current output lines
-     * @param output             output
-     * @return
-     */
-    private List<String> getNewLines(List<String> currentOutputLines, String output) {
-        List<String> newLines = new ArrayList<String>();
-
-        if (StringUtils.isNotBlank(output)) {
-            String[] lines = output.split(NEW_LINE);
-            if (lines != null) {
-                for (String line : lines) {
-                    if (!currentOutputLines.contains(line)) {
-                        currentOutputLines.add(line);
-                        newLines.add(line);
-                    }
-                }
-            }
-        }
-        return newLines;
-    }
-
-    /**
-     * Sleep current thread
-     *
-     * @param time
-     */
-    private void sleep(long time) {
-        try {
-            Thread.sleep(time);
-        }
-        catch (InterruptedException ignore) {
-        }
-    }
-
-    /**
-     * Copy python agent distribution to a new folder, extract it and copy sample configuration files
-     *
-     * @return
-     */
-    private String setupPythonAgent() {
-        try {
-            log.info("Setting up python cartridge agent...");
-            String srcAgentPath = getResourcesFolderPath() + "/../../src/main/python/cartridge.agent/cartridge.agent";
-            String destAgentPath =
-                    getResourcesFolderPath() + File.separator + ".." + File.separator + PYTHON_AGENT_DIR_NAME +
-                            "/cartridge.agent";
-            FileUtils.copyDirectory(new File(srcAgentPath), new File(destAgentPath));
-
-            String srcAgentConfPath = getResourcesFolderPath() + "/agent.conf";
-            String destAgentConfPath = destAgentPath + "/agent.conf";
-            FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
-
-            String srcLoggingIniPath = getResourcesFolderPath() + "/logging.ini";
-            String destLoggingIniPath = destAgentPath + "/logging.ini";
-            FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
-
-            String srcPayloadPath = getResourcesFolderPath() + "/payload";
-            String destPayloadPath = destAgentPath + "/payload";
-            FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
-
-            log.info("Changing extension scripts permissions");
-            File extensionsPath = new File(destAgentPath + "/extensions/bash");
-            File[] extensions = extensionsPath.listFiles();
-            for (File extension : extensions) {
-                extension.setExecutable(true);
-            }
-
-            log.info("Python cartridge agent setup completed");
-
-            return destAgentPath;
-        }
-        catch (Exception e) {
-            String message = "Could not copy cartridge agent distribution";
-            log.error(message, e);
-            throw new RuntimeException(message, e);
-        }
-    }
-
-    /**
-     * Execute shell command
-     *
-     * @param commandText
-     */
-    private ByteArrayOutputStreamLocal executeCommand(final String commandText) {
-        final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
-        try {
-            CommandLine commandline = CommandLine.parse(commandText);
-            DefaultExecutor exec = new DefaultExecutor();
-            PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
-            exec.setWorkingDirectory(new File(
-                    getResourcesFolderPath() + File.separator + ".." + File.separator + PYTHON_AGENT_DIR_NAME));
-            exec.setStreamHandler(streamHandler);
-            ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
-            exec.setWatchdog(watchdog);
-            exec.execute(commandline, new ExecuteResultHandler() {
-                @Override
-                public void onProcessComplete(int i) {
-                    log.info(commandText + " process completed");
-                }
-
-                @Override
-                public void onProcessFailed(ExecuteException e) {
-                    log.error(commandText + " process failed", e);
-                }
-            });
-            executorList.put(commandText, exec);
-            return outputStream;
-        }
-        catch (Exception e) {
-            log.error(outputStream.toString(), e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Get resources folder path
-     *
-     * @return
-     */
-    private static String getResourcesFolderPath() {
-        String path = PythonCartridgeAgentTest.class.getResource(File.separator).getPath();
-        return StringUtils.removeEnd(path, File.separator);
-    }
-
-    /**
-     * Implements ByteArrayOutputStream.isClosed() method
-     */
-    private class ByteArrayOutputStreamLocal extends ByteArrayOutputStream {
-        private boolean closed;
-
-        @Override
-        public void close() throws IOException {
-            super.close();
-            closed = true;
-        }
-
-        public boolean isClosed() {
-            return closed;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
deleted file mode 100644
index 136433d..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
+++ /dev/null
@@ -1,46 +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.
-
-[agent]
-mb.ip                                 =localhost
-mb.port                               =1885
-listen.address                        =localhost
-thrift.receiver.ip                    =localhost
-thrift.receiver.port                  =7712
-thrift.server.admin.username          =admin
-thrift.server.admin.password          =admin
-cep.stats.publisher.enabled           =true
-lb.private.ip                         =
-lb.public.ip                          =
-enable.artifact.update                =true
-auto.commit                           =false
-auto.checkout                         =true
-artifact.update.interval              =15
-artifact.clone.retries                =5
-artifact.clone.interval               =10
-port.check.timeout                    =600000
-enable.data.publisher                 =false
-monitoring.server.ip                  =localhost
-monitoring.server.port                =7612
-monitoring.server.secure.port         =7712
-monitoring.server.admin.username      =admin
-monitoring.server.admin.password      =admin
-#log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths                        =/tmp/agent.screen.log
-metadata.service.url                  =https://localhost:9443
-super.tenant.repository.path          =/repository/deployment/server/
-tenant.repository.path                =/repository/tenants/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties
deleted file mode 100644
index beefe3c..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/jndi.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61617
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties
deleted file mode 100644
index c0c6e78..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,41 +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.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=cartridge-agent.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.cartridge.agent=INFO
-log4j.logger.org.apache.stratos.messaging=INFO
-log4j.logger.org.apache.stratos.common.util=DEBUG
-log4j.logger.org.wso2.andes.client=ERROR
-log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini
deleted file mode 100644
index 15cad9b..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/logging.ini
+++ /dev/null
@@ -1,52 +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.
-
-
-[formatters]
-keys=default
-
-[formatter_default]
-format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
-class=logging.Formatter
-
-[handlers]
-keys=console, error_file, log_file
-
-[handler_console]
-class=logging.StreamHandler
-formatter=default
-args=tuple()
-
-[handler_log_file]
-class=logging.FileHandler
-level=DEBUG
-formatter=default
-args=("agent.log", "w")
-
-[handler_error_file]
-class=logging.FileHandler
-level=ERROR
-formatter=default
-args=("error.log", "w")
-
-[loggers]
-keys=root
-
-[logger_root]
-level=DEBUG
-formatter=default
-handlers=console,error_file,log_file
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params
deleted file mode 100644
index 165508e..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params
+++ /dev/null
@@ -1 +0,0 @@
-APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' 	,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
 ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
 MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
 0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2 b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2
deleted file mode 100644
index 0d29753..0000000
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/payload/launch-params2
+++ /dev/null
@@ -1,18 +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.
-
-APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
new file mode 100755
index 0000000..e92bbb4
--- /dev/null
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -0,0 +1,161 @@
+<!--
+  ~ 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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>python-cartridge-agent-parent</artifactId>
+        <version>4.1.2</version>
+    </parent>
+
+    <artifactId>python-agent-integration</artifactId>
+    <packaging>jar</packaging>
+    <name>Python Cartridge Agent - Integration Tests</name>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/test/resources/test-conf</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <excludes>
+                                <exclude>**/*</exclude>
+                            </excludes>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>live</id>
+            <build>
+                <resources>
+                    <resource>
+                        <directory>src/test/resources/test-conf</directory>
+                        <filtering>true</filtering>
+                    </resource>
+                </resources>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <inherited>false</inherited>
+                        <configuration>
+                            <suiteXmlFiles>
+                                <suiteXmlFile>src/test/resources/pca-testing1.xml</suiteXmlFile>
+                            </suiteXmlFiles>
+                            <workingDirectory>${basedir}/target</workingDirectory>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-jar-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>test-jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-exec</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>6.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2-client</artifactId>
+            <version>${axis2.wso2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents.wso2</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.3.0.wso2v1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents.wso2</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.2.5.wso2v1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.mock.iaas.client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.andes.wso2</groupId>
+            <artifactId>andes-client</artifactId>
+            <version>0.13.wso2v8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-all</artifactId>
+            <version>5.10.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-mqtt</artifactId>
+            <version>5.10.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.messaging</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
new file mode 100755
index 0000000..86fc7c3
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -0,0 +1,21 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * 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.
+ */
+
+public class ADCTest {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
new file mode 100755
index 0000000..93f4c1e
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
@@ -0,0 +1,578 @@
+/*
+ * 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.python.cartridge.agent.test;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.commons.exec.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
+import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
+import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.util.MessagingUtil;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.*;
+import java.net.ServerSocket;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import static junit.framework.Assert.assertTrue;
+
+public class PythonCartridgeAgentTest {
+
+    private static final Log log = LogFactory.getLog(PythonCartridgeAgentTest.class);
+    private static final String RESOURCES_PATH = "/suite-1";
+    private static final String NEW_LINE = System.getProperty("line.separator");
+    //    private static final long TIMEOUT = 1440000;
+    private static final long TIMEOUT = 120000;
+    private static final String CLUSTER_ID = "php.php.domain";
+    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
+    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
+    private static final String APP_ID = "application-1";
+    private static final String MEMBER_ID = "php.member-1";
+    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+    private static final String NETWORK_PARTITION_ID = "network-partition-1";
+    private static final String PARTITION_ID = "partition-1";
+    private static final String TENANT_ID = "-1234";
+    private static final String SERVICE_NAME = "php";
+    public static final String SOURCE_PATH = "/tmp/stratos-pca-test-app-path/";
+
+    private static List<ServerSocket> serverSocketList;
+    private static Map<String, Executor> executorList;
+
+    private boolean instanceStarted;
+    private boolean instanceActivated;
+    private ByteArrayOutputStreamLocal outputStream;
+    private boolean eventReceiverInitiated = false;
+    private TopologyEventReceiver topologyEventReceiver;
+    private InstanceStatusEventReceiver instanceStatusEventReceiver;
+    private BrokerService broker = new BrokerService();
+    private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
+
+    private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
+    private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
+    private static final String CEP_PORT = "cep.port";
+    private static final String DISTRIBUTION_NAME = "distribution.name";
+
+    private int cepPort;
+    private String amqpBindAddress;
+    private String mqttBindAddress;
+    private String distributionName;
+    private Properties integrationProperties;
+
+    public PythonCartridgeAgentTest() {
+        if (integrationProperties == null) {
+            integrationProperties = new Properties();
+            try {
+                integrationProperties
+                        .load(PythonCartridgeAgentTest.class.getResourceAsStream("/integration-test.properties"));
+                distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
+                amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
+                mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
+                cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
+                log.info("PCA integration properties: " + integrationProperties.toString());
+            }
+            catch (IOException e) {
+                log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
+                        "exists in classpath.", e);
+            }
+        }
+    }
+
+    /**
+     * Setup method for test class
+     */
+    @BeforeSuite
+    public static void oneTimeSetUp() {
+        // Set jndi.properties.dir system property for initializing event publishers and receivers
+        System.setProperty("jndi.properties.dir", getResourcesPath());
+    }
+
+    /**
+     * Setup method for test method testPythonCartridgeAgent
+     */
+    @BeforeSuite
+    public void setup() {
+        serverSocketList = new ArrayList<ServerSocket>();
+        executorList = new HashMap<String, Executor>();
+        try {
+            broker.addConnector(amqpBindAddress);
+            broker.addConnector(mqttBindAddress);
+            broker.setBrokerName("testBroker");
+            broker.setDataDirectory(
+                    PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+                            "/activemq-data");
+            broker.start();
+            log.info("Broker service started!");
+        }
+        catch (Exception e) {
+            log.error("Error while setting up broker service", e);
+        }
+        if (!this.eventReceiverInitiated) {
+            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
+            topologyEventReceiver = new TopologyEventReceiver();
+            topologyEventReceiver.setExecutorService(executorService);
+            topologyEventReceiver.execute();
+
+            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
+            instanceStatusEventReceiver.setExecutorService(executorService);
+            instanceStatusEventReceiver.execute();
+
+            this.instanceStarted = false;
+            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
+                @Override
+                protected void onEvent(Event event) {
+                    log.info("Instance started event received");
+                    instanceStarted = true;
+                }
+            });
+
+            this.instanceActivated = false;
+            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
+                @Override
+                protected void onEvent(Event event) {
+                    log.info("Instance activated event received");
+                    instanceActivated = true;
+                }
+            });
+
+            this.eventReceiverInitiated = true;
+        }
+        // Simulate CEP server socket
+        startServerSocket(cepPort);
+        String agentPath = setupPythonAgent();
+        log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
+        log.info("Starting python cartridge agent...");
+        this.outputStream = executeCommand("python " + agentPath + "/agent.py > " +
+                PythonCartridgeAgentTest.class.getResource(File.separator).getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+                "/cartridge-agent.log");
+    }
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    @AfterSuite
+    public void tearDown() {
+        for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
+            try {
+                String commandText = entry.getKey();
+                Executor executor = entry.getValue();
+                ExecuteWatchdog watchdog = executor.getWatchdog();
+                if (watchdog != null) {
+                    log.info("Terminating process: " + commandText);
+                    watchdog.destroyProcess();
+                }
+            }
+            catch (Exception ignore) {
+            }
+        }
+        for (ServerSocket serverSocket : serverSocketList) {
+            try {
+                log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
+                serverSocket.close();
+            }
+            catch (IOException ignore) {
+            }
+        }
+
+        try {
+            log.info("Deleting source checkout folder...");
+            FileUtils.deleteDirectory(new File(SOURCE_PATH));
+        }
+        catch (Exception ignore) {
+
+        }
+
+        this.instanceStatusEventReceiver.terminate();
+        this.topologyEventReceiver.terminate();
+
+        this.instanceActivated = false;
+        this.instanceStarted = false;
+        try {
+            broker.stop();
+        }
+        catch (Exception e) {
+            log.error("Error while stopping the broker service", e);
+        }
+    }
+
+
+    /**
+     * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
+     * objects as parameters to the test
+     *
+     * @return
+     */
+
+    public static ArrayList<ArtifactUpdatedEvent> getArtifactUpdatedEventsAsParams() {
+        ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+
+        ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
+        privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
+        privateRepoEvent.setRepoUserName("testapache2211");
+        privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
+
+        ArtifactUpdatedEvent privateRepoEvent2 = createTestArtifactUpdatedEvent();
+        privateRepoEvent2.setRepoURL("https://testapache2211@bitbucket.org/testapache2211/testrepo.git");
+        privateRepoEvent2.setRepoUserName("testapache2211");
+        privateRepoEvent2.setRepoPassword("iF7qT+BKKPE3PGV1TeDsJA==");
+
+        ArrayList<ArtifactUpdatedEvent> list = new ArrayList<ArtifactUpdatedEvent>();
+        list.add(privateRepoEvent);
+        list.add(privateRepoEvent2);
+        list.add(publicRepoEvent);
+        return list;
+    }
+
+    /**
+     * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
+     * repository URL
+     *
+     * @return
+     */
+    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+        ArtifactUpdatedEvent publicRepoEvent = new ArtifactUpdatedEvent();
+        publicRepoEvent.setClusterId(CLUSTER_ID);
+        publicRepoEvent.setTenantId(TENANT_ID);
+        publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+        publicRepoEvent.setCommitEnabled(true);
+        return publicRepoEvent;
+    }
+
+    @Test(timeOut = TIMEOUT)
+    public void testPythonCartridgeAgent() {
+        Thread communicatorThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Subscribed to 'topology/#'")) {
+                                sleep(1000);
+                                // Send complete topology event
+                                log.info("Publishing complete topology event...");
+                                Topology topology = createTestTopology();
+                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+                                publishEvent(completeTopologyEvent);
+                                log.info("Complete topology event published");
+
+                                sleep(3000);
+                                // Publish member initialized event
+                                log.info("Publishing member initialized event...");
+                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+                                        PARTITION_ID
+                                );
+                                publishEvent(memberInitializedEvent);
+                                log.info("Member initialized event published");
+
+                                // Simulate server socket
+                                startServerSocket(8080);
+                            }
+                            if (line.contains("Artifact repository found")) {
+                                // Send artifact updated event
+                                ArrayList<ArtifactUpdatedEvent> list = getArtifactUpdatedEventsAsParams();
+                                for (ArtifactUpdatedEvent artifactUpdatedEvent : list) {
+                                    publishEvent(artifactUpdatedEvent);
+                                }
+                            }
+
+                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
+                                //throw new RuntimeException(line);
+                            }
+                            log.info(line);
+                        }
+                    }
+                    sleep(100);
+                }
+            }
+        });
+
+        communicatorThread.start();
+
+        while (!instanceActivated) {
+            // wait until the instance activated event is received.
+            sleep(2000);
+        }
+
+        assertTrue("Instance started event was not received", instanceStarted);
+        assertTrue("Instance activated event was not received", instanceActivated);
+    }
+
+    /**
+     * Publish messaging event
+     *
+     * @param event
+     */
+    private void publishEvent(Event event) {
+        String topicName = MessagingUtil.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+        eventPublisher.publish(event);
+    }
+
+    /**
+     * Start server socket
+     *
+     * @param port
+     */
+    private void startServerSocket(final int port) {
+        Thread socketThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    ServerSocket serverSocket = new ServerSocket(port);
+                    serverSocketList.add(serverSocket);
+                    log.info("Server socket started on port: " + port);
+                    serverSocket.accept();
+                }
+                catch (IOException e) {
+                    String message = "Could not start server socket: [port] " + port;
+                    log.error(message, e);
+                    throw new RuntimeException(message, e);
+                }
+            }
+        });
+        socketThread.start();
+    }
+
+    /**
+     * Create test topology
+     *
+     * @return
+     */
+    private Topology createTestTopology() {
+        Topology topology = new Topology();
+        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+        topology.addService(service);
+
+        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+                AUTOSCALING_POLICY_NAME, APP_ID);
+        service.addCluster(cluster);
+
+        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+                System.currentTimeMillis());
+
+        member.setDefaultPrivateIP("10.0.0.1");
+        member.setDefaultPublicIP("20.0.0.1");
+        Properties properties = new Properties();
+        properties.setProperty("prop1", "value1");
+        member.setProperties(properties);
+        member.setStatus(MemberStatus.Created);
+        cluster.addMember(member);
+
+        return topology;
+    }
+
+    /**
+     * Return new lines found in the output
+     *
+     * @param currentOutputLines current output lines
+     * @param output             output
+     * @return
+     */
+    private List<String> getNewLines(List<String> currentOutputLines, String output) {
+        List<String> newLines = new ArrayList<String>();
+
+        if (StringUtils.isNotBlank(output)) {
+            String[] lines = output.split(NEW_LINE);
+            for (String line : lines) {
+                if (!currentOutputLines.contains(line)) {
+                    currentOutputLines.add(line);
+                    newLines.add(line);
+                }
+            }
+        }
+        return newLines;
+    }
+
+    public static String getResourcesPath() {
+        return PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../../src/test/resources" + RESOURCES_PATH;
+    }
+
+    /**
+     * Sleep current thread
+     *
+     * @param time
+     */
+    private void sleep(long time) {
+        try {
+            Thread.sleep(time);
+        }
+        catch (InterruptedException ignore) {
+        }
+    }
+
+    /**
+     * Copy python agent distribution to a new folder, extract it and copy sample configuration files
+     *
+     * @return
+     */
+    private String setupPythonAgent() {
+        try {
+            log.info("Setting up python cartridge agent...");
+
+
+            String srcAgentPath = PythonCartridgeAgentTest.class.getResource("/").getPath() +
+                    "/../../../distribution/target/" + distributionName + ".zip";
+            String unzipDestPath =
+                    PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME + "/";
+            //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
+            unzip(srcAgentPath, unzipDestPath);
+            String destAgentPath = PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" +
+                    PYTHON_AGENT_DIR_NAME + "/" + distributionName;
+
+            String srcAgentConfPath = getResourcesPath() + "/agent.conf";
+            String destAgentConfPath = destAgentPath + "/agent.conf";
+            FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
+
+            String srcLoggingIniPath = getResourcesPath() + "/logging.ini";
+            String destLoggingIniPath = destAgentPath + "/logging.ini";
+            FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
+
+            String srcPayloadPath = getResourcesPath() + "/payload";
+            String destPayloadPath = destAgentPath + "/payload";
+            FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
+
+            log.info("Changing extension scripts permissions");
+            File extensionsPath = new File(destAgentPath + "/extensions/bash");
+            File[] extensions = extensionsPath.listFiles();
+            for (File extension : extensions) {
+                extension.setExecutable(true);
+            }
+
+            log.info("Python cartridge agent setup completed");
+
+            return destAgentPath;
+        }
+        catch (Exception e) {
+            String message = "Could not copy cartridge agent distribution";
+            log.error(message, e);
+            throw new RuntimeException(message, e);
+        }
+    }
+
+    public void unzip(String zipFilePath, String destDirectory) throws IOException {
+        File destDir = new File(destDirectory);
+        if (!destDir.exists()) {
+            destDir.mkdir();
+        }
+        ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
+        ZipEntry entry = zipIn.getNextEntry();
+        // iterates over entries in the zip file
+        while (entry != null) {
+            String filePath = destDirectory + File.separator + entry.getName();
+            if (!entry.isDirectory()) {
+                // if the entry is a file, extracts it
+                extractFile(zipIn, filePath);
+            } else {
+                // if the entry is a directory, make the directory
+                File dir = new File(filePath);
+                dir.mkdir();
+            }
+            zipIn.closeEntry();
+            entry = zipIn.getNextEntry();
+        }
+        zipIn.close();
+    }
+
+    private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
+        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
+        byte[] bytesIn = new byte[4096];
+        int read = 0;
+        while ((read = zipIn.read(bytesIn)) != -1) {
+            bos.write(bytesIn, 0, read);
+        }
+        bos.close();
+    }
+
+    /**
+     * Execute shell command
+     *
+     * @param commandText
+     */
+    private ByteArrayOutputStreamLocal executeCommand(final String commandText) {
+        final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
+        try {
+            CommandLine commandline = CommandLine.parse(commandText);
+            DefaultExecutor exec = new DefaultExecutor();
+            PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
+            exec.setWorkingDirectory(new File(
+                    PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME));
+            exec.setStreamHandler(streamHandler);
+            ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
+            exec.setWatchdog(watchdog);
+            exec.execute(commandline, new ExecuteResultHandler() {
+                @Override
+                public void onProcessComplete(int i) {
+                    log.info(commandText + " process completed");
+                }
+
+                @Override
+                public void onProcessFailed(ExecuteException e) {
+                    log.error(commandText + " process failed", e);
+                }
+            });
+            executorList.put(commandText, exec);
+            return outputStream;
+        }
+        catch (Exception e) {
+            log.error(outputStream.toString(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Implements ByteArrayOutputStream.isClosed() method
+     */
+    private class ByteArrayOutputStreamLocal extends ByteArrayOutputStream {
+        private boolean closed;
+
+        @Override
+        public void close() throws IOException {
+            super.close();
+            closed = true;
+        }
+
+        public boolean isClosed() {
+            return closed;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/log4j.properties b/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
new file mode 100755
index 0000000..c0c6e78
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/log4j.properties
@@ -0,0 +1,41 @@
+#
+# 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.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=cartridge-agent.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.cartridge.agent=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.apache.stratos.common.util=DEBUG
+log4j.logger.org.wso2.andes.client=ERROR
+log4j.logger.org.apache.activemq.jndi.ActiveMQInitialContextFactory=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
new file mode 100755
index 0000000..a13f950
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
@@ -0,0 +1,29 @@
+<?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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite1">
+    <test name="PCATest">
+        <classes>
+            <class name="org.apache.stratos.python.cartridge.agent.test.PythonCartridgeAgentTest"/>
+        </classes>
+    </test>
+</suite>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
new file mode 100755
index 0000000..c292953
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing2.xml
@@ -0,0 +1,29 @@
+<?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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite2">
+    <test name="PCATest">
+        <classes>
+            <class name="org.apache.stratos.python.cartridge.agent.test.ADCTest"/>
+        </classes>
+    </test>
+</suite>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
new file mode 100755
index 0000000..136433d
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
@@ -0,0 +1,46 @@
+# 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.
+
+[agent]
+mb.ip                                 =localhost
+mb.port                               =1885
+listen.address                        =localhost
+thrift.receiver.ip                    =localhost
+thrift.receiver.port                  =7712
+thrift.server.admin.username          =admin
+thrift.server.admin.password          =admin
+cep.stats.publisher.enabled           =true
+lb.private.ip                         =
+lb.public.ip                          =
+enable.artifact.update                =true
+auto.commit                           =false
+auto.checkout                         =true
+artifact.update.interval              =15
+artifact.clone.retries                =5
+artifact.clone.interval               =10
+port.check.timeout                    =600000
+enable.data.publisher                 =false
+monitoring.server.ip                  =localhost
+monitoring.server.port                =7612
+monitoring.server.secure.port         =7712
+monitoring.server.admin.username      =admin
+monitoring.server.admin.password      =admin
+#log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
+log.file.paths                        =/tmp/agent.screen.log
+metadata.service.url                  =https://localhost:9443
+super.tenant.repository.path          =/repository/deployment/server/
+tenant.repository.path                =/repository/tenants/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/logging.ini
@@ -0,0 +1,52 @@
+# 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.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file


[43/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml b/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
deleted file mode 100644
index 4c4c7e0..0000000
--- a/extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml
+++ /dev/null
@@ -1,309 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
-    <!-- in-flight requests stream definitions start -->
-    <streamDefinition name="in_flight_requests" version="1.0.0">
-         <description>in-flight request count</description>
-         <nickName>in-flight requests</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="in_flight_request_count" type="double"/>
-         </payloadData>
-     </streamDefinition> 
-
-    <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
-         <description>gradient of in flight request count</description>
-         <nickName>gradient in flight requests</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="count" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="average_in_flight_requests" version="1.0.0">
-         <description>average of in-flight request count</description>
-         <nickName>average in-flight requests</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="count" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
-         <description>second derivative of in-flight request count</description>
-         <nickName>second derivative in-flight requests</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="count" type="double"/>
-         </payloadData>
-    </streamDefinition>
-    <!-- in-flight requests stream definitions end -->
-
-    <!-- cartridge agent health stats stream definitions start -->
-    <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
-         <description>agent health stats</description>
-         <nickName>agent health stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-	         <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_id" type="String" />
-             <property name="partition_id" type="String" />
-             <property name="health_description" type="String"/>
-             <property name="value" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="average_load_average_stats" version="1.0.0">
-         <description>average load average stats</description>
-         <nickName>average load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-	     <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="average_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
-         <description>average memory consumption stats</description>
-         <nickName>average memory consumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="average_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="gradient_load_average_stats" version="1.0.0">
-         <description>gradient load average stats</description>
-         <nickName>gradient load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-	     <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="gradient_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
-         <description>gradient memoryconsumption stats</description>
-         <nickName>gradient memoryconsumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-	     <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="gradient_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
-         <description>second derivative memory consumption stats</description>
-         <nickName>second derivative memory consumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-	     <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="second_derivative_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
-         <description>second derivative load average stats</description>
-         <nickName>second derivative load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-	     <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="second_derivative_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="fault_message" version="1.0.0">
-         <description>fault message</description>
-         <nickName>fault message</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_id" type="String"/>
-             <property name="partition_id" type="String"/>
-         </payloadData>
-    </streamDefinition>
-    <!-- cartridge agent health stats stream definitions end -->
-
-    <!-- This is for member_id wise grouping-->
-    <streamDefinition name="member_average_load_average_stats" version="1.0.0">
-         <description>average load average stats</description>
-         <nickName>average load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_average_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
-         <description>average memory consumption stats</description>
-         <nickName>average memory consumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String"/>
-             <property name="cluster_id" type="String"/>
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_average_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
-         <description>gradient load average stats</description>
-         <nickName>gradient load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_gradient_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
-         <description>gradient memoryconsumption stats</description>
-         <nickName>gradient memoryconsumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_gradient_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
-         <description>second derivative memory consumption stats</description>
-         <nickName>second derivative memory consumption stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_second_derivative_memory_consumption" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-    <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
-         <description>second derivative load average stats</description>
-         <nickName>second derivative load average stats</nickName>
-         <metaData>
-         </metaData>
-         <correlationData>
-         </correlationData>
-         <payloadData>
-             <property name="member_id" type="String" />
-             <property name="cluster_id" type="String" />
-             <property name="cluster_instance_id" type="String"/>
-             <property name="network_partition_id" type="String"/>
-             <property name="member_second_derivative_load_average" type="double"/>
-         </payloadData>
-     </streamDefinition>
-
-</streamManagerConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/distribution/README.md
----------------------------------------------------------------------
diff --git a/extensions/cep/distribution/README.md b/extensions/cep/distribution/README.md
deleted file mode 100755
index ebf6bf2..0000000
--- a/extensions/cep/distribution/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Apache Stratos CEP Extensions
-
-Apache Stratos Complex Event Processor (CEP) extensions include Window Processors for processing 
-health statistic events. These extensions are available in Stratos binary distribution, in a 
-distributed deployment where CEP is run externally, these extensions need to be deployed manually.
-
-Please refer below link for more information on WSO2 CEP.
-http://wso2.com/products/complex-event-processor/
-
-
-Thank you for using Apache Stratos!
-The Stratos Team
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/distribution/pom.xml b/extensions/cep/distribution/pom.xml
deleted file mode 100644
index 67ed90a..0000000
--- a/extensions/cep/distribution/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  ~ 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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-extensions</artifactId>
-        <version>4.1.2</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>apache-stratos-cep-artifacts</artifactId>
-    <packaging>pom</packaging>
-    <name>Apache Stratos CEP artifacts</name>
-    <description>Apache Stratos CEP artifacts</description>
-
-    <profiles>
-        <profile>
-            <id>default</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-assembly-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>4-dist</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>attached</goal>
-                                </goals>
-                                <configuration>
-                                    <descriptors>
-                                        <descriptor>${basedir}/src/assembly/bin.xml</descriptor>
-                                    </descriptors>
-                                    <appendAssemblyId>false</appendAssemblyId>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/distribution/src/assembly/bin.xml b/extensions/cep/distribution/src/assembly/bin.xml
deleted file mode 100755
index 509a6e2..0000000
--- a/extensions/cep/distribution/src/assembly/bin.xml
+++ /dev/null
@@ -1,59 +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.
-  -->
-<assembly>
-    <id>bin</id>
-    <formats>
-        <format>zip</format>
-    </formats>
-    <includeBaseDirectory>false</includeBaseDirectory>
-    <fileSets>
-        <fileSet>
-            <directory>../artifacts/</directory>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
-            <includes>
-                <include>**/*.xml</include>
-            </includes>
-            <excludes>
-                <exclude>pom.xml</exclude>
-                <exclude>src/**</exclude>
-            </excludes>
-        </fileSet>
-    </fileSets>
-    <files>
-        <file>
-            <source>${project.basedir}/README.md</source>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
-            <filtered>true</filtered>
-            <fileMode>644</fileMode>
-        </file>
-        <file>
-            <source>src/main/notice/NOTICE</source>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
-            <filtered>true</filtered>
-            <fileMode>644</fileMode>
-        </file>
-        <file>
-            <source>src/main/license/LICENSE</source>
-            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
-            <filtered>true</filtered>
-            <fileMode>644</fileMode>
-        </file>
-    </files>
-</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/cep/distribution/src/main/license/LICENSE b/extensions/cep/distribution/src/main/license/LICENSE
deleted file mode 100644
index 25202d8..0000000
--- a/extensions/cep/distribution/src/main/license/LICENSE
+++ /dev/null
@@ -1,204 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-
-===================================================================================

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/distribution/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/cep/distribution/src/main/notice/NOTICE b/extensions/cep/distribution/src/main/notice/NOTICE
deleted file mode 100644
index 46ddddd..0000000
--- a/extensions/cep/distribution/src/main/notice/NOTICE
+++ /dev/null
@@ -1,7 +0,0 @@
-Apache Stratos CEP Extensions
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-================================================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
new file mode 100644
index 0000000..92f8d8a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
@@ -0,0 +1,31 @@
+<?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.
+
+-->
+
+<eventBuilder name="HealthStatisticsEventBuilder" statistics="disable"
+    trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
+    <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
+        <property name="stream">cartridge_agent_health_stats</property>
+        <property name="version">1.0.0</property>
+    </from>
+    <mapping customMapping="disable" type="wso2event"/>
+    <to streamName="cartridge_agent_health_stats" version="1.0.0"/>
+</eventBuilder>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml b/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
new file mode 100644
index 0000000..8090e63
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
@@ -0,0 +1,31 @@
+<?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.
+
+-->
+
+<eventBuilder name="LoadBalancerStatisticsEventBuilder"
+    statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
+    <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
+        <property name="stream">in_flight_requests</property>
+        <property name="version">1.0.0</property>
+    </from>
+    <mapping customMapping="disable" type="wso2event"/>
+    <to streamName="in_flight_requests" version="1.0.0"/>
+</eventBuilder>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..5955866
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="AverageRequestsInflightEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="average_in_flight_requests" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..a0e2052
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="AverageLoadAverageEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="average_load_average_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.AverageLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_load_average}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..cbcab0a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="AverageMemoryConsumptionEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="average_memory_consumption_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.AverageMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_memory_consumption}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml
new file mode 100644
index 0000000..96264ca
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/FaultMessageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="FaultMessageEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="fault_message" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberFaultEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","memberId":"{{member_id}}","partitionId":"{{partition_id}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..2b5045b
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="GradientInFlightRequestsEventFormatter" statistics="disable"
+  trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="gradient_in_flight_requests" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..7fa3d7a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="GradientLoadAverageEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="gradient_load_average_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_load_average}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..8c3b871
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="GradientMemoryConsumptionEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="gradient_memory_consumption_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_memory_consumption}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..cab6df6
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="MemberAverageLoadAverageEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="member_average_load_average_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_load_average}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..7f6e1f8
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="MemberAverageMemoryConsumptionEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="member_average_memory_consumption_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_memory_consumption}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..af73b46
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="MemberGradientLoadAverageEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="member_gradient_load_average_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_load_average}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..702f149
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="MemberGradientMemoryConsumptionEventFormatter"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="member_gradient_memory_consumption_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_memory_consumption}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..5281652
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="MemberSecondDerivativeLoadAverageEventFormatter"
+  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="member_second_derivative_load_average_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_load_average}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..2e32be3
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="MemberSecondDerivativeMemoryConsumptionEventFormatter"
+  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_memory_consumption}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
new file mode 100644
index 0000000..61862d1
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="SecondDerivativeEventFormatter"
+  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="second_derivative_in_flight_requests" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
new file mode 100644
index 0000000..3dc4a74
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="SecondDerivativeLoadAverageEventFormatter"
+  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="second_derivative_load_average_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_load_average}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
new file mode 100644
index 0000000..bb0f70c
--- /dev/null
+++ b/extensions/cep/modules/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+
+<eventFormatter name="SecondDerivativeMemoryConsumptionEventFormatter"
+  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
+  <from streamName="second_derivative_memory_consumption_stats" version="1.0.0"/>
+  <mapping customMapping="enable" type="json">
+    <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_memory_consumption}}"}}}</inline>
+  </mapping>
+  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
+    <property name="transport.jms.Destination">summarized-health-stats</property>
+  </to>
+</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml b/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml
new file mode 100644
index 0000000..b60a0bf
--- /dev/null
+++ b/extensions/cep/modules/artifacts/executionplans/AverageHeathRequest.xml
@@ -0,0 +1,71 @@
+<?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.
+
+-->
+
+<executionPlan name="AverageHeathRequest" statistics="disable"
+  trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+  <description>This will average health stats of an instance over a minute.</description>
+  <siddhiConfiguration>
+    <property name="siddhi.enable.distributed.processing">false</property>
+    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+  </siddhiConfiguration>
+  <importedStreams>
+    <stream as="health_avg_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
+  </importedStreams>
+  <queryExpressions><![CDATA[
+ 	from health_avg_processsor [health_description == 'ports_not_open'] 
+		select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id insert into fault_message;
+	from health_avg_processsor
+  		select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
+		stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
+  		insert into health_avg_concatinator;
+  	define partition health_avg_cluster_partition by   health_avg_concatinator.health_grad_cluster_network;
+  	define partition member_health_avg_cluster_partition by  health_avg_processsor.member_id;
+  	from health_avg_concatinator [health_description == 'load_average'] 
+		#window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_load_average
+		insert into average_load_average_stats 
+		partition by health_avg_cluster_partition;
+  	from health_avg_processsor [health_description == 'load_average'] 
+		#window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_load_average
+		insert into member_average_load_average_stats 
+		partition by member_health_avg_cluster_partition;
+  	from health_avg_processsor [health_description == 'memory_consumption'] 
+		#window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_memory_consumption
+		insert into member_average_memory_consumption_stats 
+		partition by member_health_avg_cluster_partition;
+  	from health_avg_concatinator [health_description == 'memory_consumption'] 
+		#window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_memory_consumption
+		insert into average_memory_consumption_stats 
+		partition by health_avg_cluster_partition;
+  ]]></queryExpressions>
+  <exportedStreams>
+    <stream name="average_load_average_stats" passthroughFlow="disable"
+      valueOf="average_load_average_stats" version="1.0.0"/>
+    <stream name="member_average_load_average_stats" passthroughFlow="disable"
+      valueOf="member_average_load_average_stats" version="1.0.0"/>
+    <stream name="member_average_memory_consumption_stats" passthroughFlow="disable"
+      valueOf="member_average_memory_consumption_stats" version="1.0.0"/>
+    <stream name="average_memory_consumption_stats" passthroughFlow="disable"
+      valueOf="average_memory_consumption_stats" version="1.0.0"/>
+    <stream name="fault_message" passthroughFlow="disable"
+      valueOf="fault_message" version="1.0.0"/>
+  </exportedStreams>
+</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml b/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml
new file mode 100644
index 0000000..20b94da
--- /dev/null
+++ b/extensions/cep/modules/artifacts/executionplans/AverageInFlightRequestsFinder.xml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+
+<executionPlan name="AverageInFlightRequestsFinder" statistics="disable"
+               trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+    <description>This will average the number of requests in flight over a minute.</description>
+    <siddhiConfiguration>
+        <property name="siddhi.enable.distributed.processing">false</property>
+        <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+    </siddhiConfiguration>
+    <importedStreams>
+        <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
+    </importedStreams>
+    <queryExpressions><![CDATA[
+	from avg_rif_stat
+		select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+		stratos:concat(cluster_id, '-' ,cluster_instance_id) as avg_rif_cluster_network
+		insert into avg_rif_concat;
+	define partition avg_rif_cluster_partition by avg_rif_concat.avg_rif_cluster_network;
+	from avg_rif_concat#window.timeBatch(1 min)
+		select cluster_id, cluster_instance_id, network_partition_id, avg(in_flight_request_count) as count
+		insert into average_in_flight_requests 
+		partition by avg_rif_cluster_partition;
+    ]]></queryExpressions>
+    <exportedStreams>
+        <stream name="average_in_flight_requests"
+                valueOf="average_in_flight_requests" version="1.0.0"/>
+    </exportedStreams>
+</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml b/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml
new file mode 100644
index 0000000..fcbc24e
--- /dev/null
+++ b/extensions/cep/modules/artifacts/executionplans/GradientOfHealthRequest.xml
@@ -0,0 +1,71 @@
+<?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.
+
+-->
+
+<executionPlan name="GradientOfHealthRequest" statistics="disable"
+  trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
+  <description>This will find the gradient of the heath request over a minute.</description>
+  <siddhiConfiguration>
+    <property name="siddhi.enable.distributed.processing">false</property>
+    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+  </siddhiConfiguration>
+  <importedStreams>
+    <stream as="health_grad_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
+  </importedStreams>
+  <queryExpressions><![CDATA[
+  	from health_grad_processsor 
+  		#window.stratos:faultHandling(1min, member_id) select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id
+		group by cluster_id, network_partition_id 
+  		insert into fault_message;
+  	from health_grad_processsor
+  		select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
+		stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
+  		insert into health_grad_concatinator;
+  	define partition health_grad_cluster_partition by  health_grad_concatinator.health_grad_cluster_network;
+ 	define partition member_health_grad_cluster_partition by health_grad_processsor.member_id;
+  	from health_grad_concatinator [health_description == 'load_average'] 
+		#window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_load_average
+		insert into gradient_load_average_stats 
+		partition by health_grad_cluster_partition;
+  	from health_grad_processsor [health_description == 'load_average'] 
+		#window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_load_average
+		insert into member_gradient_load_average_stats 
+		partition by member_health_grad_cluster_partition;
+  	from health_grad_processsor [health_description == 'memory_consumption'] 
+		#window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_memory_consumption
+		insert into member_gradient_memory_consumption_stats  partition by member_health_grad_cluster_partition;
+  	from health_grad_concatinator [health_description == 'memory_consumption'] 
+		#window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_memory_consumption
+		insert into gradient_memory_consumption_stats 
+		partition by health_grad_cluster_partition;]]></queryExpressions>
+  <exportedStreams>
+    <stream name="gradient_load_average_stats"
+      valueOf="gradient_load_average_stats" version="1.0.0"/>
+    <stream name="gradient_memory_consumption_stats"
+      valueOf="gradient_memory_consumption_stats" version="1.0.0"/>
+    <stream name="member_gradient_load_average_stats"
+      valueOf="member_gradient_load_average_stats" version="1.0.0"/>
+    <stream name="member_gradient_memory_consumption_stats"
+      valueOf="member_gradient_memory_consumption_stats" version="1.0.0"/>
+    <stream name="fault_message" passthroughFlow="disable"
+      valueOf="fault_message" version="1.0.0"/>
+  </exportedStreams>
+</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
new file mode 100644
index 0000000..fff4a8a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+
+<executionPlan name="GradientOfRequestsInFlightFinder"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+  <description>This will find the gradient of the number of requests in flight over a minute.</description>
+  <siddhiConfiguration>
+    <property name="siddhi.enable.distributed.processing">false</property>
+    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+  </siddhiConfiguration>
+  <importedStreams>
+    <stream as="gradient_rif_processor" name="in_flight_requests" version="1.0.0"/>
+  </importedStreams>
+  <queryExpressions><![CDATA[
+	from gradient_rif_processor 
+                select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+                stratos:concat(cluster_id, '-' , network_partition_id) as request_grad_cluster_network 
+                insert into gradient_rif_concatinator;
+        define partition request_grad_cluster_partition  by gradient_rif_concatinator.request_grad_cluster_network;
+        from gradient_rif_concatinator
+                #window.stratos:gradient(1 min, in_flight_request_count)
+                select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
+                insert into gradient_in_flight_requests 
+                partition by request_grad_cluster_partition;
+]]></queryExpressions>
+  <exportedStreams>
+    <stream name="gradient_in_flight_requests" valueOf="gradient_in_flight_requests" version="1.0.0"/>
+  </exportedStreams>
+</executionPlan>


[48/50] [abbrv] stratos git commit: Preparing for next development iteration

Posted by ra...@apache.org.
Preparing for next development iteration


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/52f6245e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/52f6245e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/52f6245e

Branch: refs/heads/master
Commit: 52f6245ebf9aae5847fbe0bdfed4e63675b26384
Parents: 9807cfa
Author: Akila Perera <ra...@gmail.com>
Authored: Tue Aug 25 11:24:10 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 22:49:59 2015 +0530

----------------------------------------------------------------------
 README.md                                       | 24 +++++++--------
 .../org.apache.stratos.autoscaler/pom.xml       |  2 +-
 .../org.apache.stratos.cartridge.agent/pom.xml  |  2 +-
 .../agent/test/JavaCartridgeAgentTest.java      |  5 ++--
 components/org.apache.stratos.cli/pom.xml       |  2 +-
 .../src/test/python/README.md                   |  2 +-
 .../org.apache.stratos.cloud.controller/pom.xml |  2 +-
 components/org.apache.stratos.common/pom.xml    |  2 +-
 .../org.apache.stratos.custom.handlers/pom.xml  |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 .../org.apache.stratos.load.balancer/pom.xml    |  2 +-
 .../console/README.md                           |  5 ++--
 .../org.apache.stratos.manager.styles/pom.xml   |  2 +-
 components/org.apache.stratos.manager/pom.xml   |  2 +-
 components/org.apache.stratos.messaging/pom.xml |  2 +-
 .../org.apache.stratos.metadata.client/pom.xml  |  2 +-
 .../org.apache.stratos.metadata.service/pom.xml |  2 +-
 .../org.apache.stratos.mock.iaas.api/pom.xml    |  2 +-
 .../org.apache.stratos.mock.iaas.client/pom.xml |  2 +-
 components/org.apache.stratos.mock.iaas/pom.xml |  2 +-
 .../pom.xml                                     |  2 +-
 .../org.apache.stratos.rest.endpoint/pom.xml    |  2 +-
 .../rest/endpoint/api/StratosApiV41.java        |  2 +-
 components/pom.xml                              |  2 +-
 dependencies/fabric8/kubernetes-api/pom.xml     |  2 +-
 dependencies/fabric8/pom.xml                    |  2 +-
 dependencies/guice-assistedinject/pom.xml       |  2 +-
 dependencies/guice-multibindings/pom.xml        |  2 +-
 dependencies/guice/pom.xml                      |  2 +-
 dependencies/jclouds/cloudstack/pom.xml         |  2 +-
 dependencies/jclouds/ec2/pom.xml                |  2 +-
 .../google-cloud-storage/pom.xml                |  2 +-
 .../google-compute-engine/pom.xml               |  2 +-
 .../google-jclouds-labs/googlecloud/pom.xml     |  2 +-
 .../jclouds/google-jclouds-labs/oauth/pom.xml   |  2 +-
 .../jclouds/google-jclouds-labs/pom.xml         |  2 +-
 dependencies/jclouds/jclouds-blobstore/pom.xml  |  2 +-
 .../jclouds/jclouds-bouncycastle/pom.xml        |  2 +-
 dependencies/jclouds/jclouds-compute/pom.xml    |  2 +-
 dependencies/jclouds/jclouds-core/pom.xml       |  2 +-
 dependencies/jclouds/jclouds-enterprise/pom.xml |  2 +-
 dependencies/jclouds/jclouds-joda/pom.xml       |  2 +-
 dependencies/jclouds/jclouds-netty/pom.xml      |  2 +-
 dependencies/jclouds/jclouds-sshj/pom.xml       |  2 +-
 dependencies/jclouds/openstack-common/pom.xml   |  2 +-
 dependencies/jclouds/openstack-keystone/pom.xml |  2 +-
 dependencies/jclouds/openstack-neutron/pom.xml  |  2 +-
 dependencies/jclouds/openstack-nova/pom.xml     |  2 +-
 dependencies/jclouds/pom.xml                    |  2 +-
 dependencies/jclouds/sts/pom.xml                |  2 +-
 dependencies/pom.xml                            |  2 +-
 dependencies/rocoto/pom.xml                     |  2 +-
 dependencies/sshj/pom.xml                       |  2 +-
 extensions/cep/modules/distribution/pom.xml     |  4 +--
 .../cep/modules/stratos-cep-extension/pom.xml   |  4 +--
 .../modules/haproxy-extension/pom.xml           |  3 +-
 .../haproxy-extension/src/main/license/LICENSE  |  8 ++---
 .../load-balancer/modules/lvs-extension/pom.xml |  3 +-
 .../modules/nginx-extension/pom.xml             |  3 +-
 .../nginx-extension/src/main/license/LICENSE    |  8 ++---
 extensions/load-balancer/pom.xml                |  2 +-
 extensions/pom.xml                              |  2 +-
 .../pom.xml                                     |  2 +-
 features/autoscaler/pom.xml                     |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 features/cep/pom.xml                            |  2 +-
 .../pom.xml                                     |  2 +-
 features/cloud-controller/pom.xml               |  2 +-
 .../org.apache.stratos.common.feature/pom.xml   |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 features/common/pom.xml                         |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 features/load-balancer/pom.xml                  |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 features/manager/pom.xml                        |  2 +-
 .../pom.xml                                     |  2 +-
 .../org.apache.stratos.manager.feature/pom.xml  |  2 +-
 .../pom.xml                                     |  2 +-
 features/manager/stratos-mgt/pom.xml            |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 features/messaging/pom.xml                      |  2 +-
 .../pom.xml                                     |  2 +-
 features/mock-iaas/pom.xml                      |  2 +-
 features/pom.xml                                |  2 +-
 pom.xml                                         |  4 +--
 .../modules/distribution/INSTALL.txt            |  2 +-
 .../modules/distribution/README.txt             |  2 +-
 .../modules/distribution/pom.xml                |  2 +-
 .../distribution/src/main/license/LICENSE       | 14 ++++-----
 products/cartridge-agent/pom.xml                |  2 +-
 .../modules/distribution/INSTALL.txt            |  2 +-
 .../load-balancer/modules/distribution/pom.xml  |  2 +-
 .../src/main/assembly/filter.properties         |  7 +++--
 .../distribution/src/main/license/LICENSE       |  8 ++---
 .../modules/p2-profile-gen/pom.xml              |  2 +-
 products/load-balancer/pom.xml                  |  2 +-
 products/pom.xml                                |  2 +-
 .../python-cartridge-agent/distribution/pom.xml |  2 +-
 products/python-cartridge-agent/pom.xml         |  2 +-
 .../stratos-cli/modules/distribution/README.txt |  2 +-
 .../stratos-cli/modules/distribution/pom.xml    |  3 +-
 .../distribution/src/main/license/LICENSE       | 14 ++++-----
 products/stratos-cli/pom.xml                    |  2 +-
 .../stratos/modules/distribution/INSTALL.txt    |  2 +-
 .../stratos/modules/distribution/README.txt     |  2 +-
 products/stratos/modules/distribution/pom.xml   |  2 +-
 .../distribution/src/assembly/filter.properties |  1 +
 .../distribution/src/main/license/LICENSE       | 31 ++++++++++----------
 products/stratos/modules/integration/pom.xml    |  2 +-
 .../tests/StratosTestServerManager.java         | 28 ++++++------------
 products/stratos/modules/p2-profile-gen/pom.xml |  2 +-
 products/stratos/pom.xml                        |  2 +-
 samples/cartridges/kubernetes/esb.json          |  2 +-
 samples/cartridges/kubernetes/php.json          |  2 +-
 samples/cartridges/kubernetes/tomcat.json       |  2 +-
 samples/cartridges/kubernetes/tomcat1.json      |  2 +-
 samples/cartridges/kubernetes/tomcat2.json      |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 .../pom.xml                                     |  2 +-
 service-stubs/pom.xml                           |  2 +-
 tools/config-scripts/ec2/config.sh              |  1 +
 tools/config-scripts/gce/config.sh              |  1 +
 tools/config-scripts/openstack/config.sh        |  1 +
 .../base-image/Dockerfile                       | 10 +++----
 .../base-image/files/run                        |  2 +-
 .../cartridge-docker-images/build.sh            |  8 ++---
 .../service-images/php/Dockerfile               |  2 +-
 .../service-images/tomcat-saml-sso/Dockerfile   |  2 +-
 .../service-images/tomcat/Dockerfile            |  2 +-
 .../service-images/wso2is-saml-sso/Dockerfile   |  2 +-
 .../stratos-docker-images/run-example.sh        |  2 +-
 tools/puppet3/modules/agent/files/README.txt    |  2 +-
 tools/puppet3/modules/haproxy/files/README.txt  |  2 +-
 tools/puppet3/modules/lb/files/README.txt       |  2 +-
 .../modules/python_agent/files/README.txt       |  2 +-
 tools/stratos-installer/README.md               |  5 ++--
 tools/stratos-installer/conf/setup.conf         |  2 +-
 145 files changed, 216 insertions(+), 227 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 8550a91..9781e26 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@ Apache Stratos
 ===========================
 Apache Stratos includes polyglot language and environment support together with the ability to run on top of multiple IaaS runtimes.
 Stratos is licensed under the Apache License, Version 2.0
-The following are the key features available in Apache Stratos:
+The following are the key features available in Apache Stratos 4.2.0:
 
 Features
 --------
@@ -46,13 +46,13 @@ auto-scaling policies with multiple factors,i.e., requests in flight, memory con
 considered when scaling up or down. The Auto-scaler also supports scaling for non-HTTP transport.
 <br />
 For detailed information on how multi-factored auto-scaling takes place in Stratos,
-see [Autoscaler](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Autoscaler).
+see [Autoscaler](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Autoscaler).
 
 * Smart policies                                        <br />
 The Auto-scaler in Stratos uses two smart policies when making auto-scaling decisions: auto-scaling policy and deployment policy.
 The instances will be automatically spawned based on the smart policies that are applied to the application.
 <br />
-For more information on auto-scaling and deployment policy scaling policies, see [Smart Policies](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Smart+Policies).
+For more information on auto-scaling and deployment policy scaling policies, see [Smart Policies](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Smart+Policies).
 
 * Multiple IaaS support                                 <br />
 Apache Stratos is tested on the following IaaS providers: AWS EC2 and OpenStack. However, it is very easy to extend
@@ -66,7 +66,7 @@ be off-loaded to another cloud.
 * Controlling IaaS resources                            <br />
 It is possible for DevOps to define partitions in a network partition, to control IaaS resources. Thereby,
 Apache Stratos can control resources per cloud, region, and zone. Controlling of IaaS resources provide a high
-availability and solves disaster recovery concerns. For more information, see [Cloud Partitioning](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Cloud+Partitioning).
+availability and solves disaster recovery concerns. For more information, see [Cloud Partitioning](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Cloud+Partitioning).
 
 * Loosely coupled communication                         <br />
 Stratos uses the Advanced Message Queuing Protocol (AMQP) messaging technology for communication among all its components.
@@ -85,7 +85,7 @@ A cartridge is a package of code that includes a Virtual Machine (VM) image plus
 be plugged into Stratos to offer a new PaaS service. Stratos supports single tenant and multi-tenant cartridges.
 If needed, tenants can easily add their own cartridges to Stratos.
 <br />
-For more information on how Stratos uses cartridges, see [Cartridge](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Cartridge).
+For more information on how Stratos uses cartridges, see [Cartridge](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Cartridge).
 
 * Cartridge automation using Puppet                     <br />
 Cartridges can be easily configured with the use of an orchestration layer such as Puppet.
@@ -94,7 +94,7 @@ Cartridges can be easily configured with the use of an orchestration layer such
 Stratos supports third-party load balancers (LBs), i.e, HAProxy, NGINX. Thereby, if required, users can use their own
 LB with Stratos.
 <br />
-For more information, see [Load Balancers](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Load+Balancers).
+For more information, see [Load Balancers](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Load+Balancers).
 
 * Artifact distribution coordination                    <br />
 The Artifact Distribution Coordinator is responsible for the distribution of artifacts. Artifacts can be uploaded
@@ -103,24 +103,24 @@ topology and send notifications to appropriate Cartridge instances. ADC supports
 repositories based deployment synchronization. Users are able to use their own Git repository to sync artifacts with
 a service instance.
 <br />
-For more information, see [Artifact Distribution Coordinator](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Artifact+Distribution+Coordinator).
+For more information, see [Artifact Distribution Coordinator](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Artifact+Distribution+Coordinator).
 
 * Stratos Manager Console                               <br />
 Administrators and tenants can use the Stratos Manager console, which is a web-based UI management console in Stratos,
 to interact with Stratos.
 <br />
-For more information, see [Stratos Manager](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Stratos+Manager).
+For more information, see [Stratos Manager](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Stratos+Manager).
 
 * Stratos REST API                                      <br />
 DevOps can use REST APIs to carry out various administering functions (e.g., adding a tenant, adding a cartridge, etc.).
 <br />
-For more information, see the [Stratos API Reference Guide](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Stratos+API+Reference).
+For more information, see the [Stratos API Reference Guide](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Stratos+API+Reference).
 
 * Interactive CLI Tool                                  <br />
 Command Line Interface (CLI) tool provides users an interface to interact with Stratos and manage your applications.
 <br />
-For more information, see the [CLI Tool](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+CLI+Tool) and the
-[CLI Guide](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+CLI+Guide).
+For more information, see the [CLI Tool](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+CLI+Tool) and the
+[CLI Guide](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+CLI+Guide).
 
 * Monitoring and metering                               <br />
 Apache Stratos provides centralized monitoring and metering. The level of resource utilization in Stratos is measured using metering.
@@ -129,7 +129,7 @@ Apache Stratos provides centralized monitoring and metering. The level of resour
 If required, the DevOps can enable a persistent volume for cartridges. If persistent volume is enabled, Apache Stratos
 automatically attaches a volume when a new cartridge instance is created.
 <br />
-For more information, see [Persistence Volume Mapping](https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Persistence+Volume+Mapping).
+For more information, see [Persistence Volume Mapping](https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Persistence+Volume+Mapping).
 
 * Gracefully shutdown instances                         <br />
 Before terminating an instance, when scaling down, the Auto-scaler will allow all the existing requests to the instance

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.autoscaler/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/pom.xml b/components/org.apache.stratos.autoscaler/pom.xml
index af7c4f2..b2ca270 100644
--- a/components/org.apache.stratos.autoscaler/pom.xml
+++ b/components/org.apache.stratos.autoscaler/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.autoscaler</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.cartridge.agent/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/pom.xml b/components/org.apache.stratos.cartridge.agent/pom.xml
index accad57..f039439 100644
--- a/components/org.apache.stratos.cartridge.agent/pom.xml
+++ b/components/org.apache.stratos.cartridge.agent/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.cartridge.agent</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
index 7db8f70..e78a6e9 100644
--- a/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
+++ b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
@@ -77,8 +77,7 @@ public class JavaCartridgeAgentTest {
     private static final String PARTITION_ID = "partition-1";
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "php";
-    public static final String AGENT_NAME = "distribution.name";
-    public static final String AGENT_VERSION = "distribution.version";
+    public static final String AGENT_NAME = "apache-stratos-cartridge-agent-4.2.0-SNAPSHOT";
     private static HashMap<String, Executor> executorList;
     private static ArrayList<ServerSocket> serverSocketList;
     private final ArtifactUpdatedEvent artifactUpdatedEvent;
@@ -264,7 +263,7 @@ public class JavaCartridgeAgentTest {
             }
 
             log.info("Copying agent jar");
-            String agentJar = "org.apache.stratos.cartridge.agent-" + agentVersion + ".jar";
+            String agentJar = "org.apache.stratos.cartridge.agent-4.2.0-SNAPSHOT.jar";
             String agentJarSource = getResourcesFolderPath() + "/../" + agentJar;
             String agentJarDest = agentHome.getCanonicalPath() + "/lib/" + agentJar;
             FileUtils.copyFile(new File(agentJarSource), new File(agentJarDest));

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.cli/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/pom.xml b/components/org.apache.stratos.cli/pom.xml
index 960161e..d642136 100644
--- a/components/org.apache.stratos.cli/pom.xml
+++ b/components/org.apache.stratos.cli/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.cli</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.cli/src/test/python/README.md
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/test/python/README.md b/components/org.apache.stratos.cli/src/test/python/README.md
index da73cb6..64eb907 100644
--- a/components/org.apache.stratos.cli/src/test/python/README.md
+++ b/components/org.apache.stratos.cli/src/test/python/README.md
@@ -18,7 +18,7 @@ Set the environment variables CLI_JAR, PYTHONPATH and WIREMOCK_JAR, WIREMOCK_HTT
 
 ```
 # the stratos CLI_JAR
-export CLI_JAR=~/stratos/components/org.apache.stratos.cli/target/org.apache.stratos.cli-4.1.2.jar
+export CLI_JAR=~/stratos/components/org.apache.stratos.cli/target/org.apache.stratos.cli-4.2.0.jar
 
 # set the PYTHONPATH to include pexpect
 export PYTHONPATH=$PYTHONPATH:~/stratos/components/org.apache.stratos.cli/target/pexpect-3.2

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.cloud.controller/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/pom.xml b/components/org.apache.stratos.cloud.controller/pom.xml
index dd6c6bb..6d8f003 100644
--- a/components/org.apache.stratos.cloud.controller/pom.xml
+++ b/components/org.apache.stratos.cloud.controller/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.cloud.controller</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.common/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/pom.xml b/components/org.apache.stratos.common/pom.xml
index 31349e5..3f7ae91 100644
--- a/components/org.apache.stratos.common/pom.xml
+++ b/components/org.apache.stratos.common/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.common</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.custom.handlers/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.custom.handlers/pom.xml b/components/org.apache.stratos.custom.handlers/pom.xml
index 759dc8b..f8b52ee 100644
--- a/components/org.apache.stratos.custom.handlers/pom.xml
+++ b/components/org.apache.stratos.custom.handlers/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.custom.handlers</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.kubernetes.client/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.kubernetes.client/pom.xml b/components/org.apache.stratos.kubernetes.client/pom.xml
index 49a54f9..cb9cb8b 100644
--- a/components/org.apache.stratos.kubernetes.client/pom.xml
+++ b/components/org.apache.stratos.kubernetes.client/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.kubernetes.client</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.load.balancer.common/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/pom.xml b/components/org.apache.stratos.load.balancer.common/pom.xml
index f6d83ff..63d1927 100644
--- a/components/org.apache.stratos.load.balancer.common/pom.xml
+++ b/components/org.apache.stratos.load.balancer.common/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.load.balancer.common</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.load.balancer.extension.api/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.extension.api/pom.xml b/components/org.apache.stratos.load.balancer.extension.api/pom.xml
index 738a637..cdc3326 100644
--- a/components/org.apache.stratos.load.balancer.extension.api/pom.xml
+++ b/components/org.apache.stratos.load.balancer.extension.api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.load.balancer/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/pom.xml b/components/org.apache.stratos.load.balancer/pom.xml
index 3f57b59..2c4c6bc 100644
--- a/components/org.apache.stratos.load.balancer/pom.xml
+++ b/components/org.apache.stratos.load.balancer/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.load.balancer</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.manager.console/console/README.md
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/README.md b/components/org.apache.stratos.manager.console/console/README.md
index d95b1d9..583a542 100644
--- a/components/org.apache.stratos.manager.console/console/README.md
+++ b/components/org.apache.stratos.manager.console/console/README.md
@@ -1,5 +1,4 @@
-====================================
- Apache Stratos UXD Implemantation
+##Stratos 4.2.0 New UXD Implemantation##
 ====================================
 
 ### Features ###
@@ -9,4 +8,4 @@
 3. JSON auto-correct feature
 4. Carbon based user Management
 5. Mobile friendly design
-6. Include Application and Group Editor
\ No newline at end of file
+6. Include Application and Group Editor

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.manager.styles/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.styles/pom.xml b/components/org.apache.stratos.manager.styles/pom.xml
index 7668f08..66fc00e 100644
--- a/components/org.apache.stratos.manager.styles/pom.xml
+++ b/components/org.apache.stratos.manager.styles/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.manager/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/pom.xml b/components/org.apache.stratos.manager/pom.xml
index 7ccd244..c94f8dc 100644
--- a/components/org.apache.stratos.manager/pom.xml
+++ b/components/org.apache.stratos.manager/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.manager</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.messaging/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/pom.xml b/components/org.apache.stratos.messaging/pom.xml
index e2cc0ca..20e5307 100644
--- a/components/org.apache.stratos.messaging/pom.xml
+++ b/components/org.apache.stratos.messaging/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.messaging</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.metadata.client/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.metadata.client/pom.xml b/components/org.apache.stratos.metadata.client/pom.xml
index 5e34ab7..d53d8f5 100644
--- a/components/org.apache.stratos.metadata.client/pom.xml
+++ b/components/org.apache.stratos.metadata.client/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.metadata.client</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.metadata.service/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.metadata.service/pom.xml b/components/org.apache.stratos.metadata.service/pom.xml
index c58dbfa..c43a6df 100644
--- a/components/org.apache.stratos.metadata.service/pom.xml
+++ b/components/org.apache.stratos.metadata.service/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.metadata.service</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.mock.iaas.api/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.mock.iaas.api/pom.xml b/components/org.apache.stratos.mock.iaas.api/pom.xml
index 468edcd..95d3f03 100644
--- a/components/org.apache.stratos.mock.iaas.api/pom.xml
+++ b/components/org.apache.stratos.mock.iaas.api/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.mock.iaas.api</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.mock.iaas.client/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.mock.iaas.client/pom.xml b/components/org.apache.stratos.mock.iaas.client/pom.xml
index 8e5974f..a490467 100644
--- a/components/org.apache.stratos.mock.iaas.client/pom.xml
+++ b/components/org.apache.stratos.mock.iaas.client/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>stratos-components-parent</artifactId>
         <groupId>org.apache.stratos</groupId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.mock.iaas.client</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.mock.iaas/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.mock.iaas/pom.xml b/components/org.apache.stratos.mock.iaas/pom.xml
index b3c964b..18d065c 100644
--- a/components/org.apache.stratos.mock.iaas/pom.xml
+++ b/components/org.apache.stratos.mock.iaas/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <artifactId>stratos-components-parent</artifactId>
         <groupId>org.apache.stratos</groupId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.mock.iaas</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.python.cartridge.agent/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/pom.xml b/components/org.apache.stratos.python.cartridge.agent/pom.xml
index 8bef161..e2384b8 100644
--- a/components/org.apache.stratos.python.cartridge.agent/pom.xml
+++ b/components/org.apache.stratos.python.cartridge.agent/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.python.cartridge.agent</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.rest.endpoint/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/pom.xml b/components/org.apache.stratos.rest.endpoint/pom.xml
index f110ee2..ba12d09 100644
--- a/components/org.apache.stratos.rest.endpoint/pom.xml
+++ b/components/org.apache.stratos.rest.endpoint/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-components-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.rest.endpoint</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index af0ff89..8216d55 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -65,7 +65,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Stratos API v4.1
+ * Stratos API v4.1 for Stratos 4.2.0 release.
  */
 @Path("/")
 public class StratosApiV41 extends AbstractApi {

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 3de8d28..5ca8c04 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-components-parent</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/fabric8/kubernetes-api/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/kubernetes-api/pom.xml b/dependencies/fabric8/kubernetes-api/pom.xml
index b855f9b..e4f86e1 100644
--- a/dependencies/fabric8/kubernetes-api/pom.xml
+++ b/dependencies/fabric8/kubernetes-api/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-fabric8</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>kubernetes-api</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/fabric8/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/fabric8/pom.xml b/dependencies/fabric8/pom.xml
index d3b2e1a..5ecc4db 100644
--- a/dependencies/fabric8/pom.xml
+++ b/dependencies/fabric8/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-dependencies-fabric8</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/guice-assistedinject/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/guice-assistedinject/pom.xml b/dependencies/guice-assistedinject/pom.xml
index c3d0957..2826787 100644
--- a/dependencies/guice-assistedinject/pom.xml
+++ b/dependencies/guice-assistedinject/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>guice-assistedinject</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/guice-multibindings/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/guice-multibindings/pom.xml b/dependencies/guice-multibindings/pom.xml
index d178d90..048f525 100644
--- a/dependencies/guice-multibindings/pom.xml
+++ b/dependencies/guice-multibindings/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>guice-multibindings</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/guice/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/guice/pom.xml b/dependencies/guice/pom.xml
index e0a3c28..c9ce406 100644
--- a/dependencies/guice/pom.xml
+++ b/dependencies/guice/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>guice</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/cloudstack/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/cloudstack/pom.xml b/dependencies/jclouds/cloudstack/pom.xml
index 7bca54c..bb76953 100644
--- a/dependencies/jclouds/cloudstack/pom.xml
+++ b/dependencies/jclouds/cloudstack/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>cloudstack</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/ec2/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/ec2/pom.xml b/dependencies/jclouds/ec2/pom.xml
index b9fc40a..34bc005 100644
--- a/dependencies/jclouds/ec2/pom.xml
+++ b/dependencies/jclouds/ec2/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>ec2</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/google-jclouds-labs/google-cloud-storage/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/google-jclouds-labs/google-cloud-storage/pom.xml b/dependencies/jclouds/google-jclouds-labs/google-cloud-storage/pom.xml
index 0980f26..6d4cc37 100644
--- a/dependencies/jclouds/google-jclouds-labs/google-cloud-storage/pom.xml
+++ b/dependencies/jclouds/google-jclouds-labs/google-cloud-storage/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>google-jclouds-labs</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>google-cloud-storage</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/google-jclouds-labs/google-compute-engine/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/google-jclouds-labs/google-compute-engine/pom.xml b/dependencies/jclouds/google-jclouds-labs/google-compute-engine/pom.xml
index 2cda992..2bfa0fe 100644
--- a/dependencies/jclouds/google-jclouds-labs/google-compute-engine/pom.xml
+++ b/dependencies/jclouds/google-jclouds-labs/google-compute-engine/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>google-jclouds-labs</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>google-compute-engine</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/google-jclouds-labs/googlecloud/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/google-jclouds-labs/googlecloud/pom.xml b/dependencies/jclouds/google-jclouds-labs/googlecloud/pom.xml
index bfed4f0..8bb140d 100644
--- a/dependencies/jclouds/google-jclouds-labs/googlecloud/pom.xml
+++ b/dependencies/jclouds/google-jclouds-labs/googlecloud/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>google-jclouds-labs</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>googlecloud</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/google-jclouds-labs/oauth/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/google-jclouds-labs/oauth/pom.xml b/dependencies/jclouds/google-jclouds-labs/oauth/pom.xml
index 4b7eca1..624774b 100644
--- a/dependencies/jclouds/google-jclouds-labs/oauth/pom.xml
+++ b/dependencies/jclouds/google-jclouds-labs/oauth/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>google-jclouds-labs</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>oauth</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/google-jclouds-labs/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/google-jclouds-labs/pom.xml b/dependencies/jclouds/google-jclouds-labs/pom.xml
index 4c54776..7535e05 100644
--- a/dependencies/jclouds/google-jclouds-labs/pom.xml
+++ b/dependencies/jclouds/google-jclouds-labs/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>google-jclouds-labs</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-blobstore/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-blobstore/pom.xml b/dependencies/jclouds/jclouds-blobstore/pom.xml
index 38013be..5a3904b 100644
--- a/dependencies/jclouds/jclouds-blobstore/pom.xml
+++ b/dependencies/jclouds/jclouds-blobstore/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-blobstore</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-bouncycastle/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-bouncycastle/pom.xml b/dependencies/jclouds/jclouds-bouncycastle/pom.xml
index 373ef7e..6643c93 100644
--- a/dependencies/jclouds/jclouds-bouncycastle/pom.xml
+++ b/dependencies/jclouds/jclouds-bouncycastle/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-bouncycastle</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-compute/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-compute/pom.xml b/dependencies/jclouds/jclouds-compute/pom.xml
index 57deea9..8796f61 100644
--- a/dependencies/jclouds/jclouds-compute/pom.xml
+++ b/dependencies/jclouds/jclouds-compute/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-compute</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-core/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-core/pom.xml b/dependencies/jclouds/jclouds-core/pom.xml
index 0498522..7a4460f 100644
--- a/dependencies/jclouds/jclouds-core/pom.xml
+++ b/dependencies/jclouds/jclouds-core/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-core</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-enterprise/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-enterprise/pom.xml b/dependencies/jclouds/jclouds-enterprise/pom.xml
index 1b65170..c69d487 100644
--- a/dependencies/jclouds/jclouds-enterprise/pom.xml
+++ b/dependencies/jclouds/jclouds-enterprise/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-enterprise</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-joda/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-joda/pom.xml b/dependencies/jclouds/jclouds-joda/pom.xml
index 926da36..fa819e7 100644
--- a/dependencies/jclouds/jclouds-joda/pom.xml
+++ b/dependencies/jclouds/jclouds-joda/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-joda</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-netty/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-netty/pom.xml b/dependencies/jclouds/jclouds-netty/pom.xml
index 59cd0e5..3a3eff9 100644
--- a/dependencies/jclouds/jclouds-netty/pom.xml
+++ b/dependencies/jclouds/jclouds-netty/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-netty</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/jclouds-sshj/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/jclouds-sshj/pom.xml b/dependencies/jclouds/jclouds-sshj/pom.xml
index 9f78171..bcd184e 100644
--- a/dependencies/jclouds/jclouds-sshj/pom.xml
+++ b/dependencies/jclouds/jclouds-sshj/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>jclouds-sshj</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/openstack-common/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-common/pom.xml b/dependencies/jclouds/openstack-common/pom.xml
index 2469e73..8a3adaf 100644
--- a/dependencies/jclouds/openstack-common/pom.xml
+++ b/dependencies/jclouds/openstack-common/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>openstack-common</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/openstack-keystone/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-keystone/pom.xml b/dependencies/jclouds/openstack-keystone/pom.xml
index f525aec..3ef6870 100644
--- a/dependencies/jclouds/openstack-keystone/pom.xml
+++ b/dependencies/jclouds/openstack-keystone/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>openstack-keystone</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/openstack-neutron/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-neutron/pom.xml b/dependencies/jclouds/openstack-neutron/pom.xml
index 085210b..ac117b2 100644
--- a/dependencies/jclouds/openstack-neutron/pom.xml
+++ b/dependencies/jclouds/openstack-neutron/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>openstack-neutron</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/openstack-nova/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/pom.xml b/dependencies/jclouds/openstack-nova/pom.xml
index 7c29cb8..c08d4ee 100644
--- a/dependencies/jclouds/openstack-nova/pom.xml
+++ b/dependencies/jclouds/openstack-nova/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>openstack-nova</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/pom.xml b/dependencies/jclouds/pom.xml
index 50cdaeb..8b94072 100644
--- a/dependencies/jclouds/pom.xml
+++ b/dependencies/jclouds/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-dependencies-jclouds</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/jclouds/sts/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/sts/pom.xml b/dependencies/jclouds/sts/pom.xml
index 5aa5eb4..b525f1a 100644
--- a/dependencies/jclouds/sts/pom.xml
+++ b/dependencies/jclouds/sts/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependencies-jclouds</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>sts</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/pom.xml b/dependencies/pom.xml
index 9c9044c..a1a447d 100644
--- a/dependencies/pom.xml
+++ b/dependencies/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-dependents</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/rocoto/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/rocoto/pom.xml b/dependencies/rocoto/pom.xml
index 68b96b1..48aca74 100644
--- a/dependencies/rocoto/pom.xml
+++ b/dependencies/rocoto/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>rocoto</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/dependencies/sshj/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/sshj/pom.xml b/dependencies/sshj/pom.xml
index 0250478..ab4d5f0 100644
--- a/dependencies/sshj/pom.xml
+++ b/dependencies/sshj/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-dependents</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>net.schmizz.sshj</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/cep/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/pom.xml b/extensions/cep/modules/distribution/pom.xml
index 1fe52f0..276ec40 100644
--- a/extensions/cep/modules/distribution/pom.xml
+++ b/extensions/cep/modules/distribution/pom.xml
@@ -22,8 +22,8 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.stratos</groupId>
-        <artifactId>cep-extensions</artifactId>
-        <version>4.1.2</version>
+        <artifactId>stratos-extensions</artifactId>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/cep/modules/stratos-cep-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/pom.xml b/extensions/cep/modules/stratos-cep-extension/pom.xml
index 1905ed4..b80d022 100644
--- a/extensions/cep/modules/stratos-cep-extension/pom.xml
+++ b/extensions/cep/modules/stratos-cep-extension/pom.xml
@@ -22,8 +22,8 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.stratos</groupId>
-        <artifactId>cep-extensions</artifactId>
-        <version>4.1.2</version>
+        <artifactId>stratos-extensions</artifactId>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/load-balancer/modules/haproxy-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/pom.xml b/extensions/load-balancer/modules/haproxy-extension/pom.xml
index c15ceba..ecd1af1 100644
--- a/extensions/load-balancer/modules/haproxy-extension/pom.xml
+++ b/extensions/load-balancer/modules/haproxy-extension/pom.xml
@@ -24,8 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-load-balancer-extensions</artifactId>
-        <version>4.1.2</version>
-        <relativePath>../../pom.xml</relativePath>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-stratos-haproxy-extension</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE b/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
index 60e7f41..e506f30 100644
--- a/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
@@ -291,10 +291,10 @@ neethi-2.0.4.wso2v4.jar
 not-yet-commons-ssl-0.3.9.jar
 opencsv-1.8.wso2v1.jar
 org.apache.log4j-1.2.13.v200706111418.jar
-org.apache.stratos.common-4.1.2.jar
-org.apache.stratos.load.balancer.common-4.1.2.jar
-org.apache.stratos.load.balancer.extension.api-4.1.2.jar
-org.apache.stratos.messaging-4.1.2.jar
+org.apache.stratos.common-4.2.0.jar
+org.apache.stratos.load.balancer.common-4.2.0.jar
+org.apache.stratos.load.balancer.extension.api-4.2.0.jar
+org.apache.stratos.messaging-4.2.0.jar
 poi-3.9.jar
 poi-ooxml-3.9.0.wso2v1.jar
 poi-ooxml-3.9.jar

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/load-balancer/modules/lvs-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/pom.xml b/extensions/load-balancer/modules/lvs-extension/pom.xml
index 7111cf6..60c6c7e 100644
--- a/extensions/load-balancer/modules/lvs-extension/pom.xml
+++ b/extensions/load-balancer/modules/lvs-extension/pom.xml
@@ -24,8 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-load-balancer-extensions</artifactId>
-        <version>4.1.2</version>
-        <relativePath>../../pom.xml</relativePath>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-stratos-lvs-extension</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/load-balancer/modules/nginx-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/pom.xml b/extensions/load-balancer/modules/nginx-extension/pom.xml
index b7223c1..355e371 100644
--- a/extensions/load-balancer/modules/nginx-extension/pom.xml
+++ b/extensions/load-balancer/modules/nginx-extension/pom.xml
@@ -24,8 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-load-balancer-extensions</artifactId>
-        <version>4.1.2</version>
-        <relativePath>../../pom.xml</relativePath>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-stratos-nginx-extension</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE b/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
index 60e7f41..e506f30 100644
--- a/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
@@ -291,10 +291,10 @@ neethi-2.0.4.wso2v4.jar
 not-yet-commons-ssl-0.3.9.jar
 opencsv-1.8.wso2v1.jar
 org.apache.log4j-1.2.13.v200706111418.jar
-org.apache.stratos.common-4.1.2.jar
-org.apache.stratos.load.balancer.common-4.1.2.jar
-org.apache.stratos.load.balancer.extension.api-4.1.2.jar
-org.apache.stratos.messaging-4.1.2.jar
+org.apache.stratos.common-4.2.0.jar
+org.apache.stratos.load.balancer.common-4.2.0.jar
+org.apache.stratos.load.balancer.extension.api-4.2.0.jar
+org.apache.stratos.messaging-4.2.0.jar
 poi-3.9.jar
 poi-ooxml-3.9.0.wso2v1.jar
 poi-ooxml-3.9.jar

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/load-balancer/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/pom.xml b/extensions/load-balancer/pom.xml
index 71137dc..f90a8ea 100644
--- a/extensions/load-balancer/pom.xml
+++ b/extensions/load-balancer/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-extensions</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-load-balancer-extensions</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/extensions/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 5fa09df..b79098e 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-extensions</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/autoscaler/org.apache.stratos.autoscaler.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/autoscaler/org.apache.stratos.autoscaler.feature/pom.xml b/features/autoscaler/org.apache.stratos.autoscaler.feature/pom.xml
index 2e311f5..a5073ce 100644
--- a/features/autoscaler/org.apache.stratos.autoscaler.feature/pom.xml
+++ b/features/autoscaler/org.apache.stratos.autoscaler.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>autoscaler-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/autoscaler/pom.xml
----------------------------------------------------------------------
diff --git a/features/autoscaler/pom.xml b/features/autoscaler/pom.xml
index 897fc1b..1afa0b8 100644
--- a/features/autoscaler/pom.xml
+++ b/features/autoscaler/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>autoscaler-features</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/cep/org.apache.stratos.event.processor.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/cep/org.apache.stratos.event.processor.feature/pom.xml b/features/cep/org.apache.stratos.event.processor.feature/pom.xml
index 8833286..e090840 100644
--- a/features/cep/org.apache.stratos.event.processor.feature/pom.xml
+++ b/features/cep/org.apache.stratos.event.processor.feature/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>cep-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml b/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
index 2dc5cdb..e58018f 100644
--- a/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
+++ b/features/cep/org.apache.stratos.event.processor.server.feature/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>cep-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/cep/pom.xml
----------------------------------------------------------------------
diff --git a/features/cep/pom.xml b/features/cep/pom.xml
index 71337df..ba17564 100644
--- a/features/cep/pom.xml
+++ b/features/cep/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>cep-features</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
index fef5a8a..6fd6218 100644
--- a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
+++ b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>cloud-controller-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/cloud-controller/pom.xml
----------------------------------------------------------------------
diff --git a/features/cloud-controller/pom.xml b/features/cloud-controller/pom.xml
index 4add826..11f58a4 100644
--- a/features/cloud-controller/pom.xml
+++ b/features/cloud-controller/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/common/org.apache.stratos.common.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/common/org.apache.stratos.common.feature/pom.xml b/features/common/org.apache.stratos.common.feature/pom.xml
index 4ad509d..6ce9415 100644
--- a/features/common/org.apache.stratos.common.feature/pom.xml
+++ b/features/common/org.apache.stratos.common.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>common-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.common.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/common/org.apache.stratos.common.server.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/common/org.apache.stratos.common.server.feature/pom.xml b/features/common/org.apache.stratos.common.server.feature/pom.xml
index f05f5d6..7348e8a 100644
--- a/features/common/org.apache.stratos.common.server.feature/pom.xml
+++ b/features/common/org.apache.stratos.common.server.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>common-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/common/org.apache.stratos.custom.handlers.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/common/org.apache.stratos.custom.handlers.feature/pom.xml b/features/common/org.apache.stratos.custom.handlers.feature/pom.xml
index a5ed2cb..ad28d58 100644
--- a/features/common/org.apache.stratos.custom.handlers.feature/pom.xml
+++ b/features/common/org.apache.stratos.custom.handlers.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>common-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/common/pom.xml
----------------------------------------------------------------------
diff --git a/features/common/pom.xml b/features/common/pom.xml
index f0cf374..11216e9 100644
--- a/features/common/pom.xml
+++ b/features/common/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>common-features</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/load-balancer/org.apache.stratos.load.balancer.common.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/load-balancer/org.apache.stratos.load.balancer.common.feature/pom.xml b/features/load-balancer/org.apache.stratos.load.balancer.common.feature/pom.xml
index 5e62917..febccac 100644
--- a/features/load-balancer/org.apache.stratos.load.balancer.common.feature/pom.xml
+++ b/features/load-balancer/org.apache.stratos.load.balancer.common.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>loadbalancer-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.load.balancer.common.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/load-balancer/org.apache.stratos.load.balancer.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/load-balancer/org.apache.stratos.load.balancer.feature/pom.xml b/features/load-balancer/org.apache.stratos.load.balancer.feature/pom.xml
index b279a2b..5f11a94 100644
--- a/features/load-balancer/org.apache.stratos.load.balancer.feature/pom.xml
+++ b/features/load-balancer/org.apache.stratos.load.balancer.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>loadbalancer-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.load.balancer.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/load-balancer/pom.xml
----------------------------------------------------------------------
diff --git a/features/load-balancer/pom.xml b/features/load-balancer/pom.xml
index 5ba9cd7..1d23c9c 100644
--- a/features/load-balancer/pom.xml
+++ b/features/load-balancer/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>loadbalancer-features</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/metadata-service/org.apache.stratos.metadata.client.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/metadata-service/org.apache.stratos.metadata.client.feature/pom.xml b/features/manager/metadata-service/org.apache.stratos.metadata.client.feature/pom.xml
index df0ab6e..1c99ea2 100644
--- a/features/manager/metadata-service/org.apache.stratos.metadata.client.feature/pom.xml
+++ b/features/manager/metadata-service/org.apache.stratos.metadata.client.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-manager-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/metadata-service/org.apache.stratos.metadata.service.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/metadata-service/org.apache.stratos.metadata.service.feature/pom.xml b/features/manager/metadata-service/org.apache.stratos.metadata.service.feature/pom.xml
index d7e83bc..ef4cc87 100644
--- a/features/manager/metadata-service/org.apache.stratos.metadata.service.feature/pom.xml
+++ b/features/manager/metadata-service/org.apache.stratos.metadata.service.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-manager-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/pom.xml b/features/manager/pom.xml
index 7dfe727..7aab3dd 100644
--- a/features/manager/pom.xml
+++ b/features/manager/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-manager-features</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/rest-endpoint/org.apache.stratos.rest.endpoint.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/rest-endpoint/org.apache.stratos.rest.endpoint.feature/pom.xml b/features/manager/rest-endpoint/org.apache.stratos.rest.endpoint.feature/pom.xml
index 20e8d38..0f5f53d 100644
--- a/features/manager/rest-endpoint/org.apache.stratos.rest.endpoint.feature/pom.xml
+++ b/features/manager/rest-endpoint/org.apache.stratos.rest.endpoint.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-manager-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/stratos-mgt/org.apache.stratos.manager.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/stratos-mgt/org.apache.stratos.manager.feature/pom.xml b/features/manager/stratos-mgt/org.apache.stratos.manager.feature/pom.xml
index 145ace5..5e1c996 100644
--- a/features/manager/stratos-mgt/org.apache.stratos.manager.feature/pom.xml
+++ b/features/manager/stratos-mgt/org.apache.stratos.manager.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-mgt-parent-feature</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.manager.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/stratos-mgt/org.apache.stratos.manager.server.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/stratos-mgt/org.apache.stratos.manager.server.feature/pom.xml b/features/manager/stratos-mgt/org.apache.stratos.manager.server.feature/pom.xml
index 49b64cd..0863d15 100644
--- a/features/manager/stratos-mgt/org.apache.stratos.manager.server.feature/pom.xml
+++ b/features/manager/stratos-mgt/org.apache.stratos.manager.server.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-mgt-parent-feature</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.manager.server.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/stratos-mgt/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/stratos-mgt/pom.xml b/features/manager/stratos-mgt/pom.xml
index 463edd8..fab13c9 100644
--- a/features/manager/stratos-mgt/pom.xml
+++ b/features/manager/stratos-mgt/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-manager-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-mgt-parent-feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/manager/styles/org.apache.stratos.manager.styles.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/manager/styles/org.apache.stratos.manager.styles.feature/pom.xml b/features/manager/styles/org.apache.stratos.manager.styles.feature/pom.xml
index 2e790a0..9132f40 100644
--- a/features/manager/styles/org.apache.stratos.manager.styles.feature/pom.xml
+++ b/features/manager/styles/org.apache.stratos.manager.styles.feature/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-manager-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/messaging/org.apache.stratos.messaging.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/messaging/org.apache.stratos.messaging.feature/pom.xml b/features/messaging/org.apache.stratos.messaging.feature/pom.xml
index 1b6271d..1dcc000 100644
--- a/features/messaging/org.apache.stratos.messaging.feature/pom.xml
+++ b/features/messaging/org.apache.stratos.messaging.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>messaging-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.messaging.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/messaging/pom.xml
----------------------------------------------------------------------
diff --git a/features/messaging/pom.xml b/features/messaging/pom.xml
index fd14be6..4ba9b20 100644
--- a/features/messaging/pom.xml
+++ b/features/messaging/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>messaging-features</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/mock-iaas/org.apache.stratos.mock.iaas.api.feature/pom.xml
----------------------------------------------------------------------
diff --git a/features/mock-iaas/org.apache.stratos.mock.iaas.api.feature/pom.xml b/features/mock-iaas/org.apache.stratos.mock.iaas.api.feature/pom.xml
index 585acc6..4a211c7 100644
--- a/features/mock-iaas/org.apache.stratos.mock.iaas.api.feature/pom.xml
+++ b/features/mock-iaas/org.apache.stratos.mock.iaas.api.feature/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>mock-iaas-features</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.mock.iaas.api.feature</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/mock-iaas/pom.xml
----------------------------------------------------------------------
diff --git a/features/mock-iaas/pom.xml b/features/mock-iaas/pom.xml
index d65e8f7..5327b79 100644
--- a/features/mock-iaas/pom.xml
+++ b/features/mock-iaas/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-features-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/features/pom.xml
----------------------------------------------------------------------
diff --git a/features/pom.xml b/features/pom.xml
index 47de6a2..4ea8051 100644
--- a/features/pom.xml
+++ b/features/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 479806d..0804613 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
     <groupId>org.apache.stratos</groupId>
     <artifactId>stratos-parent</artifactId>
     <packaging>pom</packaging>
-    <version>4.1.2</version>
+    <version>4.2.0-SNAPSHOT</version>
     <name>Apache Stratos</name>
     <description>Apache Stratos is an open source polyglot Platform as a Service (PaaS) framework</description>
     <url>http://stratos.apache.org</url>
@@ -73,7 +73,7 @@
         <connection>scm:git:https://git-wip-us.apache.org/repos/asf/stratos.git</connection>
         <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/stratos.git</developerConnection>
         <url>https://git-wip-us.apache.org/repos/asf?p=stratos.git</url>
-        <tag>4.1.2</tag>
+        <tag>4.2.0-SNAPSHOT</tag>
     </scm>
 
     <modules>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/cartridge-agent/modules/distribution/INSTALL.txt
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/INSTALL.txt b/products/cartridge-agent/modules/distribution/INSTALL.txt
index 6229354..f3151ea 100644
--- a/products/cartridge-agent/modules/distribution/INSTALL.txt
+++ b/products/cartridge-agent/modules/distribution/INSTALL.txt
@@ -26,4 +26,4 @@ properties="-Dmb.ip=MB-IP
 
 
 Please refer following link for more information:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Installation+Guide
\ No newline at end of file
+https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Installation+Guide

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/cartridge-agent/modules/distribution/README.txt
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/README.txt b/products/cartridge-agent/modules/distribution/README.txt
index e9ec1bf..d5b0ffd 100644
--- a/products/cartridge-agent/modules/distribution/README.txt
+++ b/products/cartridge-agent/modules/distribution/README.txt
@@ -13,7 +13,7 @@ Synchronizer and Instance Status Event Publisher.
 
 
 Please refer below link for more information:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Cartridge+Agent
+https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Cartridge+Agent
 
 
 Thank you for using Apache Stratos!

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/cartridge-agent/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/pom.xml b/products/cartridge-agent/modules/distribution/pom.xml
index 67c9c43..205b789 100644
--- a/products/cartridge-agent/modules/distribution/pom.xml
+++ b/products/cartridge-agent/modules/distribution/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>cartidge-agent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/cartridge-agent/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/src/main/license/LICENSE b/products/cartridge-agent/modules/distribution/src/main/license/LICENSE
index 43644d8..6a72e59 100644
--- a/products/cartridge-agent/modules/distribution/src/main/license/LICENSE
+++ b/products/cartridge-agent/modules/distribution/src/main/license/LICENSE
@@ -218,7 +218,7 @@ activemq-client-5.10.0.jar,
 ant-1.7.0.jar,
 ant-1.7.0.wso2v1.jar,
 ant-launcher-1.7.0.jar,
-apache-stratos-cartridge-agent-4.1.2.jar,
+apache-stratos-cartridge-agent-4.2.0.jar,
 axiom-1.2.11.wso2v4.jar,
 axiom-api-1.2.11.jar,
 axiom-impl-1.2.11.jar,
@@ -272,12 +272,12 @@ neethi-2.0.4.wso2v4.jar
 not-yet-commons-ssl-0.3.9.jar
 opencsv-1.8.wso2v1.jar
 org.apache.log4j-1.2.13.v200706111418.jar
-org.apache.stratos.cartridge.agent-4.1.2.jar
-org.apache.stratos.common-4.1.2.jar
-org.apache.stratos.messaging-4.1.2.jar
-org.apache.stratos.autoscaler.service.stub-4.1.2.jar
-org.apache.stratos.cloud.controller.service.stub-4.1.2.jar
-org.apache.stratos.manager.service.stub-4.1.2.jar
+org.apache.stratos.cartridge.agent-4.2.0.jar
+org.apache.stratos.common-4.2.0.jar
+org.apache.stratos.messaging-4.2.0.jar
+org.apache.stratos.autoscaler.service.stub-4.2.0.jar
+org.apache.stratos.cloud.controller.service.stub-4.2.0.jar
+org.apache.stratos.manager.service.stub-4.2.0.jar
 org.wso2.carbon.base-4.2.0.jar
 org.wso2.carbon.bootstrap-4.2.0.jar
 org.wso2.carbon.core-4.2.0.jar


[40/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java
deleted file mode 100644
index 464f093..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java
+++ /dev/null
@@ -1,39 +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.haproxy.extension;
-
-/**
- * HA proxy extension constants.
- */
-public class Constants {
-    public static final String HAPROXY_PRIVATE_IP = "haproxy.private.ip";
-    public static final String EXECUTABLE_FILE_PATH = "executable.file.path";
-    public static final String TEMPLATES_PATH = "templates.path";
-    public static final String TEMPLATES_NAME = "templates.name";
-    public static final String SCRIPTS_PATH = "scripts.path";
-    public static final String CONF_FILE_PATH = "conf.file.path";
-    public static final String STATS_SOCKET_FILE_PATH = "stats.socket.file.path";
-    public static final String CEP_STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
-    public static final String THRIFT_RECEIVER_IP = "thrift.receiver.ip";
-    public static final String THRIFT_RECEIVER_PORT = "thrift.receiver.port";
-    public static final String NETWORK_PARTITION_ID = "network.partition.id";
-    public static final String CLUSTER_ID = "cluster.id";
-    public static final String SERVICE_NAME = "service.name";
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java
deleted file mode 100644
index 18f005d..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java
+++ /dev/null
@@ -1,158 +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.haproxy.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.util.CommandUtils;
-import org.apache.stratos.load.balancer.extension.api.LoadBalancer;
-import org.apache.stratos.load.balancer.extension.api.exception.LoadBalancerExtensionException;
-import org.apache.stratos.load.balancer.common.domain.Topology;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.Vector;
-
-/**
- * HAProxy load balancer life-cycle implementation.
- */
-public class HAProxy implements LoadBalancer {
-
-    private static final Log log = LogFactory.getLog(HAProxy.class);
-
-    private String executableFilePath;
-    private String processIdFilePath;
-    private String templatePath;
-    private String templateName;
-    private String confFilePath;
-    private String statsSocketFilePath;
-
-    public HAProxy() {
-        this.executableFilePath = HAProxyContext.getInstance().getExecutableFilePath();
-        this.templatePath = HAProxyContext.getInstance().getTemplatePath();
-        this.templateName = HAProxyContext.getInstance().getTemplateName();
-        this.confFilePath = HAProxyContext.getInstance().getConfFilePath();
-        this.processIdFilePath = confFilePath.replace(".cfg", ".pid");
-        this.statsSocketFilePath = HAProxyContext.getInstance().getStatsSocketFilePath();
-    }
-
-    /**
-     * Configure haproxy instance according to topology given
-     * @param topology
-     * @throws LoadBalancerExtensionException
-     */
-    public boolean configure(Topology topology) throws LoadBalancerExtensionException {
-        try {
-            log.info("Generating haproxy configuration...");
-            HAProxyConfigWriter writer = new HAProxyConfigWriter(templatePath, templateName, confFilePath, statsSocketFilePath);
-            if(writer.write(topology)) {
-                return true;
-            }
-            return false;
-        } catch (Exception e) {
-            log.error("Could not generate haproxy configuration");
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Start haproxy instance
-     * @throws LoadBalancerExtensionException
-     */
-    public void start() throws LoadBalancerExtensionException {
-        log.info("Starting haproxy instance...");
-        // Check for configuration file
-        File conf = new File(confFilePath);
-        if (!conf.exists()) {
-            throw new LoadBalancerExtensionException("Could not find haproxy configuration file");
-        }
-
-        // Start haproxy and write pid to processIdFilePath
-        try {
-            String command = executableFilePath + " -f " + confFilePath + " -p " + processIdFilePath;
-            CommandUtils.executeCommand(command);
-            log.info("haproxy instance started");
-        } catch (Exception e) {
-            log.error("Could not start haproxy instance");
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Reload haproxy instance according to the configuration written in configure() method.
-     * @throws LoadBalancerExtensionException
-     */
-    public void reload() throws LoadBalancerExtensionException {
-        try {
-            log.info("Reloading configuration...");
-
-            // Read pid
-            String pid = "";
-            BufferedReader reader = new BufferedReader(new FileReader(processIdFilePath));
-            String line;
-            while ((line = reader.readLine()) != null) {
-                pid += line + " ";
-            }
-
-            // Execute hot configuration deployment
-            String command = executableFilePath + " -f " + confFilePath + " -p " + processIdFilePath + " -sf " + pid;
-            CommandUtils.executeCommand(command);
-            if (log.isInfoEnabled()) {
-                log.info("Configuration done");
-            }
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error("Reconfiguration failed");
-            }
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Stop haproxy instance
-     * @throws LoadBalancerExtensionException
-     */
-    public void stop() throws LoadBalancerExtensionException {
-
-        try {
-            // Read the PIDs
-            Vector<String> pids = new Vector<String>();
-            BufferedReader reader = new BufferedReader(new FileReader(processIdFilePath));
-            String pid_;
-            while ((pid_ = reader.readLine()) != null) {
-                pids.add(pid_);
-            }
-
-            // Kill all haproxy processes
-            for (String pid : pids) {
-                String command = "kill -s 9 " + pid;
-                CommandUtils.executeCommand(command);
-                if (log.isInfoEnabled()) {
-                    log.info(String.format("haproxy instance stopped [pid] %s", pid));
-                }
-            }
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error("Could not stop haproxy instance", e);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
deleted file mode 100644
index 7a0d531..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
+++ /dev/null
@@ -1,152 +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.haproxy.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.load.balancer.common.domain.*;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.RuntimeConstants;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.Collection;
-
-/**
- * HAProxy load balancer configuration writer.
- */
-public class HAProxyConfigWriter {
-
-    private static final Log log = LogFactory.getLog(Main.class);
-    private static final String NEW_LINE = System.getProperty("line.separator");
-
-    private String templatePath;
-    private String templateName;
-    private String confFilePath;
-    private String statsSocketFilePath;
-
-    public HAProxyConfigWriter(String templatePath, String templateName, String confFilePath,
-                               String statsSocketFilePath) {
-
-        this.templatePath = templatePath;
-        this.templateName = templateName;
-        this.confFilePath = confFilePath;
-        this.statsSocketFilePath = statsSocketFilePath;
-    }
-
-    public boolean write(Topology topology) {
-        // Prepare global parameters
-        StringBuilder globalParameters = new StringBuilder();
-        globalParameters.append("stats socket ");
-        globalParameters.append(statsSocketFilePath);
-
-        StringBuilder frontendCollection = new StringBuilder();
-        StringBuilder backendCollection = new StringBuilder();
-
-        for (Service service : topology.getServices()) {
-            for (Cluster cluster : service.getClusters()) {
-                createConfig(cluster, frontendCollection, backendCollection);
-            }
-        }
-
-        // Start velocity engine
-        VelocityEngine ve = new VelocityEngine();
-        ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatePath);
-        ve.init();
-
-        // Open the template
-        Template t = ve.getTemplate(templateName);
-
-        // Insert strings into the template
-        VelocityContext context = new VelocityContext();
-        context.put("global_parameters", globalParameters.toString());
-        context.put("frontend_collection", frontendCollection.toString());
-        context.put("backend_collection", backendCollection.toString());
-
-        // Create a new string from the template
-        StringWriter stringWriter = new StringWriter();
-        t.merge(context, stringWriter);
-        String configuration = stringWriter.toString();
-
-        // Write configuration file
-        try {
-            BufferedWriter writer = new BufferedWriter(new FileWriter(confFilePath));
-            writer.write(configuration);
-            writer.close();
-
-            if (log.isInfoEnabled()) {
-                log.info(String.format("Configuration written to file: %s", confFilePath));
-            }
-            return true;
-        } catch (IOException e) {
-            if (log.isErrorEnabled()) {
-                log.error(String.format("Could not write configuration file: %s", confFilePath));
-            }
-            throw new RuntimeException(e);
-        }
-    }
-
-    private void createConfig(Cluster cluster, StringBuilder frontendCollection,
-                              StringBuilder backendCollection) {
-
-        if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
-            return;
-        }
-
-        // Find port mappings
-        Member firstMember = (Member) cluster.getMembers().toArray()[0];
-        Collection<Port> ports = firstMember.getPorts();
-
-        for (Port port : ports) {
-            // Frontend block start
-            String protocol = port.getProtocol();
-            String frontendId = protocol + "_" + port.getValue() + "_frontend";
-
-            frontendCollection.append("frontend ").append(frontendId).append(NEW_LINE);
-            frontendCollection.append("\tbind ").append(HAProxyContext.getInstance().getHAProxyPrivateIp())
-                    .append(":").append(port.getProxy()).append(NEW_LINE);
-            frontendCollection.append("\tmode ").append(protocol).append(NEW_LINE);
-
-            for (String hostname : cluster.getHostNames()) {
-                String backendId = hostname + "_" + protocol + "_" + port.getValue() + "_backend";
-
-                frontendCollection.append("\tacl ").append("is_").append(hostname).append(" hdr_beg(host) -i ")
-                        .append(hostname).append(NEW_LINE);
-                frontendCollection.append("\tuse_backend ").append(backendId).append(" if is_")
-                        .append(hostname).append(NEW_LINE);
-                // Front end block end
-
-                // Backend block start
-                backendCollection.append("backend ").append(backendId).append(NEW_LINE);
-                backendCollection.append("\tmode ").append(protocol).append(NEW_LINE);
-                for (Member member : cluster.getMembers()) {
-                    backendCollection.append("\tserver ").append(member.getMemberId()).append(" ")
-                            .append(member.getHostName()).append(":").append(port.getValue()).append(NEW_LINE);
-                }
-                backendCollection.append(NEW_LINE);
-                // Backend block end
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java
deleted file mode 100644
index 3019c94..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java
+++ /dev/null
@@ -1,157 +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.haproxy.extension;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * HAProxy context to read and store system properties.
- */
-public class HAProxyContext {
-    private static final Log log = LogFactory.getLog(HAProxyContext.class);
-    private static volatile HAProxyContext context;
-
-    private String haProxyPrivateIp;
-    private String executableFilePath;
-    private String templatePath;
-    private String templateName;
-    private String scriptsPath;
-    private String confFilePath;
-    private String statsSocketFilePath;
-    private boolean cepStatsPublisherEnabled;
-    private String thriftReceiverIp;
-    private String thriftReceiverPort;
-    private String networkPartitionId;
-    private String clusterId;
-    private String serviceName;
-
-    private HAProxyContext() {
-        this.haProxyPrivateIp = System.getProperty(Constants.HAPROXY_PRIVATE_IP);
-        this.executableFilePath = System.getProperty(Constants.EXECUTABLE_FILE_PATH);
-        this.templatePath = System.getProperty(Constants.TEMPLATES_PATH);
-        this.templateName = System.getProperty(Constants.TEMPLATES_NAME);
-        this.scriptsPath = System.getProperty(Constants.SCRIPTS_PATH);
-        this.confFilePath = System.getProperty(Constants.CONF_FILE_PATH);
-        this.statsSocketFilePath = System.getProperty(Constants.STATS_SOCKET_FILE_PATH);
-        this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED);
-        this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP);
-        this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT);
-        this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID);
-        this.clusterId = System.getProperty(Constants.CLUSTER_ID);
-        this.serviceName = System.getProperty(Constants.SERVICE_NAME);
-
-        if (log.isDebugEnabled()) {
-            log.debug(Constants.HAPROXY_PRIVATE_IP + " = " + haProxyPrivateIp);
-            log.debug(Constants.EXECUTABLE_FILE_PATH + " = " + executableFilePath);
-            log.debug(Constants.TEMPLATES_PATH + " = " + templatePath);
-            log.debug(Constants.TEMPLATES_NAME + " = " + templateName);
-            log.debug(Constants.SCRIPTS_PATH + " = " + scriptsPath);
-            log.debug(Constants.CONF_FILE_PATH + " = " + confFilePath);
-            log.debug(Constants.STATS_SOCKET_FILE_PATH + " = " + statsSocketFilePath);
-            log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled);
-            log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp);
-            log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort);
-            log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId);
-            log.debug(Constants.CLUSTER_ID + " = " + clusterId);
-        }
-    }
-
-    public static HAProxyContext getInstance() {
-        if (context == null) {
-            synchronized (HAProxyContext.class) {
-                if (context == null) {
-                    context = new HAProxyContext();
-                }
-            }
-        }
-        return context;
-    }
-
-    public void validate() {
-        validateSystemProperty(Constants.HAPROXY_PRIVATE_IP);
-        validateSystemProperty(Constants.EXECUTABLE_FILE_PATH);
-        validateSystemProperty(Constants.TEMPLATES_PATH);
-        validateSystemProperty(Constants.TEMPLATES_NAME);
-        validateSystemProperty(Constants.SCRIPTS_PATH);
-        validateSystemProperty(Constants.CONF_FILE_PATH);
-        validateSystemProperty(Constants.STATS_SOCKET_FILE_PATH);
-        validateSystemProperty(Constants.CEP_STATS_PUBLISHER_ENABLED);
-        validateSystemProperty(Constants.CLUSTER_ID);
-
-        if (cepStatsPublisherEnabled) {
-            validateSystemProperty(Constants.THRIFT_RECEIVER_IP);
-            validateSystemProperty(Constants.THRIFT_RECEIVER_PORT);
-            validateSystemProperty(Constants.NETWORK_PARTITION_ID);
-        }
-    }
-
-    private void validateSystemProperty(String propertyName) {
-        String value = System.getProperty(propertyName);
-        if (StringUtils.isEmpty(value)) {
-            throw new RuntimeException("System property was not found: " + propertyName);
-        }
-    }
-
-    public String getHAProxyPrivateIp() {
-        return haProxyPrivateIp;
-    }
-
-    public String getExecutableFilePath() {
-        return executableFilePath;
-    }
-
-    public String getTemplatePath() {
-        return templatePath;
-    }
-
-    public String getTemplateName() {
-        return templateName;
-    }
-
-    public String getScriptsPath() {
-        return scriptsPath;
-    }
-
-    public String getConfFilePath() {
-        return confFilePath;
-    }
-
-    public String getStatsSocketFilePath() {
-        return statsSocketFilePath;
-    }
-
-    public boolean isCEPStatsPublisherEnabled() {
-        return cepStatsPublisherEnabled;
-    }
-
-    public String getNetworkPartitionId() {
-        return networkPartitionId;
-    }
-
-    public String getClusterId() {
-        return clusterId;
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java
deleted file mode 100644
index 7dec489..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java
+++ /dev/null
@@ -1,108 +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.haproxy.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.constants.StratosConstants;
-import org.apache.stratos.common.util.CommandUtils;
-import org.apache.stratos.load.balancer.common.domain.Cluster;
-import org.apache.stratos.load.balancer.common.domain.Member;
-import org.apache.stratos.load.balancer.common.domain.Port;
-import org.apache.stratos.load.balancer.common.domain.Service;
-import org.apache.stratos.load.balancer.common.statistics.LoadBalancerStatisticsReader;
-import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
-
-import java.io.IOException;
-
-/**
- * HAProxy statistics reader.
- */
-public class HAProxyStatisticsReader implements LoadBalancerStatisticsReader {
-
-    private static final Log log = LogFactory.getLog(HAProxyStatisticsReader.class);
-
-    private String scriptsPath;
-    private String statsSocketFilePath;
-    private TopologyProvider topologyProvider;
-    private String clusterInstanceId;
-
-    public HAProxyStatisticsReader(TopologyProvider topologyProvider) {
-        this.scriptsPath = HAProxyContext.getInstance().getScriptsPath();
-        this.statsSocketFilePath = HAProxyContext.getInstance().getStatsSocketFilePath();
-        this.topologyProvider = topologyProvider;
-        this.clusterInstanceId = System.getProperty(StratosConstants.CLUSTER_INSTANCE_ID, StratosConstants.NOT_DEFINED);
-    }
-
-    @Override
-    public String getClusterInstanceId() {
-        return clusterInstanceId;
-    }
-
-    @Override
-    public int getInFlightRequestCount(String clusterId) {
-        String frontendId, backendId, command, output;
-        String[] array;
-        int totalWeight, weight;
-
-        for (Service service : topologyProvider.getTopology().getServices()) {
-            for (Cluster cluster : service.getClusters()) {
-                if (cluster.getClusterId().equals(clusterId)) {
-                    totalWeight = 0;
-                    if ((service.getPorts() == null) || (service.getPorts().size() == 0)) {
-                        throw new RuntimeException(String.format("No ports found in service: %s", service.getServiceName()));
-                    }
-
-                    for (Port port : service.getPorts()) {
-                        for(String hostname : cluster.getHostNames()) {
-                            backendId = hostname+"-http-members";
-                            for (Member member : cluster.getMembers()) {
-                                // echo "get weight <backend>/<server>" | socat stdio <stats-socket>
-                                command = String.format("%s/get-weight.sh %s %s %s", scriptsPath, backendId, member.getMemberId(), statsSocketFilePath);
-                                try {
-                                    output = CommandUtils.executeCommand(command);
-                                    if ((output != null) && (output.length() > 0)) {
-                                        array = output.split(" ");
-                                        if ((array != null) && (array.length > 0)) {
-                                            weight = Integer.parseInt(array[0]);
-                                            if (log.isDebugEnabled()) {
-                                                log.debug(String.format("Member weight found: [cluster] %s [member] %s [weight] %d", member.getClusterId(), member.getMemberId(), weight));
-                                            }
-                                            totalWeight += weight;
-                                        }
-                                    }
-                                } catch (IOException e) {
-                                    if (log.isErrorEnabled()) {
-                                        log.error(e);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    if (log.isInfoEnabled()) {
-                        log.info(String.format("Cluster weight found: [cluster] %s [weight] %d", cluster.getClusterId(), totalWeight));
-                    }
-                    return totalWeight;
-                }
-            }
-        }
-        return 0;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java
deleted file mode 100644
index f56541d..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java
+++ /dev/null
@@ -1,85 +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.haproxy.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
-import org.apache.stratos.load.balancer.extension.api.LoadBalancerExtension;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * HAProxy extension main class.
- */
-public class Main {
-	private static final Log log = LogFactory.getLog(Main.class);
-	private static ExecutorService executorService;
-
-	public static void main(String[] args) {
-
-		LoadBalancerExtension extension = null;
-		try {
-			// Configure log4j properties
-			PropertyConfigurator.configure(System.getProperty("log4j.properties.file.path"));
-
-			if (log.isInfoEnabled()) {
-				log.info("HAProxy extension started");
-			}
-
-            // Add shutdown hook
-            final Thread mainThread = Thread.currentThread();
-            final LoadBalancerExtension finalExtension = extension;
-            Runtime.getRuntime().addShutdownHook(new Thread() {
-                public void run() {
-                    try {
-                        if(finalExtension != null) {
-                            log.info("Shutting haproxy instance...");
-                            finalExtension.stop();
-                        }
-                        mainThread.join();
-                    } catch (Exception e) {
-                        log.error(e);
-                    }
-                }
-            });
-
-			executorService = StratosThreadPool.getExecutorService("haproxy.extension.thread.pool", 10);
-			// Validate runtime parameters
-			HAProxyContext.getInstance().validate();
-            TopologyProvider topologyProvider = new TopologyProvider();
-            HAProxyStatisticsReader statisticsReader = HAProxyContext.getInstance().isCEPStatsPublisherEnabled() ?
-                    new HAProxyStatisticsReader(topologyProvider) : null;
-            extension = new LoadBalancerExtension(new HAProxy(), statisticsReader, topologyProvider);
-			extension.setExecutorService(executorService);
-			extension.execute();
-		} catch (Exception e) {
-			if (log.isErrorEnabled()) {
-				log.error(e);
-			}
-			if (extension != null) {
-                log.info("Shutting haproxy instance...");
-				extension.stop();
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/license/LICENSE b/extensions/load-balancer/haproxy-extension/src/main/license/LICENSE
deleted file mode 100644
index 60e7f41..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/license/LICENSE
+++ /dev/null
@@ -1,481 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-===================================================================================
-
-===================================================================================
-The Apache Stratos distribution includes a number of run time dependencies with 
-separate copyright notices and license terms. Your use of the Apache Stratos code
-is subject to the terms and conditions of the following licenses.
-===================================================================================
-
-===============================================================================
-The following components come under Apache Software License 2.0
-===============================================================================
-
-org.wso2.carbon.base-4.2.0.jar
-org.wso2.carbon.bootstrap-4.2.0.jar
-org.wso2.carbon.core-4.2.0.jar
-org.wso2.carbon.core.common-4.2.0.jar
-org.wso2.carbon.databridge.agent.thrift-4.2
-org.wso2.carbon.databridge.commons-4.2.
-org.wso2.carbon.databridge.commons.thrif
-org.wso2.carbon.logging-4.2.0.jar
-org.wso2.carbon.ndatasource.common-4.2.
-org.wso2.carbon.ndatasource.rdbms-4.2.0.j
-org.wso2.carbon.queuing-4.2.0.jar
-org.wso2.carbon.registry.api-4.2.0.jar
-org.wso2.carbon.registry.core-4.2.0.jar
-org.wso2.carbon.registry.xboot-4.2.0.jar
-org.wso2.carbon.securevault-4.2.0.jar
-org.wso2.carbon.user.api-4.2.0.jar
-org.wso2.carbon.user.core-4.2.0.jar
-org.wso2.carbon.user.mgt-4.2.0.jar
-org.wso2.carbon.user.mgt.common-4.2.0.ja
-org.wso2.carbon.utils-4.2.0.jar
-org.wso2.securevault-1.0.0-wso2v2.jar
-abdera-1.0.0.wso2v3.jar
-andes-client-0.13.wso2v8.jar
-annotations-1.3.2.jar
-ant-1.7.0.jar
-ant-launcher-1.7.0.jar
-axiom-1.2.11.wso2v4.jar
-axiom-api-1.2.11.jar
-axiom-impl-1.2.11.jar
-axis2-1.6.1.wso2v10.jar
-commons-cli-1.0.jar
-commons-codec-1.2.jar
-commons-collections-3.2.0.wso2v
-commons-collections-3.2.1.jar
-commons-dbcp-1.4.0.wso2v1.jar
-commons-fileupload-1.2.0.wso2v1
-commons-fileupload-1.2.jar
-commons-httpclient-3.1.0.wso2v2.
-commons-httpclient-3.1.jar
-commons-io-2.0.0.wso2v2.jar
-commons-io-2.0.jar
-commons-lang-2.4.jar
-commons-lang-2.6.0.wso2v1.jar
-commons-lang3-3.1.jar
-commons-logging-1.1.1.jar
-commons-pool-1.5.6.jar
-commons-pool-1.5.6.wso2v1.jar
-compass-2.0.1.wso2v2.jar
-geronimo-activation_1.1_spec-1.0.2.jar
-geronimo-javamail_1.4_spec-1.6.jar
-geronimo-jms_1.1_spec-1.1.jar
-geronimo-stax-api_1.0_spec-1.0.1.jar
-gson-2.2.4.jar
-hazelcast-3.0.1.jar
-hazelcast-3.0.1.wso2v1.jar
-httpclient-4.1.1-wso2v1.jar
-httpclient-4.2.5.jar
-httpcore-4.1.0-wso2v1.jar
-httpcore-4.2.4.jar
-javax.cache.wso2-4.2.0.jar
-java-xmlbuilder-0.6.jar
-javax.servlet-3.0.0.v201112011016.jar
-jdbc-pool-7.0.34.wso2v1.jar
-jdom-1.0.jar
-tomcat-catalina-ha-7.0.34.jar
-tomcat-ha-7.0.34.wso2v1.jar
-tomcat-jdbc-7.0.34.jar
-tomcat-juli-7.0.34.jar
-tomcat-tribes-7.0.34.jar
-tomcat-util-7.0.34.jar
-velocity-1.7.jar
-json-2.0.0.wso2v1.jar
-libthrift-0.7.wso2v1.jar
-libthrift-0.9.1.jar
-log4j-1.2.17.jar
-neethi-2.0.4.wso2v4.jar
-not-yet-commons-ssl-0.3.9.jar
-opencsv-1.8.wso2v1.jar
-org.apache.log4j-1.2.13.v200706111418.jar
-org.apache.stratos.common-4.1.2.jar
-org.apache.stratos.load.balancer.common-4.1.2.jar
-org.apache.stratos.load.balancer.extension.api-4.1.2.jar
-org.apache.stratos.messaging-4.1.2.jar
-poi-3.9.jar
-poi-ooxml-3.9.0.wso2v1.jar
-poi-ooxml-3.9.jar
-poi-ooxml-schemas-3.9.jar
-poi-scratchpad-3.9.0.wso2v1.jar
-poi-scratchpad-3.9.jar
-smack-3.0.4.wso2v1.jar
-smackx-3.0.4.wso2v1.jar
-stax-api-1.0.1.jar
-tomcat-annotations-api-7.0.34.jar
-tomcat-api-7.0.34.jar
-tomcat-catalina-7.0.34.jar
-
-
-===============================================================================
-The following components come under Public Domain License
-===============================================================================
-
-For base64-2.3.8.jar
-
-===============================================================================
-The following components come under BouncyCastle License
-===============================================================================
-
-For bcprov-jdk15-132.jar
-
-Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-===============================================================================
-The following components are Licensed under BSD license
-===============================================================================
-
-For dom4j-1.6.1.jar, 
-jline-0.9.94.jar, 
-jsch-0.1.49.jar
-jaxen-1.1.1.jar
-
-Copyright (c) 2010 Terence Parr
-All rights reserved.
-
-[The BSD License]
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of JiBX nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=============================================================================== 
-The following components are licensed under EPL
-=============================================================================== 
-
-For junit-3.8.1.jar,
-org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
-org.eclipse.osgi-3.8.1.v20120830-144521.jar,
-org.eclipse.osgi.services-3.3.100.v20120522-1822.jar
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of the Program.
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-
-=============================================================================== 
-The following components are licensed under MIT license
-=============================================================================== 
-
-For slf4j-1.5.10.wso2v1.jar,
-slf4j-api-1.7.5.jar,
-slf4j-log4j12-1.7.5.jar
-
-The MIT License (MIT)
-
-Copyright (c) 2004-2013 QOS.ch
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/notice/NOTICE b/extensions/load-balancer/haproxy-extension/src/main/notice/NOTICE
deleted file mode 100644
index 47d3993..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/notice/NOTICE
+++ /dev/null
@@ -1,402 +0,0 @@
-Apache Stratos HAProxy Extension
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-================================================================================
-Apache Software
-Copyright 2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-================================================================================
-Apache Abdera Notice:
-
-Portions of Abdera were orginally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Abdera CLA".
-
-This software's test suite contains data files derived from the
-Universal Feed Parser, Copyright (c) 2002-2005, Mark Pilgrim.
-
-This software's extensions module contains a JSON writer for Atom XML
-that utilizes a JSON parser, Copyright (c) 2002, json.org. The code was 
-licensed using Apache License by the author Douglas Crockford and made 
-available at http://json.org/java/apache.zip We have included portions 
-of the code in the extensions module.
-
-===============================================================================
-Apache Ant Notice:
-
-The <sync> task is based on code Copyright (c) 2002, Landmark
-Graphics Corp that has been kindly donated to the Apache Software
-Foundation.
-
-================================================================================
-Apache Axiom Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-
-================================================================================
-Apache Axis2 Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems,
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-================================================================================
-Apache Commons-Lang Notice:
-
-This product includes software from the Spring Framework,
-under the Apache License 2.0 (see: StringUtils.containsWhitespace())
-
-================================================================================
-Apache Commons-Pool Notice:
-
-The LinkedBlockingDeque implementation is based on an implementation written by
-Doug Lea with assistance from members of JCP JSR-166 Expert Group and released
-to the public domain, as explained at
-http://creativecommons.org/licenses/publicdomain
-
-================================================================================
-Apache Commons-httpclient Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache Tomcat Notice:
-
-The Windows Installer is built with the Nullsoft
-Scriptable Install System (NSIS), which is
-open source software.  The original software and
-related information is available at
-http://nsis.sourceforge.net.
-
-Java compilation software for JSP pages is provided by Eclipse,
-which is open source software.  The original software and
-related information is available at
-http://www.eclipse.org.
-
-For the bayeux implementation
-The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation
-* Copyright 2007-2008 Guy Molinari
-* Copyright 2007-2008 Filip Hanik
-* Copyright 2007 Dojo Foundation
-* Copyright 2007 Mort Bay Consulting Pty. Ltd.
-
-The original XML Schemas for Java EE Deployment Descriptors:
- - javaee_5.xsd
- - javaee_web_services_1_2.xsd
- - javaee_web_services_client_1_2.xsd
- - javaee_6.xsd
- - javaee_web_services_1_3.xsd
- - javaee_web_services_client_1_3.xsd
- - jsp_2_2.xsd
- - web-app_3_0.xsd
- - web-common_3_0.xsd
- - web-fragment_3_0.xsd
- - javaee_7.xsd
- - javaee_web_services_1_4.xsd
- - javaee_web_services_client_1_4.xsd
- - jsp_2_3.xsd
- - web-app_3_1.xsd
- - web-common_3_1.xsd
- - web-fragment_3_1.xsd
-
-may be obtained from:
-http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
-
-================================================================================
-Apache Geranimo Notice:
-
-Apache Geronimo
-Copyright 2003-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-Portions of the Web Console were orginally developed by International
-Business Machines Corporation and are licensed to the Apache Software
-Foundation under the "Software Grant and Corporate Contribution
-License Agreement", informally known as the "IBM Console CLA".
-
-Portions of the ASN1 codec implementation in
-framework/modules/geronimo-crypto/ were developed by the Bouncy Castle
-project (http://www.bouncycastle.org/).
-
-Copyright (c) 2000-2005
-The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
-
-ORB Portions of this software were developed at IONA Technologies.
-
-Object Management Group (OMG) classes used by the orb.
-The original classes are available from www.org.omg.
-
-The RMI over IIOP implementation were developed at Trifork Technologies.
-
-Copyright 2004-2009 Tranql project committers
-This product includes software developed at
-Tranql (http://tranql.codehaus.org/).
-
-This product includes software developed by the Protocol Buffers
-project (http://code.google.com/apis/protocolbuffers).
-
-This product includes also software developed by :
-  - the W3C consortium (http://www.w3c.org) ,
-  - the SAX project (http://www.saxproject.org)
-
-The <sync> task is based on code Copyright (c) 2002, Landmark
-Graphics Corp that has been kindly donated to the Apache Software
-Foundation.
-
-Portions of this software were originally based on the following:
-  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-  - voluntary contributions made by Paul Eng on behalf of the
-    Apache Software Foundation that were originally developed at iClick, Inc.,
-    software copyright (c) 1999.
-
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems,
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-This product also includes schemas and specification developed by:
-      - the W3C consortium (http://www.w3c.org)
-      (http://www.w3.org/XML/1998/namespace)
-
-This product also includes WS-* schemas developed by International
-   Business Machines Corporation, Microsoft Corporation, BEA Systems,
-   TIBCO Software, SAP AG, Sonic Software, and VeriSign
-   (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)
-   (http://schemas.xmlsoap.org/ws/2004/08/addressing/)
-   (http://schemas.xmlsoap.org/wsdl/http)
-   (http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm.xsd)
-   (http://www.w3.org/2005/08/addressing/ws-addr.xsd)
-
-Portions of Derby were originally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Derby CLA".
-The following copyright notice(s) were affixed to portions of the code
-with which this file is now or was at one time distributed
-and are placed here unaltered.
-
-(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
-
-(C) Copyright IBM Corp. 2003.
-
-The portion of the functionTests under 'nist' was originally
-developed by the National Institute of Standards and Technology (NIST),
-an agency of the United States Department of Commerce, and adapted by
-International Business Machines Corporation in accordance with the NIST
-Software Acknowledgment and Redistribution document at
-http://www.itl.nist.gov/div897/ctg/sql_form.htm
-
-* OpenJPA includes software written by Miroslav Nachev.
-
-* OpenJPA uses test code written by Charles Tillman.
-
-XMLSec was originally based on software copyright (c) 2001, Institute for
-Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
-
-The development of XMLSec was partly funded by the European
-Commission in the <WebSig> project in the ISIS Programme.
-
-This product also includes software developed by :
-
-  - IBM Corporation (http://www.ibm.com),
-      WSDL4J was the initial code contribution for the Apache Woden
-      project and some of the WSDL4J design and code has been reused.
-  - The W3C Consortium (http://www.w3c.org),
-      Common W3C XML Schema and DTD files are packaged with Apache Woden.
-
-Portions Copyright 2006 International Business Machines Corp.
-
-Portions of this software were originally based on the following:
-  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-Aside from contributions to the Apache XMLBeans project, this
-software also includes:
-
- - one or more source files from the Apache Xerces-J and Apache Axis
-   products, Copyright (c) 1999-2003 Apache Software Foundation
-
- - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
-   Consortium (Massachusetts Institute of Technology, European Research
-   Consortium for Informatics and Mathematics, Keio University)
-
- - resolver.jar from Apache Xml Commons project,
-   Copyright (c) 2001-2003 Apache Software Foundation
-
- - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
-   Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
-
- - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
-   Copyright 2005 BEA under the terms of the Apache Software License 2.0
-
-This product includes software developed by the Simple XML Compiler (SXC)
-project (http://sxc.codehaus.org/project-info.html)
-
-This product includes software developed for the JAXB Reference
-Implementation project. (https://jaxb.dev.java.net/).  Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes software developed for SOAP with Attachments
-API for Java (SAAJ). The software is available from the GlassFish project
-(https://saaj.dev.java.net/).  Apache Geronimo elects to include this
-software in this distribution under the CDDL license.
-
-This product includes software developed for Java API for XML Web Services
-project (JAX-WS) (https://jax-ws.dev.java.net/).  Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes software developed for the Java Server Pages Tag
-Library project (https://jstl.dev.java.net/).   Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes schema files developed for the Glassfish Java EE
-reference implementation (http://java.sun.com/xml/ns/j2ee/).
-Apache Geronimo elects to include this software in this distribution
-under the CDDL license.  You can obtain a copy of the License at:
-    https://glassfish.dev.java.net/public/CDDL+GPL.html
-The source code is available at:
-    https://glassfish.dev.java.net/source/browse/glassfish/
-
-The following schemas are included:
-
-----------------------------------
-  application-client_1_4.xsd
-  application_1_4.xsd
-  connector_1_5.xsd
-  datatypes.dtd
-  ejb-jar_2_1.xsd
-  j2ee_1_4.xsd
-  j2ee_jaxrpc_mapping_1_1.xsd
-  j2ee_web_services_1_1.xsd
-  j2ee_web_services_client_1_1.xsd
-  jsp_2_0.xsd
-  web-app_2_4.xsd
-  web-jsptaglibrary_2_0.xsd
-  application-client_5.xsd
-  application_5.xsd
-  ejb-jar_3_0.xsd
-  handler-chain.xsd
-  javaee_5.xsd
-  javaee_web_services_1_2.xsd
-  javaee_web_services_client_1_2.xsd
-  jsp_2_1.xsd
-  persistence_1_0.xsd
-  web-app_2_5.xsd
-  web-facelettaglibrary_2_0.xsd
-  web-facesconfig_2_0.xsd
-  web-partialresponse_2_0.xsd
-  web-jsptaglibrary_2_1.xsd
-  application_6.xsd
-  application-client_6.xsd
-  connector_1_6.xsd
-  ejb-jar_3_1.xsd
-  javaee_6.xsd
-  javaee_web_services_1_3.xsd
-  javaee_web_services_client_1_3.xsd
-  jsp_2_2.xsd
-  persistence_2_0.xsd
-  web-app_3_0.xsd
-  web-common_3_0.xsd
-  web-fragment_3_0.xsd
---------------------------------
-
-This product includes software developed at
-the OSGi Alliance (http://www.osgi.org/).
-
- This product includes software developed at
- OPS4J (http://www.ops4j.org/).
--------------------------------------------------------------------------------
-
-The product contains the software developed in javassist.org (http://www.javassist.org) 
-which is released under both the Mozilla Public License 
-(http://www.mozilla.org/MPL/MPL-1.1.html) and the GNU Lesser General Public 
-License (http://www.gnu.org/licenses/lgpl-2.1.html).  
-
-The Apache Geronimo project elects to distribute this software under the terms of 
-the Mozilla Public License. 
-
--------------------------------------------------------------------------------
-
-The product contains the software developed in json.org which released under the following license.
-
-http://www.json.org/license.html
-
-Copyright (c) 2002 JSON.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-================================================================================
-Apache Httpclient Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-================================================================================
-Apache Httpcore Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache POI Notice:
-
-This product contains the DOM4J library (http://www.dom4j.org).
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-This product contains parts that were originally based on software from BEA.
-Copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
-World Wide Web Consortium (Massachusetts Institute of Technology, European
-Research Consortium for Informatics and Mathematics, Keio University)
-
-This product contains the Piccolo XML Parser for Java
-(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
-
-This product contains the chunks_parse_cmds.tbl file from the vsdump program.
-Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/resources/velocity.properties b/extensions/load-balancer/haproxy-extension/src/main/resources/velocity.properties
deleted file mode 100644
index 437aec5..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/resources/velocity.properties
+++ /dev/null
@@ -1,26 +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.
-#
-
-resource.loader=class, file
-class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
-file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
-runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
-runtime.log.logsystem.log4j.category=velocity
-input.encoding=UTF-8
-output.encoding=UTF-8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/scripts/get-weight.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/scripts/get-weight.sh b/extensions/load-balancer/haproxy-extension/src/main/scripts/get-weight.sh
deleted file mode 100644
index cef3a1f..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/scripts/get-weight.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-echo "get weight $1/$2" | socat stdio $3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/security/client-truststore.jks
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/security/client-truststore.jks b/extensions/load-balancer/haproxy-extension/src/main/security/client-truststore.jks
deleted file mode 100644
index be441f3..0000000
Binary files a/extensions/load-balancer/haproxy-extension/src/main/security/client-truststore.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/templates/haproxy.cfg.template
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/templates/haproxy.cfg.template b/extensions/load-balancer/haproxy-extension/src/main/templates/haproxy.cfg.template
deleted file mode 100644
index bee3471..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/templates/haproxy.cfg.template
+++ /dev/null
@@ -1,17 +0,0 @@
-global
-    daemon
-    maxconn 256
-    $global_parameters
-
-defaults
-    mode http
-    timeout connect 5000ms
-    timeout client 50000ms
-    timeout server 50000ms
-
-$frontend_collection
-
-$backend_collection
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/INSTALL.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/INSTALL.md b/extensions/load-balancer/lvs-extension/INSTALL.md
deleted file mode 100644
index a6679b4..0000000
--- a/extensions/load-balancer/lvs-extension/INSTALL.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# Installing Apache Stratos LVS Extension
-
-Apache Stratos LVS Extension could be used for integrating LVS load balancer with Apache Stratos. Please follow
-below steps to proceed with the installation:
-
-1. Install keepalived and ipvsadm:
-   ```
-   apt-get install keepalived ipvsadm
-   ```
-
-2. Open <lvs-extension-home>/bin/lvs-extension.sh file in a text editor and update following system properties:
-   ```
-   # Keepalived configuration file location:
-   -Dconf.file.path=/etc/keepalived/keepalived.conf
-
-   # Enable/disable cep statistics publisher:
-   -Dcep.stats.publisher.enabled=false
-
-   # If cep statistics publisher is enabled define the following properties:
-   -Dthrift.receiver.ip=127.0.0.1
-   -Dthrift.receiver.port=7615
-   -Dnetwork.partition.id=network-partition-1
-
-   # LVS server Virtual IP set for services
-   -Dlvs.service.virtualip.set=tomcat2|192.168.56.40,tomcat1|192.168.56.41,tomcat|192.168.56.40
-   # Server state (MASTER|BACKUP)
-   -Dserver.state=MASTER
-
-   ```
-
-4. Open <lvs-extension-home>/conf/jndi.properties file in a text editor and update message broker information:
-   ```
-   java.naming.provider.url=tcp://localhost:61616
-   ```
-
-5. Run <lvs-extension-home>/bin/lvs-extension.sh as the root user.
-


[28/50] [abbrv] stratos git commit: Removing cartridge-agent.log file

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/96c7935d/products/python-cartridge-agent/integration/cartridge-agent.log
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/cartridge-agent.log b/products/python-cartridge-agent/integration/cartridge-agent.log
deleted file mode 100644
index 75bf741..0000000
--- a/products/python-cartridge-agent/integration/cartridge-agent.log
+++ /dev/null
@@ -1,3372 +0,0 @@
-2015-08-28 16:51:34,169 [-] [main]  INFO BrokerService Loaded the Bouncy Castle security provider.
-2015-08-28 16:51:34,176 [-] [main]  INFO PythonAgentTestManager PCA integration properties: {distribution.name=apache-stratos-python-cartridge-agent-4.1.2, stratos.admin.password=admin, activemq.mqtt.bind.address=mqtt://localhost:1885, stratos.endpoint=http://localhost:9763, cep.port=7712, distribution.version=4.1.2, stratos.admin.username=admin, activemq.amqp.bind.address=tcp://localhost:61617}
-2015-08-28 16:51:34,178 [-] [main]  INFO PythonAgentTestManager PCA integration properties: {distribution.name=apache-stratos-python-cartridge-agent-4.1.2, stratos.admin.password=admin, activemq.mqtt.bind.address=mqtt://localhost:1885, stratos.endpoint=http://localhost:9763, cep.port=7712, distribution.version=4.1.2, stratos.admin.username=admin, activemq.amqp.bind.address=tcp://localhost:61617}
-2015-08-28 16:51:34,179 [-] [main]  INFO PythonAgentTestManager PCA integration properties: {distribution.name=apache-stratos-python-cartridge-agent-4.1.2, stratos.admin.password=admin, activemq.mqtt.bind.address=mqtt://localhost:1885, stratos.endpoint=http://localhost:9763, cep.port=7712, distribution.version=4.1.2, stratos.admin.username=admin, activemq.amqp.bind.address=tcp://localhost:61617}
-2015-08-28 16:51:34,470 [-] [JMX connector]  INFO ManagementContext JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
-2015-08-28 16:51:34,547 [-] [main]  INFO PListStoreImpl PListStore:[/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/tmp_storage] started
-2015-08-28 16:51:34,553 [-] [main]  INFO BrokerService Using Persistence Adapter: KahaDBPersistenceAdapter[/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/KahaDB]
-2015-08-28 16:51:34,807 [-] [main]  INFO BrokerService Apache ActiveMQ 5.10.0 (testBroker, ID:akila-wso2-lap-23868-1440760894669-0:1) is starting
-2015-08-28 16:51:34,816 [-] [main]  INFO TransportServerThreadSupport Listening for connections at: tcp://localhost:61617
-2015-08-28 16:51:34,817 [-] [main]  INFO TransportConnector Connector tcp://localhost:61617 started
-2015-08-28 16:51:34,818 [-] [main]  INFO TransportServerThreadSupport Listening for connections at: mqtt://localhost:1885
-2015-08-28 16:51:34,818 [-] [main]  INFO TransportConnector Connector mqtt://localhost:1885 started
-2015-08-28 16:51:34,819 [-] [main]  INFO BrokerService Apache ActiveMQ 5.10.0 (testBroker, ID:akila-wso2-lap-23868-1440760894669-0:1) started
-2015-08-28 16:51:34,819 [-] [main]  INFO BrokerService For help or more information please see: http://activemq.apache.org
-2015-08-28 16:51:34,819 [-] [main]  WARN BrokerService Store limit is 102400 mb (current store usage is 0 mb). The data directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/KahaDB only has 25094 mb of usable space - resetting to maximum available disk space: 25094 mb
-2015-08-28 16:51:34,819 [-] [main] ERROR BrokerService Temporary Store limit is 51200 mb, whilst the temporary data directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/tmp_storage only has 25094 mb of usable space - resetting to maximum available 25094 mb.
-2015-08-28 16:51:34,854 [-] [main]  INFO PythonAgentTestManager Broker service started!
-2015-08-28 16:51:34,857 [-] [main]  INFO StratosThreadPool Thread pool created: [type] Executor Service [id] TEST_THREAD_POOL [size] 15
-2015-08-28 16:51:34,935 [-] [pool-2-thread-2]  INFO TopologyEventMessageDelegator Topology event message delegator started
-2015-08-28 16:51:34,950 [-] [pool-2-thread-4]  INFO InstanceStatusEventMessageDelegator Instance notifier event message delegator started
-2015-08-28 16:51:34,952 [-] [main]  INFO PythonAgentTestManager Setting up python cartridge agent...
-2015-08-28 16:51:34,952 [-] [Thread-5]  INFO PythonAgentTestManager Server socket started on port: 7712
-2015-08-28 16:51:35,003 [-] [main]  INFO PythonAgentTestManager Changing extension scripts permissions
-2015-08-28 16:51:35,015 [-] [main]  INFO PythonAgentTestManager Python cartridge agent setup completed
-2015-08-28 16:51:35,015 [-] [main]  INFO PythonAgentTestManager Python agent working directory name: d172cc3f-19ec-49a3-9d52-909804158deb
-2015-08-28 16:51:35,015 [-] [main]  INFO PythonAgentTestManager Starting python cartridge agent...
-2015-08-28 16:51:35,024 [-] [Thread-7]  INFO PythonAgentTestManager Server socket started on port: 8080
-2015-08-28 16:51:35,026 [-] [main] ERROR PythonAgentTestManager Error while starting MB
-java.io.IOException: Failed to bind to server socket: tcp://localhost:61617 due to: java.net.BindException: Address already in use
-	at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
-	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
-	at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:56)
-	at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
-	at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2327)
-	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:316)
-	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:306)
-	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.startBroker(PythonAgentTestManager.java:189)
-	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.setup(PythonAgentTestManager.java:77)
-	at org.apache.stratos.python.cartridge.agent.test.ADCTest.setupADCTest(ADCTest.java:64)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
-	at java.lang.reflect.Method.invoke(Method.java:606)
-	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
-	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
-	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
-	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
-	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
-	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
-	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
-	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
-	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
-	at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
-	at org.testng.TestNG.run(TestNG.java:999)
-	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
-	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:205)
-	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)
-	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
-	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
-	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
-	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
-Caused by: java.net.BindException: Address already in use
-	at java.net.PlainSocketImpl.socketBind(Native Method)
-	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
-	at java.net.ServerSocket.bind(ServerSocket.java:376)
-	at java.net.ServerSocket.<init>(ServerSocket.java:237)
-	at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
-	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:132)
-	... 30 more
-2015-08-28 16:51:35,029 [-] [Thread-8] ERROR PythonAgentTestManager Could not start server socket: [port] 8080
-java.net.BindException: Address already in use
-	at java.net.PlainSocketImpl.socketBind(Native Method)
-	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
-	at java.net.ServerSocket.bind(ServerSocket.java:376)
-	at java.net.ServerSocket.<init>(ServerSocket.java:237)
-	at java.net.ServerSocket.<init>(ServerSocket.java:128)
-	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager$4.run(PythonAgentTestManager.java:236)
-	at java.lang.Thread.run(Thread.java:745)
-2015-08-28 16:51:35,030 [-] [main] ERROR PythonAgentTestManager Error while starting MB
-java.io.IOException: Failed to bind to server socket: tcp://localhost:61617 due to: java.net.BindException: Address already in use
-	at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
-	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
-	at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:56)
-	at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
-	at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2327)
-	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:316)
-	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:306)
-	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.startBroker(PythonAgentTestManager.java:189)
-	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.setup(PythonAgentTestManager.java:77)
-	at org.apache.stratos.python.cartridge.agent.test.AgentStartupTest.setupAgentStartupTest(AgentStartupTest.java:57)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
-	at java.lang.reflect.Method.invoke(Method.java:606)
-	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
-	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
-	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
-	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
-	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
-	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
-	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
-	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
-	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
-	at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
-	at org.testng.TestNG.run(TestNG.java:999)
-	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
-	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:205)
-	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)
-	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
-	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
-	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
-	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
-Caused by: java.net.BindException: Address already in use
-	at java.net.PlainSocketImpl.socketBind(Native Method)
-	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
-	at java.net.ServerSocket.bind(ServerSocket.java:376)
-	at java.net.ServerSocket.<init>(ServerSocket.java:237)
-	at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
-	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:132)
-	... 30 more
-2015-08-28 16:51:35,032 [-] [Thread-9] ERROR PythonAgentTestManager Could not start server socket: [port] 8080
-java.net.BindException: Address already in use
-	at java.net.PlainSocketImpl.socketBind(Native Method)
-	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
-	at java.net.ServerSocket.bind(ServerSocket.java:376)
-	at java.net.ServerSocket.<init>(ServerSocket.java:237)
-	at java.net.ServerSocket.<init>(ServerSocket.java:128)
-	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager$4.run(PythonAgentTestManager.java:236)
-	at java.lang.Thread.run(Thread.java:745)
-2015-08-28 16:51:35,349 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,269] DEBUG {config.py:read_conf_file} - Config file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/agent.conf'
-2015-08-28 16:51:35,349 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_payload_file} - Param file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params'
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_ID = application-3
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: SERVICE_NAME = tomcat-mt
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_ID = tomcat.domain
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: PORTS = 8080
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: MULTITENANT = true
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: TENANT_ID = -1234
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.commit = true
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: INTERNAL = false
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: artifact.update.interval = 15
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_INSTANCE_ID = cluster-1-instance-1
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: MEMBER_ID = tomcat.member-1
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: NETWORK_PARTITION_ID = network-p1
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PARTITION_ID = p1
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_PATH = /tmp/pca-test-suite-2
-2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: REPO_URL = https://github.com/imesh/stratos-php-applications.git
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CARTRIDGE_KEY = PUjpXCLujDhYr5A6
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: log.file.paths = /tmp/agent.screen-adc-mt-test.log
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PERSISTENCE_MAPPING = None
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.checkout = true
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: listen.address = localhost
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: LB_CLUSTER_ID = None
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: MIN_COUNT = 1
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.private.ip = 
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.public.ip = 
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: tenant.repository.path = /repository/tenants/
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: super.tenant.repository.path = /repository/deployment/server/
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] INFO {config.py:initialize_config} - Cartridge agent configuration initialized
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - service-name: 'tomcat-mt'
-2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-id: 'tomcat.domain'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-instance-id: 'cluster-1-instance-1'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - member-id: 'tomcat.member-1'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - network-partition-id: 'network-p1'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - partition-id: 'p1'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - cartridge-key: 'PUjpXCLujDhYr5A6'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - app-path: '/tmp/pca-test-suite-2'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - repo-url: 'https://github.com/imesh/stratos-php-applications.git'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - ports: "['8080']"
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-private-ip: None
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-public-ip: None
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - dependant_cluster_id: None
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - export_metadata_keys: None
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - import_metadata_keys: None
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - artifact.update.interval: '15'
-2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lvs-virtual-ip: None
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - log_file_paths: ['/tmp/agent.screen-adc-mt-test.log']
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] INFO {config.py:initialize_config} - Initializing plugins
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] INFO {config.py:initialize_plugins} - Collecting and loading plugins
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:read_property} - Reading property: plugins.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.pyc is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.pyc is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - README.md is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] INFO {config.py:initialize_extensions} - Collecting and loading extensions
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {config.py:read_property} - Reading property: extensions.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - ExtensionExecutor.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator found a candidate:
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager     /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor.yapsy-plugin
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,275] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {config.py:initialize_extensions} - Found extension executor [ExtensionExecutor] at [/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor]
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] INFO {config.py:initialize_extensions} - Activated extension executor [ExtensionExecutor]
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {agent.py:main} - Starting cartridge agent
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] INFO {agent.py:run} - Starting Cartridge Agent...
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {agent.py:register_topology_event_listeners} - Starting topology event message receiver thread
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberActivatedEvent'
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberTerminatedEvent'
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberSuspendedEvent'
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTopologyEvent'
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberStartedEvent'
-2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberCreatedEvent'
-2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,278] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberInitializedEvent'
-2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,278] INFO {agent.py:register_topology_event_listeners} - Cartridge agent topology receiver thread started
-2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,279] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Subscribed to 'topology/#'
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,269] DEBUG {config.py:read_conf_file} - Config file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/agent.conf'
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_payload_file} - Param file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params'
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_ID = application-3
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: SERVICE_NAME = tomcat-mt
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_ID = tomcat.domain
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: PORTS = 8080
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: MULTITENANT = true
-2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: TENANT_ID = -1234
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.commit = true
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: INTERNAL = false
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: artifact.update.interval = 15
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_INSTANCE_ID = cluster-1-instance-1
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: MEMBER_ID = tomcat.member-1
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: NETWORK_PARTITION_ID = network-p1
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PARTITION_ID = p1
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_PATH = /tmp/pca-test-suite-2
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: REPO_URL = https://github.com/imesh/stratos-php-applications.git
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CARTRIDGE_KEY = PUjpXCLujDhYr5A6
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: log.file.paths = /tmp/agent.screen-adc-mt-test.log
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PERSISTENCE_MAPPING = None
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.checkout = true
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: listen.address = localhost
-2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: LB_CLUSTER_ID = None
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: MIN_COUNT = 1
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.private.ip = 
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.public.ip = 
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: tenant.repository.path = /repository/tenants/
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: super.tenant.repository.path = /repository/deployment/server/
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] INFO {config.py:initialize_config} - Cartridge agent configuration initialized
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - service-name: 'tomcat-mt'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-id: 'tomcat.domain'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-instance-id: 'cluster-1-instance-1'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - member-id: 'tomcat.member-1'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - network-partition-id: 'network-p1'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - partition-id: 'p1'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - cartridge-key: 'PUjpXCLujDhYr5A6'
-2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - app-path: '/tmp/pca-test-suite-2'
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - repo-url: 'https://github.com/imesh/stratos-php-applications.git'
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - ports: "['8080']"
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-private-ip: None
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-public-ip: None
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - dependant_cluster_id: None
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - export_metadata_keys: None
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - import_metadata_keys: None
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - artifact.update.interval: '15'
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lvs-virtual-ip: None
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - log_file_paths: ['/tmp/agent.screen-adc-mt-test.log']
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] INFO {config.py:initialize_config} - Initializing plugins
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] INFO {config.py:initialize_plugins} - Collecting and loading plugins
-2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:read_property} - Reading property: plugins.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.pyc is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.pyc is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - README.md is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] INFO {config.py:initialize_extensions} - Collecting and loading extensions
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {config.py:read_property} - Reading property: extensions.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - ExtensionExecutor.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator found a candidate:
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest     /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor.yapsy-plugin
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,275] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {config.py:initialize_extensions} - Found extension executor [ExtensionExecutor] at [/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor]
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] INFO {config.py:initialize_extensions} - Activated extension executor [ExtensionExecutor]
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {agent.py:main} - Starting cartridge agent
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] INFO {agent.py:run} - Starting Cartridge Agent...
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {agent.py:register_topology_event_listeners} - Starting topology event message receiver thread
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberActivatedEvent'
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberTerminatedEvent'
-2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberSuspendedEvent'
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTopologyEvent'
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberStartedEvent'
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberCreatedEvent'
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,278] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberInitializedEvent'
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,278] INFO {agent.py:register_topology_event_listeners} - Cartridge agent topology receiver thread started
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,279] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:36,360 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:36,279] DEBUG {agent.py:run} - LVS Virtual IP is not defined
-2015-08-28 16:51:36,360 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:36,279] INFO {agent.py:wait_for_complete_topology} - Waiting for complete topology event...
-2015-08-28 16:51:38,055 [-] [Thread-15]  INFO ADCMTAppTest Publishing complete topology event...
-2015-08-28 16:51:38,208 [-] [Thread-15]  INFO ADCMTAppTest Complete topology event published
-2015-08-28 16:51:38,209 [-] [Thread-15]  INFO ADCMTAppTest Publishing member initialized event...
-2015-08-28 16:51:38,228 [-] [pool-2-thread-2]  INFO CompleteTopologyMessageProcessor Topology initialized
-2015-08-28 16:51:38,246 [-] [Thread-15]  INFO ADCMTAppTest Member initialized event published
-2015-08-28 16:51:38,246 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Subscribed to 'topology/#'
-2015-08-28 16:51:38,248 [-] [pool-2-thread-2]  INFO MemberInitializedMessageProcessor Member initialized: [service] tomcat-mt [cluster] tomcat.domain [member] tomcat.member-1
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,212] DEBUG {subscriber.py:on_message} - Message received: topology/CompleteTopologyEvent:
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager {"topology":{"clusterMap":{},"serviceMap":{"tomcat-mt":{"serviceName":"tomcat-mt","serviceType":"SingleTenant","clusterIdClusterMap":{"tomcat.domain":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","autoscalePolicyName":"autoscaling-policy-3","deploymentPolicyName":"deployment-policy-3","hostNames":[],"isLbCluster":false,"isKubernetesCluster":false,"memberMap":{"tomcat.member-1":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","memberId":"tomcat.member-1","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","initTime":1440760898061,"portMap":{},"defaultPublicIP":"20.0.0.1","defaultPrivateIP":"10.0.0.1","properties":{"prop1":"value1"},"memberStateManager":{"stateStack":["Created"],"identifier":"tomcat.member-1"},"loadBalancingIPType":"Private"}},"appId":"application-3","instanceIdToInstanceContextMap":{},"accessUrls":[],"kubernetesServices":[]
 }},"portMap":{}}},"initialized":false}}
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,212] DEBUG {subscriber.py:run} - Executing handler for event 'CompleteTopologyEvent'
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {agent.py:on_complete_topology} - Complete topology event received
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Processing Complete topology event...
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Created}
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Member initialized False
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,214] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,214] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [CompleteTopologyEvent]
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,214] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for CompleteTopologyEvent
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,215] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/CompleteTopologyEvent.sh
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,220] INFO {ExtensionExecutor.py:run_plugin} - CompleteTopologyEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Complete topology event shell extension executed
-2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager 
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,220] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event CompleteTopologyEvent
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {subscriber.py:on_message} - Message received: topology/MemberInitializedEvent:
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager {"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {subscriber.py:run} - Executing handler for event 'MemberInitializedEvent'
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {agent.py:on_member_initialized} - Member initialized event received: '{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}'
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Processing Member initialized event...
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Member exists: True
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,242] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,242] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [MemberInitializedEvent]
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,242] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for MemberInitializedEvent
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,243] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/MemberInitializedEvent.sh
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,247] INFO {ExtensionExecutor.py:run_plugin} - MemberInitializedEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Member initialized event shell extension executed
-2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,248] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event MemberInitializedEvent
-2015-08-28 16:51:39,247 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:36,279] DEBUG {agent.py:run} - LVS Virtual IP is not defined
-2015-08-28 16:51:39,247 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:36,279] INFO {agent.py:wait_for_complete_topology} - Waiting for complete topology event...
-2015-08-28 16:51:39,247 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,212] DEBUG {subscriber.py:on_message} - Message received: topology/CompleteTopologyEvent:
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest {"topology":{"clusterMap":{},"serviceMap":{"tomcat-mt":{"serviceName":"tomcat-mt","serviceType":"SingleTenant","clusterIdClusterMap":{"tomcat.domain":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","autoscalePolicyName":"autoscaling-policy-3","deploymentPolicyName":"deployment-policy-3","hostNames":[],"isLbCluster":false,"isKubernetesCluster":false,"memberMap":{"tomcat.member-1":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","memberId":"tomcat.member-1","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","initTime":1440760898061,"portMap":{},"defaultPublicIP":"20.0.0.1","defaultPrivateIP":"10.0.0.1","properties":{"prop1":"value1"},"memberStateManager":{"stateStack":["Created"],"identifier":"tomcat.member-1"},"loadBalancingIPType":"Private"}},"appId":"application-3","instanceIdToInstanceContextMap":{},"accessUrls":[],"kubernetesServices":[]}},"portMa
 p":{}}},"initialized":false}}
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,212] DEBUG {subscriber.py:run} - Executing handler for event 'CompleteTopologyEvent'
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {agent.py:on_complete_topology} - Complete topology event received
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Processing Complete topology event...
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Created}
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Member initialized False
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,214] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,214] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [CompleteTopologyEvent]
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,214] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for CompleteTopologyEvent
-2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,215] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/CompleteTopologyEvent.sh
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,220] INFO {ExtensionExecutor.py:run_plugin} - CompleteTopologyEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Complete topology event shell extension executed
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest 
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,220] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event CompleteTopologyEvent
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {subscriber.py:on_message} - Message received: topology/MemberInitializedEvent:
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest {"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {subscriber.py:run} - Executing handler for event 'MemberInitializedEvent'
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {agent.py:on_member_initialized} - Member initialized event received: '{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}'
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Processing Member initialized event...
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Member exists: True
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,242] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,242] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [MemberInitializedEvent]
-2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,242] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for MemberInitializedEvent
-2015-08-28 16:51:39,250 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,243] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/MemberInitializedEvent.sh
-2015-08-28 16:51:39,250 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,247] INFO {ExtensionExecutor.py:run_plugin} - MemberInitializedEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Member initialized event shell extension executed
-2015-08-28 16:51:39,250 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,248] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event MemberInitializedEvent
-2015-08-28 16:51:41,379 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] INFO {agent.py:wait_for_complete_topology} - Complete topology event received
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {agent.py:register_instance_topic_listeners} - Starting instance notifier event message receiver thread
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ArtifactUpdatedEvent'
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupMemberEvent'
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupClusterEvent'
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] INFO {agent.py:register_instance_topic_listeners} - Instance notifier event message receiver thread started
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,286] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Subscribed to 'instance/#'
-2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] INFO {agent.py:wait_for_complete_topology} - Complete topology event received
-2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {agent.py:register_instance_topic_listeners} - Starting instance notifier event message receiver thread
-2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ArtifactUpdatedEvent'
-2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupMemberEvent'
-2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupClusterEvent'
-2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] INFO {agent.py:register_instance_topic_listeners} - Instance notifier event message receiver thread started
-2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,286] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Subscribed to 'instance/#'
-2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {agent.py:register_tenant_event_listeners} - Starting tenant event message receiver thread
-2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainMappingAddedEvent'
-2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainsMappingRemovedEvent'
-2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTenantEvent'
-2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,288] DEBUG {subscriber.py:register_handler} - Registered handler for event 'TenantSubscribedEvent'
-2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,288] INFO {agent.py:register_tenant_event_listeners} - Tenant event message receiver thread started
-2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,289] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Subscribed to 'tenant/#'
-2015-08-28 16:51:43,253 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {agent.py:register_tenant_event_listeners} - Starting tenant event message receiver thread
-2015-08-28 16:51:43,253 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainMappingAddedEvent'
-2015-08-28 16:51:43,253 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainsMappingRemovedEvent'
-2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTenantEvent'
-2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,288] DEBUG {subscriber.py:register_handler} - Registered handler for event 'TenantSubscribedEvent'
-2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,288] INFO {agent.py:register_tenant_event_listeners} - Tenant event message receiver thread started
-2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,289] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Subscribed to 'tenant/#'
-2015-08-28 16:51:43,389 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,290] DEBUG {agent.py:register_application_signup_event_listeners} - Starting application signup event message receiver thread
-2015-08-28 16:51:43,389 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,290] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ApplicationSignUpRemovedEvent'
-2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,291] INFO {agent.py:register_application_signup_event_listeners} - Application signup event message receiver thread started
-2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,291] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Subscribed to 'application/signup/#'
-2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,290] DEBUG {agent.py:register_application_signup_event_listeners} - Starting application signup event message receiver thread
-2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,290] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ApplicationSignUpRemovedEvent'
-2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,291] INFO {agent.py:register_application_signup_event_listeners} - Application signup event message receiver thread started
-2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,291] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
-2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Connected to message broker.
-2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Subscribed to 'application/signup/#'
-2015-08-28 16:51:44,294 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:on_instance_started_event} - Processing instance started event...
-2015-08-28 16:51:44,294 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,292] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:44,294 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [InstanceStartedEvent]
-2015-08-28 16:51:44,295 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for InstanceStartedEvent
-2015-08-28 16:51:44,295 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/InstanceStartedEvent.sh
-2015-08-28 16:51:44,316 [-] [pool-2-thread-4]  INFO PythonAgentTestManager Instance started event received
-2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,298] INFO {ExtensionExecutor.py:run_plugin} - InstanceStartedEvent Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Instance started event shell extension executed
-2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event InstanceStartedEvent
-2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] INFO {publisher.py:publish_instance_started_event} - Publishing instance started event
-2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
-2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
-2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] INFO {publisher.py:publish_instance_started_event} - Instance started event published
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] INFO {eventhandler.py:start_server_extension} - Processing start server extension...
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Initialized}
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,307] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [StartServers]
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for StartServers
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/StartServers.sh
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,312] INFO {ExtensionExecutor.py:run_plugin} - StartServers Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Start servers event shell extension executed
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event StartServers
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] INFO {agent.py:run} - Artifact repository found, waiting for artifact updated event to checkout artifacts: [repo_url] https://github.com/imesh/stratos-php-applications.git
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] DEBUG {config.py:read_property} - Reading property: enable.data.publisher = false
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] INFO {logpublisher.py:read_config} - Data Publisher disabled
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,315] DEBUG {subscriber.py:on_message} - Message received: instance/status/InstanceStartedEvent:
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager {
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager     "applicationId": "application-3", 
-2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager     "clusterId": "tomcat.domain", 
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "clusterInstanceId": "cluster-1-instance-1", 
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "instanceId": null, 
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "memberId": "tomcat.member-1", 
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "networkPartitionId": "network-p1", 
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "partitionId": "p1", 
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "serviceName": "tomcat-mt"
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager }
-2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,315] DEBUG {subscriber.py:run} - Event handler not found for event : 'InstanceStartedEvent'
-2015-08-28 16:51:45,256 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:on_instance_started_event} - Processing instance started event...
-2015-08-28 16:51:45,256 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,292] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [InstanceStartedEvent]
-2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for InstanceStartedEvent
-2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/InstanceStartedEvent.sh
-2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,298] INFO {ExtensionExecutor.py:run_plugin} - InstanceStartedEvent Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Instance started event shell extension executed
-2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event InstanceStartedEvent
-2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] INFO {publisher.py:publish_instance_started_event} - Publishing instance started event
-2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
-2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
-2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] INFO {publisher.py:publish_instance_started_event} - Instance started event published
-2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] INFO {eventhandler.py:start_server_extension} - Processing start server extension...
-2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Initialized}
-2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,307] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [StartServers]
-2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for StartServers
-2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/StartServers.sh
-2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,312] INFO {ExtensionExecutor.py:run_plugin} - StartServers Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Start servers event shell extension executed
-2015-08-28 16:51:45,260 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event StartServers
-2015-08-28 16:51:45,286 [-] [Thread-15]  INFO ADCMTAppTest Artifact updated event published
-2015-08-28 16:51:45,286 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] INFO {agent.py:run} - Artifact repository found, waiting for artifact updated event to checkout artifacts: [repo_url] https://github.com/imesh/stratos-php-applications.git
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] DEBUG {config.py:read_property} - Reading property: enable.data.publisher = false
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] INFO {logpublisher.py:read_config} - Data Publisher disabled
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,315] DEBUG {subscriber.py:on_message} - Message received: instance/status/InstanceStartedEvent:
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest {
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "applicationId": "application-3", 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "clusterId": "tomcat.domain", 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "clusterInstanceId": "cluster-1-instance-1", 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "instanceId": null, 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "memberId": "tomcat.member-1", 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "networkPartitionId": "network-p1", 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "partitionId": "p1", 
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "serviceName": "tomcat-mt"
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest }
-2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,315] DEBUG {subscriber.py:run} - Event handler not found for event : 'InstanceStartedEvent'
-2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] DEBUG {subscriber.py:on_message} - Message received: instance/notifier/ArtifactUpdatedEvent:
-2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager {"clusterId":"tomcat.domain","repoURL":"https://bitbucket.org/testapache2211/opentestrepo1.git","tenantId":"-1234","commitEnabled":false}
-2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] DEBUG {subscriber.py:run} - Executing handler for event 'ArtifactUpdatedEvent'
-2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Processing Artifact update event: [tenant] -1234 [cluster] tomcat.domain [status] None
-2015-08-28 16:51:45,307 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Executing git checkout
-2015-08-28 16:51:45,307 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,285] DEBUG {eventhandler.py:get_repo_path_for_tenant} - Repo path returned : '/tmp/pca-test-suite-2/repository/deployment/server/'
-2015-08-28 16:51:45,308 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Cloning artifacts from https://bitbucket.org/testapache2211/opentestrepo1.git for the first time to /tmp/pca-test-suite-2/repository/deployment/server/
-2015-08-28 16:51:45,308 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Executing git clone: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git, [repo path] /tmp/pca-test-suite-2/repository/deployment/server/
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] DEBUG {subscriber.py:on_message} - Message received: instance/notifier/ArtifactUpdatedEvent:
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest {"clusterId":"tomcat.domain","repoURL":"https://bitbucket.org/testapache2211/opentestrepo1.git","tenantId":"-1234","commitEnabled":false}
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] DEBUG {subscriber.py:run} - Executing handler for event 'ArtifactUpdatedEvent'
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Processing Artifact update event: [tenant] -1234 [cluster] tomcat.domain [status] None
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Executing git checkout
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,285] DEBUG {eventhandler.py:get_repo_path_for_tenant} - Repo path returned : '/tmp/pca-test-suite-2/repository/deployment/server/'
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Cloning artifacts from https://bitbucket.org/testapache2211/opentestrepo1.git for the first time to /tmp/pca-test-suite-2/repository/deployment/server/
-2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Executing git clone: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git, [repo path] /tmp/pca-test-suite-2/repository/deployment/server/
-2015-08-28 16:51:49,372 [-] [Thread-7]  INFO PythonAgentTestManager Client connected to port 8080
-2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] INFO {agentgithandler.py:clone} - Git clone operation for tenant -1234 successful
-2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] DEBUG {agentgithandler.py:checkout} - Git clone executed: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git
-2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [ArtifactUpdatedEvent]
-2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for ArtifactUpdatedEvent
-2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/ArtifactUpdatedEvent.sh
-2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,370] INFO {ExtensionExecutor.py:run_plugin} - ArtifactUpdatedEvent Extension executed. [output]: Fri Aug 28 16:51:49 IST 2015: Artifacts updated event shell extension executed
-2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,371] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event ArtifactUpdatedEvent
-2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,371] DEBUG {config.py:read_property} - Reading property: port.check.timeout = 600000
-2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:wait_until_ports_active} - Port check timeout: 600000
-2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,372] INFO {cartridgeagentutils.py:wait_until_ports_active} - Waiting for ports to be active: [ip] 'localhost' [ports] ['8080']
-2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:check_ports_active} - Port '8080' is active
-2015-08-28 16:51:50,289 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] INFO {agentgithandler.py:clone} - Git clone operation for tenant -1234 successful
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] DEBUG {agentgithandler.py:checkout} - Git clone executed: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [ArtifactUpdatedEvent]
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for ArtifactUpdatedEvent
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/ArtifactUpdatedEvent.sh
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,370] INFO {ExtensionExecutor.py:run_plugin} - ArtifactUpdatedEvent Extension executed. [output]: Fri Aug 28 16:51:49 IST 2015: Artifacts updated event shell extension executed
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,371] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event ArtifactUpdatedEvent
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,371] DEBUG {config.py:read_property} - Reading property: port.check.timeout = 600000
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:wait_until_ports_active} - Port check timeout: 600000
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,372] INFO {cartridgeagentutils.py:wait_until_ports_active} - Waiting for ports to be active: [ip] 'localhost' [ports] ['8080']
-2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:check_ports_active}

<TRUNCATED>

[20/50] [abbrv] stratos git commit: Fixing health stat publisher in PCA, adding MT app integration test to PCA

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/cartridge-agent.log
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/cartridge-agent.log b/products/python-cartridge-agent/integration/cartridge-agent.log
new file mode 100644
index 0000000..75bf741
--- /dev/null
+++ b/products/python-cartridge-agent/integration/cartridge-agent.log
@@ -0,0 +1,3372 @@
+2015-08-28 16:51:34,169 [-] [main]  INFO BrokerService Loaded the Bouncy Castle security provider.
+2015-08-28 16:51:34,176 [-] [main]  INFO PythonAgentTestManager PCA integration properties: {distribution.name=apache-stratos-python-cartridge-agent-4.1.2, stratos.admin.password=admin, activemq.mqtt.bind.address=mqtt://localhost:1885, stratos.endpoint=http://localhost:9763, cep.port=7712, distribution.version=4.1.2, stratos.admin.username=admin, activemq.amqp.bind.address=tcp://localhost:61617}
+2015-08-28 16:51:34,178 [-] [main]  INFO PythonAgentTestManager PCA integration properties: {distribution.name=apache-stratos-python-cartridge-agent-4.1.2, stratos.admin.password=admin, activemq.mqtt.bind.address=mqtt://localhost:1885, stratos.endpoint=http://localhost:9763, cep.port=7712, distribution.version=4.1.2, stratos.admin.username=admin, activemq.amqp.bind.address=tcp://localhost:61617}
+2015-08-28 16:51:34,179 [-] [main]  INFO PythonAgentTestManager PCA integration properties: {distribution.name=apache-stratos-python-cartridge-agent-4.1.2, stratos.admin.password=admin, activemq.mqtt.bind.address=mqtt://localhost:1885, stratos.endpoint=http://localhost:9763, cep.port=7712, distribution.version=4.1.2, stratos.admin.username=admin, activemq.amqp.bind.address=tcp://localhost:61617}
+2015-08-28 16:51:34,470 [-] [JMX connector]  INFO ManagementContext JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
+2015-08-28 16:51:34,547 [-] [main]  INFO PListStoreImpl PListStore:[/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/tmp_storage] started
+2015-08-28 16:51:34,553 [-] [main]  INFO BrokerService Using Persistence Adapter: KahaDBPersistenceAdapter[/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/KahaDB]
+2015-08-28 16:51:34,807 [-] [main]  INFO BrokerService Apache ActiveMQ 5.10.0 (testBroker, ID:akila-wso2-lap-23868-1440760894669-0:1) is starting
+2015-08-28 16:51:34,816 [-] [main]  INFO TransportServerThreadSupport Listening for connections at: tcp://localhost:61617
+2015-08-28 16:51:34,817 [-] [main]  INFO TransportConnector Connector tcp://localhost:61617 started
+2015-08-28 16:51:34,818 [-] [main]  INFO TransportServerThreadSupport Listening for connections at: mqtt://localhost:1885
+2015-08-28 16:51:34,818 [-] [main]  INFO TransportConnector Connector mqtt://localhost:1885 started
+2015-08-28 16:51:34,819 [-] [main]  INFO BrokerService Apache ActiveMQ 5.10.0 (testBroker, ID:akila-wso2-lap-23868-1440760894669-0:1) started
+2015-08-28 16:51:34,819 [-] [main]  INFO BrokerService For help or more information please see: http://activemq.apache.org
+2015-08-28 16:51:34,819 [-] [main]  WARN BrokerService Store limit is 102400 mb (current store usage is 0 mb). The data directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/KahaDB only has 25094 mb of usable space - resetting to maximum available disk space: 25094 mb
+2015-08-28 16:51:34,819 [-] [main] ERROR BrokerService Temporary Store limit is 51200 mb, whilst the temporary data directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/test-classes/../d172cc3f-19ec-49a3-9d52-909804158deb/activemq-data/testBroker/tmp_storage only has 25094 mb of usable space - resetting to maximum available 25094 mb.
+2015-08-28 16:51:34,854 [-] [main]  INFO PythonAgentTestManager Broker service started!
+2015-08-28 16:51:34,857 [-] [main]  INFO StratosThreadPool Thread pool created: [type] Executor Service [id] TEST_THREAD_POOL [size] 15
+2015-08-28 16:51:34,935 [-] [pool-2-thread-2]  INFO TopologyEventMessageDelegator Topology event message delegator started
+2015-08-28 16:51:34,950 [-] [pool-2-thread-4]  INFO InstanceStatusEventMessageDelegator Instance notifier event message delegator started
+2015-08-28 16:51:34,952 [-] [main]  INFO PythonAgentTestManager Setting up python cartridge agent...
+2015-08-28 16:51:34,952 [-] [Thread-5]  INFO PythonAgentTestManager Server socket started on port: 7712
+2015-08-28 16:51:35,003 [-] [main]  INFO PythonAgentTestManager Changing extension scripts permissions
+2015-08-28 16:51:35,015 [-] [main]  INFO PythonAgentTestManager Python cartridge agent setup completed
+2015-08-28 16:51:35,015 [-] [main]  INFO PythonAgentTestManager Python agent working directory name: d172cc3f-19ec-49a3-9d52-909804158deb
+2015-08-28 16:51:35,015 [-] [main]  INFO PythonAgentTestManager Starting python cartridge agent...
+2015-08-28 16:51:35,024 [-] [Thread-7]  INFO PythonAgentTestManager Server socket started on port: 8080
+2015-08-28 16:51:35,026 [-] [main] ERROR PythonAgentTestManager Error while starting MB
+java.io.IOException: Failed to bind to server socket: tcp://localhost:61617 due to: java.net.BindException: Address already in use
+	at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
+	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
+	at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:56)
+	at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
+	at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2327)
+	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:316)
+	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:306)
+	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.startBroker(PythonAgentTestManager.java:189)
+	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.setup(PythonAgentTestManager.java:77)
+	at org.apache.stratos.python.cartridge.agent.test.ADCTest.setupADCTest(ADCTest.java:64)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
+	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
+	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
+	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
+	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
+	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
+	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
+	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
+	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
+	at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
+	at org.testng.TestNG.run(TestNG.java:999)
+	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
+	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:205)
+	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)
+	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
+	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
+	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
+	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
+Caused by: java.net.BindException: Address already in use
+	at java.net.PlainSocketImpl.socketBind(Native Method)
+	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
+	at java.net.ServerSocket.bind(ServerSocket.java:376)
+	at java.net.ServerSocket.<init>(ServerSocket.java:237)
+	at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
+	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:132)
+	... 30 more
+2015-08-28 16:51:35,029 [-] [Thread-8] ERROR PythonAgentTestManager Could not start server socket: [port] 8080
+java.net.BindException: Address already in use
+	at java.net.PlainSocketImpl.socketBind(Native Method)
+	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
+	at java.net.ServerSocket.bind(ServerSocket.java:376)
+	at java.net.ServerSocket.<init>(ServerSocket.java:237)
+	at java.net.ServerSocket.<init>(ServerSocket.java:128)
+	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager$4.run(PythonAgentTestManager.java:236)
+	at java.lang.Thread.run(Thread.java:745)
+2015-08-28 16:51:35,030 [-] [main] ERROR PythonAgentTestManager Error while starting MB
+java.io.IOException: Failed to bind to server socket: tcp://localhost:61617 due to: java.net.BindException: Address already in use
+	at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
+	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:135)
+	at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:56)
+	at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
+	at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2327)
+	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:316)
+	at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:306)
+	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.startBroker(PythonAgentTestManager.java:189)
+	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager.setup(PythonAgentTestManager.java:77)
+	at org.apache.stratos.python.cartridge.agent.test.AgentStartupTest.setupAgentStartupTest(AgentStartupTest.java:57)
+	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+	at java.lang.reflect.Method.invoke(Method.java:606)
+	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
+	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)
+	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)
+	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)
+	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
+	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
+	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
+	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
+	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
+	at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
+	at org.testng.TestNG.run(TestNG.java:999)
+	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
+	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:205)
+	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:108)
+	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
+	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
+	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
+	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
+Caused by: java.net.BindException: Address already in use
+	at java.net.PlainSocketImpl.socketBind(Native Method)
+	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
+	at java.net.ServerSocket.bind(ServerSocket.java:376)
+	at java.net.ServerSocket.<init>(ServerSocket.java:237)
+	at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
+	at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:132)
+	... 30 more
+2015-08-28 16:51:35,032 [-] [Thread-9] ERROR PythonAgentTestManager Could not start server socket: [port] 8080
+java.net.BindException: Address already in use
+	at java.net.PlainSocketImpl.socketBind(Native Method)
+	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
+	at java.net.ServerSocket.bind(ServerSocket.java:376)
+	at java.net.ServerSocket.<init>(ServerSocket.java:237)
+	at java.net.ServerSocket.<init>(ServerSocket.java:128)
+	at org.apache.stratos.python.cartridge.agent.test.PythonAgentTestManager$4.run(PythonAgentTestManager.java:236)
+	at java.lang.Thread.run(Thread.java:745)
+2015-08-28 16:51:35,349 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,269] DEBUG {config.py:read_conf_file} - Config file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/agent.conf'
+2015-08-28 16:51:35,349 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_payload_file} - Param file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params'
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_ID = application-3
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: SERVICE_NAME = tomcat-mt
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_ID = tomcat.domain
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: PORTS = 8080
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: MULTITENANT = true
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: TENANT_ID = -1234
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.commit = true
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: INTERNAL = false
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: artifact.update.interval = 15
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_INSTANCE_ID = cluster-1-instance-1
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: MEMBER_ID = tomcat.member-1
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: NETWORK_PARTITION_ID = network-p1
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PARTITION_ID = p1
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_PATH = /tmp/pca-test-suite-2
+2015-08-28 16:51:35,350 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: REPO_URL = https://github.com/imesh/stratos-php-applications.git
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CARTRIDGE_KEY = PUjpXCLujDhYr5A6
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: log.file.paths = /tmp/agent.screen-adc-mt-test.log
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PERSISTENCE_MAPPING = None
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.checkout = true
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: listen.address = localhost
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: LB_CLUSTER_ID = None
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: MIN_COUNT = 1
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.private.ip = 
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.public.ip = 
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: tenant.repository.path = /repository/tenants/
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: super.tenant.repository.path = /repository/deployment/server/
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] INFO {config.py:initialize_config} - Cartridge agent configuration initialized
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - service-name: 'tomcat-mt'
+2015-08-28 16:51:35,351 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-id: 'tomcat.domain'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-instance-id: 'cluster-1-instance-1'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - member-id: 'tomcat.member-1'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - network-partition-id: 'network-p1'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - partition-id: 'p1'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - cartridge-key: 'PUjpXCLujDhYr5A6'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - app-path: '/tmp/pca-test-suite-2'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - repo-url: 'https://github.com/imesh/stratos-php-applications.git'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - ports: "['8080']"
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-private-ip: None
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-public-ip: None
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - dependant_cluster_id: None
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - export_metadata_keys: None
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - import_metadata_keys: None
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - artifact.update.interval: '15'
+2015-08-28 16:51:35,352 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lvs-virtual-ip: None
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - log_file_paths: ['/tmp/agent.screen-adc-mt-test.log']
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] INFO {config.py:initialize_config} - Initializing plugins
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] INFO {config.py:initialize_plugins} - Collecting and loading plugins
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,273] DEBUG {config.py:read_property} - Reading property: plugins.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.pyc is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.pyc is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - README.md is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] INFO {config.py:initialize_extensions} - Collecting and loading extensions
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {config.py:read_property} - Reading property: extensions.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - ExtensionExecutor.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,353 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator found a candidate:
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager     /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor.yapsy-plugin
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,275] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {config.py:initialize_extensions} - Found extension executor [ExtensionExecutor] at [/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor]
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] INFO {config.py:initialize_extensions} - Activated extension executor [ExtensionExecutor]
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,276] DEBUG {agent.py:main} - Starting cartridge agent
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] INFO {agent.py:run} - Starting Cartridge Agent...
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {agent.py:register_topology_event_listeners} - Starting topology event message receiver thread
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberActivatedEvent'
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberTerminatedEvent'
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberSuspendedEvent'
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTopologyEvent'
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberStartedEvent'
+2015-08-28 16:51:35,354 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberCreatedEvent'
+2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,278] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberInitializedEvent'
+2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,278] INFO {agent.py:register_topology_event_listeners} - Cartridge agent topology receiver thread started
+2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,279] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:35,355 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Subscribed to 'topology/#'
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,269] DEBUG {config.py:read_conf_file} - Config file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/agent.conf'
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_payload_file} - Param file path : '/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params'
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_ID = application-3
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: SERVICE_NAME = tomcat-mt
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_ID = tomcat.domain
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: PORTS = 8080
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,270] DEBUG {config.py:read_property} - Reading payload parameter: MULTITENANT = true
+2015-08-28 16:51:36,049 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: TENANT_ID = -1234
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.commit = true
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: INTERNAL = false
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: artifact.update.interval = 15
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CLUSTER_INSTANCE_ID = cluster-1-instance-1
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: MEMBER_ID = tomcat.member-1
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: NETWORK_PARTITION_ID = network-p1
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PARTITION_ID = p1
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: APPLICATION_PATH = /tmp/pca-test-suite-2
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: REPO_URL = https://github.com/imesh/stratos-php-applications.git
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: CARTRIDGE_KEY = PUjpXCLujDhYr5A6
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: log.file.paths = /tmp/agent.screen-adc-mt-test.log
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading payload parameter: PERSISTENCE_MAPPING = None
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,271] DEBUG {config.py:read_property} - Reading property: auto.checkout = true
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: listen.address = localhost
+2015-08-28 16:51:36,050 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: LB_CLUSTER_ID = None
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading payload parameter: MIN_COUNT = 1
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.private.ip = 
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: lb.public.ip = 
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: tenant.repository.path = /repository/tenants/
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:read_property} - Reading property: super.tenant.repository.path = /repository/deployment/server/
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] INFO {config.py:initialize_config} - Cartridge agent configuration initialized
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - service-name: 'tomcat-mt'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-id: 'tomcat.domain'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - cluster-instance-id: 'cluster-1-instance-1'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - member-id: 'tomcat.member-1'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - network-partition-id: 'network-p1'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,272] DEBUG {config.py:initialize_config} - partition-id: 'p1'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - cartridge-key: 'PUjpXCLujDhYr5A6'
+2015-08-28 16:51:36,051 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - app-path: '/tmp/pca-test-suite-2'
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - repo-url: 'https://github.com/imesh/stratos-php-applications.git'
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - ports: "['8080']"
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-private-ip: None
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lb-public-ip: None
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - dependant_cluster_id: None
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - export_metadata_keys: None
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - import_metadata_keys: None
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - artifact.update.interval: '15'
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - lvs-virtual-ip: None
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:initialize_config} - log_file_paths: ['/tmp/agent.screen-adc-mt-test.log']
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] INFO {config.py:initialize_config} - Initializing plugins
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] INFO {config.py:initialize_plugins} - Collecting and loading plugins
+2015-08-28 16:51:36,052 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,273] DEBUG {config.py:read_property} - Reading property: plugins.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/plugins
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.pyc is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.pyc is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - contracts.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - README.md is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] INFO {config.py:initialize_extensions} - Collecting and loading extensions
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {config.py:read_property} - Reading property: extensions.dir = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator walks (recursively) into directory: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - ExtensionExecutor.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,053 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,274] DEBUG {PluginFileLocator.py:locatePlugins} - PluginFileLocator found a candidate:
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest     /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor.yapsy-plugin
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,275] DEBUG {PluginFileLocator.py:locatePlugins} - __init__.py is not a valid plugin for strategy info_ext
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {config.py:initialize_extensions} - Found extension executor [ExtensionExecutor] at [/home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/py/ExtensionExecutor]
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] INFO {config.py:initialize_extensions} - Activated extension executor [ExtensionExecutor]
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,276] DEBUG {agent.py:main} - Starting cartridge agent
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] INFO {agent.py:run} - Starting Cartridge Agent...
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {agent.py:register_topology_event_listeners} - Starting topology event message receiver thread
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberActivatedEvent'
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberTerminatedEvent'
+2015-08-28 16:51:36,054 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberSuspendedEvent'
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTopologyEvent'
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberStartedEvent'
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,277] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberCreatedEvent'
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,278] DEBUG {subscriber.py:register_handler} - Registered handler for event 'MemberInitializedEvent'
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,278] INFO {agent.py:register_topology_event_listeners} - Cartridge agent topology receiver thread started
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,279] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:36,055 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:36,360 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:36,279] DEBUG {agent.py:run} - LVS Virtual IP is not defined
+2015-08-28 16:51:36,360 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:36,279] INFO {agent.py:wait_for_complete_topology} - Waiting for complete topology event...
+2015-08-28 16:51:38,055 [-] [Thread-15]  INFO ADCMTAppTest Publishing complete topology event...
+2015-08-28 16:51:38,208 [-] [Thread-15]  INFO ADCMTAppTest Complete topology event published
+2015-08-28 16:51:38,209 [-] [Thread-15]  INFO ADCMTAppTest Publishing member initialized event...
+2015-08-28 16:51:38,228 [-] [pool-2-thread-2]  INFO CompleteTopologyMessageProcessor Topology initialized
+2015-08-28 16:51:38,246 [-] [Thread-15]  INFO ADCMTAppTest Member initialized event published
+2015-08-28 16:51:38,246 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:35,317] DEBUG {subscriber.py:on_connect} - Subscribed to 'topology/#'
+2015-08-28 16:51:38,248 [-] [pool-2-thread-2]  INFO MemberInitializedMessageProcessor Member initialized: [service] tomcat-mt [cluster] tomcat.domain [member] tomcat.member-1
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,212] DEBUG {subscriber.py:on_message} - Message received: topology/CompleteTopologyEvent:
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager {"topology":{"clusterMap":{},"serviceMap":{"tomcat-mt":{"serviceName":"tomcat-mt","serviceType":"SingleTenant","clusterIdClusterMap":{"tomcat.domain":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","autoscalePolicyName":"autoscaling-policy-3","deploymentPolicyName":"deployment-policy-3","hostNames":[],"isLbCluster":false,"isKubernetesCluster":false,"memberMap":{"tomcat.member-1":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","memberId":"tomcat.member-1","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","initTime":1440760898061,"portMap":{},"defaultPublicIP":"20.0.0.1","defaultPrivateIP":"10.0.0.1","properties":{"prop1":"value1"},"memberStateManager":{"stateStack":["Created"],"identifier":"tomcat.member-1"},"loadBalancingIPType":"Private"}},"appId":"application-3","instanceIdToInstanceContextMap":{},"accessUrls":[],"kubernetesServices":[]
 }},"portMap":{}}},"initialized":false}}
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,212] DEBUG {subscriber.py:run} - Executing handler for event 'CompleteTopologyEvent'
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {agent.py:on_complete_topology} - Complete topology event received
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Processing Complete topology event...
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Created}
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Member initialized False
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,214] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,214] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [CompleteTopologyEvent]
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,214] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for CompleteTopologyEvent
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,215] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/CompleteTopologyEvent.sh
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,220] INFO {ExtensionExecutor.py:run_plugin} - CompleteTopologyEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Complete topology event shell extension executed
+2015-08-28 16:51:38,267 [-] [Thread-14]  INFO PythonAgentTestManager 
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,220] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event CompleteTopologyEvent
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {subscriber.py:on_message} - Message received: topology/MemberInitializedEvent:
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager {"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {subscriber.py:run} - Executing handler for event 'MemberInitializedEvent'
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {agent.py:on_member_initialized} - Member initialized event received: '{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}'
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Processing Member initialized event...
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Member exists: True
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,242] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,242] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [MemberInitializedEvent]
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,242] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for MemberInitializedEvent
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,243] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/MemberInitializedEvent.sh
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,247] INFO {ExtensionExecutor.py:run_plugin} - MemberInitializedEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Member initialized event shell extension executed
+2015-08-28 16:51:38,268 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:38,248] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event MemberInitializedEvent
+2015-08-28 16:51:39,247 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:36,279] DEBUG {agent.py:run} - LVS Virtual IP is not defined
+2015-08-28 16:51:39,247 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:36,279] INFO {agent.py:wait_for_complete_topology} - Waiting for complete topology event...
+2015-08-28 16:51:39,247 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,212] DEBUG {subscriber.py:on_message} - Message received: topology/CompleteTopologyEvent:
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest {"topology":{"clusterMap":{},"serviceMap":{"tomcat-mt":{"serviceName":"tomcat-mt","serviceType":"SingleTenant","clusterIdClusterMap":{"tomcat.domain":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","autoscalePolicyName":"autoscaling-policy-3","deploymentPolicyName":"deployment-policy-3","hostNames":[],"isLbCluster":false,"isKubernetesCluster":false,"memberMap":{"tomcat.member-1":{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","memberId":"tomcat.member-1","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","initTime":1440760898061,"portMap":{},"defaultPublicIP":"20.0.0.1","defaultPrivateIP":"10.0.0.1","properties":{"prop1":"value1"},"memberStateManager":{"stateStack":["Created"],"identifier":"tomcat.member-1"},"loadBalancingIPType":"Private"}},"appId":"application-3","instanceIdToInstanceContextMap":{},"accessUrls":[],"kubernetesServices":[]}},"portMa
 p":{}}},"initialized":false}}
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,212] DEBUG {subscriber.py:run} - Executing handler for event 'CompleteTopologyEvent'
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {agent.py:on_complete_topology} - Complete topology event received
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Processing Complete topology event...
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Created}
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,213] DEBUG {eventhandler.py:on_complete_topology_event} - Member initialized False
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,214] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,214] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [CompleteTopologyEvent]
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,214] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for CompleteTopologyEvent
+2015-08-28 16:51:39,248 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,215] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/CompleteTopologyEvent.sh
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,220] INFO {ExtensionExecutor.py:run_plugin} - CompleteTopologyEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Complete topology event shell extension executed
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest 
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,220] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event CompleteTopologyEvent
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {subscriber.py:on_message} - Message received: topology/MemberInitializedEvent:
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest {"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {subscriber.py:run} - Executing handler for event 'MemberInitializedEvent'
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {agent.py:on_member_initialized} - Member initialized event received: '{"serviceName":"tomcat-mt","clusterId":"tomcat.domain","clusterInstanceId":"cluster-1-instance-1","networkPartitionId":"network-partition-1","partitionId":"partition-1","memberId":"tomcat.member-1"}'
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Processing Member initialized event...
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,241] DEBUG {eventhandler.py:on_member_initialized_event} - Member exists: True
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,242] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,242] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [MemberInitializedEvent]
+2015-08-28 16:51:39,249 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,242] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for MemberInitializedEvent
+2015-08-28 16:51:39,250 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,243] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/MemberInitializedEvent.sh
+2015-08-28 16:51:39,250 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,247] INFO {ExtensionExecutor.py:run_plugin} - MemberInitializedEvent Extension executed. [output]: Fri Aug 28 16:51:38 IST 2015: Member initialized event shell extension executed
+2015-08-28 16:51:39,250 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:38,248] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event MemberInitializedEvent
+2015-08-28 16:51:41,379 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] INFO {agent.py:wait_for_complete_topology} - Complete topology event received
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {agent.py:register_instance_topic_listeners} - Starting instance notifier event message receiver thread
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ArtifactUpdatedEvent'
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupMemberEvent'
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupClusterEvent'
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,285] INFO {agent.py:register_instance_topic_listeners} - Instance notifier event message receiver thread started
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,286] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:41,380 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Subscribed to 'instance/#'
+2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] INFO {agent.py:wait_for_complete_topology} - Complete topology event received
+2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {agent.py:register_instance_topic_listeners} - Starting instance notifier event message receiver thread
+2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ArtifactUpdatedEvent'
+2015-08-28 16:51:42,251 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupMemberEvent'
+2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] DEBUG {subscriber.py:register_handler} - Registered handler for event 'InstanceCleanupClusterEvent'
+2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,285] INFO {agent.py:register_instance_topic_listeners} - Instance notifier event message receiver thread started
+2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,286] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:42,252 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:41,292] DEBUG {subscriber.py:on_connect} - Subscribed to 'instance/#'
+2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {agent.py:register_tenant_event_listeners} - Starting tenant event message receiver thread
+2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainMappingAddedEvent'
+2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainsMappingRemovedEvent'
+2015-08-28 16:51:42,384 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTenantEvent'
+2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,288] DEBUG {subscriber.py:register_handler} - Registered handler for event 'TenantSubscribedEvent'
+2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,288] INFO {agent.py:register_tenant_event_listeners} - Tenant event message receiver thread started
+2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,289] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:42,385 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Subscribed to 'tenant/#'
+2015-08-28 16:51:43,253 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {agent.py:register_tenant_event_listeners} - Starting tenant event message receiver thread
+2015-08-28 16:51:43,253 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainMappingAddedEvent'
+2015-08-28 16:51:43,253 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'DomainsMappingRemovedEvent'
+2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,287] DEBUG {subscriber.py:register_handler} - Registered handler for event 'CompleteTenantEvent'
+2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,288] DEBUG {subscriber.py:register_handler} - Registered handler for event 'TenantSubscribedEvent'
+2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,288] INFO {agent.py:register_tenant_event_listeners} - Tenant event message receiver thread started
+2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,289] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:43,254 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:42,300] DEBUG {subscriber.py:on_connect} - Subscribed to 'tenant/#'
+2015-08-28 16:51:43,389 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,290] DEBUG {agent.py:register_application_signup_event_listeners} - Starting application signup event message receiver thread
+2015-08-28 16:51:43,389 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,290] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ApplicationSignUpRemovedEvent'
+2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,291] INFO {agent.py:register_application_signup_event_listeners} - Application signup event message receiver thread started
+2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,291] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:43,390 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Subscribed to 'application/signup/#'
+2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,290] DEBUG {agent.py:register_application_signup_event_listeners} - Starting application signup event message receiver thread
+2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,290] DEBUG {subscriber.py:register_handler} - Registered handler for event 'ApplicationSignUpRemovedEvent'
+2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,291] INFO {agent.py:register_application_signup_event_listeners} - Application signup event message receiver thread started
+2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,291] DEBUG {subscriber.py:run} - Connecting to the message broker with address 'localhost':'1885'
+2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Connected to message broker.
+2015-08-28 16:51:44,255 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:43,298] DEBUG {subscriber.py:on_connect} - Subscribed to 'application/signup/#'
+2015-08-28 16:51:44,294 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:on_instance_started_event} - Processing instance started event...
+2015-08-28 16:51:44,294 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,292] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:44,294 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [InstanceStartedEvent]
+2015-08-28 16:51:44,295 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for InstanceStartedEvent
+2015-08-28 16:51:44,295 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/InstanceStartedEvent.sh
+2015-08-28 16:51:44,316 [-] [pool-2-thread-4]  INFO PythonAgentTestManager Instance started event received
+2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,298] INFO {ExtensionExecutor.py:run_plugin} - InstanceStartedEvent Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Instance started event shell extension executed
+2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event InstanceStartedEvent
+2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] INFO {publisher.py:publish_instance_started_event} - Publishing instance started event
+2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
+2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
+2015-08-28 16:51:44,395 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] INFO {publisher.py:publish_instance_started_event} - Instance started event published
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] INFO {eventhandler.py:start_server_extension} - Processing start server extension...
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Initialized}
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,306] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,307] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [StartServers]
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for StartServers
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/StartServers.sh
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,312] INFO {ExtensionExecutor.py:run_plugin} - StartServers Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Start servers event shell extension executed
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event StartServers
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] INFO {agent.py:run} - Artifact repository found, waiting for artifact updated event to checkout artifacts: [repo_url] https://github.com/imesh/stratos-php-applications.git
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] DEBUG {config.py:read_property} - Reading property: enable.data.publisher = false
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,313] INFO {logpublisher.py:read_config} - Data Publisher disabled
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,315] DEBUG {subscriber.py:on_message} - Message received: instance/status/InstanceStartedEvent:
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager {
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager     "applicationId": "application-3", 
+2015-08-28 16:51:44,396 [-] [Thread-14]  INFO PythonAgentTestManager     "clusterId": "tomcat.domain", 
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "clusterInstanceId": "cluster-1-instance-1", 
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "instanceId": null, 
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "memberId": "tomcat.member-1", 
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "networkPartitionId": "network-p1", 
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "partitionId": "p1", 
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager     "serviceName": "tomcat-mt"
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager }
+2015-08-28 16:51:44,397 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:44,315] DEBUG {subscriber.py:run} - Event handler not found for event : 'InstanceStartedEvent'
+2015-08-28 16:51:45,256 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:on_instance_started_event} - Processing instance started event...
+2015-08-28 16:51:45,256 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,292] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,292] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [InstanceStartedEvent]
+2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for InstanceStartedEvent
+2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,293] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/InstanceStartedEvent.sh
+2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,298] INFO {ExtensionExecutor.py:run_plugin} - InstanceStartedEvent Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Instance started event shell extension executed
+2015-08-28 16:51:45,257 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event InstanceStartedEvent
+2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] INFO {publisher.py:publish_instance_started_event} - Publishing instance started event
+2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.ip = localhost
+2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,299] DEBUG {config.py:read_property} - Reading property: mb.port = 1885
+2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] INFO {publisher.py:publish_instance_started_event} - Instance started event published
+2015-08-28 16:51:45,258 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] INFO {eventhandler.py:start_server_extension} - Processing start server extension...
+2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] DEBUG {eventhandler.py:is_member_initialized_in_topology} - Found member: {memberId: tomcat.member-1, status: Initialized}
+2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,306] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,307] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [StartServers]
+2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for StartServers
+2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,307] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/StartServers.sh
+2015-08-28 16:51:45,259 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,312] INFO {ExtensionExecutor.py:run_plugin} - StartServers Extension executed. [output]: Fri Aug 28 16:51:44 IST 2015: Start servers event shell extension executed
+2015-08-28 16:51:45,260 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event StartServers
+2015-08-28 16:51:45,286 [-] [Thread-15]  INFO ADCMTAppTest Artifact updated event published
+2015-08-28 16:51:45,286 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] INFO {agent.py:run} - Artifact repository found, waiting for artifact updated event to checkout artifacts: [repo_url] https://github.com/imesh/stratos-php-applications.git
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] DEBUG {config.py:read_property} - Reading property: enable.data.publisher = false
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,313] INFO {logpublisher.py:read_config} - Data Publisher disabled
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,315] DEBUG {subscriber.py:on_message} - Message received: instance/status/InstanceStartedEvent:
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest {
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "applicationId": "application-3", 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "clusterId": "tomcat.domain", 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "clusterInstanceId": "cluster-1-instance-1", 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "instanceId": null, 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "memberId": "tomcat.member-1", 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "networkPartitionId": "network-p1", 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "partitionId": "p1", 
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest     "serviceName": "tomcat-mt"
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest }
+2015-08-28 16:51:45,287 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:44,315] DEBUG {subscriber.py:run} - Event handler not found for event : 'InstanceStartedEvent'
+2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] DEBUG {subscriber.py:on_message} - Message received: instance/notifier/ArtifactUpdatedEvent:
+2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager {"clusterId":"tomcat.domain","repoURL":"https://bitbucket.org/testapache2211/opentestrepo1.git","tenantId":"-1234","commitEnabled":false}
+2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] DEBUG {subscriber.py:run} - Executing handler for event 'ArtifactUpdatedEvent'
+2015-08-28 16:51:45,306 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Processing Artifact update event: [tenant] -1234 [cluster] tomcat.domain [status] None
+2015-08-28 16:51:45,307 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Executing git checkout
+2015-08-28 16:51:45,307 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,285] DEBUG {eventhandler.py:get_repo_path_for_tenant} - Repo path returned : '/tmp/pca-test-suite-2/repository/deployment/server/'
+2015-08-28 16:51:45,308 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Cloning artifacts from https://bitbucket.org/testapache2211/opentestrepo1.git for the first time to /tmp/pca-test-suite-2/repository/deployment/server/
+2015-08-28 16:51:45,308 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Executing git clone: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git, [repo path] /tmp/pca-test-suite-2/repository/deployment/server/
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] DEBUG {subscriber.py:on_message} - Message received: instance/notifier/ArtifactUpdatedEvent:
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest {"clusterId":"tomcat.domain","repoURL":"https://bitbucket.org/testapache2211/opentestrepo1.git","tenantId":"-1234","commitEnabled":false}
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] DEBUG {subscriber.py:run} - Executing handler for event 'ArtifactUpdatedEvent'
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Processing Artifact update event: [tenant] -1234 [cluster] tomcat.domain [status] None
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,284] INFO {eventhandler.py:on_artifact_updated_event} - Executing git checkout
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,285] DEBUG {eventhandler.py:get_repo_path_for_tenant} - Repo path returned : '/tmp/pca-test-suite-2/repository/deployment/server/'
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Cloning artifacts from https://bitbucket.org/testapache2211/opentestrepo1.git for the first time to /tmp/pca-test-suite-2/repository/deployment/server/
+2015-08-28 16:51:46,288 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:45,285] DEBUG {agentgithandler.py:checkout} - Executing git clone: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git, [repo path] /tmp/pca-test-suite-2/repository/deployment/server/
+2015-08-28 16:51:49,372 [-] [Thread-7]  INFO PythonAgentTestManager Client connected to port 8080
+2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] INFO {agentgithandler.py:clone} - Git clone operation for tenant -1234 successful
+2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] DEBUG {agentgithandler.py:checkout} - Git clone executed: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git
+2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,360] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [ArtifactUpdatedEvent]
+2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for ArtifactUpdatedEvent
+2015-08-28 16:51:49,421 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/ArtifactUpdatedEvent.sh
+2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,370] INFO {ExtensionExecutor.py:run_plugin} - ArtifactUpdatedEvent Extension executed. [output]: Fri Aug 28 16:51:49 IST 2015: Artifacts updated event shell extension executed
+2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,371] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event ArtifactUpdatedEvent
+2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,371] DEBUG {config.py:read_property} - Reading property: port.check.timeout = 600000
+2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:wait_until_ports_active} - Port check timeout: 600000
+2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,372] INFO {cartridgeagentutils.py:wait_until_ports_active} - Waiting for ports to be active: [ip] 'localhost' [ports] ['8080']
+2015-08-28 16:51:49,422 [-] [Thread-14]  INFO PythonAgentTestManager [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:check_ports_active} - Port '8080' is active
+2015-08-28 16:51:50,289 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] INFO {agentgithandler.py:clone} - Git clone operation for tenant -1234 successful
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] DEBUG {agentgithandler.py:checkout} - Git clone executed: [tenant-id] -1234 [repo-url] https://bitbucket.org/testapache2211/opentestrepo1.git
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] DEBUG {config.py:read_property} - Reading property: param.file.path = /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/payload/launch-params
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,360] DEBUG {eventhandler.py:execute_extension_for_event} - Executing extension for event [ArtifactUpdatedEvent]
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:run_plugin} - Running extension for ArtifactUpdatedEvent
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,361] DEBUG {ExtensionExecutor.py:execute_script} - Execute bash script :: /home/akila/Documents/ASF/stratos-ravihansa3000.git/products/python-cartridge-agent/integration/target/d172cc3f-19ec-49a3-9d52-909804158deb/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/ArtifactUpdatedEvent.sh
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,370] INFO {ExtensionExecutor.py:run_plugin} - ArtifactUpdatedEvent Extension executed. [output]: Fri Aug 28 16:51:49 IST 2015: Artifacts updated event shell extension executed
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,371] DEBUG {eventhandler.py:execute_plugins_for_event} - No plugins registered for event ArtifactUpdatedEvent
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,371] DEBUG {config.py:read_property} - Reading property: port.check.timeout = 600000
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:wait_until_ports_active} - Port check timeout: 600000
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,372] INFO {cartridgeagentutils.py:wait_until_ports_active} - Waiting for ports to be active: [ip] 'localhost' [ports] ['8080']
+2015-08-28 16:51:50,290 [-] [Thread-15]  INFO ADCMTAppTest [2015-08-28 16:51:49,372] DEBUG {cartridgeagentutils.py:check_ports_active} - P

<TRUNCATED>

[19/50] [abbrv] stratos git commit: Fixing health stat publisher in PCA, adding MT app integration test to PCA

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
index a359615..52cc286 100755
--- a/products/python-cartridge-agent/integration/pom.xml
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -72,8 +72,13 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <excludes>
+                                <exclude>**/*</exclude>
+                            </excludes>
+                        </configuration>
                         <executions>
-                            <execution>
+                            <!--execution>
                                 <id>default-test</id>
                                 <goals>
                                     <goal>test</goal>
@@ -98,6 +103,19 @@
                                     </suiteXmlFiles>
                                     <workingDirectory>${basedir}/target</workingDirectory>
                                 </configuration>
+                            </execution-->
+                            <execution>
+                                <id>adc-mt-test</id>
+                                <goals>
+                                    <goal>test</goal>
+                                </goals>
+                                <inherited>false</inherited>
+                                <configuration>
+                                    <suiteXmlFiles>
+                                        <suiteXmlFile>src/test/resources/pca-testing3.xml</suiteXmlFile>
+                                    </suiteXmlFiles>
+                                    <workingDirectory>${basedir}/target</workingDirectory>
+                                </configuration>
                             </execution>
                         </executions>
                     </plugin>

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
new file mode 100644
index 0000000..3104281
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
@@ -0,0 +1,213 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * 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.
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertTrue;
+
+public class ADCMTAppTest extends PythonAgentTestManager {
+    private static final Log log = LogFactory.getLog(ADCMTAppTest.class);
+    private static final int ADC_TIMEOUT = 180000;
+    private static final String RESOURCES_PATH = "/suite-3";
+    private static final String APPLICATION_PATH = "/tmp/pca-test-suite-3";
+    private static final String CLUSTER_ID = "tomcat.domain";
+    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-3";
+    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-3";
+    private static final String APP_ID = "application-3";
+    private static final String MEMBER_ID = "tomcat.member-1";
+    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+    private static final String NETWORK_PARTITION_ID = "network-partition-1";
+    private static final String PARTITION_ID = "partition-1";
+    private static final String TENANT_ID = "-1234";
+    private static final String SERVICE_NAME = "tomcat-mt";
+
+    private static boolean hasADCTestCompleted = false;
+
+    @BeforeSuite
+    public void setupADCMTAppTest() {
+        // Set jndi.properties.dir system property for initializing event publishers and receivers
+        System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
+
+        // start Python agent with configurations provided in resource path
+        setup(RESOURCES_PATH);
+
+        // Simulate server socket
+        startServerSocket(8080);
+    }
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    @AfterSuite
+    public void tearDownADCMTAppTest() {
+        // TODO: app path is duplicated in Java test and payload
+        tearDown(APPLICATION_PATH);
+    }
+
+    @Test(timeOut = ADC_TIMEOUT)
+    public void testADCForMTApps() {
+        startCommunicatorThread();
+        assertAgentActivation();
+        Thread adcTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                log.info("Running ADC MT Test thread...");
+                // Send artifact updated event
+                publishEvent(getArtifactUpdatedEventForPublicRepo());
+                log.info("Publishing artifact updated event for repo: " +
+                        getArtifactUpdatedEventForPublicRepo().getRepoURL());
+
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed() && !hasADCTestCompleted) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Git clone executed")) {
+                                log.info("Agent has completed git clone. Asserting the operation...");
+                                assertRepoClone(getArtifactUpdatedEventForPublicRepo());
+                                //hasADCTestCompleted = true;
+                            }
+                        }
+                    }
+                    sleep(1000);
+                }
+            }
+        });
+        adcTestThread.start();
+
+        while (!hasADCTestCompleted) {
+            // wait until the instance activated event is received.
+            sleep(1000);
+        }
+    }
+
+    private void assertAgentActivation() {
+        Thread startupTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (!eventReceiverInitiated) {
+                    sleep(1000);
+                }
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Subscribed to 'topology/#'")) {
+                                sleep(2000);
+                                // Send complete topology event
+                                log.info("Publishing complete topology event...");
+                                Topology topology = createTestTopology();
+                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+                                publishEvent(completeTopologyEvent);
+                                log.info("Complete topology event published");
+
+                                // Publish member initialized event
+                                log.info("Publishing member initialized event...");
+                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+                                        PARTITION_ID
+                                );
+                                publishEvent(memberInitializedEvent);
+                                log.info("Member initialized event published");
+                            }
+
+                            // Send artifact updated event to activate the instance first
+                            if (line.contains("Artifact repository found")) {
+                                publishEvent(getArtifactUpdatedEventForPublicRepo());
+                                log.info("Artifact updated event published");
+                            }
+                            log.info(line);
+                        }
+                    }
+                    sleep(1000);
+                }
+            }
+        });
+        startupTestThread.start();
+
+        while (!instanceStarted || !instanceActivated) {
+            // wait until the instance activated event is received.
+            // this will assert whether instance got activated within timeout period; no need for explicit assertions
+            sleep(2000);
+        }
+    }
+
+    private ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
+        ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+        publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+        return publicRepoEvent;
+    }
+
+    private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
+        File file = new File(APPLICATION_PATH + "/repository/deployment/server/test1.txt");
+        assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(),
+                file.exists());
+    }
+
+    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+        ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+        artifactUpdatedEvent.setClusterId(CLUSTER_ID);
+        artifactUpdatedEvent.setTenantId(TENANT_ID);
+        return artifactUpdatedEvent;
+    }
+
+    /**
+     * Create test topology
+     *
+     * @return
+     */
+    private Topology createTestTopology() {
+        Topology topology = new Topology();
+        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+        topology.addService(service);
+
+        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+                AUTOSCALING_POLICY_NAME, APP_ID);
+        service.addCluster(cluster);
+
+        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+                System.currentTimeMillis());
+
+        member.setDefaultPrivateIP("10.0.0.1");
+        member.setDefaultPublicIP("20.0.0.1");
+        Properties properties = new Properties();
+        properties.setProperty("prop1", "value1");
+        member.setProperties(properties);
+        member.setStatus(MemberStatus.Created);
+        cluster.addMember(member);
+
+        return topology;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
index e657ecc..99dc217 100755
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -37,7 +37,7 @@ import java.util.UUID;
 
 import static junit.framework.Assert.assertTrue;
 
-public class ADCTest extends PythonTestManager {
+public class ADCTest extends PythonAgentTestManager {
     private static final Log log = LogFactory.getLog(ADCTest.class);
     private static final int ADC_TIMEOUT = 180000;
     private static final String RESOURCES_PATH = "/suite-2";
@@ -52,12 +52,11 @@ public class ADCTest extends PythonTestManager {
     private static final String PARTITION_ID = "partition-1";
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "tomcat";
-    private static final String SOURCE_PATH = "/tmp/stratos-pca-adc-test-app-path/";
 
     private static boolean hasADCTestCompleted = false;
 
     @BeforeSuite
-    public void setupStartUpTest() {
+    public void setupADCTest() {
         // Set jndi.properties.dir system property for initializing event publishers and receivers
         System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
 
@@ -72,33 +71,72 @@ public class ADCTest extends PythonTestManager {
      * TearDown method for test method testPythonCartridgeAgent
      */
     @AfterSuite
-    public void tearDownStartUpTest() {
+    public void tearDownADCTest() {
         // TODO: app path is duplicated in Java test and payload
         tearDown(APPLICATION_PATH);
     }
 
 
     @Test(timeOut = ADC_TIMEOUT)
-    public void testPythonCartridgeAgent() {
-        Thread communicatorThread = new Thread(new Runnable() {
+    public void testADC() {
+        startCommunicatorThread();
+        assertAgentActivation();
+        Thread adcTestThread = new Thread(new Runnable() {
             @Override
             public void run() {
-                while (!eventReceiverInitiated) {
-                    sleep(1000);
-                }
+                log.info("Running ADC Test thread...");
+                // Send artifact updated event
+                publishEvent(getArtifactUpdatedEventForPrivateRepo());
+                log.info("Publishing artifact updated event for repo: " +
+                        getArtifactUpdatedEventForPrivateRepo().getRepoURL());
+
                 List<String> outputLines = new ArrayList<String>();
-                while (!outputStream.isClosed()) {
+                while (!outputStream.isClosed() && !hasADCTestCompleted) {
                     List<String> newLines = getNewLines(outputLines, outputStream.toString());
                     if (newLines.size() > 0) {
                         for (String line : newLines) {
-                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
+                            if (line.contains("Git clone executed")) {
+                                log.info("Agent has completed git clone. Asserting the operation...");
+                                assertRepoClone(getArtifactUpdatedEventForPrivateRepo());
+                                File file = new File(APPLICATION_PATH + "/pca-live-" + UUID.randomUUID());
                                 try {
-                                    throw new RuntimeException(line);
+                                    file.createNewFile();
                                 }
-                                catch (Exception e) {
-                                    log.error("ERROR found in PCA log", e);
+                                catch (IOException e) {
+                                    log.error("Could not create file", e);
                                 }
                             }
+                            if (line.contains("Pushed artifacts for tenant")) {
+                                // TODO: Get rid of static var
+                                log.info("ADC Test completed");
+                                hasADCTestCompleted = true;
+                            }
+                        }
+                    }
+                    sleep(1000);
+                }
+            }
+        });
+        adcTestThread.start();
+
+        while (!hasADCTestCompleted) {
+            // wait until the instance activated event is received.
+            sleep(1000);
+        }
+    }
+
+    private void assertAgentActivation() {
+        Thread startupTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (!eventReceiverInitiated) {
+                    sleep(1000);
+                }
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
                             if (line.contains("Subscribed to 'topology/#'")) {
                                 sleep(2000);
                                 // Send complete topology event
@@ -126,62 +164,17 @@ public class ADCTest extends PythonTestManager {
                             log.info(line);
                         }
                     }
-                    sleep(100);
-                }
-            }
-        });
-        communicatorThread.start();
-
-        while (!instanceActivated) {
-            // wait until the instance activated event is received.
-            sleep(1000);
-        }
-        assertTrue("Instance started event was not received", instanceStarted);
-        assertTrue("Instance activated event was not received", instanceActivated);
-
-        Thread adcTestThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                log.info("Running ADC Test thread...");
-                // Send artifact updated event
-                publishEvent(getArtifactUpdatedEventForPrivateRepo());
-                log.info("Publishing artifact updated event for repo: " +
-                        getArtifactUpdatedEventForPrivateRepo().getRepoURL());
-
-                List<String> outputLines = new ArrayList<String>();
-                while (!outputStream.isClosed() && !hasADCTestCompleted) {
-                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
-                    if (newLines.size() > 0) {
-                        for (String line : newLines) {
-                            if (line.contains("Git clone executed")) {
-                                log.info("Agent has completed git clone. Asserting the operation...");
-                                assertRepoClone(getArtifactUpdatedEventForPrivateRepo());
-                                File file = new File(APPLICATION_PATH + "/pca-live-" + UUID.randomUUID());
-                                try {
-                                    file.createNewFile();
-                                }
-                                catch (IOException e) {
-                                    log.error("Could not create file", e);
-                                }
-                            }
-                            if (line.contains("Pushed artifacts for tenant")) {
-                                // TODO: Get rid of static var
-                                log.info("ADC Test completed");
-                                hasADCTestCompleted = true;
-                            }
-                        }
-                    }
-                    sleep(100);
+                    sleep(1000);
                 }
             }
         });
-        adcTestThread.start();
+        startupTestThread.start();
 
-        while (!hasADCTestCompleted) {
+        while (!instanceStarted || !instanceActivated) {
             // wait until the instance activated event is received.
-            sleep(1000);
+            // this will assert whether instance got activated within timeout period; no need for explicit assertions
+            sleep(2000);
         }
-        assertTrue("ADC Test failed", hasADCTestCompleted);
     }
 
     private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
@@ -190,18 +183,7 @@ public class ADCTest extends PythonTestManager {
                 file.exists());
     }
 
-    private void assertRepoPush(ArtifactUpdatedEvent artifactUpdatedEvent) {
-        File file = new File(APPLICATION_PATH + "/test1.txt");
-        assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(), file.exists());
-
-    }
 
-    /**
-     * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
-     * objects as parameters to the test
-     *
-     * @return
-     */
     public static ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
         ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
         publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
@@ -216,12 +198,6 @@ public class ADCTest extends PythonTestManager {
         return privateRepoEvent;
     }
 
-    /**
-     * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
-     * repository URL
-     *
-     * @return
-     */
     private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
         ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
         artifactUpdatedEvent.setClusterId(CLUSTER_ID);

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
new file mode 100755
index 0000000..83fc227
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
@@ -0,0 +1,149 @@
+/*
+ * 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.python.cartridge.agent.test;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class AgentStartupTest extends PythonAgentTestManager {
+    private static final Log log = LogFactory.getLog(AgentStartupTest.class);
+    private static final int STARTUP_TIMEOUT = 30000;
+    private static final String RESOURCES_PATH = "/suite-1";
+    private static final String CLUSTER_ID = "php.php.domain";
+    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
+    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
+    private static final String APP_ID = "application-1";
+    private static final String MEMBER_ID = "php.member-1";
+    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+    private static final String NETWORK_PARTITION_ID = "network-partition-1";
+    private static final String PARTITION_ID = "partition-1";
+    private static final String TENANT_ID = "-1234";
+    private static final String SERVICE_NAME = "php";
+
+    @BeforeSuite
+    public void setupAgentStartupTest() {
+        // Set jndi.properties.dir system property for initializing event publishers and receivers
+        System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
+
+        // start Python agent with configurations provided in resource path
+        setup(RESOURCES_PATH);
+
+        // Simulate server socket
+        startServerSocket(8080);
+    }
+
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    @AfterSuite
+    public void tearDownAgentStartupTest() {
+        tearDown();
+    }
+
+    @Test(timeOut = STARTUP_TIMEOUT)
+    public void testPythonCartridgeAgent() {
+        startCommunicatorThread();
+        Thread startupTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (!eventReceiverInitiated) {
+                    sleep(2000);
+                }
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Subscribed to 'topology/#'")) {
+                                sleep(2000);
+                                // Send complete topology event
+                                log.info("Publishing complete topology event...");
+                                Topology topology = createTestTopology();
+                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+                                publishEvent(completeTopologyEvent);
+                                log.info("Complete topology event published");
+
+                                // Publish member initialized event
+                                log.info("Publishing member initialized event...");
+                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+                                        PARTITION_ID
+                                );
+                                publishEvent(memberInitializedEvent);
+                                log.info("Member initialized event published");
+                            }
+                        }
+                    }
+                    sleep(1000);
+                }
+            }
+        });
+
+        startupTestThread.start();
+
+        while (!instanceStarted || !instanceActivated) {
+            // wait until the instance activated event is received.
+            // this will assert whether instance got activated within timeout period; no need for explicit assertions
+            sleep(2000);
+        }
+    }
+
+
+    /**
+     * Create test topology
+     *
+     * @return
+     */
+    private Topology createTestTopology() {
+        Topology topology = new Topology();
+        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+        topology.addService(service);
+
+        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+                AUTOSCALING_POLICY_NAME, APP_ID);
+        service.addCluster(cluster);
+
+        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+                System.currentTimeMillis());
+
+        member.setDefaultPrivateIP("10.0.0.1");
+        member.setDefaultPublicIP("20.0.0.1");
+        Properties properties = new Properties();
+        properties.setProperty("prop1", "value1");
+        member.setProperties(properties);
+        member.setStatus(MemberStatus.Created);
+        cluster.addMember(member);
+
+        return topology;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
new file mode 100644
index 0000000..6ed4bb3
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
@@ -0,0 +1,455 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * 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.
+ */
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.commons.exec.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
+import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
+import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+import java.io.*;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+public class PythonAgentTestManager {
+    protected final Properties integrationProperties = new Properties();
+    private static final Log log = LogFactory.getLog(PythonAgentTestManager.class);
+    protected BrokerService broker = new BrokerService();
+
+    public final long TIMEOUT = 180000;
+    public static final String NEW_LINE = System.getProperty("line.separator");
+    public static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
+    public static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
+    public static final String CEP_PORT = "cep.port";
+    public static final String DISTRIBUTION_NAME = "distribution.name";
+    protected final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
+
+    protected Map<Integer, ServerSocket> serverSocketMap = new HashMap<>();
+    protected Map<String, Executor> executorList = new HashMap<String, Executor>();
+
+    protected int cepPort;
+    protected String amqpBindAddress;
+    protected String mqttBindAddress;
+    protected String distributionName;
+
+    protected boolean eventReceiverInitiated = false;
+    protected TopologyEventReceiver topologyEventReceiver;
+    protected InstanceStatusEventReceiver instanceStatusEventReceiver;
+    protected boolean instanceStarted;
+    protected boolean instanceActivated;
+    protected ByteArrayOutputStreamLocal outputStream;
+
+    /**
+     * Setup method for test method testPythonCartridgeAgent
+     */
+    protected void setup(String resourcePath) {
+        try {
+            startBroker();
+        }
+        catch (Exception e) {
+            log.error("Error while starting MB", e);
+            return;
+        }
+        if (!this.eventReceiverInitiated) {
+            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
+            topologyEventReceiver = new TopologyEventReceiver();
+            topologyEventReceiver.setExecutorService(executorService);
+            topologyEventReceiver.execute();
+
+            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
+            instanceStatusEventReceiver.setExecutorService(executorService);
+            instanceStatusEventReceiver.execute();
+
+            this.instanceStarted = false;
+            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
+                @Override
+                protected void onEvent(Event event) {
+                    log.info("Instance started event received");
+                    instanceStarted = true;
+                }
+            });
+
+            this.instanceActivated = false;
+            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
+                @Override
+                protected void onEvent(Event event) {
+                    log.info("Instance activated event received");
+                    instanceActivated = true;
+                }
+            });
+
+            this.eventReceiverInitiated = true;
+        }
+        // Simulate CEP server socket
+        startServerSocket(cepPort);
+        String agentPath = setupPythonAgent(resourcePath);
+        log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
+        log.info("Starting python cartridge agent...");
+        this.outputStream = executeCommand("python " + agentPath + "/agent.py > " +
+                PythonAgentTestManager.class.getResource(File.separator).getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+                "/cartridge-agent-console.log");
+    }
+
+    protected void tearDown() {
+        tearDown(null);
+    }
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    protected void tearDown(String sourcePath) {
+        for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
+            try {
+                String commandText = entry.getKey();
+                Executor executor = entry.getValue();
+                log.info("Terminating process: " + commandText);
+                executor.setExitValue(0);
+                executor.getWatchdog().destroyProcess();
+            }
+            catch (Exception ignore) {
+            }
+        }
+        // wait until everything cleans up to avoid connection errors
+        sleep(1000);
+        for (ServerSocket serverSocket : serverSocketMap.values()) {
+            try {
+                log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
+                serverSocket.close();
+            }
+            catch (IOException ignore) {
+            }
+        }
+
+        try {
+            log.info("Deleting source checkout folder...");
+            FileUtils.deleteDirectory(new File(sourcePath));
+        }
+        catch (Exception ignore) {
+        }
+        this.instanceStatusEventReceiver.terminate();
+        this.topologyEventReceiver.terminate();
+
+        this.instanceActivated = false;
+        this.instanceStarted = false;
+        try {
+            broker.stop();
+        }
+        catch (Exception e) {
+            log.error("Error while stopping the broker service", e);
+        }
+    }
+
+    public PythonAgentTestManager() {
+        try {
+            integrationProperties
+                    .load(PythonAgentTestManager.class.getResourceAsStream("/integration-test.properties"));
+            distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
+            amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
+            mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
+            cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
+            log.info("PCA integration properties: " + integrationProperties.toString());
+        }
+        catch (IOException e) {
+            log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
+                    "exists in classpath.", e);
+        }
+    }
+
+    protected void startBroker() throws Exception {
+        broker.addConnector(amqpBindAddress);
+        broker.addConnector(mqttBindAddress);
+        broker.setBrokerName("testBroker");
+        broker.setDataDirectory(
+                PythonAgentTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+                        "/activemq-data");
+        broker.start();
+        log.info("Broker service started!");
+    }
+
+    protected void startCommunicatorThread() {
+        Thread communicatorThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
+                                try {
+                                    throw new RuntimeException(line);
+                                }
+                                catch (Exception e) {
+                                    log.error("ERROR found in PCA log", e);
+                                }
+                            }
+                            log.info(line);
+                        }
+                    }
+                    sleep(100);
+                }
+            }
+        });
+        communicatorThread.start();
+    }
+
+    /**
+     * Start server socket
+     *
+     * @param port
+     */
+    protected void startServerSocket(final int port) {
+        Thread socketThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (true) { // do this infinitely until test is complete
+                    try {
+                        ServerSocket serverSocket = new ServerSocket(port);
+                        serverSocketMap.put(port, serverSocket);
+                        log.info("Server socket started on port: " + port);
+                        Socket socket = serverSocket.accept();
+                        log.info("Client connected to [port] " + port);
+
+                        InputStream is = socket.getInputStream();
+                        byte[] buffer = new byte[1024];
+                        int read;
+                        while (true) {
+                            if (socket.isClosed()) {
+                                log.info("Socket for [port] " + port + " has been closed.");
+                                break;
+                            }
+                            if ((read = is.read(buffer)) != -1) {
+                                String output = new String(buffer, 0, read);
+                                log.info("Message received for [port] " + port + ", [message] " + output);
+                            }
+                        }
+                    }
+                    catch (IOException e) {
+                        String message = "Could not start server socket: [port] " + port;
+                        log.error(message, e);
+                        throw new RuntimeException(message, e);
+                    }
+                }
+            }
+        });
+        socketThread.start();
+    }
+
+
+    protected static String getResourcesPath(String resourcesPath) {
+        return PythonAgentTestManager.class.getResource("/").getPath() + "/../../src/test/resources" + resourcesPath;
+    }
+
+    /**
+     * Copy python agent distribution to a new folder, extract it and copy sample configuration files
+     *
+     * @return
+     */
+    protected String setupPythonAgent(String resourcesPath) {
+        try {
+            log.info("Setting up python cartridge agent...");
+
+
+            String srcAgentPath = PythonAgentTestManager.class.getResource("/").getPath() +
+                    "/../../../distribution/target/" + distributionName + ".zip";
+            String unzipDestPath =
+                    PythonAgentTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME + "/";
+            //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
+            unzip(srcAgentPath, unzipDestPath);
+            String destAgentPath = PythonAgentTestManager.class.getResource("/").getPath() + "/../" +
+                    PYTHON_AGENT_DIR_NAME + "/" + distributionName;
+
+            String srcAgentConfPath = getResourcesPath(resourcesPath) + "/agent.conf";
+            String destAgentConfPath = destAgentPath + "/agent.conf";
+            FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
+
+            String srcLoggingIniPath = getResourcesPath(resourcesPath) + "/logging.ini";
+            String destLoggingIniPath = destAgentPath + "/logging.ini";
+            FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
+
+            String srcPayloadPath = getResourcesPath(resourcesPath) + "/payload";
+            String destPayloadPath = destAgentPath + "/payload";
+            FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
+
+            log.info("Changing extension scripts permissions");
+            File extensionsPath = new File(destAgentPath + "/extensions/bash");
+            File[] extensions = extensionsPath.listFiles();
+            for (File extension : extensions) {
+                extension.setExecutable(true);
+            }
+
+            log.info("Python cartridge agent setup completed");
+
+            return destAgentPath;
+        }
+        catch (Exception e) {
+            String message = "Could not copy cartridge agent distribution";
+            log.error(message, e);
+            throw new RuntimeException(message, e);
+        }
+    }
+
+    private void unzip(String zipFilePath, String destDirectory) throws IOException {
+        File destDir = new File(destDirectory);
+        if (!destDir.exists()) {
+            destDir.mkdir();
+        }
+        ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
+        ZipEntry entry = zipIn.getNextEntry();
+        // iterates over entries in the zip file
+        while (entry != null) {
+            String filePath = destDirectory + File.separator + entry.getName();
+            if (!entry.isDirectory()) {
+                // if the entry is a file, extracts it
+                extractFile(zipIn, filePath);
+            } else {
+                // if the entry is a directory, make the directory
+                File dir = new File(filePath);
+                dir.mkdir();
+            }
+            zipIn.closeEntry();
+            entry = zipIn.getNextEntry();
+        }
+        zipIn.close();
+    }
+
+    private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
+        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
+        byte[] bytesIn = new byte[4096];
+        int read = 0;
+        while ((read = zipIn.read(bytesIn)) != -1) {
+            bos.write(bytesIn, 0, read);
+        }
+        bos.close();
+    }
+
+    /**
+     * Execute shell command
+     *
+     * @param commandText
+     */
+    protected ByteArrayOutputStreamLocal executeCommand(final String commandText) {
+        final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
+        try {
+            CommandLine commandline = CommandLine.parse(commandText);
+            DefaultExecutor exec = new DefaultExecutor();
+            PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
+            exec.setWorkingDirectory(new File(
+                    PythonAgentTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME));
+            exec.setStreamHandler(streamHandler);
+            ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
+            exec.setWatchdog(watchdog);
+            exec.execute(commandline, new ExecuteResultHandler() {
+                @Override
+                public void onProcessComplete(int i) {
+                    log.info(commandText + " process completed");
+                }
+
+                @Override
+                public void onProcessFailed(ExecuteException e) {
+                    log.error(commandText + " process failed", e);
+                }
+            });
+            executorList.put(commandText, exec);
+            return outputStream;
+        }
+        catch (Exception e) {
+            log.error(outputStream.toString(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Sleep current thread
+     *
+     * @param time
+     */
+    protected void sleep(long time) {
+        try {
+            Thread.sleep(time);
+        }
+        catch (InterruptedException ignore) {
+        }
+    }
+
+    /**
+     * Return new lines found in the output
+     *
+     * @param currentOutputLines current output lines
+     * @param output             output
+     * @return
+     */
+    protected List<String> getNewLines(List<String> currentOutputLines, String output) {
+        List<String> newLines = new ArrayList<String>();
+
+        if (StringUtils.isNotBlank(output)) {
+            String[] lines = output.split(NEW_LINE);
+            for (String line : lines) {
+                if (!currentOutputLines.contains(line)) {
+                    currentOutputLines.add(line);
+                    newLines.add(line);
+                }
+            }
+        }
+        return newLines;
+    }
+
+    /**
+     * Publish messaging event
+     *
+     * @param event
+     */
+    protected void publishEvent(Event event) {
+        String topicName = MessagingUtil.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+        eventPublisher.publish(event);
+    }
+
+
+    /**
+     * Implements ByteArrayOutputStream.isClosed() method
+     */
+    protected class ByteArrayOutputStreamLocal extends org.apache.commons.io.output.ByteArrayOutputStream {
+        private boolean closed;
+
+        @Override
+        public void close() throws IOException {
+            super.close();
+            closed = true;
+        }
+
+        public boolean isClosed() {
+            return closed;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java
deleted file mode 100644
index 68cca0c..0000000
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java
+++ /dev/null
@@ -1,411 +0,0 @@
-package org.apache.stratos.python.cartridge.agent.test;/*
- * 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.
- */
-
-import org.apache.activemq.broker.BrokerService;
-import org.apache.commons.exec.*;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.messaging.broker.publish.EventPublisher;
-import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
-import org.apache.stratos.messaging.event.Event;
-import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
-import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
-import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
-import org.apache.stratos.messaging.util.MessagingUtil;
-
-import java.io.*;
-import java.net.ServerSocket;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-public class PythonTestManager {
-    protected final Properties integrationProperties = new Properties();
-    private static final Log log = LogFactory.getLog(PythonTestManager.class);
-    protected BrokerService broker = new BrokerService();
-
-    public final long TIMEOUT = 180000;
-    public static final String NEW_LINE = System.getProperty("line.separator");
-    public static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
-    public static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
-    public static final String CEP_PORT = "cep.port";
-    public static final String DISTRIBUTION_NAME = "distribution.name";
-    protected final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
-
-    protected List<ServerSocket> serverSocketList = new ArrayList<ServerSocket>();
-    protected Map<String, Executor> executorList = new HashMap<String, Executor>();
-
-    protected int cepPort;
-    protected String amqpBindAddress;
-    protected String mqttBindAddress;
-    protected String distributionName;
-
-    protected boolean eventReceiverInitiated = false;
-    protected TopologyEventReceiver topologyEventReceiver;
-    protected InstanceStatusEventReceiver instanceStatusEventReceiver;
-    protected boolean instanceStarted;
-    protected boolean instanceActivated;
-    protected ByteArrayOutputStreamLocal outputStream;
-
-    /**
-     * Setup method for test method testPythonCartridgeAgent
-     */
-    protected void setup(String resourcePath) {
-        try {
-            startBroker();
-        }
-        catch (Exception e) {
-            log.error("Error while starting MB", e);
-            return;
-        }
-        if (!this.eventReceiverInitiated) {
-            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
-            topologyEventReceiver = new TopologyEventReceiver();
-            topologyEventReceiver.setExecutorService(executorService);
-            topologyEventReceiver.execute();
-
-            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
-            instanceStatusEventReceiver.setExecutorService(executorService);
-            instanceStatusEventReceiver.execute();
-
-            this.instanceStarted = false;
-            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
-                @Override
-                protected void onEvent(Event event) {
-                    log.info("Instance started event received");
-                    instanceStarted = true;
-                }
-            });
-
-            this.instanceActivated = false;
-            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
-                @Override
-                protected void onEvent(Event event) {
-                    log.info("Instance activated event received");
-                    instanceActivated = true;
-                }
-            });
-
-            this.eventReceiverInitiated = true;
-        }
-        // Simulate CEP server socket
-        startServerSocket(cepPort);
-        String agentPath = setupPythonAgent(resourcePath);
-        log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
-        log.info("Starting python cartridge agent...");
-        this.outputStream = executeCommand("python " + agentPath + "/agent.py > " +
-                PythonTestManager.class.getResource(File.separator).getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
-                "/cartridge-agent-console.log");
-    }
-
-    protected void tearDown() {
-        tearDown(null);
-    }
-
-    /**
-     * TearDown method for test method testPythonCartridgeAgent
-     */
-    protected void tearDown(String sourcePath) {
-        for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
-            try {
-                String commandText = entry.getKey();
-                Executor executor = entry.getValue();
-                log.info("Terminating process: " + commandText);
-                executor.setExitValue(0);
-                executor.getWatchdog().destroyProcess();
-            }
-            catch (Exception ignore) {
-            }
-        }
-        for (ServerSocket serverSocket : serverSocketList) {
-            try {
-                log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
-                serverSocket.close();
-            }
-            catch (IOException ignore) {
-            }
-        }
-
-        try {
-            log.info("Deleting source checkout folder...");
-            FileUtils.deleteDirectory(new File(sourcePath));
-        }
-        catch (Exception ignore) {
-        }
-
-        this.instanceStatusEventReceiver.terminate();
-        this.topologyEventReceiver.terminate();
-
-        this.instanceActivated = false;
-        this.instanceStarted = false;
-        // wait until everything cleans up to avoid connection errors
-        sleep(1000);
-        try {
-            broker.stop();
-        }
-        catch (Exception e) {
-            log.error("Error while stopping the broker service", e);
-        }
-    }
-
-    public PythonTestManager() {
-        try {
-            integrationProperties
-                    .load(PythonTestManager.class.getResourceAsStream("/integration-test.properties"));
-            distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
-            amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
-            mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
-            cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
-            log.info("PCA integration properties: " + integrationProperties.toString());
-        }
-        catch (IOException e) {
-            log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
-                    "exists in classpath.", e);
-        }
-    }
-
-    protected void startBroker() throws Exception {
-        broker.addConnector(amqpBindAddress);
-        broker.addConnector(mqttBindAddress);
-        broker.setBrokerName("testBroker");
-        broker.setDataDirectory(
-                PythonTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
-                        "/activemq-data");
-        broker.start();
-        log.info("Broker service started!");
-    }
-
-    /**
-     * Start server socket
-     *
-     * @param port
-     */
-    protected void startServerSocket(final int port) {
-        Thread socketThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    ServerSocket serverSocket = new ServerSocket(port);
-                    serverSocketList.add(serverSocket);
-                    log.info("Server socket started on port: " + port);
-                    serverSocket.accept();
-                }
-                catch (IOException e) {
-                    String message = "Could not start server socket: [port] " + port;
-                    log.error(message, e);
-                    throw new RuntimeException(message, e);
-                }
-            }
-        });
-        socketThread.start();
-    }
-
-
-    protected static String getResourcesPath(String resourcesPath) {
-        return PythonTestManager.class.getResource("/").getPath() + "/../../src/test/resources" + resourcesPath;
-    }
-
-    /**
-     * Copy python agent distribution to a new folder, extract it and copy sample configuration files
-     *
-     * @return
-     */
-    protected String setupPythonAgent(String resourcesPath) {
-        try {
-            log.info("Setting up python cartridge agent...");
-
-
-            String srcAgentPath = PythonTestManager.class.getResource("/").getPath() +
-                    "/../../../distribution/target/" + distributionName + ".zip";
-            String unzipDestPath =
-                    PythonTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME + "/";
-            //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
-            unzip(srcAgentPath, unzipDestPath);
-            String destAgentPath = PythonTestManager.class.getResource("/").getPath() + "/../" +
-                    PYTHON_AGENT_DIR_NAME + "/" + distributionName;
-
-            String srcAgentConfPath = getResourcesPath(resourcesPath) + "/agent.conf";
-            String destAgentConfPath = destAgentPath + "/agent.conf";
-            FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
-
-            String srcLoggingIniPath = getResourcesPath(resourcesPath) + "/logging.ini";
-            String destLoggingIniPath = destAgentPath + "/logging.ini";
-            FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
-
-            String srcPayloadPath = getResourcesPath(resourcesPath) + "/payload";
-            String destPayloadPath = destAgentPath + "/payload";
-            FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
-
-            log.info("Changing extension scripts permissions");
-            File extensionsPath = new File(destAgentPath + "/extensions/bash");
-            File[] extensions = extensionsPath.listFiles();
-            for (File extension : extensions) {
-                extension.setExecutable(true);
-            }
-
-            log.info("Python cartridge agent setup completed");
-
-            return destAgentPath;
-        }
-        catch (Exception e) {
-            String message = "Could not copy cartridge agent distribution";
-            log.error(message, e);
-            throw new RuntimeException(message, e);
-        }
-    }
-
-    private void unzip(String zipFilePath, String destDirectory) throws IOException {
-        File destDir = new File(destDirectory);
-        if (!destDir.exists()) {
-            destDir.mkdir();
-        }
-        ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
-        ZipEntry entry = zipIn.getNextEntry();
-        // iterates over entries in the zip file
-        while (entry != null) {
-            String filePath = destDirectory + File.separator + entry.getName();
-            if (!entry.isDirectory()) {
-                // if the entry is a file, extracts it
-                extractFile(zipIn, filePath);
-            } else {
-                // if the entry is a directory, make the directory
-                File dir = new File(filePath);
-                dir.mkdir();
-            }
-            zipIn.closeEntry();
-            entry = zipIn.getNextEntry();
-        }
-        zipIn.close();
-    }
-
-    private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
-        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
-        byte[] bytesIn = new byte[4096];
-        int read = 0;
-        while ((read = zipIn.read(bytesIn)) != -1) {
-            bos.write(bytesIn, 0, read);
-        }
-        bos.close();
-    }
-
-    /**
-     * Execute shell command
-     *
-     * @param commandText
-     */
-    protected ByteArrayOutputStreamLocal executeCommand(final String commandText) {
-        final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
-        try {
-            CommandLine commandline = CommandLine.parse(commandText);
-            DefaultExecutor exec = new DefaultExecutor();
-            PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
-            exec.setWorkingDirectory(new File(
-                    PythonTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME));
-            exec.setStreamHandler(streamHandler);
-            ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
-            exec.setWatchdog(watchdog);
-            exec.execute(commandline, new ExecuteResultHandler() {
-                @Override
-                public void onProcessComplete(int i) {
-                    log.info(commandText + " process completed");
-                }
-
-                @Override
-                public void onProcessFailed(ExecuteException e) {
-                    log.error(commandText + " process failed", e);
-                }
-            });
-            executorList.put(commandText, exec);
-            return outputStream;
-        }
-        catch (Exception e) {
-            log.error(outputStream.toString(), e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Sleep current thread
-     *
-     * @param time
-     */
-    protected void sleep(long time) {
-        try {
-            Thread.sleep(time);
-        }
-        catch (InterruptedException ignore) {
-        }
-    }
-
-    /**
-     * Return new lines found in the output
-     *
-     * @param currentOutputLines current output lines
-     * @param output             output
-     * @return
-     */
-    protected List<String> getNewLines(List<String> currentOutputLines, String output) {
-        List<String> newLines = new ArrayList<String>();
-
-        if (StringUtils.isNotBlank(output)) {
-            String[] lines = output.split(NEW_LINE);
-            for (String line : lines) {
-                if (!currentOutputLines.contains(line)) {
-                    currentOutputLines.add(line);
-                    newLines.add(line);
-                }
-            }
-        }
-        return newLines;
-    }
-
-    /**
-     * Publish messaging event
-     *
-     * @param event
-     */
-    protected void publishEvent(Event event) {
-        String topicName = MessagingUtil.getMessageTopicName(event);
-        EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
-        eventPublisher.publish(event);
-    }
-
-
-    /**
-     * Implements ByteArrayOutputStream.isClosed() method
-     */
-    protected class ByteArrayOutputStreamLocal extends org.apache.commons.io.output.ByteArrayOutputStream {
-        private boolean closed;
-
-        @Override
-        public void close() throws IOException {
-            super.close();
-            closed = true;
-        }
-
-        public boolean isClosed() {
-            return closed;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java
deleted file mode 100755
index 36a8cd5..0000000
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java
+++ /dev/null
@@ -1,171 +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.python.cartridge.agent.test;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.domain.LoadBalancingIPType;
-import org.apache.stratos.messaging.domain.topology.*;
-import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
-import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static junit.framework.Assert.assertTrue;
-
-public class StartUpTest extends PythonTestManager {
-    private static final Log log = LogFactory.getLog(StartUpTest.class);
-    private static final int STARTUP_TIMEOUT = 30000;
-    private static final String RESOURCES_PATH = "/suite-1";
-    private static final String CLUSTER_ID = "php.php.domain";
-    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
-    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
-    private static final String APP_ID = "application-1";
-    private static final String MEMBER_ID = "php.member-1";
-    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
-    private static final String NETWORK_PARTITION_ID = "network-partition-1";
-    private static final String PARTITION_ID = "partition-1";
-    private static final String TENANT_ID = "-1234";
-    private static final String SERVICE_NAME = "php";
-    private static final String SOURCE_PATH = "/tmp/stratos-pca-startup-test-app-path/";
-
-
-    @BeforeSuite
-    public void setupStartUpTest() {
-        // Set jndi.properties.dir system property for initializing event publishers and receivers
-        System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
-
-        // start Python agent with configurations provided in resource path
-        setup(RESOURCES_PATH);
-    }
-
-
-    /**
-     * TearDown method for test method testPythonCartridgeAgent
-     */
-    @AfterSuite
-    public void tearDownStartUpTest() {
-        tearDown();
-    }
-
-    @Test(timeOut = STARTUP_TIMEOUT)
-    public void testPythonCartridgeAgent() {
-        Thread communicatorThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                while (!eventReceiverInitiated) {
-                    sleep(2000);
-                }
-                List<String> outputLines = new ArrayList<String>();
-                while (!outputStream.isClosed()) {
-                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
-                    if (newLines.size() > 0) {
-                        for (String line : newLines) {
-                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
-                                try {
-                                    throw new RuntimeException(line);
-                                }
-                                catch (Exception e) {
-                                    log.error("ERROR found in PCA log", e);
-                                }
-                            }
-                            if (line.contains("Subscribed to 'topology/#'")) {
-                                sleep(2000);
-                                // Send complete topology event
-                                log.info("Publishing complete topology event...");
-                                Topology topology = createTestTopology();
-                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
-                                publishEvent(completeTopologyEvent);
-                                log.info("Complete topology event published");
-
-                                // Publish member initialized event
-                                log.info("Publishing member initialized event...");
-                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
-                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
-                                        PARTITION_ID
-                                );
-                                publishEvent(memberInitializedEvent);
-                                log.info("Member initialized event published");
-
-                                // Simulate server socket
-                                startServerSocket(8080);
-                            }
-                            /*
-                            if (line.contains("Artifact repository found")) {
-                                // Send artifact updated event
-                                ArrayList<ArtifactUpdatedEvent> list = getArtifactUpdatedEventsAsParams();
-                                for (ArtifactUpdatedEvent artifactUpdatedEvent : list) {
-                                    publishEvent(artifactUpdatedEvent);
-                                }
-                            }*/
-                            log.info(line);
-                        }
-                    }
-                    sleep(100);
-                }
-            }
-        });
-
-        communicatorThread.start();
-
-        while (!instanceActivated) {
-            // wait until the instance activated event is received.
-            sleep(2000);
-        }
-
-        assertTrue("Instance started event was not received", instanceStarted);
-        assertTrue("Instance activated event was not received", instanceActivated);
-    }
-
-
-    /**
-     * Create test topology
-     *
-     * @return
-     */
-    private Topology createTestTopology() {
-        Topology topology = new Topology();
-        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
-        topology.addService(service);
-
-        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
-                AUTOSCALING_POLICY_NAME, APP_ID);
-        service.addCluster(cluster);
-
-        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
-                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
-                System.currentTimeMillis());
-
-        member.setDefaultPrivateIP("10.0.0.1");
-        member.setDefaultPublicIP("20.0.0.1");
-        Properties properties = new Properties();
-        properties.setProperty("prop1", "value1");
-        member.setProperties(properties);
-        member.setStatus(MemberStatus.Created);
-        cluster.addMember(member);
-
-        return topology;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
index 35e60e3..c102914 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
@@ -23,7 +23,7 @@
 <suite name="PythonCartridgeAgentIntegrationSuite1">
     <test name="PCATest">
         <classes>
-            <class name="org.apache.stratos.python.cartridge.agent.test.StartUpTest"/>
+            <class name="org.apache.stratos.python.cartridge.agent.test.AgentStartupTest"/>
         </classes>
     </test>
 </suite>

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/pca-testing3.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing3.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing3.xml
new file mode 100755
index 0000000..f20cf20
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing3.xml
@@ -0,0 +1,29 @@
+<?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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite3">
+    <test name="PCATest">
+        <classes>
+            <class name="org.apache.stratos.python.cartridge.agent.test.ADCMTAppTest"/>
+        </classes>
+    </test>
+</suite>

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
index dc34a1f..eae5003 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
@@ -39,8 +39,7 @@ monitoring.server.port                =7612
 monitoring.server.secure.port         =7712
 monitoring.server.admin.username      =admin
 monitoring.server.admin.password      =admin
-#log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
 log.file.paths                        =/tmp/agent.screen-startup-test.log
 metadata.service.url                  =https://localhost:9443
 super.tenant.repository.path          =/repository/deployment/server/
-tenant.repository.path                =/repository/tenants/
\ No newline at end of file
+tenant.repository.path                =/repository/tenants/

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
index f05a00e..fd3e423 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
@@ -39,8 +39,7 @@ monitoring.server.port                =7612
 monitoring.server.secure.port         =7712
 monitoring.server.admin.username      =admin
 monitoring.server.admin.password      =admin
-#log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
 log.file.paths                        =/tmp/agent.screen-adc-test.log
 metadata.service.url                  =https://localhost:9443
 super.tenant.repository.path          =/repository/deployment/server/
-tenant.repository.path                =/repository/tenants/
\ No newline at end of file
+tenant.repository.path                =/repository/tenants/

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/suite-3/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-3/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-3/agent.conf
new file mode 100755
index 0000000..0ee1dce
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-3/agent.conf
@@ -0,0 +1,45 @@
+# 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.
+
+[agent]
+mb.ip                                 =localhost
+mb.port                               =1885
+listen.address                        =localhost
+thrift.receiver.ip                    =localhost
+thrift.receiver.port                  =7712
+thrift.server.admin.username          =admin
+thrift.server.admin.password          =admin
+cep.stats.publisher.enabled           =true
+lb.private.ip                         =
+lb.public.ip                          =
+enable.artifact.update                =true
+auto.commit                           =true
+auto.checkout                         =true
+artifact.update.interval              =15
+artifact.clone.retries                =5
+artifact.clone.interval               =10
+port.check.timeout                    =600000
+enable.data.publisher                 =false
+monitoring.server.ip                  =localhost
+monitoring.server.port                =7612
+monitoring.server.secure.port         =7712
+monitoring.server.admin.username      =admin
+monitoring.server.admin.password      =admin
+log.file.paths                        =/tmp/agent.screen-adc-mt-test.log
+metadata.service.url                  =https://localhost:9443
+super.tenant.repository.path          =/repository/deployment/server/
+tenant.repository.path                =/repository/tenants/

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/suite-3/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-3/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-3/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-3/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/suite-3/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-3/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-3/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-3/logging.ini
@@ -0,0 +1,52 @@
+# 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.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
new file mode 100755
index 0000000..ba9387b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
@@ -0,0 +1,2 @@
+APPLICATION_ID=application-3,SERVICE_NAME=tomcat-mt,HOST_NAME=tomcat.stratos.org,MULTITENANT=true,TENANT_ID=-1234,
+TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-3,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null


[41/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
new file mode 100644
index 0000000..96cff22
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
@@ -0,0 +1,301 @@
+/*
+ * 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.cep.extension;
+
+import org.apache.log4j.Logger;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.event.remove.RemoveEvent;
+import org.wso2.siddhi.core.event.remove.RemoveListEvent;
+import org.wso2.siddhi.core.persistence.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.definition.Attribute.Type;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+@SiddhiExtension(namespace = "stratos", function = "secondDerivative")
+public class SecondDerivativeFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+    static final Logger log = Logger.getLogger(SecondDerivativeFinderWindowProcessor.class);
+    private ScheduledExecutorService eventRemoverScheduler;
+	private ScheduledFuture<?> lastSchedule;
+    private long timeToKeep;
+    private int subjectedAttrIndex;
+    private Attribute.Type subjectedAttrType;
+    private List<InEvent> newEventList;
+    private List<RemoveEvent> oldEventList;
+    private ThreadBarrier threadBarrier;
+    private ISchedulerSiddhiQueue<StreamEvent> window;
+
+    @Override
+    protected void processEvent(InEvent event) {
+        acquireLock();
+        try {
+            newEventList.add(event);
+        } finally {
+            releaseLock();
+        }
+    }
+
+    @Override
+    protected void processEvent(InListEvent listEvent) {
+        acquireLock();
+        try {
+            System.out.println(listEvent);
+            for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+                newEventList.add((InEvent) listEvent.getEvent(i));
+            }
+        } finally {
+            releaseLock();
+        }
+    }
+
+    @Override
+    public Iterator<StreamEvent> iterator() {
+        return window.iterator();
+    }
+
+    @Override
+    public Iterator<StreamEvent> iterator(String predicate) {
+        if (siddhiContext.isDistributedProcessingEnabled()) {
+            return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+        } else {
+            return window.iterator();
+        }
+    }
+
+
+    @Override
+	public void run() {
+		acquireLock();
+		try {
+			long scheduledTime = System.currentTimeMillis();
+			try {
+				oldEventList.clear();
+				while (true) {
+					threadBarrier.pass();
+					RemoveEvent removeEvent = (RemoveEvent) window.poll();
+					if (removeEvent == null) {
+						if (oldEventList.size() > 0) {
+							nextProcessor.process(new RemoveListEvent(
+							                                          oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
+							oldEventList.clear();
+						}
+
+						if (newEventList.size() > 0) {
+							InEvent[] inEvents =
+							                     newEventList.toArray(new InEvent[newEventList.size()]);
+							for (InEvent inEvent : inEvents) {
+								window.put(new RemoveEvent(inEvent, -1));
+							}
+							
+							// in order to find second derivative, we need at least 3 events.
+							if (newEventList.size() > 2) {
+
+								InEvent firstDerivative1 =
+								                           gradient(inEvents[0],
+								                                    inEvents[(newEventList.size() / 2) - 1],
+								                                    null)[0];
+								InEvent firstDerivative2 =
+								                           gradient(inEvents[newEventList.size() / 2],
+								                                    inEvents[newEventList.size() - 1],
+								                                    null)[0];
+								InEvent[] secondDerivative =
+								                             gradient(firstDerivative1,
+								                                      firstDerivative2, Type.DOUBLE);
+
+								for (InEvent inEvent : secondDerivative) {
+									window.put(new RemoveEvent(inEvent, -1));
+								}
+								nextProcessor.process(new InListEvent(secondDerivative));
+							} else {
+								log.debug("Insufficient events to calculate second derivative. We need at least 3 events. Current event count: " +
+								          newEventList.size());
+							}
+
+							newEventList.clear();
+						}
+
+						long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
+						if (diff > 0) {
+							try {
+								if (lastSchedule != null) {
+									lastSchedule.cancel(false);
+								}
+								lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
+							} catch (RejectedExecutionException ex) {
+								log.warn("scheduling cannot be accepted for execution: elementID " +
+								         elementId);
+							}
+							break;
+						}
+						scheduledTime = System.currentTimeMillis();
+					} else {
+						oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
+					}
+				}
+			} catch (Throwable t) {
+				log.error(t.getMessage(), t);
+			}
+		} finally {
+			releaseLock();
+		}
+	}
+
+
+    /**
+     * This function will calculate the linear gradient (per second) of the events received during
+     * a specified time period.
+     */
+	private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent, Type type) {
+		Type attrType = type == null ? subjectedAttrType : type;
+		double firstVal = 0.0, lastVal = 0.0;
+		// FIXME I'm not sure whether there's some other good way to do correct casting,
+		// based on the type.
+		if (Type.DOUBLE.equals(attrType)) {
+			firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
+		} else if (Type.INT.equals(attrType)) {
+			firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
+		} else if (Type.LONG.equals(attrType)) {
+			firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
+		} else if (Type.FLOAT.equals(attrType)) {
+			firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
+		}
+		
+		long t1 = firstInEvent.getTimeStamp();
+		long t2 = lastInEvent.getTimeStamp();
+		long millisecondsForASecond = 1000;
+        long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
+		double gradient = 0.0;
+		if (tGap > 0) {
+			gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
+		}
+		if (log.isDebugEnabled()) {
+		    log.debug("Gradient: " + gradient + " Last val: " + lastVal +
+		            " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
+		            t2+" hash: "+this.hashCode());
+		}
+		Object[] data = firstInEvent.getData().clone();
+		data[subjectedAttrIndex] = gradient;
+		InEvent gradientEvent =
+		                        new InEvent(firstInEvent.getStreamId(), t1+((t2-t1)/2),
+		                                    data);
+		InEvent[] output = new InEvent[1];
+		output[0] = gradientEvent;
+		return output;
+	}
+
+	@Override
+    protected Object[] currentState() {
+        return new Object[]{window.currentState(), oldEventList, newEventList};
+    }
+
+    @Override
+    protected void restoreState(Object[] data) {
+        window.restoreState(data);
+        window.restoreState((Object[]) data[0]);
+        oldEventList = ((ArrayList<RemoveEvent>) data[1]);
+        newEventList = ((ArrayList<InEvent>) data[2]);
+        window.reSchedule();
+    }
+
+    @Override
+    protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+        if (parameters[0] instanceof IntConstant) {
+            timeToKeep = ((IntConstant) parameters[0]).getValue();
+        } else {
+            timeToKeep = ((LongConstant) parameters[0]).getValue();
+        }
+        
+        String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
+        subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
+        subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
+
+        oldEventList = new ArrayList<RemoveEvent>();
+        if (this.siddhiContext.isDistributedProcessingEnabled()) {
+            newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
+        } else {
+            newEventList = new ArrayList<InEvent>();
+        }
+
+        if (this.siddhiContext.isDistributedProcessingEnabled()) {
+            window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+        } else {
+            window = new SchedulerSiddhiQueue<StreamEvent>(this);
+        }
+        //Ordinary scheduling
+        window.schedule();
+
+    }
+
+    @Override
+    public void schedule() {
+		if (lastSchedule != null) {
+			lastSchedule.cancel(false);
+		}
+		lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+	}
+
+	public void scheduleNow() {
+		if (lastSchedule != null) {
+			lastSchedule.cancel(false);
+		}
+		lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+	}
+
+    @Override
+    public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+        this.eventRemoverScheduler = scheduledExecutorService;
+    }
+
+    public void setThreadBarrier(ThreadBarrier threadBarrier) {
+        this.threadBarrier = threadBarrier;
+    }
+
+    @Override
+    public void destroy(){
+    	oldEventList = null;
+    	newEventList = null;
+    	window = null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/pom.xml b/extensions/cep/pom.xml
new file mode 100644
index 0000000..7c82bdf
--- /dev/null
+++ b/extensions/cep/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-parent</artifactId>
+        <version>4.1.2</version>
+    </parent>
+
+    <artifactId>cep-extensions</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache Stratos - CEP Extensions</name>
+    <description>Apache Stratos CEP Extensions</description>
+
+    <modules>
+        <module>modules/distribution</module>
+        <module>modules/stratos-cep-extension</module>
+    </modules>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/pom.xml b/extensions/cep/stratos-cep-extension/pom.xml
deleted file mode 100644
index e34c79e..0000000
--- a/extensions/cep/stratos-cep-extension/pom.xml
+++ /dev/null
@@ -1,63 +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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-extensions</artifactId>
-        <version>4.1.2</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>org.apache.stratos.cep.extension</artifactId>
-    <name>Apache Stratos - CEP Extensions</name>
-    <description>Apache Stratos CEP Extensions</description>
-
-    <repositories>
-        <repository>
-            <id>wso2-maven2-repository</id>
-            <name>WSO2 Maven2 Repository</name>
-            <url>http://dist.wso2.org/maven2</url>
-        </repository>
-    </repositories>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.wso2.siddhi</groupId>
-            <artifactId>siddhi-core</artifactId>
-            <version>2.0.0-wso2v5</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.messaging</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java b/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
deleted file mode 100644
index 59c70c5..0000000
--- a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
+++ /dev/null
@@ -1,99 +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.cep.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.messaging.event.Event;
-import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
-import org.apache.stratos.messaging.event.topology.MemberActivatedEvent;
-import org.apache.stratos.messaging.event.topology.MemberTerminatedEvent;
-import org.apache.stratos.messaging.listener.topology.CompleteTopologyEventListener;
-import org.apache.stratos.messaging.listener.topology.MemberActivatedEventListener;
-import org.apache.stratos.messaging.listener.topology.MemberTerminatedEventListener;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
-
-/**
- * CEP Topology Receiver for Fault Handling Window Processor.
- */
-public class CEPTopologyEventReceiver extends TopologyEventReceiver {
-
-    private static final Log log = LogFactory.getLog(CEPTopologyEventReceiver.class);
-
-    private FaultHandlingWindowProcessor faultHandler;
-
-    public CEPTopologyEventReceiver(FaultHandlingWindowProcessor faultHandler) {
-        this.faultHandler = faultHandler;
-        addEventListeners();
-    }
-
-    @Override
-    public void execute() {
-        super.execute();
-        log.info("CEP topology event receiver thread started");
-    }
-
-    private void addEventListeners() {
-        // Load member time stamp map from the topology as a one time task
-        addEventListener(new CompleteTopologyEventListener() {
-            private boolean initialized;
-
-            @Override
-            protected void onEvent(Event event) {
-                if (!initialized) {
-                    try {
-                        TopologyManager.acquireReadLock();
-                        log.debug("Complete topology event received to fault handling window processor.");
-                        CompleteTopologyEvent completeTopologyEvent = (CompleteTopologyEvent) event;
-                        initialized = faultHandler.loadTimeStampMapFromTopology(completeTopologyEvent.getTopology());
-                    } catch (Exception e) {
-                        log.error("Error loading member time stamp map from complete topology event.", e);
-                    } finally {
-                        TopologyManager.releaseReadLock();
-                    }
-                }
-            }
-        });
-
-        // Remove member from the time stamp map when MemberTerminated event is received.
-        addEventListener(new MemberTerminatedEventListener() {
-            @Override
-            protected void onEvent(Event event) {
-                MemberTerminatedEvent memberTerminatedEvent = (MemberTerminatedEvent) event;
-                faultHandler.getMemberTimeStampMap().remove(memberTerminatedEvent.getMemberId());
-                log.debug("Member was removed from the timestamp map: [member] " + memberTerminatedEvent.getMemberId());
-            }
-        });
-
-        // Add member to time stamp map whenever member is activated
-        addEventListener(new MemberActivatedEventListener() {
-            @Override
-            protected void onEvent(Event event) {
-                MemberActivatedEvent memberActivatedEvent = (MemberActivatedEvent) event;
-
-                // do not put this member if we have already received a health event
-                faultHandler.getMemberTimeStampMap().putIfAbsent(memberActivatedEvent.getMemberId(),
-                        System.currentTimeMillis());
-                log.debug("Member was added to the timestamp map: [member] " + memberActivatedEvent.getMemberId());
-            }
-        });
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java b/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
deleted file mode 100644
index 699f036..0000000
--- a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
+++ /dev/null
@@ -1,54 +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.cep.extension;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.executor.function.FunctionExecutor;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-@SiddhiExtension(namespace = "stratos", function = "concat")
-public class ConcatWindowProcessor extends FunctionExecutor {
-    Attribute.Type returnType = Attribute.Type.STRING;
-    @Override
-    public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
-    }
-
-    @Override
-    protected Object process(Object obj) {
-        if (obj instanceof Object[]) {
-            StringBuffer sb=new StringBuffer();
-            for (Object aObj : (Object[]) obj) {
-                sb.append(aObj);
-            }
-            return sb.toString();
-        } else {
-            return obj.toString();
-        }
-
-    }
-
-    @Override
-    public void destroy() {
-    }
-
-    @Override
-    public Attribute.Type getReturnType() {
-        return returnType;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java b/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
deleted file mode 100644
index 0aa01ed..0000000
--- a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
+++ /dev/null
@@ -1,349 +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.cep.extension;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.messaging.broker.publish.EventPublisher;
-import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
-import org.apache.stratos.messaging.domain.topology.*;
-import org.apache.stratos.messaging.event.health.stat.MemberFaultEvent;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
-import org.apache.stratos.messaging.util.MessagingUtil;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.event.StreamEvent;
-import org.wso2.siddhi.core.event.in.InEvent;
-import org.wso2.siddhi.core.event.in.InListEvent;
-import org.wso2.siddhi.core.persistence.ThreadBarrier;
-import org.wso2.siddhi.core.query.QueryPostProcessingElement;
-import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
-import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
-import org.wso2.siddhi.query.api.definition.AbstractDefinition;
-import org.wso2.siddhi.query.api.expression.Expression;
-import org.wso2.siddhi.query.api.expression.Variable;
-import org.wso2.siddhi.query.api.expression.constant.IntConstant;
-import org.wso2.siddhi.query.api.expression.constant.LongConstant;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-/**
- * CEP window processor to handle faulty member instances. This window processor is responsible for
- * publishing MemberFault event if health stats are not received within a given time window.
- */
-@SiddhiExtension(namespace = "stratos", function = "faultHandling")
-public class FaultHandlingWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
-
-	private static final Logger log = Logger.getLogger(FaultHandlingWindowProcessor.class);
-
-    private static final int TIME_OUT = 60 * 1000;
-    public static final String CEP_EXTENSION_THREAD_POOL_KEY = "cep.extension.thread.pool";
-    public static final int CEP_EXTENSION_THREAD_POOL_SIZE = 10;
-
-    private ExecutorService executorService;
-    private ScheduledExecutorService faultHandleScheduler;
-    private ScheduledFuture<?> lastSchedule;
-	private ThreadBarrier threadBarrier;
-	private long timeToKeep;
-	private ISchedulerSiddhiQueue<StreamEvent> window;
-	private EventPublisher healthStatPublisher =
-			EventPublisherPool.getPublisher(MessagingUtil.Topics.HEALTH_STAT_TOPIC.getTopicName());
-	private Map<String, Object> MemberFaultEventMap = new HashMap<String, Object>();
-	private Map<String, Object> memberFaultEventMessageMap = new HashMap<String, Object>();
-
-	// Map of member id's to their last received health event time stamp
-	private ConcurrentHashMap<String, Long> memberTimeStampMap = new ConcurrentHashMap<String, Long>();
-
-	// Event receiver to receive topology events published by cloud-controller
-	private CEPTopologyEventReceiver cepTopologyEventReceiver = new CEPTopologyEventReceiver(this);
-
-	// Stratos member id attribute index in stream execution plan
-	private int memberIdAttrIndex;
-
-	@Override
-	protected void processEvent(InEvent event) {
-		addDataToMap(event);
-	}
-
-	@Override
-	protected void processEvent(InListEvent listEvent) {
-		for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
-			addDataToMap((InEvent) listEvent.getEvent(i));
-		}
-	}
-
-	/**
-	 * Add new entry to time stamp map from the received event.
-	 *
-	 * @param event Event received by Siddhi.
-	 */
-	protected void addDataToMap(InEvent event) {
-		String id = (String) event.getData()[memberIdAttrIndex];
-		//checking whether this member is the topology.
-		//sometimes there can be a delay between publishing member terminated events
-		//and actually terminating instances. Hence CEP might get events for already terminated members
-		//so we are checking the topology for the member existence
-		Member member = getMemberFromId(id);
-		if (null == member) {
-			log.debug("Member not found in the topology. Event rejected");
-			return;
-		}
-        if (StringUtils.isNotEmpty(id)) {
-            memberTimeStampMap.put(id, event.getTimeStamp());
-        } else {
-            log.warn("NULL member id found in the event received. Event rejected.");
-        }
-        if (log.isDebugEnabled()){
-            log.debug("Event received from [member-id] " + id + " [time-stamp] " + event.getTimeStamp());
-        }
-    }
-
-    @Override
-    public Iterator<StreamEvent> iterator() {
-        return window.iterator();
-    }
-
-    @Override
-    public Iterator<StreamEvent> iterator(String predicate) {
-        if (siddhiContext.isDistributedProcessingEnabled()) {
-            return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
-        } else {
-            return window.iterator();
-        }
-    }
-
-    /**
-     *  Retrieve the current activated members from the topology and initialize the timestamp map.
-     *  This will allow the system to recover from a restart
-     *
-     *  @param topology Topology model object
-     */
-    boolean loadTimeStampMapFromTopology(Topology topology){
-
-        long currentTimeStamp = System.currentTimeMillis();
-        if (topology == null || topology.getServices() == null){
-            return false;
-        }
-        // TODO make this efficient by adding APIs to messaging component
-        for (Service service : topology.getServices()) {
-            if (service.getClusters() != null) {
-                for (Cluster cluster : service.getClusters()) {
-                    if (cluster.getMembers() != null) {
-                        for (Member member : cluster.getMembers()) {
-                            // we are checking faulty status only in previously activated members
-                            if (member != null && MemberStatus.Active.equals(member.getStatus())) {
-                                // Initialize the member time stamp map from the topology at the beginning
-                                memberTimeStampMap.putIfAbsent(member.getMemberId(), currentTimeStamp);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        if (log.isDebugEnabled()){
-            log.debug("Member timestamps were successfully loaded from the topology: [timestamps] " +
-                    memberTimeStampMap);
-        }
-        return true;
-    }
-
-    private Member getMemberFromId(String memberId){
-        if (StringUtils.isEmpty(memberId)){
-            return null;
-        }
-        if (TopologyManager.getTopology().isInitialized()){
-        	try {
-                TopologyManager.acquireReadLock();
-                if (TopologyManager.getTopology().getServices() == null){
-                    return null;
-                }
-                // TODO make this efficient by adding APIs to messaging component
-                for (Service service : TopologyManager.getTopology().getServices()) {
-                    if (service.getClusters() != null) {
-                        for (Cluster cluster : service.getClusters()) {
-                            if (cluster.getMembers() != null) {
-                                for (Member member : cluster.getMembers()){
-                                    if (memberId.equals(member.getMemberId())){
-                                        return member;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-        	} catch (Exception e) {
-        		log.error("Error while reading topology" + e);
-        	} finally {
-        		TopologyManager.releaseReadLock();
-        	}
-        }
-        return null;
-    }
-
-    private void publishMemberFault(String memberId){
-        Member member = getMemberFromId(memberId);
-        if (member == null){
-            log.warn("Failed to publish member fault event. Member having [member-id] " + memberId +
-                    " does not exist in topology");
-            return;
-        }
-        log.info("Publishing member fault event for [member-id] " + memberId);
-
-        MemberFaultEvent memberFaultEvent = new MemberFaultEvent(member.getClusterId(), member.getClusterInstanceId(),
-                member.getMemberId(), member.getPartitionId(),
-                member.getNetworkPartitionId(), 0);
-
-        memberFaultEventMessageMap.put("message", memberFaultEvent);
-        healthStatPublisher.publish(MemberFaultEventMap, true);
-    }
-
-    @Override
-    public void run() {
-        try {
-            threadBarrier.pass();
-
-            for (Object o : memberTimeStampMap.entrySet()) {
-                Map.Entry pair = (Map.Entry) o;
-                long currentTime = System.currentTimeMillis();
-                Long eventTimeStamp = (Long) pair.getValue();
-
-                if ((currentTime - eventTimeStamp) > TIME_OUT) {
-                    log.info("Faulty member detected [member-id] " + pair.getKey() + " with [last time-stamp] " +
-                            eventTimeStamp + " [time-out] " + TIME_OUT + " milliseconds");
-                    publishMemberFault((String) pair.getKey());
-                }
-            }
-            if (log.isDebugEnabled()){
-                log.debug("Fault handling processor iteration completed with [time-stamp map length] " +
-                        memberTimeStampMap.size() + " [time-stamp map] " + memberTimeStampMap);
-            }
-        } catch (Throwable t) {
-            log.error(t.getMessage(), t);
-        } finally {
-            if (lastSchedule != null) {
-                lastSchedule.cancel(false);
-            }
-            lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
-        }
-    }
-
-    @Override
-    protected Object[] currentState() {
-        return new Object[]{window.currentState()};
-    }
-
-    @Override
-    protected void restoreState(Object[] data) {
-        window.restoreState(data);
-        window.restoreState((Object[]) data[0]);
-        window.reSchedule();
-    }
-
-    @Override
-    protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor,
-                        AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
-
-        if (parameters[0] instanceof IntConstant) {
-            timeToKeep = ((IntConstant) parameters[0]).getValue();
-        } else {
-            timeToKeep = ((LongConstant) parameters[0]).getValue();
-        }
-
-        String memberIdAttrName = ((Variable) parameters[1]).getAttributeName();
-        memberIdAttrIndex = streamDefinition.getAttributePosition(memberIdAttrName);
-
-        if (this.siddhiContext.isDistributedProcessingEnabled()) {
-            window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
-        } else {
-            window = new SchedulerSiddhiQueue<StreamEvent>(this);
-        }
-        MemberFaultEventMap.put("org.apache.stratos.messaging.event.health.stat.MemberFaultEvent", memberFaultEventMessageMap);
-
-	    executorService = StratosThreadPool.getExecutorService(CEP_EXTENSION_THREAD_POOL_KEY,
-                CEP_EXTENSION_THREAD_POOL_SIZE);
-	    cepTopologyEventReceiver.setExecutorService(executorService);
-        cepTopologyEventReceiver.execute();
-
-        //Ordinary scheduling
-        window.schedule();
-        if (log.isDebugEnabled()){
-            log.debug("Fault handling window processor initialized with [timeToKeep] " + timeToKeep +
-                    ", [memberIdAttrName] " + memberIdAttrName + ", [memberIdAttrIndex] " + memberIdAttrIndex +
-                    ", [distributed-enabled] " + this.siddhiContext.isDistributedProcessingEnabled());
-        }
-    }
-
-    @Override
-    public void schedule() {
-        if (lastSchedule != null) {
-            lastSchedule.cancel(false);
-        }
-        lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
-    }
-
-    @Override
-    public void scheduleNow() {
-        if (lastSchedule != null) {
-            lastSchedule.cancel(false);
-        }
-        lastSchedule = faultHandleScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
-    }
-
-    @Override
-    public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
-        this.faultHandleScheduler = scheduledExecutorService;
-    }
-
-    @Override
-    public void setThreadBarrier(ThreadBarrier threadBarrier) {
-        this.threadBarrier = threadBarrier;
-    }
-
-    @Override
-    public void destroy(){
-        // terminate topology listener thread
-        cepTopologyEventReceiver.terminate();
-        window = null;
-
-        // Shutdown executor service
-        if(executorService != null) {
-            try {
-                executorService.shutdownNow();
-            } catch (Exception e) {
-                log.warn("An error occurred while shutting down cep extension executor service", e);
-            }
-        }
-    }
-
-    public ConcurrentHashMap<String, Long> getMemberTimeStampMap() {
-        return memberTimeStampMap;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java b/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
deleted file mode 100644
index dff0f79..0000000
--- a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
+++ /dev/null
@@ -1,283 +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.cep.extension;
-
-import org.apache.log4j.Logger;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.event.StreamEvent;
-import org.wso2.siddhi.core.event.in.InEvent;
-import org.wso2.siddhi.core.event.in.InListEvent;
-import org.wso2.siddhi.core.event.remove.RemoveEvent;
-import org.wso2.siddhi.core.event.remove.RemoveListEvent;
-import org.wso2.siddhi.core.persistence.ThreadBarrier;
-import org.wso2.siddhi.core.query.QueryPostProcessingElement;
-import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
-import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
-import org.wso2.siddhi.query.api.definition.AbstractDefinition;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.definition.Attribute.Type;
-import org.wso2.siddhi.query.api.expression.Expression;
-import org.wso2.siddhi.query.api.expression.Variable;
-import org.wso2.siddhi.query.api.expression.constant.IntConstant;
-import org.wso2.siddhi.query.api.expression.constant.LongConstant;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-@SiddhiExtension(namespace = "stratos", function = "gradient")
-public class GradientFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
-
-    static final Logger log = Logger.getLogger(GradientFinderWindowProcessor.class);
-    private ScheduledExecutorService eventRemoverScheduler;
-    private ScheduledFuture<?> lastSchedule;
-    private long timeToKeep;
-    private int subjectedAttrIndex;
-    private Attribute.Type subjectedAttrType;
-    private List<InEvent> newEventList;
-    private List<RemoveEvent> oldEventList;
-    private ThreadBarrier threadBarrier;
-    private ISchedulerSiddhiQueue<StreamEvent> window;
-
-    @Override
-    protected void processEvent(InEvent event) {
-        acquireLock();
-        try {
-            newEventList.add(event);
-        } finally {
-            releaseLock();
-        }
-    }
-
-    @Override
-    protected void processEvent(InListEvent listEvent) {
-        acquireLock();
-        try {
-            System.out.println(listEvent);
-            for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
-                newEventList.add((InEvent) listEvent.getEvent(i));
-            }
-        } finally {
-            releaseLock();
-        }
-    }
-
-    @Override
-    public Iterator<StreamEvent> iterator() {
-        return window.iterator();
-    }
-
-    @Override
-    public Iterator<StreamEvent> iterator(String predicate) {
-        if (siddhiContext.isDistributedProcessingEnabled()) {
-            return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
-        } else {
-            return window.iterator();
-        }
-    }
-
-
-    @Override
-	public void run() {
-		acquireLock();
-		try {
-			long scheduledTime = System.currentTimeMillis();
-			try {
-				oldEventList.clear();
-				while (true) {
-					threadBarrier.pass();
-					RemoveEvent removeEvent = (RemoveEvent) window.poll();
-					if (removeEvent == null) {
-						if (oldEventList.size() > 0) {
-							nextProcessor.process(new RemoveListEvent(
-							                                          oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
-							oldEventList.clear();
-						}
-
-						if (newEventList.size() > 0) {
-							InEvent[] inEvents =
-							                     newEventList.toArray(new InEvent[newEventList.size()]);
-							for (InEvent inEvent : inEvents) {
-								window.put(new RemoveEvent(inEvent, -1));
-							}
-							
-							InEvent[] gradientEvents = gradient(inEvents[0], inEvents[newEventList.size() - 1]);
-							
-							for (InEvent inEvent : gradientEvents) {
-	                            window.put(new RemoveEvent(inEvent, -1));
-                            }
-							nextProcessor.process(new InListEvent(gradientEvents));
-
-							newEventList.clear();
-						}
-
-						long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
-						if (diff > 0) {
-                            try {
-                                if (lastSchedule != null) {
-                                    lastSchedule.cancel(false);
-                                }
-                                lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
-                            } catch (RejectedExecutionException ex) {
-								log.warn("scheduling cannot be accepted for execution: elementID " +
-								         elementId);
-							}
-							break;
-						}
-						scheduledTime = System.currentTimeMillis();
-					} else {
-						oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
-					}
-				}
-			} catch (Throwable t) {
-				log.error(t.getMessage(), t);
-			}
-		} finally {
-			releaseLock();
-		}
-	}
-
-
-    /**
-     * This function will calculate the linear gradient (per second) of the events received during
-     * a specified time period.
-     */
-	private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent) {
-		double firstVal = 0.0, lastVal = 0.0;
-		// FIXME I'm not sure whether there's some other good way to do correct casting,
-		// based on the type.
-		if (Type.DOUBLE.equals(subjectedAttrType)) {
-			firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
-		} else if (Type.INT.equals(subjectedAttrType)) {
-			firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
-		} else if (Type.LONG.equals(subjectedAttrType)) {
-			firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
-		} else if (Type.FLOAT.equals(subjectedAttrType)) {
-			firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
-		}
-		
-		long t1 = firstInEvent.getTimeStamp();
-		long t2 = lastInEvent.getTimeStamp();
-		long millisecondsForASecond = 1000;
-		long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
-		double gradient = 0.0;
-		if (tGap > 0) {
-			gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
-		}
-		if (log.isDebugEnabled()) {
-            log.debug("Gradient: " + gradient + " Last val: " + lastVal +
-                    " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
-                    t2+" hash: "+this.hashCode());
-        }
-		Object[] data = firstInEvent.getData().clone();
-		data[subjectedAttrIndex] = gradient;
-		InEvent gradientEvent =
-		                        new InEvent(firstInEvent.getStreamId(), (t1+t2)/2,
-		                                    data);
-		InEvent[] output = new InEvent[1];
-		output[0] = gradientEvent;
-		return output;
-	}
-
-	@Override
-    protected Object[] currentState() {
-        return new Object[]{window.currentState(), oldEventList, newEventList};
-    }
-
-    @Override
-    protected void restoreState(Object[] data) {
-        window.restoreState(data);
-        window.restoreState((Object[]) data[0]);
-        oldEventList = ((ArrayList<RemoveEvent>) data[1]);
-        newEventList = ((ArrayList<InEvent>) data[2]);
-        window.reSchedule();
-    }
-
-    @Override
-    protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
-        if (parameters[0] instanceof IntConstant) {
-            timeToKeep = ((IntConstant) parameters[0]).getValue();
-        } else {
-            timeToKeep = ((LongConstant) parameters[0]).getValue();
-        }
-        
-        String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
-        subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
-        subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
-
-        oldEventList = new ArrayList<RemoveEvent>();
-        if (this.siddhiContext.isDistributedProcessingEnabled()) {
-            newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
-        } else {
-            newEventList = new ArrayList<InEvent>();
-        }
-
-        if (this.siddhiContext.isDistributedProcessingEnabled()) {
-            window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
-        } else {
-            window = new SchedulerSiddhiQueue<StreamEvent>(this);
-        }
-        //Ordinary scheduling
-        window.schedule();
-
-    }
-
-    @Override
-    public void schedule() {
-        if (lastSchedule != null) {
-            lastSchedule.cancel(false);
-            }
-        lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
-    }
-
-    public void scheduleNow() {
-        if (lastSchedule != null) {
-            lastSchedule.cancel(false);
-        }
-        lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
-    }
-
-    @Override
-    public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
-        this.eventRemoverScheduler = scheduledExecutorService;
-    }
-
-    public void setThreadBarrier(ThreadBarrier threadBarrier) {
-        this.threadBarrier = threadBarrier;
-    }
-
-    @Override
-    public void destroy(){
-    	oldEventList = null;
-    	newEventList = null;
-    	window = null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java b/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
deleted file mode 100755
index 0dc24bd..0000000
--- a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.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.cep.extension;
-
-/**
- * Member Request Handling Capability Window Processor
- */
-
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.executor.function.FunctionExecutor;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-@SiddhiExtension(namespace = "stratos", function = "divider")
-public class MemeberRequestHandlingCapabilityWindowProcessor extends FunctionExecutor {
-
-    Attribute.Type returnType = Attribute.Type.DOUBLE;
-
-    @Override
-    public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
-    }
-
-    @Override
-    protected Object process(Object obj) {
-
-        double[] value = new double[2];
-        if (obj instanceof Object[]) {
-            int i=0;
-            for (Object aObj : (Object[]) obj) {
-                value[i]= Double.parseDouble(String.valueOf(aObj));
-                i++;
-            }
-        }//to do avoid deviding zero number of active instances won't be zero cz there is min
-        Double unit = (value[0] / value[1]);
-        if(!unit.isNaN() && !unit.isInfinite())
-            return unit;
-        else
-            return 0.0;
-
-    }
-
-    @Override
-    public void destroy() {
-
-    }
-
-    @Override
-    public Attribute.Type getReturnType() {
-        return returnType;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java b/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
deleted file mode 100644
index 96cff22..0000000
--- a/extensions/cep/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/SecondDerivativeFinderWindowProcessor.java
+++ /dev/null
@@ -1,301 +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.cep.extension;
-
-import org.apache.log4j.Logger;
-import org.wso2.siddhi.core.config.SiddhiContext;
-import org.wso2.siddhi.core.event.StreamEvent;
-import org.wso2.siddhi.core.event.in.InEvent;
-import org.wso2.siddhi.core.event.in.InListEvent;
-import org.wso2.siddhi.core.event.remove.RemoveEvent;
-import org.wso2.siddhi.core.event.remove.RemoveListEvent;
-import org.wso2.siddhi.core.persistence.ThreadBarrier;
-import org.wso2.siddhi.core.query.QueryPostProcessingElement;
-import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
-import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
-import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
-import org.wso2.siddhi.query.api.definition.AbstractDefinition;
-import org.wso2.siddhi.query.api.definition.Attribute;
-import org.wso2.siddhi.query.api.definition.Attribute.Type;
-import org.wso2.siddhi.query.api.expression.Expression;
-import org.wso2.siddhi.query.api.expression.Variable;
-import org.wso2.siddhi.query.api.expression.constant.IntConstant;
-import org.wso2.siddhi.query.api.expression.constant.LongConstant;
-import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-@SiddhiExtension(namespace = "stratos", function = "secondDerivative")
-public class SecondDerivativeFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
-
-    static final Logger log = Logger.getLogger(SecondDerivativeFinderWindowProcessor.class);
-    private ScheduledExecutorService eventRemoverScheduler;
-	private ScheduledFuture<?> lastSchedule;
-    private long timeToKeep;
-    private int subjectedAttrIndex;
-    private Attribute.Type subjectedAttrType;
-    private List<InEvent> newEventList;
-    private List<RemoveEvent> oldEventList;
-    private ThreadBarrier threadBarrier;
-    private ISchedulerSiddhiQueue<StreamEvent> window;
-
-    @Override
-    protected void processEvent(InEvent event) {
-        acquireLock();
-        try {
-            newEventList.add(event);
-        } finally {
-            releaseLock();
-        }
-    }
-
-    @Override
-    protected void processEvent(InListEvent listEvent) {
-        acquireLock();
-        try {
-            System.out.println(listEvent);
-            for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
-                newEventList.add((InEvent) listEvent.getEvent(i));
-            }
-        } finally {
-            releaseLock();
-        }
-    }
-
-    @Override
-    public Iterator<StreamEvent> iterator() {
-        return window.iterator();
-    }
-
-    @Override
-    public Iterator<StreamEvent> iterator(String predicate) {
-        if (siddhiContext.isDistributedProcessingEnabled()) {
-            return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
-        } else {
-            return window.iterator();
-        }
-    }
-
-
-    @Override
-	public void run() {
-		acquireLock();
-		try {
-			long scheduledTime = System.currentTimeMillis();
-			try {
-				oldEventList.clear();
-				while (true) {
-					threadBarrier.pass();
-					RemoveEvent removeEvent = (RemoveEvent) window.poll();
-					if (removeEvent == null) {
-						if (oldEventList.size() > 0) {
-							nextProcessor.process(new RemoveListEvent(
-							                                          oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
-							oldEventList.clear();
-						}
-
-						if (newEventList.size() > 0) {
-							InEvent[] inEvents =
-							                     newEventList.toArray(new InEvent[newEventList.size()]);
-							for (InEvent inEvent : inEvents) {
-								window.put(new RemoveEvent(inEvent, -1));
-							}
-							
-							// in order to find second derivative, we need at least 3 events.
-							if (newEventList.size() > 2) {
-
-								InEvent firstDerivative1 =
-								                           gradient(inEvents[0],
-								                                    inEvents[(newEventList.size() / 2) - 1],
-								                                    null)[0];
-								InEvent firstDerivative2 =
-								                           gradient(inEvents[newEventList.size() / 2],
-								                                    inEvents[newEventList.size() - 1],
-								                                    null)[0];
-								InEvent[] secondDerivative =
-								                             gradient(firstDerivative1,
-								                                      firstDerivative2, Type.DOUBLE);
-
-								for (InEvent inEvent : secondDerivative) {
-									window.put(new RemoveEvent(inEvent, -1));
-								}
-								nextProcessor.process(new InListEvent(secondDerivative));
-							} else {
-								log.debug("Insufficient events to calculate second derivative. We need at least 3 events. Current event count: " +
-								          newEventList.size());
-							}
-
-							newEventList.clear();
-						}
-
-						long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
-						if (diff > 0) {
-							try {
-								if (lastSchedule != null) {
-									lastSchedule.cancel(false);
-								}
-								lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
-							} catch (RejectedExecutionException ex) {
-								log.warn("scheduling cannot be accepted for execution: elementID " +
-								         elementId);
-							}
-							break;
-						}
-						scheduledTime = System.currentTimeMillis();
-					} else {
-						oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
-					}
-				}
-			} catch (Throwable t) {
-				log.error(t.getMessage(), t);
-			}
-		} finally {
-			releaseLock();
-		}
-	}
-
-
-    /**
-     * This function will calculate the linear gradient (per second) of the events received during
-     * a specified time period.
-     */
-	private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent, Type type) {
-		Type attrType = type == null ? subjectedAttrType : type;
-		double firstVal = 0.0, lastVal = 0.0;
-		// FIXME I'm not sure whether there's some other good way to do correct casting,
-		// based on the type.
-		if (Type.DOUBLE.equals(attrType)) {
-			firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
-		} else if (Type.INT.equals(attrType)) {
-			firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
-		} else if (Type.LONG.equals(attrType)) {
-			firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
-		} else if (Type.FLOAT.equals(attrType)) {
-			firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
-			lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
-		}
-		
-		long t1 = firstInEvent.getTimeStamp();
-		long t2 = lastInEvent.getTimeStamp();
-		long millisecondsForASecond = 1000;
-        long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
-		double gradient = 0.0;
-		if (tGap > 0) {
-			gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
-		}
-		if (log.isDebugEnabled()) {
-		    log.debug("Gradient: " + gradient + " Last val: " + lastVal +
-		            " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
-		            t2+" hash: "+this.hashCode());
-		}
-		Object[] data = firstInEvent.getData().clone();
-		data[subjectedAttrIndex] = gradient;
-		InEvent gradientEvent =
-		                        new InEvent(firstInEvent.getStreamId(), t1+((t2-t1)/2),
-		                                    data);
-		InEvent[] output = new InEvent[1];
-		output[0] = gradientEvent;
-		return output;
-	}
-
-	@Override
-    protected Object[] currentState() {
-        return new Object[]{window.currentState(), oldEventList, newEventList};
-    }
-
-    @Override
-    protected void restoreState(Object[] data) {
-        window.restoreState(data);
-        window.restoreState((Object[]) data[0]);
-        oldEventList = ((ArrayList<RemoveEvent>) data[1]);
-        newEventList = ((ArrayList<InEvent>) data[2]);
-        window.reSchedule();
-    }
-
-    @Override
-    protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
-        if (parameters[0] instanceof IntConstant) {
-            timeToKeep = ((IntConstant) parameters[0]).getValue();
-        } else {
-            timeToKeep = ((LongConstant) parameters[0]).getValue();
-        }
-        
-        String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
-        subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
-        subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
-
-        oldEventList = new ArrayList<RemoveEvent>();
-        if (this.siddhiContext.isDistributedProcessingEnabled()) {
-            newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
-        } else {
-            newEventList = new ArrayList<InEvent>();
-        }
-
-        if (this.siddhiContext.isDistributedProcessingEnabled()) {
-            window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
-        } else {
-            window = new SchedulerSiddhiQueue<StreamEvent>(this);
-        }
-        //Ordinary scheduling
-        window.schedule();
-
-    }
-
-    @Override
-    public void schedule() {
-		if (lastSchedule != null) {
-			lastSchedule.cancel(false);
-		}
-		lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
-	}
-
-	public void scheduleNow() {
-		if (lastSchedule != null) {
-			lastSchedule.cancel(false);
-		}
-		lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
-	}
-
-    @Override
-    public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
-        this.eventRemoverScheduler = scheduledExecutorService;
-    }
-
-    public void setThreadBarrier(ThreadBarrier threadBarrier) {
-        this.threadBarrier = threadBarrier;
-    }
-
-    @Override
-    public void destroy(){
-    	oldEventList = null;
-    	newEventList = null;
-    	window = null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/INSTALL.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/INSTALL.md b/extensions/load-balancer/haproxy-extension/INSTALL.md
deleted file mode 100644
index 826419f..0000000
--- a/extensions/load-balancer/haproxy-extension/INSTALL.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# Installing Apache Stratos HAProxy Extension
-
-Apache Stratos HAProxy Extension could be used for integrating HAProxy load balancer with Apache Stratos. Please follow
-below steps to proceed with the installation:
-
-1. Download and extract HAProxy binary distribution to a desired location: <haproxy-home>.
-
-2. Extract org.apache.stratos.haproxy.extension-<version>.zip to a desired location: <haproxy-extension-home>.
-
-3. Open <haproxy-extension-home>/bin/haproxy-extension.sh file in a text editor and update following system properties:
-   ```
-   # Define haproxy host private ip address:
-   -Dhaproxy.private.ip=127.0.0.1
-
-   # Define the haproxy executable file path:
-   -Dexecutable.file.path=<haproxy-home>/haproxy
-
-   # Enable/disable cep statistics publisher:
-   -Dcep.stats.publisher.enabled=false
-
-   # If cep statistics publisher is enabled define the following properties:
-   -Dthrift.receiver.ip=127.0.0.1
-   -Dthrift.receiver.port=7615
-   -Dnetwork.partition.id=network-partition-1
-   ```
-
-4. Open <haproxy-extension-home>/conf/jndi.properties file in a text editor and update message broker information:
-   ```
-   java.naming.provider.url=tcp://localhost:61616
-   ```
-5. Run <haproxy-extension-home>/bin/haproxy-extension.sh as the root user.
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/README.md b/extensions/load-balancer/haproxy-extension/README.md
deleted file mode 100644
index 50a49a1..0000000
--- a/extensions/load-balancer/haproxy-extension/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Apache Stratos HAProxy Extension
-
-Apache Stratos HAProxy extension is a load balancer extension for HAProxy. It is an executable program
-which can manage the life-cycle of a HAProxy instance according to the topology, composite application model,
-tenant application signups and domain mapping information received from Stratos via the message broker.
-
-## How it works
-1. Wait for the complete topology event message to initialize the topology.
-2. Configure and start an instance of HAProxy.
-3. Listen to topology, application, application signup, domain mapping events.
-4. Reload HAProxy instance with the new topology configuration.
-5. Periodically publish statistics to Complex Event Processor (CEP).
-
-## Installation
-Please refer INSTALL.md for information on the installation process.
-
-Thanks to Vaadin for HAProxyController implementation:
-https://vaadin.com/license
-http://dev.vaadin.com/browser/svn/incubator/Arvue/ArvueMaster/src/org/vaadin/arvue/arvuemaster/HAProxyController.java
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/pom.xml b/extensions/load-balancer/haproxy-extension/pom.xml
deleted file mode 100644
index d90641b..0000000
--- a/extensions/load-balancer/haproxy-extension/pom.xml
+++ /dev/null
@@ -1,109 +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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-load-balancer-extensions</artifactId>
-        <version>4.1.2</version>
-    </parent>
-
-    <artifactId>apache-stratos-haproxy-extension</artifactId>
-    <name>Apache Stratos - HAProxy Extension</name>
-    <description>Apache Stratos HAProxy Extension for Load Balancing</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>1.7.5</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.messaging</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.velocity</groupId>
-            <artifactId>velocity</artifactId>
-            <version>1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.andes.wso2</groupId>
-            <artifactId>andes-client</artifactId>
-            <version>0.13.wso2v8</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>org.apache.stratos.haproxy.extension.Main</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <descriptors>
-                        <descriptor>src/main/assembly/bin.xml</descriptor>
-                    </descriptors>
-                    <archiverConfig>
-                        <fileMode>420</fileMode>
-                        <directoryMode>493</directoryMode>
-                        <defaultDirectoryMode>493</defaultDirectoryMode>
-                    </archiverConfig>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/assembly/bin.xml b/extensions/load-balancer/haproxy-extension/src/main/assembly/bin.xml
deleted file mode 100644
index 5bfa02e..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,106 +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.
-  -->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-    <id>bin</id>
-    <formats>
-        <format>zip</format>
-    </formats>
-    <fileSets>
-        <fileSet>
-            <directory>${project.basedir}/src/main/bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>haproxy-extension.sh</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/conf</directory>
-            <outputDirectory>/conf</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>jndi.properties</include>
-                <include>log4j.properties</include>
-                <include>thrift-client-config.xml</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/security</directory>
-            <outputDirectory>/security</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>client-truststore.jks</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/templates</directory>
-            <outputDirectory>/templates</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>haproxy.cfg.template</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/scripts</directory>
-            <outputDirectory>/scripts</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>get-weight.sh</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>DISCLAIMER</include>
-                <include>README*</include>
-                <include>LICENSE*</include>
-                <include>INSTALL*</include>
-            </includes>
-        </fileSet>
-	<fileSet>
-            <directory>${project.basedir}/src/main/license</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/notice</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-        </fileSet>
-    </fileSets>
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>/lib</outputDirectory>
-	    <excludes>
-                <exclude>*:icu4j*</exclude>
-                <exclude>*:jaxen*</exclude>
-                <exclude>*:jboss-transaction-api*</exclude>
-                <exclude>*:wrapper*</exclude>
-                <exclude>*:xom*</exclude>
-            </excludes>
-            <useProjectArtifact>true</useProjectArtifact>
-            <scope>runtime</scope>
-        </dependencySet>
-    </dependencySets>
-</assembly>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh b/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
deleted file mode 100755
index bc17399..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-echo "Starting haproxy extension..."
-script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-lib_path=${script_path}/../lib/
-class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
-properties="-Dhaproxy.private.ip=127.0.0.1
-            -Dexecutable.file.path=haproxy
-            -Djndi.properties.dir=${script_path}/../conf
-            -Dtemplates.path=${script_path}/../templates
-            -Dtemplates.name=haproxy.cfg.template
-            -Dscripts.path=${script_path}/../scripts
-            -Dconf.file.path=/tmp/haproxy.cfg
-            -Dstats.socket.file.path=/tmp/haproxy-stats.socket
-            -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
-            -Djavax.net.ssl.trustStore=${script_path}/../security/client-truststore.jks
-            -Djavax.net.ssl.trustStorePassword=wso2carbon
-            -Dthrift.client.config.file.path=${script_path}/../conf/thrift-client-config.xml
-            -Dcep.stats.publisher.enabled=false
-            -Dthrift.receiver.ip=127.0.0.1
-            -Dthrift.receiver.port=7615
-            -Dnetwork.partition.id=network-partition-1
-            -Dcluster.id=cluster-1
-            -Dservice.name=service-1"
-
-
-# Uncomment below line to enable remote debugging
-#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
-
-java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.haproxy.extension.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/conf/jndi.properties b/extensions/load-balancer/haproxy-extension/src/main/conf/jndi.properties
deleted file mode 100644
index 21d7420..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/conf/jndi.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61616
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/conf/log4j.properties b/extensions/load-balancer/haproxy-extension/src/main/conf/log4j.properties
deleted file mode 100644
index ec45878..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/conf/log4j.properties
+++ /dev/null
@@ -1,40 +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.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=logs/haproxy-extension.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.haproxy.extension=INFO
-log4j.logger.org.apache.stratos.load.balancer.extension.api=INFO
-log4j.logger.org.apache.stratos.messaging=INFO
-log4j.logger.org.wso2.andes.client=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/haproxy-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/haproxy-extension/src/main/conf/thrift-client-config.xml
deleted file mode 100644
index 5cacada..0000000
--- a/extensions/load-balancer/haproxy-extension/src/main/conf/thrift-client-config.xml
+++ /dev/null
@@ -1,27 +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.
-  -->
-
-<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
-<thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file


[36/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
new file mode 100644
index 0000000..1a09c5c
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
@@ -0,0 +1,241 @@
+/*
+ * 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.lvs.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommandUtils;
+import org.apache.stratos.load.balancer.common.domain.*;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Collection;
+
+/**
+ * LVS load balancer configuration writer.
+ */
+public class LVSConfigWriter {
+
+	private static final Log log = LogFactory.getLog(Main.class);
+	private static final String NEW_LINE = System.getProperty("line.separator");
+	private static final String TAB = "    ";
+
+	private String templatePath;
+	private String templateName;
+	private String confFilePath;
+	private String statsSocketFilePath;
+	private String virtualIPsForServices;
+	private String serverState;
+	private String scheduleAlgo;
+	private boolean isKeepAlived=false;
+
+	public LVSConfigWriter(String templatePath, String templateName, String confFilePath,
+	                       String statsSocketFilePath, String virtualIPsForServices, String serverState,
+	                       String scheduleAlgo) {
+
+		this.templatePath = templatePath;
+		this.templateName = templateName;
+		this.confFilePath = confFilePath;
+		this.statsSocketFilePath = statsSocketFilePath;
+		this.virtualIPsForServices = virtualIPsForServices;
+		this.serverState = serverState;
+		this.scheduleAlgo = scheduleAlgo;
+	}
+
+	public boolean write(Topology topology) {
+
+		StringBuilder configurationBuilder = new StringBuilder();
+		StringBuilder virtualIPBuilder = new StringBuilder();
+		String state;
+		for (Service service : topology.getServices()) {
+			for (Cluster cluster : service.getClusters()) {
+				generateConfigurationForCluster(cluster, configurationBuilder, virtualIPBuilder,
+				                                virtualIPsForServices, scheduleAlgo,isKeepAlived);
+			}
+		}
+
+		// Start velocity engine
+		VelocityEngine ve = new VelocityEngine();
+		ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatePath);
+		ve.init();
+
+		// Open the template
+		Template t = ve.getTemplate(templateName);
+
+		// Insert strings into the template
+		VelocityContext context = new VelocityContext();
+		context.put("configuration", configurationBuilder.toString());
+		context.put("virtualips", virtualIPBuilder.toString());
+		context.put("state", serverState);
+
+		// Create a new string from the template
+		StringWriter stringWriter = new StringWriter();
+		t.merge(context, stringWriter);
+		String configuration = stringWriter.toString();
+
+		// Write configuration file
+		try {
+			BufferedWriter writer = new BufferedWriter(new FileWriter(confFilePath));
+			writer.write(configuration);
+			writer.close();
+
+			if (log.isInfoEnabled()) {
+				log.info(String.format("Configuration written to file: %s", confFilePath));
+			}
+			return true;
+		} catch (IOException e) {
+			if (log.isErrorEnabled()) {
+				log.error(String.format("Could not write configuration file: %s", confFilePath));
+			}
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * Generate configuration for a cluster with the following format:
+	 * <p/>
+	 * virtual_server 10.10.10.10 80 {
+	 * delay_loop 10
+	 * lvs_sched wlc
+	 * lvs_method DR
+	 * persistence_timeout 5
+	 * protocol TCP
+	 * <p/>
+	 * real_server 10.10.10.41 80 {
+	 * weight 50
+	 * TCP_CHECK {
+	 * connect_timeout 3
+	 * }
+	 * }
+	 * <p/>
+	 * real_server 10.10.10.42 80 {
+	 * weight 50
+	 * TCP_CHECK {
+	 * connect_timeout 3
+	 * }
+	 * }
+	 * }
+	 *
+	 * @param cluster
+	 * @param text
+	 */
+	private void generateConfigurationForCluster(Cluster cluster, StringBuilder text,
+	                                             StringBuilder virtualIPs, String virtualIPsForServices,
+	                                             String scheduleAlgo,boolean isKeepAlived) {
+
+		if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
+			return;
+		}
+
+		// Find port mappings
+		Member firstMember = (Member) cluster.getMembers().toArray()[0];
+		Collection<Port> ports = firstMember.getPorts();
+
+		String commandClear = "ipvsadm --clear";
+		try {
+			CommandUtils.executeCommand(commandClear);
+		} catch (IOException e) {
+			if (log.isErrorEnabled()) {
+				log.error(String.format("Could not run the command: %s", commandClear));
+			}
+			throw new RuntimeException(e);
+		}
+
+		String[] virtualIPForServiceArray;
+		if (virtualIPsForServices.contains(",")) {
+			virtualIPForServiceArray = virtualIPsForServices.split(",");
+		} else {
+			virtualIPForServiceArray = new String[1];
+			virtualIPForServiceArray[0] = virtualIPsForServices;
+		}
+		boolean isServiceAvailable = false;
+		for (int i = 0; i < virtualIPForServiceArray.length; i++) {
+			String[] virtualIpForService = virtualIPForServiceArray[i].split("\\|");
+		    for (Port port : ports) {
+			    String command = "ipvsadm -A -t " + virtualIpForService[1]+":" + port.getProxy()+ " -s " + scheduleAlgo;
+
+			    try {
+				    CommandUtils.executeCommand(command);
+			    } catch (IOException e) {
+				    if (log.isErrorEnabled()) {
+					    log.error(String.format("Could not run the command: %s", command));
+				    }
+				    throw new RuntimeException(e);
+			    }
+
+			    for (String hostname : cluster.getHostNames()) {
+				    if (virtualIpForService[0].equals(cluster.getServiceName())) {
+
+					    text.append("virtual_server ").append(virtualIpForService[1]).append(" ")
+					        .append(port.getProxy()).append(
+							    " {").append(
+							    NEW_LINE);
+					    text.append(TAB).append("delay_loop 10").append(NEW_LINE);
+					    text.append(TAB).append("lvs_sched ").append(scheduleAlgo).append(NEW_LINE);
+					    text.append(TAB).append("lvs_method DR").append(NEW_LINE);
+					    text.append(TAB).append("persistence_timeout 5").append(NEW_LINE);
+					    text.append(TAB).append("protocol TCP").append(NEW_LINE).append(NEW_LINE);
+
+					    //Start real servers block
+
+					    for (Member member : cluster.getMembers()) {
+						    // Start upstream server block
+						    text.append(TAB).append("real_server ").append(member.getHostName()).append(" ")
+						        .append(port.getValue()).append(" {")
+						        .append(NEW_LINE);
+						    text.append(TAB).append(TAB).append("weight 50").append(NEW_LINE);
+						    text.append(TAB).append(TAB).append("TCP_CHECK {").append(NEW_LINE);
+						    text.append(TAB).append(TAB).append(TAB).append("connect_timeout 3").append(NEW_LINE);
+						    text.append(TAB).append(TAB).append("}").append(NEW_LINE);
+						    text.append(TAB).append("}").append(NEW_LINE);
+						    String commandMember =
+								    "ipvsadm -a -t " + virtualIpForService[1] + ":" + port.getProxy() + " -r " +
+								    member.getHostName() + ":" + port.getValue() + " -m";
+
+						    try {
+							    CommandUtils.executeCommand(commandMember);
+						    } catch (IOException e) {
+							    if (log.isErrorEnabled()) {
+								    log.error(String.format("Could not run the command: %s", commandMember));
+							    }
+							    throw new RuntimeException(e);
+						    }
+					    }
+					    text.append("}").append(NEW_LINE);
+					    isServiceAvailable = true;
+					    virtualIPs.append(TAB).append(TAB).append(virtualIpForService[1]).append(NEW_LINE);
+
+				    }
+
+			    }
+		    }
+			if (!isServiceAvailable) {
+				log.warn(String.format("Given service is not available in the topology %s", virtualIpForService[0]));
+			}
+		}
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java
new file mode 100644
index 0000000..08feb71
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java
@@ -0,0 +1,203 @@
+/*
+ * 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.lvs.extension;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * LVS context to read and store system properties.
+ */
+public class LVSContext {
+    private static final Log log = LogFactory.getLog(LVSContext.class);
+    private static volatile LVSContext context;
+
+    private String lvsPrivateIp;
+    private String executableFilePath;
+    private String templatePath;
+    private String templateName;
+    private String scriptsPath;
+    private String confFilePath;
+    private String statsSocketFilePath;
+    private boolean cepStatsPublisherEnabled;
+    private String thriftReceiverIp;
+    private String thriftReceiverPort;
+    private String networkPartitionId;
+    private String clusterId;
+    private String serviceName;
+	private String virtualIPsForServices;
+	private String keepAlivedStartCommand;
+	private String serverState;
+	private String lvsScheduleAlgo;
+
+    private LVSContext() {
+        this.lvsPrivateIp = System.getProperty(Constants.LVS_PRIVATE_IP);
+        this.executableFilePath = System.getProperty(Constants.EXECUTABLE_FILE_PATH);
+        this.templatePath = System.getProperty(Constants.TEMPLATES_PATH);
+        this.templateName = System.getProperty(Constants.TEMPLATES_NAME);
+        this.scriptsPath = System.getProperty(Constants.SCRIPTS_PATH);
+        this.confFilePath = System.getProperty(Constants.CONF_FILE_PATH);
+        this.statsSocketFilePath = System.getProperty(Constants.STATS_SOCKET_FILE_PATH);
+        this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED);
+        this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP);
+        this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT);
+        this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID);
+        this.clusterId = System.getProperty(Constants.CLUSTER_ID);
+        this.serviceName = System.getProperty(Constants.SERVICE_NAME);
+	    this.virtualIPsForServices=System.getProperty(Constants.VIRTUALIPS_FOR_SERVICES);
+	    this.keepAlivedStartCommand=Constants.KEEPALIVED_START_COMMAND;
+	    this.serverState=System.getProperty(Constants.SERVER_STATE);
+	    this.lvsScheduleAlgo = System.getProperty(Constants.LVS_SCHEDULE_ALGO);
+
+        if (log.isDebugEnabled()) {
+            log.debug(Constants.LVS_PRIVATE_IP + " = " + lvsPrivateIp);
+            log.debug(Constants.EXECUTABLE_FILE_PATH + " = " + executableFilePath);
+            log.debug(Constants.TEMPLATES_PATH + " = " + templatePath);
+            log.debug(Constants.TEMPLATES_NAME + " = " + templateName);
+            log.debug(Constants.SCRIPTS_PATH + " = " + scriptsPath);
+            log.debug(Constants.CONF_FILE_PATH + " = " + confFilePath);
+            log.debug(Constants.STATS_SOCKET_FILE_PATH + " = " + statsSocketFilePath);
+            log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled);
+            log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp);
+            log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort);
+            log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId);
+            log.debug(Constants.CLUSTER_ID + " = " + clusterId);
+	        log.debug(Constants.VIRTUALIPS_FOR_SERVICES + " = " + virtualIPsForServices);
+	        log.debug(Constants.LVS_SCHEDULE_ALGO + " = " + lvsScheduleAlgo);
+        }
+    }
+
+    public static LVSContext getInstance() {
+        if (context == null) {
+            synchronized (LVSContext.class) {
+                if (context == null) {
+                    context = new LVSContext();
+                }
+            }
+        }
+        return context;
+    }
+
+    public void validate() {
+        validateSystemProperty(Constants.LVS_PRIVATE_IP);
+        validateSystemProperty(Constants.EXECUTABLE_FILE_PATH);
+        validateSystemProperty(Constants.TEMPLATES_PATH);
+        validateSystemProperty(Constants.TEMPLATES_NAME);
+        validateSystemProperty(Constants.SCRIPTS_PATH);
+        validateSystemProperty(Constants.CONF_FILE_PATH);
+        validateSystemProperty(Constants.STATS_SOCKET_FILE_PATH);
+        validateSystemProperty(Constants.CEP_STATS_PUBLISHER_ENABLED);
+        validateSystemProperty(Constants.CLUSTER_ID);
+
+        if (cepStatsPublisherEnabled) {
+            validateSystemProperty(Constants.THRIFT_RECEIVER_IP);
+            validateSystemProperty(Constants.THRIFT_RECEIVER_PORT);
+            validateSystemProperty(Constants.NETWORK_PARTITION_ID);
+        }
+    }
+
+    private void validateSystemProperty(String propertyName) {
+        String value = System.getProperty(propertyName);
+        if (StringUtils.isEmpty(value)) {
+            throw new RuntimeException("System property was not found: " + propertyName);
+        }
+    }
+
+    public String getLvsPrivateIp() {
+        return lvsPrivateIp;
+    }
+
+    public String getExecutableFilePath() {
+        return executableFilePath;
+    }
+
+    public String getTemplatePath() {
+        return templatePath;
+    }
+
+    public String getTemplateName() {
+        return templateName;
+    }
+
+    public String getScriptsPath() {
+        return scriptsPath;
+    }
+
+    public String getConfFilePath() {
+        return confFilePath;
+    }
+
+    public String getStatsSocketFilePath() {
+        return statsSocketFilePath;
+    }
+
+    public boolean isCEPStatsPublisherEnabled() {
+        return cepStatsPublisherEnabled;
+    }
+
+    public String getNetworkPartitionId() {
+        return networkPartitionId;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+	public String getVirtualIPsForServices() {
+		return virtualIPsForServices;
+	}
+
+	public void setVirtualIPsForServices(String virtualIPsForServices) {
+		this.virtualIPsForServices = virtualIPsForServices;
+	}
+
+	public String getKeepAlivedStartCommand() {
+		return keepAlivedStartCommand;
+	}
+
+	public void setKeepAlivedStartCommand(String keepAlivedStartCommand) {
+		this.keepAlivedStartCommand = keepAlivedStartCommand;
+	}
+
+	public String getServerState() {
+		return serverState;
+	}
+
+	public void setServerState(String serverState) {
+		this.serverState = serverState;
+	}
+
+	public String getLvsScheduleAlgo() {
+		return lvsScheduleAlgo;
+	}
+
+	public void setLvsScheduleAlgo(String lvsScheduleAlgo) {
+		this.lvsScheduleAlgo = lvsScheduleAlgo;
+	}
+
+	public boolean getIsKeepAlivedUsed() {
+		return false;
+	}
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
new file mode 100644
index 0000000..0cb771c
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
@@ -0,0 +1,80 @@
+/*
+ * 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.lvs.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommandUtils;
+import org.apache.stratos.load.balancer.common.statistics.LoadBalancerStatisticsReader;
+import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
+
+import java.io.IOException;
+
+/**
+ * LVS statistics reader.
+ */
+public class LVSStatisticsReader implements LoadBalancerStatisticsReader {
+
+	private static final Log log = LogFactory.getLog(LVSStatisticsReader.class);
+	private static final String IPVSADM_STATS_COMMAND = "sudo ipvsadm -L -n |grep Route";
+			//"ipvsadm -l --stats | grep TCP"
+
+	private TopologyProvider topologyProvider;
+	private String clusterInstanceId;
+
+	public LVSStatisticsReader(TopologyProvider topologyProvider) {
+		this.topologyProvider = topologyProvider;
+	}
+
+	@Override public String getClusterInstanceId() {
+		return clusterInstanceId;
+	}
+
+	@Override
+	public int getInFlightRequestCount(String clusterId) {
+		String output;
+		String[] array;
+		int totalWeight = 0, weight;
+
+		// Command to get the statistics : sudo ipvsadm -l --stats | grep TCP
+		String[] command = { "/bin/sh", "-c", IPVSADM_STATS_COMMAND };
+		try {
+			output = CommandUtils.executeCommand(command);
+			if ((output != null) && (output.length() > 0)) {
+				array = output.split("\n");
+				for (int i = 0; i < array.length; i++) {
+					weight = Integer.parseInt(array[i].substring(46, 50).toString().trim());
+					totalWeight += weight;
+				}
+			}
+		} catch (IOException e) {
+			if (log.isErrorEnabled()) {
+				log.error(e);
+			}
+		}
+		if (log.isInfoEnabled()) {
+			log.info(String.format("Cluster weight found: [cluster] %s [weight] %d", clusterId,
+			                       totalWeight));
+
+		}
+		return totalWeight;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java
new file mode 100644
index 0000000..52463e0
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java
@@ -0,0 +1,85 @@
+/*
+ * 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.lvs.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
+import org.apache.stratos.load.balancer.extension.api.LoadBalancerExtension;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * LVS extension main class.
+ */
+public class Main {
+	private static final Log log = LogFactory.getLog(Main.class);
+	private static ExecutorService executorService;
+
+	public static void main(String[] args) {
+
+		LoadBalancerExtension extension = null;
+		try {
+			// Configure log4j properties
+			PropertyConfigurator.configure(System.getProperty("log4j.properties.file.path"));
+
+			if (log.isInfoEnabled()) {
+				log.info("LVS extension started");
+			}
+
+            // Add shutdown hook
+            final Thread mainThread = Thread.currentThread();
+            final LoadBalancerExtension finalExtension = extension;
+            Runtime.getRuntime().addShutdownHook(new Thread() {
+                public void run() {
+                    try {
+                        if(finalExtension != null) {
+                            log.info("Shutting lvs instance...");
+                            finalExtension.stop();
+                        }
+                        mainThread.join();
+                    } catch (Exception e) {
+                        log.error(e);
+                    }
+                }
+            });
+
+			executorService = StratosThreadPool.getExecutorService("lvs.extension.thread.pool", 10);
+			// Validate runtime parameters
+			LVSContext.getInstance().validate();
+            TopologyProvider topologyProvider = new TopologyProvider();
+            LVSStatisticsReader statisticsReader = LVSContext.getInstance().isCEPStatsPublisherEnabled() ?
+                    new LVSStatisticsReader(topologyProvider) : null;
+            extension = new LoadBalancerExtension(new LVS(), statisticsReader, topologyProvider);
+			extension.setExecutorService(executorService);
+			extension.execute();
+		} catch (Exception e) {
+			if (log.isErrorEnabled()) {
+				log.error(e);
+			}
+			if (extension != null) {
+                log.info("Shutting lvs instance...");
+				extension.stop();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/license/LICENSE b/extensions/load-balancer/modules/lvs-extension/src/main/license/LICENSE
new file mode 100644
index 0000000..5a78fc9
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/license/LICENSE
@@ -0,0 +1,481 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+===================================================================================
+
+===================================================================================
+The Apache Stratos distribution includes a number of run time dependencies with 
+separate copyright notices and license terms. Your use of the Apache Stratos code
+is subject to the terms and conditions of the following licenses.
+===================================================================================
+
+===============================================================================
+The following components come under Apache Software License 2.0
+===============================================================================
+
+org.wso2.carbon.base-4.2.0.jar
+org.wso2.carbon.bootstrap-4.2.0.jar
+org.wso2.carbon.core-4.2.0.jar
+org.wso2.carbon.core.common-4.2.0.jar
+org.wso2.carbon.databridge.agent.thrift-4.2
+org.wso2.carbon.databridge.commons-4.2.
+org.wso2.carbon.databridge.commons.thrif
+org.wso2.carbon.logging-4.2.0.jar
+org.wso2.carbon.ndatasource.common-4.2.
+org.wso2.carbon.ndatasource.rdbms-4.2.0.j
+org.wso2.carbon.queuing-4.2.0.jar
+org.wso2.carbon.registry.api-4.2.0.jar
+org.wso2.carbon.registry.core-4.2.0.jar
+org.wso2.carbon.registry.xboot-4.2.0.jar
+org.wso2.carbon.securevault-4.2.0.jar
+org.wso2.carbon.user.api-4.2.0.jar
+org.wso2.carbon.user.core-4.2.0.jar
+org.wso2.carbon.user.mgt-4.2.0.jar
+org.wso2.carbon.user.mgt.common-4.2.0.ja
+org.wso2.carbon.utils-4.2.0.jar
+org.wso2.securevault-1.0.0-wso2v2.jar
+abdera-1.0.0.wso2v3.jar
+andes-client-0.13.wso2v8.jar
+annotations-1.3.2.jar
+ant-1.7.0.jar
+ant-launcher-1.7.0.jar
+axiom-1.2.11.wso2v4.jar
+axiom-api-1.2.11.jar
+axiom-impl-1.2.11.jar
+axis2-1.6.1.wso2v10.jar
+commons-cli-1.0.jar
+commons-codec-1.2.jar
+commons-collections-3.2.0.wso2v
+commons-collections-3.2.1.jar
+commons-dbcp-1.4.0.wso2v1.jar
+commons-fileupload-1.2.0.wso2v1
+commons-fileupload-1.2.jar
+commons-httpclient-3.1.0.wso2v2.
+commons-httpclient-3.1.jar
+commons-io-2.0.0.wso2v2.jar
+commons-io-2.0.jar
+commons-lang-2.4.jar
+commons-lang-2.6.0.wso2v1.jar
+commons-lang3-3.1.jar
+commons-logging-1.1.1.jar
+commons-pool-1.5.6.jar
+commons-pool-1.5.6.wso2v1.jar
+compass-2.0.1.wso2v2.jar
+geronimo-activation_1.1_spec-1.0.2.jar
+geronimo-javamail_1.4_spec-1.6.jar
+geronimo-jms_1.1_spec-1.1.jar
+geronimo-stax-api_1.0_spec-1.0.1.jar
+gson-2.2.4.jar
+hazelcast-3.0.1.jar
+hazelcast-3.0.1.wso2v1.jar
+httpclient-4.1.1-wso2v1.jar
+httpclient-4.2.5.jar
+httpcore-4.1.0-wso2v1.jar
+httpcore-4.2.4.jar
+javax.cache.wso2-4.2.0.jar
+java-xmlbuilder-0.6.jar
+javax.servlet-3.0.0.v201112011016.jar
+jdbc-pool-7.0.34.wso2v1.jar
+jdom-1.0.jar
+tomcat-catalina-ha-7.0.34.jar
+tomcat-ha-7.0.34.wso2v1.jar
+tomcat-jdbc-7.0.34.jar
+tomcat-juli-7.0.34.jar
+tomcat-tribes-7.0.34.jar
+tomcat-util-7.0.34.jar
+velocity-1.7.jar
+json-2.0.0.wso2v1.jar
+libthrift-0.7.wso2v1.jar
+libthrift-0.9.1.jar
+log4j-1.2.17.jar
+neethi-2.0.4.wso2v4.jar
+not-yet-commons-ssl-0.3.9.jar
+opencsv-1.8.wso2v1.jar
+org.apache.log4j-1.2.13.v200706111418.jar
+org.apache.stratos.common-4.0.0.jar
+org.apache.stratos.load.balancer.common-4.0.0.jar
+org.apache.stratos.load.balancer.extension.api-4.0.0.jar
+org.apache.stratos.messaging-4.0.0.jar
+poi-3.9.jar
+poi-ooxml-3.9.0.wso2v1.jar
+poi-ooxml-3.9.jar
+poi-ooxml-schemas-3.9.jar
+poi-scratchpad-3.9.0.wso2v1.jar
+poi-scratchpad-3.9.jar
+smack-3.0.4.wso2v1.jar
+smackx-3.0.4.wso2v1.jar
+stax-api-1.0.1.jar
+tomcat-annotations-api-7.0.34.jar
+tomcat-api-7.0.34.jar
+tomcat-catalina-7.0.34.jar
+
+
+===============================================================================
+The following components come under Public Domain License
+===============================================================================
+
+For base64-2.3.8.jar
+
+===============================================================================
+The following components come under BouncyCastle License
+===============================================================================
+
+For bcprov-jdk15-132.jar
+
+Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+===============================================================================
+The following components are Licensed under BSD license
+===============================================================================
+
+For dom4j-1.6.1.jar, 
+jline-0.9.94.jar, 
+jsch-0.1.49.jar
+jaxen-1.1.1.jar
+
+Copyright (c) 2010 Terence Parr
+All rights reserved.
+
+[The BSD License]
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+ * Neither the name of JiBX nor the names of its contributors may be used
+   to endorse or promote products derived from this software without specific
+   prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================== 
+The following components are licensed under EPL
+=============================================================================== 
+
+For junit-3.8.1.jar,
+org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
+org.eclipse.osgi-3.8.1.v20120830-144521.jar,
+org.eclipse.osgi.services-3.3.100.v20120522-1822.jar
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+=============================================================================== 
+The following components are licensed under MIT license
+=============================================================================== 
+
+For slf4j-1.5.10.wso2v1.jar,
+slf4j-api-1.7.5.jar,
+slf4j-log4j12-1.7.5.jar
+
+The MIT License (MIT)
+
+Copyright (c) 2004-2013 QOS.ch
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/notice/NOTICE b/extensions/load-balancer/modules/lvs-extension/src/main/notice/NOTICE
new file mode 100644
index 0000000..8624fcc
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/notice/NOTICE
@@ -0,0 +1,395 @@
+Apache Software
+Copyright 2014 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+================================================================================
+Apache Abdera Notice:
+
+Portions of Abdera were orginally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Abdera CLA".
+
+This software's test suite contains data files derived from the
+Universal Feed Parser, Copyright (c) 2002-2005, Mark Pilgrim.
+
+This software's extensions module contains a JSON writer for Atom XML
+that utilizes a JSON parser, Copyright (c) 2002, json.org. The code was 
+licensed using Apache License by the author Douglas Crockford and made 
+available at http://json.org/java/apache.zip We have included portions 
+of the code in the extensions module.
+
+===============================================================================
+Apache Ant Notice:
+
+The <sync> task is based on code Copyright (c) 2002, Landmark
+Graphics Corp that has been kindly donated to the Apache Software
+Foundation.
+
+================================================================================
+Apache Axiom Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+
+================================================================================
+Apache Axis2 Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems,
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+================================================================================
+Apache Commons-Lang Notice:
+
+This product includes software from the Spring Framework,
+under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+================================================================================
+Apache Commons-Pool Notice:
+
+The LinkedBlockingDeque implementation is based on an implementation written by
+Doug Lea with assistance from members of JCP JSR-166 Expert Group and released
+to the public domain, as explained at
+http://creativecommons.org/licenses/publicdomain
+
+================================================================================
+Apache Commons-httpclient Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache Tomcat Notice:
+
+The Windows Installer is built with the Nullsoft
+Scriptable Install System (NSIS), which is
+open source software.  The original software and
+related information is available at
+http://nsis.sourceforge.net.
+
+Java compilation software for JSP pages is provided by Eclipse,
+which is open source software.  The original software and
+related information is available at
+http://www.eclipse.org.
+
+For the bayeux implementation
+The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation
+* Copyright 2007-2008 Guy Molinari
+* Copyright 2007-2008 Filip Hanik
+* Copyright 2007 Dojo Foundation
+* Copyright 2007 Mort Bay Consulting Pty. Ltd.
+
+The original XML Schemas for Java EE Deployment Descriptors:
+ - javaee_5.xsd
+ - javaee_web_services_1_2.xsd
+ - javaee_web_services_client_1_2.xsd
+ - javaee_6.xsd
+ - javaee_web_services_1_3.xsd
+ - javaee_web_services_client_1_3.xsd
+ - jsp_2_2.xsd
+ - web-app_3_0.xsd
+ - web-common_3_0.xsd
+ - web-fragment_3_0.xsd
+ - javaee_7.xsd
+ - javaee_web_services_1_4.xsd
+ - javaee_web_services_client_1_4.xsd
+ - jsp_2_3.xsd
+ - web-app_3_1.xsd
+ - web-common_3_1.xsd
+ - web-fragment_3_1.xsd
+
+may be obtained from:
+http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
+
+================================================================================
+Apache Geranimo Notice:
+
+Apache Geronimo
+Copyright 2003-2011 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of the Web Console were orginally developed by International
+Business Machines Corporation and are licensed to the Apache Software
+Foundation under the "Software Grant and Corporate Contribution
+License Agreement", informally known as the "IBM Console CLA".
+
+Portions of the ASN1 codec implementation in
+framework/modules/geronimo-crypto/ were developed by the Bouncy Castle
+project (http://www.bouncycastle.org/).
+
+Copyright (c) 2000-2005
+The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+ORB Portions of this software were developed at IONA Technologies.
+
+Object Management Group (OMG) classes used by the orb.
+The original classes are available from www.org.omg.
+
+The RMI over IIOP implementation were developed at Trifork Technologies.
+
+Copyright 2004-2009 Tranql project committers
+This product includes software developed at
+Tranql (http://tranql.codehaus.org/).
+
+This product includes software developed by the Protocol Buffers
+project (http://code.google.com/apis/protocolbuffers).
+
+This product includes also software developed by :
+  - the W3C consortium (http://www.w3c.org) ,
+  - the SAX project (http://www.saxproject.org)
+
+The <sync> task is based on code Copyright (c) 2002, Landmark
+Graphics Corp that has been kindly donated to the Apache Software
+Foundation.
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+  - voluntary contributions made by Paul Eng on behalf of the
+    Apache Software Foundation that were originally developed at iClick, Inc.,
+    software copyright (c) 1999.
+
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems,
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+This product also includes schemas and specification developed by:
+      - the W3C consortium (http://www.w3c.org)
+      (http://www.w3.org/XML/1998/namespace)
+
+This product also includes WS-* schemas developed by International
+   Business Machines Corporation, Microsoft Corporation, BEA Systems,
+   TIBCO Software, SAP AG, Sonic Software, and VeriSign
+   (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)
+   (http://schemas.xmlsoap.org/ws/2004/08/addressing/)
+   (http://schemas.xmlsoap.org/wsdl/http)
+   (http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm.xsd)
+   (http://www.w3.org/2005/08/addressing/ws-addr.xsd)
+
+Portions of Derby were originally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Derby CLA".
+The following copyright notice(s) were affixed to portions of the code
+with which this file is now or was at one time distributed
+and are placed here unaltered.
+
+(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
+
+(C) Copyright IBM Corp. 2003.
+
+The portion of the functionTests under 'nist' was originally
+developed by the National Institute of Standards and Technology (NIST),
+an agency of the United States Department of Commerce, and adapted by
+International Business Machines Corporation in accordance with the NIST
+Software Acknowledgment and Redistribution document at
+http://www.itl.nist.gov/div897/ctg/sql_form.htm
+
+* OpenJPA includes software written by Miroslav Nachev.
+
+* OpenJPA uses test code written by Charles Tillman.
+
+XMLSec was originally based on software copyright (c) 2001, Institute for
+Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
+
+The development of XMLSec was partly funded by the European
+Commission in the <WebSig> project in the ISIS Programme.
+
+This product also includes software developed by :
+
+  - IBM Corporation (http://www.ibm.com),
+      WSDL4J was the initial code contribution for the Apache Woden
+      project and some of the WSDL4J design and code has been reused.
+  - The W3C Consortium (http://www.w3c.org),
+      Common W3C XML Schema and DTD files are packaged with Apache Woden.
+
+Portions Copyright 2006 International Business Machines Corp.
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+Aside from contributions to the Apache XMLBeans project, this
+software also includes:
+
+ - one or more source files from the Apache Xerces-J and Apache Axis
+   products, Copyright (c) 1999-2003 Apache Software Foundation
+
+ - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
+   Consortium (Massachusetts Institute of Technology, European Research
+   Consortium for Informatics and Mathematics, Keio University)
+
+ - resolver.jar from Apache Xml Commons project,
+   Copyright (c) 2001-2003 Apache Software Foundation
+
+ - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
+   Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
+
+ - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
+   Copyright 2005 BEA under the terms of the Apache Software License 2.0
+
+This product includes software developed by the Simple XML Compiler (SXC)
+project (http://sxc.codehaus.org/project-info.html)
+
+This product includes software developed for the JAXB Reference
+Implementation project. (https://jaxb.dev.java.net/).  Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes software developed for SOAP with Attachments
+API for Java (SAAJ). The software is available from the GlassFish project
+(https://saaj.dev.java.net/).  Apache Geronimo elects to include this
+software in this distribution under the CDDL license.
+
+This product includes software developed for Java API for XML Web Services
+project (JAX-WS) (https://jax-ws.dev.java.net/).  Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes software developed for the Java Server Pages Tag
+Library project (https://jstl.dev.java.net/).   Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes schema files developed for the Glassfish Java EE
+reference implementation (http://java.sun.com/xml/ns/j2ee/).
+Apache Geronimo elects to include this software in this distribution
+under the CDDL license.  You can obtain a copy of the License at:
+    https://glassfish.dev.java.net/public/CDDL+GPL.html
+The source code is available at:
+    https://glassfish.dev.java.net/source/browse/glassfish/
+
+The following schemas are included:
+
+----------------------------------
+  application-client_1_4.xsd
+  application_1_4.xsd
+  connector_1_5.xsd
+  datatypes.dtd
+  ejb-jar_2_1.xsd
+  j2ee_1_4.xsd
+  j2ee_jaxrpc_mapping_1_1.xsd
+  j2ee_web_services_1_1.xsd
+  j2ee_web_services_client_1_1.xsd
+  jsp_2_0.xsd
+  web-app_2_4.xsd
+  web-jsptaglibrary_2_0.xsd
+  application-client_5.xsd
+  application_5.xsd
+  ejb-jar_3_0.xsd
+  handler-chain.xsd
+  javaee_5.xsd
+  javaee_web_services_1_2.xsd
+  javaee_web_services_client_1_2.xsd
+  jsp_2_1.xsd
+  persistence_1_0.xsd
+  web-app_2_5.xsd
+  web-facelettaglibrary_2_0.xsd
+  web-facesconfig_2_0.xsd
+  web-partialresponse_2_0.xsd
+  web-jsptaglibrary_2_1.xsd
+  application_6.xsd
+  application-client_6.xsd
+  connector_1_6.xsd
+  ejb-jar_3_1.xsd
+  javaee_6.xsd
+  javaee_web_services_1_3.xsd
+  javaee_web_services_client_1_3.xsd
+  jsp_2_2.xsd
+  persistence_2_0.xsd
+  web-app_3_0.xsd
+  web-common_3_0.xsd
+  web-fragment_3_0.xsd
+--------------------------------
+
+This product includes software developed at
+the OSGi Alliance (http://www.osgi.org/).
+
+ This product includes software developed at
+ OPS4J (http://www.ops4j.org/).
+-------------------------------------------------------------------------------
+
+The product contains the software developed in javassist.org (http://www.javassist.org) 
+which is released under both the Mozilla Public License 
+(http://www.mozilla.org/MPL/MPL-1.1.html) and the GNU Lesser General Public 
+License (http://www.gnu.org/licenses/lgpl-2.1.html).  
+
+The Apache Geronimo project elects to distribute this software under the terms of 
+the Mozilla Public License. 
+
+-------------------------------------------------------------------------------
+
+The product contains the software developed in json.org which released under the following license.
+
+http://www.json.org/license.html
+
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+================================================================================
+Apache Httpclient Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+================================================================================
+Apache Httpcore Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache POI Notice:
+
+This product contains the DOM4J library (http://www.dom4j.org).
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+This product contains parts that were originally based on software from BEA.
+Copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
+World Wide Web Consortium (Massachusetts Institute of Technology, European
+Research Consortium for Informatics and Mathematics, Keio University)
+
+This product contains the Piccolo XML Parser for Java
+(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
+
+This product contains the chunks_parse_cmds.tbl file from the vsdump program.
+Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/resources/velocity.properties b/extensions/load-balancer/modules/lvs-extension/src/main/resources/velocity.properties
new file mode 100644
index 0000000..437aec5
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/resources/velocity.properties
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+resource.loader=class, file
+class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
+file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
+runtime.log.logsystem.log4j.category=velocity
+input.encoding=UTF-8
+output.encoding=UTF-8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/security/client-truststore.jks
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/security/client-truststore.jks b/extensions/load-balancer/modules/lvs-extension/src/main/security/client-truststore.jks
new file mode 100644
index 0000000..be441f3
Binary files /dev/null and b/extensions/load-balancer/modules/lvs-extension/src/main/security/client-truststore.jks differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/templates/keepalived.conf.template
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/templates/keepalived.conf.template b/extensions/load-balancer/modules/lvs-extension/src/main/templates/keepalived.conf.template
new file mode 100644
index 0000000..682598f
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/templates/keepalived.conf.template
@@ -0,0 +1,59 @@
+! 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.
+!
+! This is a generated file and will be overwritten at the next load balancer startup.
+! Please use loadbalancer.conf for updating mb-ip, mb-port and templates/jndi.properties.template
+! file for updating other configurations.
+!
+
+! Configuration File for keepalived
+
+global_defs {
+   notification_email {
+       your_email@admin.com
+   }
+   notification_email_from loadbalancer1@admin.com
+   smtp_server localhost
+   smtp_connect_timeout 30
+! UNIQUE:
+   router_id LVS_PRI
+}
+
+! ***********************************************************************
+! *************************   WEB SERVICES VIP  *************************
+! ***********************************************************************
+vrrp_instance VirtIP_10 {
+    state $state
+    interface eth0
+    virtual_router_id 10
+! UNIQUE:
+    priority 150
+    advert_int 3
+    smtp_alert
+    authentication {
+        auth_type PASS
+        auth_pass MY_PASS
+    }
+    virtual_ipaddress {
+$virtualips
+    }
+
+    lvs_sync_daemon_interface eth0
+}
+
+
+$configuration
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/INSTALL.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/INSTALL.md b/extensions/load-balancer/modules/nginx-extension/INSTALL.md
new file mode 100644
index 0000000..3e0aa5a
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/INSTALL.md
@@ -0,0 +1,33 @@
+# Installing Apache Stratos Nginx Extension
+
+Apache Stratos Nginx Extension could be used for integrating Nginx load balancer with Apache Stratos. Please follow
+below steps to proceed with the installation:
+
+1. Download and extract Nginx binary distribution to a desired location: <nginx-home>.
+
+2. Extract org.apache.stratos.nginx.extension-<version>.zip to a desired location: <nginx-extension-home>.
+
+3. Open <nginx-extension-home>/bin/nginx-extension.sh file in a text editor and update following system properties:
+   ```
+   # Define nginx host private ip address:
+   -Dnginx.private.ip=127.0.0.1
+
+   # Define the nginx executable file path:
+   -Dexecutable.file.path=<nginx-home>/nginx
+
+   # Enable/disable cep statistics publisher:
+   -Dcep.stats.publisher.enabled=false
+
+   # If cep statistics publisher is enabled define the following properties:
+   -Dthrift.receiver.ip=127.0.0.1
+   -Dthrift.receiver.port=7615
+   -Dnetwork.partition.id=network-partition-1
+   ```
+
+4. Open <nginx-extension-home>/conf/jndi.properties file in a text editor and update message broker information:
+   ```
+   java.naming.provider.url=tcp://localhost:61616
+   ```
+
+5. Run <nginx-extension-home>/bin/nginx-extension.sh as the root user.
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/README.md b/extensions/load-balancer/modules/nginx-extension/README.md
new file mode 100644
index 0000000..cfbe2a3
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/README.md
@@ -0,0 +1,27 @@
+# Apache Stratos Nginx Extension
+
+Apache Stratos Nginx extension is a load balancer extension for Nginx. It is an executable program
+which can manage the life-cycle of a Nginx instance according to the topology, composite application model,
+tenant application signups and domain mapping information received from Stratos via the message broker.
+
+## How it works
+1. Wait for the complete topology event message to initialize the topology.
+2. Configure and start an instance of Nginx.
+3. Listen to topology, application, application signup, domain mapping events.
+4. Reload Nginx instance with the new topology configuration.
+5. Periodically publish statistics to Complex Event Processor (CEP).
+
+## Statistics publishing
+Set cep.stats.publisher.enabled to true in nginx-extension.sh file to enable statistics publishing. Please note that
+Nginx must be compiled with HttpStubStatusModule module to read statistics. Execute the following command to make
+ sure that HttpStubStatusModule module is installed:
+```
+nginx -V 2>&1 | grep -o with-http_stub_status_module
+```
+If HttpStubStatusModule is installed the following output will be given:
+```
+with-http_stub_status_module
+```
+
+## Installation
+Please refer INSTALL.md for information on the installation process.

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/pom.xml b/extensions/load-balancer/modules/nginx-extension/pom.xml
new file mode 100644
index 0000000..b7223c1
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/pom.xml
@@ -0,0 +1,110 @@
+<?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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-load-balancer-extensions</artifactId>
+        <version>4.1.2</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>apache-stratos-nginx-extension</artifactId>
+    <name>Apache Stratos - Nginx Extension</name>
+    <description>Apache Stratos Nginx Extension for Load Balancing</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.7.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.messaging</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.andes.wso2</groupId>
+            <artifactId>andes-client</artifactId>
+            <version>0.13.wso2v8</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.stratos.nginx.extension.Main</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptors>
+                        <descriptor>src/main/assembly/bin.xml</descriptor>
+                    </descriptors>
+                    <archiverConfig>
+                        <fileMode>420</fileMode>
+                        <directoryMode>493</directoryMode>
+                        <defaultDirectoryMode>493</defaultDirectoryMode>
+                    </archiverConfig>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file


[18/50] [abbrv] stratos git commit: Fixing port mapping issue in nginx extension

Posted by ra...@apache.org.
Fixing port mapping issue in nginx extension


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/6ed9bf66
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6ed9bf66
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6ed9bf66

Branch: refs/heads/master
Commit: 6ed9bf6627b665a34111e07a4c99a1b95172c390
Parents: f7d6649
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Aug 28 18:35:30 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Aug 28 18:35:30 2015 +0530

----------------------------------------------------------------------
 .../stratos/nginx/extension/NginxConfigWriter.java  | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/6ed9bf66/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
index a7adad8..6f6a77c 100644
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
+++ b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
@@ -62,10 +62,7 @@ public class NginxConfigWriter {
 
         for (Service service : topology.getServices()) {
             for (Cluster cluster : service.getClusters()) {
-                if ((service.getPorts() == null) || (service.getPorts().size() == 0)) {
-                    throw new RuntimeException(String.format("No ports found in service: %s", service.getServiceName()));
-                }
-                generateConfigurationForCluster(cluster, service.getPorts(), configurationBuilder);
+                generateConfigurationForCluster(cluster, configurationBuilder);
             }
         }
 
@@ -127,10 +124,17 @@ public class NginxConfigWriter {
      *     }
      * }
      * @param cluster
-     * @param ports
      * @param text
      */
-    private void generateConfigurationForCluster(Cluster cluster, Collection<Port> ports, StringBuilder text) {
+    private void generateConfigurationForCluster(Cluster cluster, StringBuilder text) {
+
+        if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
+            return;
+        }
+
+        // Find port mappings
+        Member firstMember = (Member) cluster.getMembers().toArray()[0];
+        Collection<Port> ports = firstMember.getPorts();
 
         for (Port port : ports) {
             for (String hostname : cluster.getHostNames()) {


[03/50] [abbrv] stratos git commit: ApplicationCreatedEvent should be published when adding an application

Posted by ra...@apache.org.
ApplicationCreatedEvent should be published when adding an application


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/be8ebd4c
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/be8ebd4c
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/be8ebd4c

Branch: refs/heads/master
Commit: be8ebd4c67dd29d4e345f52b657dd271268b1f17
Parents: b778c6d
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 12:35:35 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 12:35:35 2015 +0530

----------------------------------------------------------------------
 .../stratos/autoscaler/applications/topic/ApplicationBuilder.java  | 1 -
 .../stratos/autoscaler/services/impl/AutoscalerServiceImpl.java    | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/be8ebd4c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
index 912a2f6..2f1b5f0 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/topic/ApplicationBuilder.java
@@ -75,7 +75,6 @@ public class ApplicationBuilder {
                     application.getUniqueIdentifier());
         }
         ApplicationHolder.persistApplication(application);
-        ApplicationsEventPublisher.sendApplicationCreatedEvent(application);
         AutoscalerCloudControllerClient.getInstance().createApplicationClusters(application.getUniqueIdentifier(),
                 appClusterContexts);
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/be8ebd4c/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index 3ccd970..738ced9 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -27,6 +27,7 @@ import org.apache.stratos.autoscaler.applications.parser.ApplicationParser;
 import org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser;
 import org.apache.stratos.autoscaler.applications.pojo.*;
 import org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder;
+import org.apache.stratos.autoscaler.applications.topic.ApplicationsEventPublisher;
 import org.apache.stratos.autoscaler.client.AutoscalerCloudControllerClient;
 import org.apache.stratos.autoscaler.context.AutoscalerContext;
 import org.apache.stratos.autoscaler.context.InstanceContext;
@@ -142,6 +143,7 @@ public class AutoscalerServiceImpl implements AutoscalerService {
             log.info(String.format("Application added successfully: [application-id] %s",
                     applicationContext.getApplicationId()));
         }
+        ApplicationsEventPublisher.sendApplicationCreatedEvent(application);
         return true;
     }
 


[37/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE b/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
new file mode 100644
index 0000000..60e7f41
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/license/LICENSE
@@ -0,0 +1,481 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+===================================================================================
+
+===================================================================================
+The Apache Stratos distribution includes a number of run time dependencies with 
+separate copyright notices and license terms. Your use of the Apache Stratos code
+is subject to the terms and conditions of the following licenses.
+===================================================================================
+
+===============================================================================
+The following components come under Apache Software License 2.0
+===============================================================================
+
+org.wso2.carbon.base-4.2.0.jar
+org.wso2.carbon.bootstrap-4.2.0.jar
+org.wso2.carbon.core-4.2.0.jar
+org.wso2.carbon.core.common-4.2.0.jar
+org.wso2.carbon.databridge.agent.thrift-4.2
+org.wso2.carbon.databridge.commons-4.2.
+org.wso2.carbon.databridge.commons.thrif
+org.wso2.carbon.logging-4.2.0.jar
+org.wso2.carbon.ndatasource.common-4.2.
+org.wso2.carbon.ndatasource.rdbms-4.2.0.j
+org.wso2.carbon.queuing-4.2.0.jar
+org.wso2.carbon.registry.api-4.2.0.jar
+org.wso2.carbon.registry.core-4.2.0.jar
+org.wso2.carbon.registry.xboot-4.2.0.jar
+org.wso2.carbon.securevault-4.2.0.jar
+org.wso2.carbon.user.api-4.2.0.jar
+org.wso2.carbon.user.core-4.2.0.jar
+org.wso2.carbon.user.mgt-4.2.0.jar
+org.wso2.carbon.user.mgt.common-4.2.0.ja
+org.wso2.carbon.utils-4.2.0.jar
+org.wso2.securevault-1.0.0-wso2v2.jar
+abdera-1.0.0.wso2v3.jar
+andes-client-0.13.wso2v8.jar
+annotations-1.3.2.jar
+ant-1.7.0.jar
+ant-launcher-1.7.0.jar
+axiom-1.2.11.wso2v4.jar
+axiom-api-1.2.11.jar
+axiom-impl-1.2.11.jar
+axis2-1.6.1.wso2v10.jar
+commons-cli-1.0.jar
+commons-codec-1.2.jar
+commons-collections-3.2.0.wso2v
+commons-collections-3.2.1.jar
+commons-dbcp-1.4.0.wso2v1.jar
+commons-fileupload-1.2.0.wso2v1
+commons-fileupload-1.2.jar
+commons-httpclient-3.1.0.wso2v2.
+commons-httpclient-3.1.jar
+commons-io-2.0.0.wso2v2.jar
+commons-io-2.0.jar
+commons-lang-2.4.jar
+commons-lang-2.6.0.wso2v1.jar
+commons-lang3-3.1.jar
+commons-logging-1.1.1.jar
+commons-pool-1.5.6.jar
+commons-pool-1.5.6.wso2v1.jar
+compass-2.0.1.wso2v2.jar
+geronimo-activation_1.1_spec-1.0.2.jar
+geronimo-javamail_1.4_spec-1.6.jar
+geronimo-jms_1.1_spec-1.1.jar
+geronimo-stax-api_1.0_spec-1.0.1.jar
+gson-2.2.4.jar
+hazelcast-3.0.1.jar
+hazelcast-3.0.1.wso2v1.jar
+httpclient-4.1.1-wso2v1.jar
+httpclient-4.2.5.jar
+httpcore-4.1.0-wso2v1.jar
+httpcore-4.2.4.jar
+javax.cache.wso2-4.2.0.jar
+java-xmlbuilder-0.6.jar
+javax.servlet-3.0.0.v201112011016.jar
+jdbc-pool-7.0.34.wso2v1.jar
+jdom-1.0.jar
+tomcat-catalina-ha-7.0.34.jar
+tomcat-ha-7.0.34.wso2v1.jar
+tomcat-jdbc-7.0.34.jar
+tomcat-juli-7.0.34.jar
+tomcat-tribes-7.0.34.jar
+tomcat-util-7.0.34.jar
+velocity-1.7.jar
+json-2.0.0.wso2v1.jar
+libthrift-0.7.wso2v1.jar
+libthrift-0.9.1.jar
+log4j-1.2.17.jar
+neethi-2.0.4.wso2v4.jar
+not-yet-commons-ssl-0.3.9.jar
+opencsv-1.8.wso2v1.jar
+org.apache.log4j-1.2.13.v200706111418.jar
+org.apache.stratos.common-4.1.2.jar
+org.apache.stratos.load.balancer.common-4.1.2.jar
+org.apache.stratos.load.balancer.extension.api-4.1.2.jar
+org.apache.stratos.messaging-4.1.2.jar
+poi-3.9.jar
+poi-ooxml-3.9.0.wso2v1.jar
+poi-ooxml-3.9.jar
+poi-ooxml-schemas-3.9.jar
+poi-scratchpad-3.9.0.wso2v1.jar
+poi-scratchpad-3.9.jar
+smack-3.0.4.wso2v1.jar
+smackx-3.0.4.wso2v1.jar
+stax-api-1.0.1.jar
+tomcat-annotations-api-7.0.34.jar
+tomcat-api-7.0.34.jar
+tomcat-catalina-7.0.34.jar
+
+
+===============================================================================
+The following components come under Public Domain License
+===============================================================================
+
+For base64-2.3.8.jar
+
+===============================================================================
+The following components come under BouncyCastle License
+===============================================================================
+
+For bcprov-jdk15-132.jar
+
+Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+===============================================================================
+The following components are Licensed under BSD license
+===============================================================================
+
+For dom4j-1.6.1.jar, 
+jline-0.9.94.jar, 
+jsch-0.1.49.jar
+jaxen-1.1.1.jar
+
+Copyright (c) 2010 Terence Parr
+All rights reserved.
+
+[The BSD License]
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+ * Neither the name of JiBX nor the names of its contributors may be used
+   to endorse or promote products derived from this software without specific
+   prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================== 
+The following components are licensed under EPL
+=============================================================================== 
+
+For junit-3.8.1.jar,
+org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
+org.eclipse.osgi-3.8.1.v20120830-144521.jar,
+org.eclipse.osgi.services-3.3.100.v20120522-1822.jar
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+=============================================================================== 
+The following components are licensed under MIT license
+=============================================================================== 
+
+For slf4j-1.5.10.wso2v1.jar,
+slf4j-api-1.7.5.jar,
+slf4j-log4j12-1.7.5.jar
+
+The MIT License (MIT)
+
+Copyright (c) 2004-2013 QOS.ch
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/notice/NOTICE b/extensions/load-balancer/modules/haproxy-extension/src/main/notice/NOTICE
new file mode 100644
index 0000000..47d3993
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/notice/NOTICE
@@ -0,0 +1,402 @@
+Apache Stratos HAProxy Extension
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+================================================================================
+Apache Software
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+================================================================================
+Apache Abdera Notice:
+
+Portions of Abdera were orginally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Abdera CLA".
+
+This software's test suite contains data files derived from the
+Universal Feed Parser, Copyright (c) 2002-2005, Mark Pilgrim.
+
+This software's extensions module contains a JSON writer for Atom XML
+that utilizes a JSON parser, Copyright (c) 2002, json.org. The code was 
+licensed using Apache License by the author Douglas Crockford and made 
+available at http://json.org/java/apache.zip We have included portions 
+of the code in the extensions module.
+
+===============================================================================
+Apache Ant Notice:
+
+The <sync> task is based on code Copyright (c) 2002, Landmark
+Graphics Corp that has been kindly donated to the Apache Software
+Foundation.
+
+================================================================================
+Apache Axiom Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+
+================================================================================
+Apache Axis2 Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems,
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+================================================================================
+Apache Commons-Lang Notice:
+
+This product includes software from the Spring Framework,
+under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+================================================================================
+Apache Commons-Pool Notice:
+
+The LinkedBlockingDeque implementation is based on an implementation written by
+Doug Lea with assistance from members of JCP JSR-166 Expert Group and released
+to the public domain, as explained at
+http://creativecommons.org/licenses/publicdomain
+
+================================================================================
+Apache Commons-httpclient Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache Tomcat Notice:
+
+The Windows Installer is built with the Nullsoft
+Scriptable Install System (NSIS), which is
+open source software.  The original software and
+related information is available at
+http://nsis.sourceforge.net.
+
+Java compilation software for JSP pages is provided by Eclipse,
+which is open source software.  The original software and
+related information is available at
+http://www.eclipse.org.
+
+For the bayeux implementation
+The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation
+* Copyright 2007-2008 Guy Molinari
+* Copyright 2007-2008 Filip Hanik
+* Copyright 2007 Dojo Foundation
+* Copyright 2007 Mort Bay Consulting Pty. Ltd.
+
+The original XML Schemas for Java EE Deployment Descriptors:
+ - javaee_5.xsd
+ - javaee_web_services_1_2.xsd
+ - javaee_web_services_client_1_2.xsd
+ - javaee_6.xsd
+ - javaee_web_services_1_3.xsd
+ - javaee_web_services_client_1_3.xsd
+ - jsp_2_2.xsd
+ - web-app_3_0.xsd
+ - web-common_3_0.xsd
+ - web-fragment_3_0.xsd
+ - javaee_7.xsd
+ - javaee_web_services_1_4.xsd
+ - javaee_web_services_client_1_4.xsd
+ - jsp_2_3.xsd
+ - web-app_3_1.xsd
+ - web-common_3_1.xsd
+ - web-fragment_3_1.xsd
+
+may be obtained from:
+http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
+
+================================================================================
+Apache Geranimo Notice:
+
+Apache Geronimo
+Copyright 2003-2011 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of the Web Console were orginally developed by International
+Business Machines Corporation and are licensed to the Apache Software
+Foundation under the "Software Grant and Corporate Contribution
+License Agreement", informally known as the "IBM Console CLA".
+
+Portions of the ASN1 codec implementation in
+framework/modules/geronimo-crypto/ were developed by the Bouncy Castle
+project (http://www.bouncycastle.org/).
+
+Copyright (c) 2000-2005
+The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+ORB Portions of this software were developed at IONA Technologies.
+
+Object Management Group (OMG) classes used by the orb.
+The original classes are available from www.org.omg.
+
+The RMI over IIOP implementation were developed at Trifork Technologies.
+
+Copyright 2004-2009 Tranql project committers
+This product includes software developed at
+Tranql (http://tranql.codehaus.org/).
+
+This product includes software developed by the Protocol Buffers
+project (http://code.google.com/apis/protocolbuffers).
+
+This product includes also software developed by :
+  - the W3C consortium (http://www.w3c.org) ,
+  - the SAX project (http://www.saxproject.org)
+
+The <sync> task is based on code Copyright (c) 2002, Landmark
+Graphics Corp that has been kindly donated to the Apache Software
+Foundation.
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+  - voluntary contributions made by Paul Eng on behalf of the
+    Apache Software Foundation that were originally developed at iClick, Inc.,
+    software copyright (c) 1999.
+
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems,
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+This product also includes schemas and specification developed by:
+      - the W3C consortium (http://www.w3c.org)
+      (http://www.w3.org/XML/1998/namespace)
+
+This product also includes WS-* schemas developed by International
+   Business Machines Corporation, Microsoft Corporation, BEA Systems,
+   TIBCO Software, SAP AG, Sonic Software, and VeriSign
+   (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)
+   (http://schemas.xmlsoap.org/ws/2004/08/addressing/)
+   (http://schemas.xmlsoap.org/wsdl/http)
+   (http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm.xsd)
+   (http://www.w3.org/2005/08/addressing/ws-addr.xsd)
+
+Portions of Derby were originally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Derby CLA".
+The following copyright notice(s) were affixed to portions of the code
+with which this file is now or was at one time distributed
+and are placed here unaltered.
+
+(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
+
+(C) Copyright IBM Corp. 2003.
+
+The portion of the functionTests under 'nist' was originally
+developed by the National Institute of Standards and Technology (NIST),
+an agency of the United States Department of Commerce, and adapted by
+International Business Machines Corporation in accordance with the NIST
+Software Acknowledgment and Redistribution document at
+http://www.itl.nist.gov/div897/ctg/sql_form.htm
+
+* OpenJPA includes software written by Miroslav Nachev.
+
+* OpenJPA uses test code written by Charles Tillman.
+
+XMLSec was originally based on software copyright (c) 2001, Institute for
+Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
+
+The development of XMLSec was partly funded by the European
+Commission in the <WebSig> project in the ISIS Programme.
+
+This product also includes software developed by :
+
+  - IBM Corporation (http://www.ibm.com),
+      WSDL4J was the initial code contribution for the Apache Woden
+      project and some of the WSDL4J design and code has been reused.
+  - The W3C Consortium (http://www.w3c.org),
+      Common W3C XML Schema and DTD files are packaged with Apache Woden.
+
+Portions Copyright 2006 International Business Machines Corp.
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+Aside from contributions to the Apache XMLBeans project, this
+software also includes:
+
+ - one or more source files from the Apache Xerces-J and Apache Axis
+   products, Copyright (c) 1999-2003 Apache Software Foundation
+
+ - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
+   Consortium (Massachusetts Institute of Technology, European Research
+   Consortium for Informatics and Mathematics, Keio University)
+
+ - resolver.jar from Apache Xml Commons project,
+   Copyright (c) 2001-2003 Apache Software Foundation
+
+ - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
+   Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
+
+ - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
+   Copyright 2005 BEA under the terms of the Apache Software License 2.0
+
+This product includes software developed by the Simple XML Compiler (SXC)
+project (http://sxc.codehaus.org/project-info.html)
+
+This product includes software developed for the JAXB Reference
+Implementation project. (https://jaxb.dev.java.net/).  Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes software developed for SOAP with Attachments
+API for Java (SAAJ). The software is available from the GlassFish project
+(https://saaj.dev.java.net/).  Apache Geronimo elects to include this
+software in this distribution under the CDDL license.
+
+This product includes software developed for Java API for XML Web Services
+project (JAX-WS) (https://jax-ws.dev.java.net/).  Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes software developed for the Java Server Pages Tag
+Library project (https://jstl.dev.java.net/).   Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes schema files developed for the Glassfish Java EE
+reference implementation (http://java.sun.com/xml/ns/j2ee/).
+Apache Geronimo elects to include this software in this distribution
+under the CDDL license.  You can obtain a copy of the License at:
+    https://glassfish.dev.java.net/public/CDDL+GPL.html
+The source code is available at:
+    https://glassfish.dev.java.net/source/browse/glassfish/
+
+The following schemas are included:
+
+----------------------------------
+  application-client_1_4.xsd
+  application_1_4.xsd
+  connector_1_5.xsd
+  datatypes.dtd
+  ejb-jar_2_1.xsd
+  j2ee_1_4.xsd
+  j2ee_jaxrpc_mapping_1_1.xsd
+  j2ee_web_services_1_1.xsd
+  j2ee_web_services_client_1_1.xsd
+  jsp_2_0.xsd
+  web-app_2_4.xsd
+  web-jsptaglibrary_2_0.xsd
+  application-client_5.xsd
+  application_5.xsd
+  ejb-jar_3_0.xsd
+  handler-chain.xsd
+  javaee_5.xsd
+  javaee_web_services_1_2.xsd
+  javaee_web_services_client_1_2.xsd
+  jsp_2_1.xsd
+  persistence_1_0.xsd
+  web-app_2_5.xsd
+  web-facelettaglibrary_2_0.xsd
+  web-facesconfig_2_0.xsd
+  web-partialresponse_2_0.xsd
+  web-jsptaglibrary_2_1.xsd
+  application_6.xsd
+  application-client_6.xsd
+  connector_1_6.xsd
+  ejb-jar_3_1.xsd
+  javaee_6.xsd
+  javaee_web_services_1_3.xsd
+  javaee_web_services_client_1_3.xsd
+  jsp_2_2.xsd
+  persistence_2_0.xsd
+  web-app_3_0.xsd
+  web-common_3_0.xsd
+  web-fragment_3_0.xsd
+--------------------------------
+
+This product includes software developed at
+the OSGi Alliance (http://www.osgi.org/).
+
+ This product includes software developed at
+ OPS4J (http://www.ops4j.org/).
+-------------------------------------------------------------------------------
+
+The product contains the software developed in javassist.org (http://www.javassist.org) 
+which is released under both the Mozilla Public License 
+(http://www.mozilla.org/MPL/MPL-1.1.html) and the GNU Lesser General Public 
+License (http://www.gnu.org/licenses/lgpl-2.1.html).  
+
+The Apache Geronimo project elects to distribute this software under the terms of 
+the Mozilla Public License. 
+
+-------------------------------------------------------------------------------
+
+The product contains the software developed in json.org which released under the following license.
+
+http://www.json.org/license.html
+
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+================================================================================
+Apache Httpclient Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+================================================================================
+Apache Httpcore Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache POI Notice:
+
+This product contains the DOM4J library (http://www.dom4j.org).
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+This product contains parts that were originally based on software from BEA.
+Copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
+World Wide Web Consortium (Massachusetts Institute of Technology, European
+Research Consortium for Informatics and Mathematics, Keio University)
+
+This product contains the Piccolo XML Parser for Java
+(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
+
+This product contains the chunks_parse_cmds.tbl file from the vsdump program.
+Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/resources/velocity.properties b/extensions/load-balancer/modules/haproxy-extension/src/main/resources/velocity.properties
new file mode 100644
index 0000000..437aec5
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/resources/velocity.properties
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+resource.loader=class, file
+class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
+file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
+runtime.log.logsystem.log4j.category=velocity
+input.encoding=UTF-8
+output.encoding=UTF-8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/scripts/get-weight.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/scripts/get-weight.sh b/extensions/load-balancer/modules/haproxy-extension/src/main/scripts/get-weight.sh
new file mode 100644
index 0000000..cef3a1f
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/scripts/get-weight.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+
+echo "get weight $1/$2" | socat stdio $3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/security/client-truststore.jks
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/security/client-truststore.jks b/extensions/load-balancer/modules/haproxy-extension/src/main/security/client-truststore.jks
new file mode 100644
index 0000000..be441f3
Binary files /dev/null and b/extensions/load-balancer/modules/haproxy-extension/src/main/security/client-truststore.jks differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/templates/haproxy.cfg.template
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/templates/haproxy.cfg.template b/extensions/load-balancer/modules/haproxy-extension/src/main/templates/haproxy.cfg.template
new file mode 100644
index 0000000..bee3471
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/templates/haproxy.cfg.template
@@ -0,0 +1,17 @@
+global
+    daemon
+    maxconn 256
+    $global_parameters
+
+defaults
+    mode http
+    timeout connect 5000ms
+    timeout client 50000ms
+    timeout server 50000ms
+
+$frontend_collection
+
+$backend_collection
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/INSTALL.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/INSTALL.md b/extensions/load-balancer/modules/lvs-extension/INSTALL.md
new file mode 100644
index 0000000..a6679b4
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/INSTALL.md
@@ -0,0 +1,37 @@
+# Installing Apache Stratos LVS Extension
+
+Apache Stratos LVS Extension could be used for integrating LVS load balancer with Apache Stratos. Please follow
+below steps to proceed with the installation:
+
+1. Install keepalived and ipvsadm:
+   ```
+   apt-get install keepalived ipvsadm
+   ```
+
+2. Open <lvs-extension-home>/bin/lvs-extension.sh file in a text editor and update following system properties:
+   ```
+   # Keepalived configuration file location:
+   -Dconf.file.path=/etc/keepalived/keepalived.conf
+
+   # Enable/disable cep statistics publisher:
+   -Dcep.stats.publisher.enabled=false
+
+   # If cep statistics publisher is enabled define the following properties:
+   -Dthrift.receiver.ip=127.0.0.1
+   -Dthrift.receiver.port=7615
+   -Dnetwork.partition.id=network-partition-1
+
+   # LVS server Virtual IP set for services
+   -Dlvs.service.virtualip.set=tomcat2|192.168.56.40,tomcat1|192.168.56.41,tomcat|192.168.56.40
+   # Server state (MASTER|BACKUP)
+   -Dserver.state=MASTER
+
+   ```
+
+4. Open <lvs-extension-home>/conf/jndi.properties file in a text editor and update message broker information:
+   ```
+   java.naming.provider.url=tcp://localhost:61616
+   ```
+
+5. Run <lvs-extension-home>/bin/lvs-extension.sh as the root user.
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/README.md b/extensions/load-balancer/modules/lvs-extension/README.md
new file mode 100644
index 0000000..13de2e0
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/README.md
@@ -0,0 +1,18 @@
+# Apache Stratos LVS Extension
+
+Apache Stratos LVS extension is a load balancer extension for LVS. It is an executable program
+which can manage the life-cycle of a LVS instance according to the topology, composite application model,
+tenant application signups and domain mapping information received from Stratos via the message broker.
+
+## How it works
+1. Wait for the complete topology event message to initialize the topology.
+2. Configure Keepalived
+3. Listen to topology, application, application signup, domain mapping events.
+4. Reload Keepalived instance with the new topology configuration.
+5. Periodically publish statistics to Complex Event Processor (CEP).
+
+## Statistics publishing
+Set cep.stats.publisher.enabled to true in lvs-extension.sh file to enable statistics publishing.
+
+## Installation
+Please refer INSTALL.md for information on the installation process.

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/pom.xml b/extensions/load-balancer/modules/lvs-extension/pom.xml
new file mode 100644
index 0000000..7111cf6
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/pom.xml
@@ -0,0 +1,110 @@
+<?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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-load-balancer-extensions</artifactId>
+        <version>4.1.2</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>apache-stratos-lvs-extension</artifactId>
+    <name>Apache Stratos - LVS Extension</name>
+    <description>Apache Stratos LVS Extension for Load Balancing</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.7.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.messaging</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.andes.wso2</groupId>
+            <artifactId>andes-client</artifactId>
+            <version>0.13.wso2v8</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.stratos.lvs.extension.Main</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptors>
+                        <descriptor>src/main/assembly/bin.xml</descriptor>
+                    </descriptors>
+                    <archiverConfig>
+                        <fileMode>420</fileMode>
+                        <directoryMode>493</directoryMode>
+                        <defaultDirectoryMode>493</defaultDirectoryMode>
+                    </archiverConfig>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/assembly/bin.xml b/extensions/load-balancer/modules/lvs-extension/src/main/assembly/bin.xml
new file mode 100644
index 0000000..5569074
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/assembly/bin.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ 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.
+  -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>bin</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/src/main/bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>lvs-extension.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/conf</directory>
+            <outputDirectory>/conf</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>jndi.properties</include>
+                <include>log4j.properties</include>
+                <include>thrift-client-config.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/security</directory>
+            <outputDirectory>/security</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>client-truststore.jks</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/templates</directory>
+            <outputDirectory>/templates</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>keepalived.conf.template</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/scripts</directory>
+            <outputDirectory>/scripts</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>get-weight.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>DISCLAIMER</include>
+                <include>README*</include>
+                <include>LICENSE*</include>
+                <include>INSTALL*</include>
+            </includes>
+        </fileSet>
+	<fileSet>
+            <directory>${project.basedir}/src/main/license</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/notice</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+        </fileSet>
+    </fileSets>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib</outputDirectory>
+	        <excludes>
+                <exclude>*:icu4j*</exclude>
+                <exclude>*:jaxen*</exclude>
+                <exclude>*:jboss-transaction-api*</exclude>
+                <exclude>*:wrapper*</exclude>
+                <exclude>*:xom*</exclude>
+            </excludes>
+            <useProjectArtifact>true</useProjectArtifact>
+            <scope>runtime</scope>
+        </dependencySet>
+    </dependencySets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/bin/lvs-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/bin/lvs-extension.sh b/extensions/load-balancer/modules/lvs-extension/src/main/bin/lvs-extension.sh
new file mode 100755
index 0000000..e769c32
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/bin/lvs-extension.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+
+echo "Starting lvs extension..."
+script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
+lib_path=${script_path}/../lib/
+class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
+properties="-Dlvs.private.ip=127.0.0.1
+            -Dexecutable.file.path=lvs
+            -Djndi.properties.dir=${script_path}/../conf
+            -Dtemplates.path=${script_path}/../templates
+            -Dtemplates.name=keepalived.conf.template
+            -Dscripts.path=${script_path}/../scripts
+            -Dconf.file.path=/tmp/keepalived.conf
+            -Dstats.socket.file.path=/tmp/nginx-stats.socket
+            -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
+            -Djavax.net.ssl.trustStore=${script_path}/../security/client-truststore.jks
+            -Djavax.net.ssl.trustStorePassword=wso2carbon
+            -Dthrift.client.config.file.path=${script_path}/../conf/thrift-client-config.xml
+            -Dcep.stats.publisher.enabled=false
+            -Dthrift.receiver.ip=127.0.0.1
+            -Dthrift.receiver.port=7615
+            -Dnetwork.partition.id=network-partition-1
+            -Dcluster.id=cluster-1
+            -Dservice.name=service-1
+            -Dlvs.service.virtualip.set=tomcat2|192.168.56.40,tomcat1|192.168.56.41
+            -Dschedule.algorithm=rr
+            -Dserver.state=MASTER
+            -Dkeepalived=false"
+
+
+# Uncomment below line to enable remote debugging
+#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
+
+java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.lvs.extension.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/conf/jndi.properties b/extensions/load-balancer/modules/lvs-extension/src/main/conf/jndi.properties
new file mode 100644
index 0000000..21d7420
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/conf/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61616
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/conf/log4j.properties b/extensions/load-balancer/modules/lvs-extension/src/main/conf/log4j.properties
new file mode 100644
index 0000000..ad6b80a
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/conf/log4j.properties
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=logs/nginx-extension.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.nginx.extension=INFO
+log4j.logger.org.apache.stratos.load.balancer.extension.api=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.wso2.andes.client=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
new file mode 100644
index 0000000..86a5fc6
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/conf/thrift-client-config.xml
@@ -0,0 +1,25 @@
+<!--
+  ~ 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.
+  -->
+
+<thriftClientConfiguration>
+    <username>admin</username>
+    <password>admin</password>
+    <ip>localhost</ip>
+    <port>7611</port>
+</thriftClientConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java
new file mode 100644
index 0000000..ce0f267
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java
@@ -0,0 +1,43 @@
+/*
+ * 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.lvs.extension;
+
+/**
+ * LVS extension constants.
+ */
+public class Constants {
+    public static final String LVS_PRIVATE_IP = "lvs.private.ip";
+    public static final String EXECUTABLE_FILE_PATH = "executable.file.path";
+    public static final String TEMPLATES_PATH = "templates.path";
+    public static final String TEMPLATES_NAME = "templates.name";
+    public static final String SCRIPTS_PATH = "scripts.path";
+    public static final String CONF_FILE_PATH = "conf.file.path";
+    public static final String STATS_SOCKET_FILE_PATH = "stats.socket.file.path";
+    public static final String CEP_STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
+    public static final String THRIFT_RECEIVER_IP = "thrift.receiver.ip";
+    public static final String THRIFT_RECEIVER_PORT = "thrift.receiver.port";
+    public static final String NETWORK_PARTITION_ID = "network.partition.id";
+    public static final String CLUSTER_ID = "cluster.id";
+    public static final String SERVICE_NAME = "service.name";
+	public static final String VIRTUALIPS_FOR_SERVICES = "lvs.service.virtualip.set" ;
+	public static final String KEEPALIVED_START_COMMAND = "service keepalived restart";
+	public static final String SERVER_STATE ="server.state" ;
+	public static final String LVS_SCHEDULE_ALGO = "schedule.algorithm";
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java
new file mode 100644
index 0000000..9494510
--- /dev/null
+++ b/extensions/load-balancer/modules/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java
@@ -0,0 +1,158 @@
+/*
+ * 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.lvs.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommandUtils;
+import org.apache.stratos.load.balancer.extension.api.LoadBalancer;
+import org.apache.stratos.load.balancer.extension.api.exception.LoadBalancerExtensionException;
+import org.apache.stratos.load.balancer.common.domain.Topology;
+
+import java.io.File;
+
+/**
+ * Lvs load balancer life-cycle implementation.
+ */
+public class LVS implements LoadBalancer {
+
+    private static final Log log = LogFactory.getLog(LVS.class);
+
+    private String executableFilePath;
+    private String processIdFilePath;
+    private String templatePath;
+    private String templateName;
+    private String confFilePath;
+    private String statsSocketFilePath;
+	private String virtualIPsForServices;
+	private String keepAlivedStartCommand;
+	private String serverState;
+	private String scheduleAlgo;
+	private boolean isKeepAlivedUsed;
+
+    public LVS() {
+        this.executableFilePath = LVSContext.getInstance().getExecutableFilePath();
+        this.templatePath = LVSContext.getInstance().getTemplatePath();
+        this.templateName = LVSContext.getInstance().getTemplateName();
+        this.confFilePath = LVSContext.getInstance().getConfFilePath();
+        this.processIdFilePath = confFilePath.replace(".cfg", ".pid");
+        this.statsSocketFilePath = LVSContext.getInstance().getStatsSocketFilePath();
+	    this.virtualIPsForServices= LVSContext.getInstance().getVirtualIPsForServices();
+	    this.keepAlivedStartCommand=LVSContext.getInstance().getKeepAlivedStartCommand();
+	    this.serverState=LVSContext.getInstance().getServerState();
+	    this.scheduleAlgo=LVSContext.getInstance().getLvsScheduleAlgo();
+	    this.isKeepAlivedUsed=LVSContext.getInstance().getIsKeepAlivedUsed();
+
+    }
+
+    /**
+     * Configure lvs instance according to topology given
+     * @param topology
+     * @throws LoadBalancerExtensionException
+     */
+    public boolean configure(Topology topology) throws LoadBalancerExtensionException {
+        try {
+            log.info("Generating lvs configuration...");
+            LVSConfigWriter writer = new LVSConfigWriter(templatePath, templateName, confFilePath, statsSocketFilePath,
+                                                         virtualIPsForServices,serverState,scheduleAlgo);
+            if(writer.write(topology)) {
+                return true;
+            }
+            return false;
+        } catch (Exception e) {
+            log.error("Could not generate lvs configuration");
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Start lvs instance
+     * @throws LoadBalancerExtensionException
+     */
+    public void start() throws LoadBalancerExtensionException {
+        log.info("Starting lvs instance...");
+        // Check for configuration file
+        File conf = new File(confFilePath);
+        if (!conf.exists()) {
+            throw new LoadBalancerExtensionException("Could not find lvs configuration file");
+        }
+
+        // Start nginx and write pid to processIdFilePath
+        try {
+	        if(isKeepAlivedUsed) {
+		        String command = keepAlivedStartCommand;
+		        CommandUtils.executeCommand(command);
+	        }
+            log.info("lvs instance started");
+        } catch (Exception e) {
+            log.error("Could not start lvs instance");
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Reload lvs instance according to the configuration written in configure() method.
+     * @throws LoadBalancerExtensionException
+     */
+    public void reload() throws LoadBalancerExtensionException {
+        try {
+            log.info("Reloading configuration...");
+
+            if(isKeepAlivedUsed) {
+	            // Execute hot configuration deployment
+		        String command = "service keepalived restart";
+		        CommandUtils.executeCommand(command);
+	        }
+            if (log.isInfoEnabled()) {
+                log.info("Configuration done");
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Reconfiguration failed");
+            }
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Stop lvs instance
+     * @throws LoadBalancerExtensionException
+     */
+    public void stop() throws LoadBalancerExtensionException {
+
+        try {
+            log.info("Stopping lvs...");
+
+	        if(isKeepAlivedUsed) {
+		        // Execute hot configuration deployment
+		        String command = "service keepalived stop";
+		        CommandUtils.executeCommand(command);
+	        }
+            if (log.isInfoEnabled()) {
+                log.info("LVS stopped");
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Could not stop lvs");
+            }
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+}


[29/50] [abbrv] stratos git commit: Removing cartridge-agent.log file

Posted by ra...@apache.org.
Removing cartridge-agent.log file


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/96c7935d
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/96c7935d
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/96c7935d

Branch: refs/heads/master
Commit: 96c7935d845308dfcfd355e44dd833437d1e474e
Parents: 8a36db5
Author: Imesh Gunaratne <im...@apache.org>
Authored: Sun Aug 30 01:01:53 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Aug 30 01:01:53 2015 +0530

----------------------------------------------------------------------
 .../integration/cartridge-agent.log             | 3372 ------------------
 1 file changed, 3372 deletions(-)
----------------------------------------------------------------------



[47/50] [abbrv] stratos git commit: Preparing for next development iteration

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/cartridge-agent/pom.xml
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/pom.xml b/products/cartridge-agent/pom.xml
index 2e15c7d..5ccf761 100644
--- a/products/cartridge-agent/pom.xml
+++ b/products/cartridge-agent/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-products-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>cartidge-agent</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/load-balancer/modules/distribution/INSTALL.txt
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/distribution/INSTALL.txt b/products/load-balancer/modules/distribution/INSTALL.txt
index fd1cdcc..7f1f732 100644
--- a/products/load-balancer/modules/distribution/INSTALL.txt
+++ b/products/load-balancer/modules/distribution/INSTALL.txt
@@ -56,7 +56,7 @@ System Requirements
 
 
 Please refer following link for more information:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Installation+Guide
+https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Installation+Guide
 
 
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/load-balancer/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/distribution/pom.xml b/products/load-balancer/modules/distribution/pom.xml
index abb1516..e94108d 100755
--- a/products/load-balancer/modules/distribution/pom.xml
+++ b/products/load-balancer/modules/distribution/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos.load.balancer</groupId>
         <artifactId>load-balancer-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/load-balancer/modules/distribution/src/main/assembly/filter.properties
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/distribution/src/main/assembly/filter.properties b/products/load-balancer/modules/distribution/src/main/assembly/filter.properties
index cdfa54a..321a036 100644
--- a/products/load-balancer/modules/distribution/src/main/assembly/filter.properties
+++ b/products/load-balancer/modules/distribution/src/main/assembly/filter.properties
@@ -19,6 +19,7 @@
 
 product.name=Apache Stratos Load Balancer
 product.key=LB
-hotdeployment=true
-hotupdate=false
-default.server.role=LoadBalancer
\ No newline at end of file
+product.version=4.2.0
+lb.version=2.0.5
+default.server.role=LoadBalancer
+bundle.creators=org.wso2.carbon.mediator.bridge.MediatorBundleCreator

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/load-balancer/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/distribution/src/main/license/LICENSE b/products/load-balancer/modules/distribution/src/main/license/LICENSE
index 12d2763..3080f50 100644
--- a/products/load-balancer/modules/distribution/src/main/license/LICENSE
+++ b/products/load-balancer/modules/distribution/src/main/license/LICENSE
@@ -252,10 +252,10 @@ org.apache.felix.gogo.command_0.8.0.v201108120515.jar,
 org.apache.felix.gogo.runtime_0.8.0.v201108120515.jar,                                    
 org.apache.felix.gogo.shell_0.8.0.v201110170705.jar,                                     
 org.apache.jasper.glassfish_2.2.2.v201205150955.jar,                                     
-org.apache.stratos.common_4.1.2.jar,
-org.apache.stratos.load.balancer.common_4.1.2.jar,
-org.apache.stratos.load.balancer_4.1.2.jar,
-org.apache.stratos.messaging_4.1.2.jar,
+org.apache.stratos.common_4.2.0.jar,
+org.apache.stratos.load.balancer.common_4.2.0.jar,
+org.apache.stratos.load.balancer_4.2.0.jar,
+org.apache.stratos.messaging_4.2.0.jar,
 org.wso2.caching_4.0.3.jar,                                                              
 org.wso2.carbon.addressing_4.2.0.jar,                                                    
 org.wso2.carbon.apache.jasper.fragment_4.2.0.jar,                                        

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/load-balancer/modules/p2-profile-gen/pom.xml
----------------------------------------------------------------------
diff --git a/products/load-balancer/modules/p2-profile-gen/pom.xml b/products/load-balancer/modules/p2-profile-gen/pom.xml
index 72e21a6..306d67f 100755
--- a/products/load-balancer/modules/p2-profile-gen/pom.xml
+++ b/products/load-balancer/modules/p2-profile-gen/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos.load.balancer</groupId>
         <artifactId>load-balancer-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/load-balancer/pom.xml
----------------------------------------------------------------------
diff --git a/products/load-balancer/pom.xml b/products/load-balancer/pom.xml
index 860344a..64b41e5 100755
--- a/products/load-balancer/pom.xml
+++ b/products/load-balancer/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/pom.xml
----------------------------------------------------------------------
diff --git a/products/pom.xml b/products/pom.xml
index 56baebd..f4057dc 100644
--- a/products/pom.xml
+++ b/products/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/python-cartridge-agent/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/pom.xml b/products/python-cartridge-agent/distribution/pom.xml
index 10826e0..f41d891 100644
--- a/products/python-cartridge-agent/distribution/pom.xml
+++ b/products/python-cartridge-agent/distribution/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>python-cartridge-agent-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/python-cartridge-agent/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/pom.xml b/products/python-cartridge-agent/pom.xml
index 16ba3b7..5e00c1c 100755
--- a/products/python-cartridge-agent/pom.xml
+++ b/products/python-cartridge-agent/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-products-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>python-cartridge-agent-parent</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos-cli/modules/distribution/README.txt
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/README.txt b/products/stratos-cli/modules/distribution/README.txt
index 42044ed..d1e02ee 100755
--- a/products/stratos-cli/modules/distribution/README.txt
+++ b/products/stratos-cli/modules/distribution/README.txt
@@ -25,7 +25,7 @@ in the interactive mode.
 
 Configuring CLI Tool
 ==================================
-Configuration guide can be found at https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Configuring+CLI+Tool
+Configuration guide can be found at https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Configuring+CLI+Tool
 
 Help
 ==================================

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos-cli/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/pom.xml b/products/stratos-cli/modules/distribution/pom.xml
index 790055c..5a967aa 100644
--- a/products/stratos-cli/modules/distribution/pom.xml
+++ b/products/stratos-cli/modules/distribution/pom.xml
@@ -23,8 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>apache-stratos-cli-parent</artifactId>
-        <version>4.1.2</version>
-        <relativePath>../../pom.xml</relativePath>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>apache-stratos-cli</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos-cli/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/license/LICENSE b/products/stratos-cli/modules/distribution/src/main/license/LICENSE
index fa362b0..a443b87 100644
--- a/products/stratos-cli/modules/distribution/src/main/license/LICENSE
+++ b/products/stratos-cli/modules/distribution/src/main/license/LICENSE
@@ -267,13 +267,13 @@ neethi-2.0.4.wso2v4.jar,
 not-yet-commons-ssl-0.3.9.jar,
 opencsv-1.8.wso2v1.jar,
 org.apache.log4j-1.2.13.v200706111418.jar,
-org.apache.stratos.autoscaler.service.stub-4.1.2.jar,
-org.apache.stratos.cli-4.1.2.jar,
-org.apache.stratos.cloud.controller.service.stub-4.1.2.jar,
-org.apache.stratos.common-4.1.2.jar,
-org.apache.stratos.manager-4.1.2.jar,
-org.apache.stratos.manager.service.stub-4.1.2.jar,
-org.apache.stratos.messaging-4.1.2.jar,
+org.apache.stratos.autoscaler.service.stub-4.2.0.jar,
+org.apache.stratos.cli-4.2.0.jar,
+org.apache.stratos.cloud.controller.service.stub-4.2.0.jar,
+org.apache.stratos.common-4.2.0.jar,
+org.apache.stratos.manager-4.2.0.jar,
+org.apache.stratos.manager.service.stub-4.2.0.jar,
+org.apache.stratos.messaging-4.2.0.jar,
 org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
 org.eclipse.osgi-3.8.1.v20120830-144521.jar,
 org.eclipse.osgi.services-3.3.100.v20120522-1822.jar,

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos-cli/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/pom.xml b/products/stratos-cli/pom.xml
index 539ea6b..18accfe 100644
--- a/products/stratos-cli/pom.xml
+++ b/products/stratos-cli/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-products-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/distribution/INSTALL.txt
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/INSTALL.txt b/products/stratos/modules/distribution/INSTALL.txt
index 1a254fb..4d16e3b 100755
--- a/products/stratos/modules/distribution/INSTALL.txt
+++ b/products/stratos/modules/distribution/INSTALL.txt
@@ -64,4 +64,4 @@ System Requirements
 
 
 Please refer below link for more information:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Installation+Guide
\ No newline at end of file
+https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Installation+Guide

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/distribution/README.txt
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/README.txt b/products/stratos/modules/distribution/README.txt
index 9b1571b..1691021 100755
--- a/products/stratos/modules/distribution/README.txt
+++ b/products/stratos/modules/distribution/README.txt
@@ -51,7 +51,7 @@ from instances and updates the routing topology periodically. Topology updates f
 
 
 Please refer below link for more information:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Architecture
+https://cwiki.apache.org/confluence/display/STRATOS/4.2.1+Architecture
 
 
 Crypto Notice

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/pom.xml b/products/stratos/modules/distribution/pom.xml
index 64867bb..1a4ea53 100755
--- a/products/stratos/modules/distribution/pom.xml
+++ b/products/stratos/modules/distribution/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/distribution/src/assembly/filter.properties
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/assembly/filter.properties b/products/stratos/modules/distribution/src/assembly/filter.properties
index 5131124..04684d5 100755
--- a/products/stratos/modules/distribution/src/assembly/filter.properties
+++ b/products/stratos/modules/distribution/src/assembly/filter.properties
@@ -19,6 +19,7 @@
 
 product.name=Apache Stratos
 product.key=STRATOS
+product.version=4.2.0
 hotdeployment=true
 hotupdate=false
 default.server.role=Stratos
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/main/license/LICENSE b/products/stratos/modules/distribution/src/main/license/LICENSE
index 16a7a7a..5e549bf 100644
--- a/products/stratos/modules/distribution/src/main/license/LICENSE
+++ b/products/stratos/modules/distribution/src/main/license/LICENSE
@@ -357,21 +357,22 @@ org.apache.jasper.glassfish_2.2.2.v201205150955.jar,
 org.apache.servicemix.bundles.jsch-agentproxy-jsch_0.0.7.1.jar,
 org.apache.servicemix.bundles.jsch-agentproxy-sshj_0.0.7.1.jar,
 org.apache.servicemix.bundles.jzlib_1.1.1.1.jar,
-org.apache.stratos.autoscaler.service.stub_4.1.2.jar,
-org.apache.stratos.autoscaler_4.1.2.jar,
-org.apache.stratos.cloud.controller.service.stub_4.1.2.jar,
-org.apache.stratos.cloud.controller_4.1.2.jar,
-org.apache.stratos.common_4.1.2.jar,
-org.apache.stratos.custom.handlers_4.1.2.jar,
-org.apache.stratos.kubernetes.client_4.1.2.jar,
-org.apache.stratos.manager.service.stub_4.1.2.jar,
-org.apache.stratos.manager.service.stub_4.1.2.jar,
-org.apache.stratos.manager.styles_4.1.2.jar,
-org.apache.stratos.manager_4.1.2.jar,
-org.apache.stratos.messaging_4.1.2.jar,
-org.apache.stratos.metadata.client_4.1.2.jar,
-org.apache.stratos.mock.iaas.client_4.1.2.jar,
-org.apache.stratos.mock.iaas_4.1.2.jar,
+org.apache.stratos.autoscaler.service.stub_4.2.0.jar,
+org.apache.stratos.autoscaler_4.2.0.jar,
+org.apache.stratos.cloud.controller.service.stub_4.2.0.jar,
+org.apache.stratos.cloud.controller_4.2.0.jar,
+org.apache.stratos.common_4.2.0.jar,
+org.apache.stratos.custom.handlers_4.2.0.jar,
+org.apache.stratos.kubernetes.client_4.2.0.jar,
+org.apache.stratos.logging.view.ui_4.2.0.jar,
+org.apache.stratos.manager.service.stub_4.2.0.jar,
+org.apache.stratos.manager.service.stub_4.2.0.jar,
+org.apache.stratos.manager.styles_4.2.0.jar,
+org.apache.stratos.manager_4.2.0.jar,
+org.apache.stratos.messaging_4.2.0.jar,
+org.apache.stratos.metadata.client_4.2.0.jar,
+org.apache.stratos.mock.iaas.client_4.2.0.jar,
+org.apache.stratos.mock.iaas_4.2.0.jar,
 org.apache.ws.commons.schema.XmlSchema_1.4.7.wso2v2.jar,
 org.jaggeryjs.hostobjects.db_0.9.0.ALPHA4_wso2v3.jar,
 org.jaggeryjs.hostobjects.email_0.9.0.ALPHA4_wso2v3.jar,

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/pom.xml b/products/stratos/modules/integration/pom.xml
index 4d8d869..a3ae303 100755
--- a/products/stratos/modules/integration/pom.xml
+++ b/products/stratos/modules/integration/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
index ea3d8f9..83d333a 100755
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
@@ -47,25 +47,15 @@ import static org.testng.Assert.assertNotNull;
  */
 public class StratosTestServerManager extends TestServerManager {
     private static final Log log = LogFactory.getLog(StratosTestServerManager.class);
-    private static Properties integrationProperties;
-    public static final String BASE_PATH = StratosTestServerManager.class.getResource("/").getPath();
-    public static final String STRATOS_DISTRIBUTION_NAME = "distribution.path";
-    public final static String PORT_OFFSET = "carbon.port.offset";
-    public static final String ACTIVEMQ_BIND_ADDRESS = "activemq.bind.address";
-    public static final String STRATOS_ENDPOINT = "stratos.endpoint";
-    public static final String ADMIN_USERNAME = "stratos.admin.username";
-    public static final String ADMIN_PASSWORD = "stratos.admin.password";
-    public static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
-    public static final String SCALING_DROOL_FILE = "scaling.drl";
-    public static final String JNDI_PROPERTIES_FILE = "jndi.properties";
-    public static final String JMS_OUTPUT_ADAPTER_FILE = "JMSOutputAdaptor.xml";
-
-    protected String distributionName;
-    protected int portOffset;
-    protected String adminUsername;
-    protected String adminPassword;
-    protected String stratosEndpoint;
-    protected String activemqBindAddress;
+
+    private final static String CARBON_ZIP = SampleApplicationsTest.class.getResource("/").getPath() +
+            "/../../../distribution/target/apache-stratos-4.2.0-SNAPSHOT.zip";
+    private final static int PORT_OFFSET = 0;
+    private static final String ACTIVEMQ_BIND_ADDRESS = "tcp://localhost:61617";
+    private static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
+    private static final String SCALING_DROOL_FILE = "scaling.drl";
+    private static final String JNDI_PROPERTIES_FILE = "jndi.properties";
+    private static final String JMS_OUTPUT_ADAPTER_FILE = "JMSOutputAdaptor.xml";
     protected RestClient restClient;
     private BrokerService broker = new BrokerService();
     private TestLogAppender testLogAppender = new TestLogAppender();

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/modules/p2-profile-gen/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/p2-profile-gen/pom.xml b/products/stratos/modules/p2-profile-gen/pom.xml
index 3f4be61..1fce144 100644
--- a/products/stratos/modules/p2-profile-gen/pom.xml
+++ b/products/stratos/modules/p2-profile-gen/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/products/stratos/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos/pom.xml b/products/stratos/pom.xml
index 5306ba6..406f737 100755
--- a/products/stratos/pom.xml
+++ b/products/stratos/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-products-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/samples/cartridges/kubernetes/esb.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/esb.json b/samples/cartridges/kubernetes/esb.json
index 75a7c21..0c145c1 100755
--- a/samples/cartridges/kubernetes/esb.json
+++ b/samples/cartridges/kubernetes/esb.json
@@ -22,7 +22,7 @@
     "iaasProvider": [
         {
             "type": "kubernetes",
-            "imageId": "stratos/cartridge:4.1.2",
+            "imageId": "stratos/cartridge:4.2.0",
             "networkInterfaces": [
                 {
                     "networkUuid": ""

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/samples/cartridges/kubernetes/php.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/php.json b/samples/cartridges/kubernetes/php.json
index 7c4aeae..6fa8399 100755
--- a/samples/cartridges/kubernetes/php.json
+++ b/samples/cartridges/kubernetes/php.json
@@ -23,7 +23,7 @@
     "iaasProvider": [
         {
             "type": "kubernetes",
-            "imageId": "stratos/php:4.1.2",
+            "imageId": "stratos/php:4.2.0",
             "networkInterfaces": [
             ],
             "property": [

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/samples/cartridges/kubernetes/tomcat.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/tomcat.json b/samples/cartridges/kubernetes/tomcat.json
index e50de25..b161e75 100755
--- a/samples/cartridges/kubernetes/tomcat.json
+++ b/samples/cartridges/kubernetes/tomcat.json
@@ -23,7 +23,7 @@
     "iaasProvider": [
         {
             "type": "kubernetes",
-            "imageId": "stratos/tomcat:4.1.2",
+            "imageId": "stratos/tomcat:4.2.0",
             "networkInterfaces": [
             ],
             "property": [

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/samples/cartridges/kubernetes/tomcat1.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/tomcat1.json b/samples/cartridges/kubernetes/tomcat1.json
index a79b1a8..4942792 100755
--- a/samples/cartridges/kubernetes/tomcat1.json
+++ b/samples/cartridges/kubernetes/tomcat1.json
@@ -22,7 +22,7 @@
     "iaasProvider": [
         {
             "type": "kubernetes",
-            "imageId": "stratos/cartridge:4.1.2",
+            "imageId": "stratos/cartridge:4.2.0",
             "networkInterfaces": [
                 {
                     "networkUuid": ""

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/samples/cartridges/kubernetes/tomcat2.json
----------------------------------------------------------------------
diff --git a/samples/cartridges/kubernetes/tomcat2.json b/samples/cartridges/kubernetes/tomcat2.json
index 8701122..dece175 100755
--- a/samples/cartridges/kubernetes/tomcat2.json
+++ b/samples/cartridges/kubernetes/tomcat2.json
@@ -22,7 +22,7 @@
     "iaasProvider": [
         {
             "type": "kubernetes",
-            "imageId": "stratos/cartridge:4.1.2",
+            "imageId": "stratos/cartridge:4.2.0",
             "networkInterfaces": [
                 {
                     "networkUuid": ""

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml b/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml
index ce0413a..94a4a91 100644
--- a/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml
+++ b/service-stubs/org.apache.stratos.autoscaler.service.stub/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-service-stubs-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.autoscaler.service.stub</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml b/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml
index 07c8d4c..55e7d3e 100644
--- a/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml
+++ b/service-stubs/org.apache.stratos.cloud.controller.service.stub/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-service-stubs-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.cloud.controller.service.stub</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/service-stubs/org.apache.stratos.manager.service.stub/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.manager.service.stub/pom.xml b/service-stubs/org.apache.stratos.manager.service.stub/pom.xml
index 8e94747..768b5f0 100644
--- a/service-stubs/org.apache.stratos.manager.service.stub/pom.xml
+++ b/service-stubs/org.apache.stratos.manager.service.stub/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-service-stubs-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>org.apache.stratos.manager.service.stub</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/service-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/pom.xml b/service-stubs/pom.xml
index f620b91..b3623ee 100644
--- a/service-stubs/pom.xml
+++ b/service-stubs/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>stratos-service-stubs-parent</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/config-scripts/ec2/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/ec2/config.sh b/tools/config-scripts/ec2/config.sh
index 7588777..21b43de 100755
--- a/tools/config-scripts/ec2/config.sh
+++ b/tools/config-scripts/ec2/config.sh
@@ -33,6 +33,7 @@ CP=`which cp`
 MV=`which mv`
 
 HOSTSFILE=/etc/hosts
+LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.2.0/wso2carbon.lck
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/config-scripts/gce/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/gce/config.sh b/tools/config-scripts/gce/config.sh
index 95eb6e0..c8b8ee2 100644
--- a/tools/config-scripts/gce/config.sh
+++ b/tools/config-scripts/gce/config.sh
@@ -36,6 +36,7 @@ CURL=`which curl`
 HOSTSFILE=/etc/hosts
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
+LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.2.0/wso2carbon.lck
 
 function valid_ip()
 {

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/config-scripts/openstack/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/openstack/config.sh b/tools/config-scripts/openstack/config.sh
index 7588777..21b43de 100755
--- a/tools/config-scripts/openstack/config.sh
+++ b/tools/config-scripts/openstack/config.sh
@@ -33,6 +33,7 @@ CP=`which cp`
 MV=`which mv`
 
 HOSTSFILE=/etc/hosts
+LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.2.0/wso2carbon.lck
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/base-image/Dockerfile b/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
index 7076fae..50bd112 100644
--- a/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
@@ -49,13 +49,13 @@ RUN pip install yapsy
 # -------------------------
 WORKDIR /mnt/
 
-ADD packs/${PCA_DISTRIBUTION_NAME}.zip /mnt/${PCA_DISTRIBUTION_NAME}.zip
-RUN unzip -q /mnt/${PCA_DISTRIBUTION_NAME}.zip -d /mnt/
-RUN rm /mnt/${PCA_DISTRIBUTION_NAME}.zip
+ADD packs/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
+RUN unzip -q /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip -d /mnt/
+RUN rm /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
 
-RUN mkdir -p /mnt/${PCA_DISTRIBUTION_NAME}/payload
+RUN mkdir -p /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT/payload
 
-RUN chmod +x /mnt/${PCA_DISTRIBUTION_NAME}/extensions/bash/*
+RUN chmod +x /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT/extensions/bash/*
 RUN mkdir -p /var/log/apache-stratos/
 RUN touch /var/log/apache-stratos/cartridge-agent-extensions.log
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/base-image/files/run
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/base-image/files/run b/tools/docker-images/cartridge-docker-images/base-image/files/run
index 96fd23f..18e8932 100755
--- a/tools/docker-images/cartridge-docker-images/base-image/files/run
+++ b/tools/docker-images/cartridge-docker-images/base-image/files/run
@@ -26,7 +26,7 @@
 
 source /root/.bashrc
 
-export STRATOS_VERSION="4.1.2"
+export STRATOS_VERSION="4.2.0-SNAPSHOT"
 export PCA_HOME="/mnt/apache-stratos-python-cartridge-agent-${STRATOS_VERSION}"
 
 set -o posix ; set | sed -e ':a;N;$!ba;s/\n/,/g' > ${PCA_HOME}/payload/launch-params

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/build.sh
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/build.sh b/tools/docker-images/cartridge-docker-images/build.sh
index 6c809ad..af6efa5 100755
--- a/tools/docker-images/cartridge-docker-images/build.sh
+++ b/tools/docker-images/cartridge-docker-images/build.sh
@@ -26,17 +26,17 @@ pca_distribution_path=`cd "$script_path/../../../products/python-cartridge-agent
 
 pushd ${pca_distribution_path}
 mvn clean install -Dmaven.test.skip=true
-cp -vf target/apache-stratos-python-cartridge-agent-4.1.2.zip ${script_path}/base-image/packs/
+cp -vf target/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip ${script_path}/base-image/packs/
 popd
 
 pushd ${script_path}/base-image/
 echo "Building base Docker image..."
-sudo docker build -t stratos/base-image:4.1.2 .
+sudo docker build -t stratos/base-image:4.2.0 .
 
 pushd ${script_path}/service-images/php
 echo "Building PHP Docker image..."
-sudo docker build -t stratos/php:4.1.2 .
+sudo docker build -t stratos/php:4.2.0 .
 
 pushd ${script_path}/service-images/tomcat
 echo "Building Tomcat Docker image..."
-sudo docker build -t stratos/tomcat:4.1.2 .
+sudo docker build -t stratos/tomcat:4.2.0 .

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile b/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
index 3795e9c..93fdba3 100644
--- a/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
@@ -19,7 +19,7 @@
 #
 # --------------------------------------------------------------
 
-FROM stratos/base-image:4.1.2
+FROM stratos/base-image:4.2.0
 MAINTAINER dev@stratos.apache.org
 
 # ----------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/Dockerfile b/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/Dockerfile
index 5d547f8..fbc0996 100644
--- a/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/service-images/tomcat-saml-sso/Dockerfile
@@ -19,7 +19,7 @@
 #
 # --------------------------------------------------------------
 
-FROM stratos/base-image:4.1.2
+FROM stratos/base-image:4.2.0
 MAINTAINER dev@stratos.apache.org
 
 ENV JDK_VERSION 1.7.0_80

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile b/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
index fd47a81..03b69ad 100644
--- a/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
@@ -19,7 +19,7 @@
 #
 # --------------------------------------------------------------
 
-FROM stratos/base-image:4.1.2
+FROM stratos/base-image:4.2.0
 MAINTAINER dev@stratos.apache.org
 
 ENV JDK_VERSION 1.7.0_80

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/Dockerfile b/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/Dockerfile
index 08ee45c..0925a7b 100644
--- a/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/service-images/wso2is-saml-sso/Dockerfile
@@ -19,7 +19,7 @@
 #
 # --------------------------------------------------------------
 
-FROM stratos/base-image:4.1.2
+FROM stratos/base-image:4.2.0
 MAINTAINER dev@stratos.apache.org
 
 ENV DEBIAN_FRONTEND noninteractive

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/docker-images/stratos-docker-images/run-example.sh
----------------------------------------------------------------------
diff --git a/tools/docker-images/stratos-docker-images/run-example.sh b/tools/docker-images/stratos-docker-images/run-example.sh
index 8a3921d..1201a19 100755
--- a/tools/docker-images/stratos-docker-images/run-example.sh
+++ b/tools/docker-images/stratos-docker-images/run-example.sh
@@ -31,7 +31,7 @@ export DOMAIN=example.com
 export IP_ADDR=192.168.56.5
 
 # Set the version of Stratos docker images
-export STRATOS_VERSION=4.1.2
+export STRATOS_VERSION=4.2.0
 
 ########
 # Bind

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/puppet3/modules/agent/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/files/README.txt b/tools/puppet3/modules/agent/files/README.txt
index c988d4d..7526a8d 100644
--- a/tools/puppet3/modules/agent/files/README.txt
+++ b/tools/puppet3/modules/agent/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-python-cartridge-agent-<java-agent-version>.zip
+>activemq  apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the agent's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/puppet3/modules/haproxy/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/haproxy/files/README.txt b/tools/puppet3/modules/haproxy/files/README.txt
index 0045c1c..d1306c3 100644
--- a/tools/puppet3/modules/haproxy/files/README.txt
+++ b/tools/puppet3/modules/haproxy/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-haproxy-extension-<haproxy-version>.zip
+>activemq  apache-stratos-haproxy-extension-4.2.0-SNAPSHOT.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the haproxy-extension's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/puppet3/modules/lb/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/files/README.txt b/tools/puppet3/modules/lb/files/README.txt
index 90ce24e..3953149 100644
--- a/tools/puppet3/modules/lb/files/README.txt
+++ b/tools/puppet3/modules/lb/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-load-balancer-<load-balancer-version>.zip
+>activemq  apache-stratos-load-balancer-4.2.0-SNAPSHOT.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the load balancer's repository/components/lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/puppet3/modules/python_agent/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/python_agent/files/README.txt b/tools/puppet3/modules/python_agent/files/README.txt
index 163193e..7526a8d 100644
--- a/tools/puppet3/modules/python_agent/files/README.txt
+++ b/tools/puppet3/modules/python_agent/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-python-cartridge-agent-<python-agent-version>.zip
+>activemq  apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the agent's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/stratos-installer/README.md
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/README.md b/tools/stratos-installer/README.md
index b20d146..ee39f98 100644
--- a/tools/stratos-installer/README.md
+++ b/tools/stratos-installer/README.md
@@ -1,8 +1,7 @@
-------------------------------
-Apache Stratos Installer
+Apache Stratos 4.2.0 Installer
 ------------------------------
 
 Stratos-Installer is a tool to install Stratos in Single JVM as well as in distributed setup.
 
 Please refer the following Stratos Wiki page for detailed installation guide:
-https://cwiki.apache.org/confluence/display/STRATOS/4.1.2+Installation+Guide
+https://cwiki.apache.org/confluence/display/STRATOS/4.2.0+Installation+Guide

http://git-wip-us.apache.org/repos/asf/stratos/blob/52f6245e/tools/stratos-installer/conf/setup.conf
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/conf/setup.conf b/tools/stratos-installer/conf/setup.conf
index babab6e..e01185f 100644
--- a/tools/stratos-installer/conf/setup.conf
+++ b/tools/stratos-installer/conf/setup.conf
@@ -55,7 +55,7 @@ export mb_ip="127.0.0.1" # Machine ip on which mb run
 export mb_port=61616 #default port which the message broker service runs
  
 export stratos_extract_path=$stratos_path/"apache-stratos"
-export stratos_pack_zip_name="apache-stratos-4.1.2.zip"
+export stratos_pack_zip_name="apache-stratos-4.2.0-SNAPSHOT.zip"
 export stratos_pack_zip=$stratos_packs/$stratos_pack_zip_name
 
 export activemq_pack=$stratos_packs/"apache-activemq-5.9.1-bin.tar.gz"


[07/50] [abbrv] stratos git commit: Remove the logic to get unstaged_files

Posted by ra...@apache.org.
Remove the logic to get unstaged_files


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/99d5cdc2
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/99d5cdc2
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/99d5cdc2

Branch: refs/heads/master
Commit: 99d5cdc2bdb9226fa19e6752adafb80750f2d4a5
Parents: 57ecc64
Author: gayangunarathne <ga...@wso2.com>
Authored: Wed Aug 26 15:54:29 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Wed Aug 26 15:54:29 2015 +0530

----------------------------------------------------------------------
 .../modules/artifactmgt/git/agentgithandler.py         | 13 +------------
 .../test/PythonCartridgeAgentTest.java                 |  3 ++-
 .../src/test/resources/agent.conf                      |  2 +-
 3 files changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/99d5cdc2/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index ea72266..bc82b35 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -395,18 +395,7 @@ class AgentGitHandler:
 
         if "Changes not staged for commit" in output:
             # there are modified files
-            modified_lines = output.split("\n\n")[2].split("\n")
-            for mod_line in modified_lines:
-                file_name = mod_line.split(":")[1].strip()
-                unstaged_files["modified"].append(file_name)
-
-        if "Untracked files" in output:
-            # there are untracked files
-            untracked_files = output.split("Untracked files:")[1].split("\n\n")[1].split("\n")
-            for unt_line in untracked_files:
-                unstaged_files["untracked"].append(unt_line.strip())
-
-        return True, unstaged_files
+            return True, unstaged_files
 
     @staticmethod
     def stage_all(repo_path):

http://git-wip-us.apache.org/repos/asf/stratos/blob/99d5cdc2/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
index 620e11b..9705228 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
+++ b/components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
@@ -88,7 +88,7 @@ public class PythonCartridgeAgentTest {
     private int cepPort = 7712;
     private BrokerService broker = new BrokerService();
     private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "tcp://localhost:61617";
-    private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "mqtt://localhost:1884";
+    private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "mqtt://localhost:1885";
     private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
 
     public PythonCartridgeAgentTest(ArtifactUpdatedEvent artifactUpdatedEvent, Boolean expectedResult) {
@@ -256,6 +256,7 @@ public class PythonCartridgeAgentTest {
         publicRepoEvent.setClusterId(CLUSTER_ID);
         publicRepoEvent.setTenantId(TENANT_ID);
         publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+        publicRepoEvent.setCommitEnabled(true);
         return publicRepoEvent;
     }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/99d5cdc2/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
index 04f4a0c..136433d 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
+++ b/components/org.apache.stratos.python.cartridge.agent/src/test/resources/agent.conf
@@ -17,7 +17,7 @@
 
 [agent]
 mb.ip                                 =localhost
-mb.port                               =1884
+mb.port                               =1885
 listen.address                        =localhost
 thrift.receiver.ip                    =localhost
 thrift.receiver.port                  =7712


[11/50] [abbrv] stratos git commit: Adding more logs for assertClusterActivation test

Posted by ra...@apache.org.
Adding more logs for assertClusterActivation test


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/4b3491d3
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/4b3491d3
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/4b3491d3

Branch: refs/heads/master
Commit: 4b3491d39fbc5f72ef99d23bb36c6e0317c0acfd
Parents: 6bdde45
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 21:22:05 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 21:22:05 2015 +0530

----------------------------------------------------------------------
 .../integration/tests/TopologyHandler.java       | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4b3491d3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
index 5c911e9..f579718 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
@@ -183,9 +183,8 @@ public class TopologyHandler {
             }
         }
         assertNotNull(String.format("Application is not found: [application-id] %s", applicationName), application);
-        assertEquals(String.format("Application status did not change to %s: [application-id] %s",
-                        status.toString(), applicationName),
-                status, application.getStatus());
+        assertEquals(String.format("Application status did not change to %s: [application-id] %s", status.toString(),
+                applicationName), status, application.getStatus());
     }
 
     /**
@@ -225,9 +224,15 @@ public class TopologyHandler {
             Cluster cluster = service.getCluster(clusterId);
             assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
                     applicationName, serviceName, clusterId), cluster);
+            for (Member member : cluster.getMembers()) {
+                log.info(String.format("Member [member-id] %s found in cluster instance [cluster-instance] %s of " +
+                        "cluster [cluster-id] %s", member
+                        .getMemberId(), member.getClusterInstanceId(), member.getClusterId()));
+            }
             boolean clusterActive = false;
-            int activeInstances = 0;
+            int activeInstances;
             for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
+                log.info("Checking for active members in cluster instance: " + instance.getInstanceId());
                 activeInstances = 0;
                 for (Member member : cluster.getMembers()) {
                     if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
@@ -236,10 +241,10 @@ public class TopologyHandler {
                         }
                     }
                 }
+                clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
+                assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
+                        clusterActive);
             }
-            clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
-            assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
-                    clusterActive);
         }
     }
 


[04/50] [abbrv] stratos git commit: Removing hard coded versions

Posted by ra...@apache.org.
Removing hard coded versions


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/282dd23e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/282dd23e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/282dd23e

Branch: refs/heads/master
Commit: 282dd23e0e05aa1f86a8dfc02e13b24002cd890c
Parents: be8ebd4
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 14:01:43 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 14:01:43 2015 +0530

----------------------------------------------------------------------
 README.md                                                 |  2 +-
 .../org.apache.stratos.manager.console/console/README.md  | 10 ++++------
 .../apache/stratos/rest/endpoint/api/StratosApiV41.java   |  2 +-
 tools/config-scripts/ec2/config.sh                        |  5 -----
 tools/config-scripts/gce/config.sh                        |  4 ----
 tools/config-scripts/openstack/config.sh                  |  5 -----
 tools/puppet3/modules/agent/files/README.txt              |  2 +-
 tools/puppet3/modules/haproxy/files/README.txt            |  2 +-
 tools/puppet3/modules/lb/files/README.txt                 |  2 +-
 tools/puppet3/modules/python_agent/files/README.txt       |  2 +-
 tools/stratos-installer/README.md                         |  3 ++-
 11 files changed, 12 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 68f7131..8550a91 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@ Apache Stratos
 ===========================
 Apache Stratos includes polyglot language and environment support together with the ability to run on top of multiple IaaS runtimes.
 Stratos is licensed under the Apache License, Version 2.0
-The following are the key features available in Apache Stratos 4.1.2:
+The following are the key features available in Apache Stratos:
 
 Features
 --------

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/components/org.apache.stratos.manager.console/console/README.md
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/README.md b/components/org.apache.stratos.manager.console/console/README.md
index c0ce886..d95b1d9 100644
--- a/components/org.apache.stratos.manager.console/console/README.md
+++ b/components/org.apache.stratos.manager.console/console/README.md
@@ -1,14 +1,12 @@
-##Stratos 4.1.2 New UXD Implemantation##
+====================================
+ Apache Stratos UXD Implemantation
 ====================================
 
-Initial version with improved UXDesigns.
-
-### New Features ###
+### Features ###
 
 1. json-schema support for all form definitions (www.json-schema.org)  [STRATOS-944]
 2. JSON Hyper-Schema based UI form implementation
 3. JSON auto-correct feature
 4. Carbon based user Management
 5. Mobile friendly design
-6. Improved UXD [STRATOS-810]
-7. Include Application and Group Editor
+6. Include Application and Group Editor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 757671a..af0ff89 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -65,7 +65,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Stratos API v4.1 for Stratos 4.1.2 release.
+ * Stratos API v4.1
  */
 @Path("/")
 public class StratosApiV41 extends AbstractApi {

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/config-scripts/ec2/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/ec2/config.sh b/tools/config-scripts/ec2/config.sh
index 89c5873..7588777 100755
--- a/tools/config-scripts/ec2/config.sh
+++ b/tools/config-scripts/ec2/config.sh
@@ -33,7 +33,6 @@ CP=`which cp`
 MV=`which mv`
 
 HOSTSFILE=/etc/hosts
-LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.1.2/wso2carbon.lck
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 
@@ -89,10 +88,6 @@ if [[ $answer = y ]] ; then
 	ARGS=("-n${NODEID}" "-d${DOMAIN}" "-s${PUPPET_IP}")
 	${ECHO} "\nRunning puppet installation with arguments: ${ARGS[@]}"
 	/root/bin/puppetinstall/puppetinstall "${ARGS[@]}"
-	#check for java agent lock file
-	if [ -e ${LOCKFILE} ]; then
-	${RM} ${LOCKFILE}
-	fi
 
 	${GREP} -q '/root/bin/init.sh > /tmp/puppet_log' /etc/rc.local || ${SED} -i 's/exit 0$/\/root\/bin\/init.sh \> \/tmp\/puppet_log\nexit 0/' /etc/rc.local
 	${RM} -rf /tmp/*

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/config-scripts/gce/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/gce/config.sh b/tools/config-scripts/gce/config.sh
index d705f12..95eb6e0 100644
--- a/tools/config-scripts/gce/config.sh
+++ b/tools/config-scripts/gce/config.sh
@@ -36,7 +36,6 @@ CURL=`which curl`
 HOSTSFILE=/etc/hosts
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
-LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.1.2/wso2carbon.lck
 
 function valid_ip()
 {
@@ -91,9 +90,6 @@ if [[ $answer = y ]] ; then
 	ARGS=("-n${NODEID}" "-d${DOMAIN}" "-s${PUPPET_IP}")
 	${ECHO} "\nRunning puppet installation with arguments: ${ARGS[@]}"
 	/root/bin/puppetinstall/puppetinstall "${ARGS[@]}"
-	if [ -e ${LOCKFILE} ]; then
-	    ${RM} ${LOCKFILE}
-	fi
 
 	${GREP} -q '/root/bin/init.sh > /tmp/puppet_log' /etc/rc.local || ${SED} -i 's/exit 0$/\/root\/bin\/init.sh \> \/tmp\/puppet_log\nexit 0/' /etc/rc.local
 	${RM} -rf /tmp/*

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/config-scripts/openstack/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/openstack/config.sh b/tools/config-scripts/openstack/config.sh
index b5e4f2a..7588777 100755
--- a/tools/config-scripts/openstack/config.sh
+++ b/tools/config-scripts/openstack/config.sh
@@ -33,7 +33,6 @@ CP=`which cp`
 MV=`which mv`
 
 HOSTSFILE=/etc/hosts
-LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.1.2/wso2carbon.lck
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 
@@ -89,10 +88,6 @@ if [[ $answer = y ]] ; then
 	ARGS=("-n${NODEID}" "-d${DOMAIN}" "-s${PUPPET_IP}")
 	${ECHO} "\nRunning puppet installation with arguments: ${ARGS[@]}"
 	/root/bin/puppetinstall/puppetinstall "${ARGS[@]}"
-	#check for java agent lock file
-	if [ -e ${LOCKFILE} ]; then
-		${RM} ${LOCKFILE}
-	fi
 
 	${GREP} -q '/root/bin/init.sh > /tmp/puppet_log' /etc/rc.local || ${SED} -i 's/exit 0$/\/root\/bin\/init.sh \> \/tmp\/puppet_log\nexit 0/' /etc/rc.local
 	${RM} -rf /tmp/*

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/puppet3/modules/agent/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/files/README.txt b/tools/puppet3/modules/agent/files/README.txt
index 0d5686d..c988d4d 100644
--- a/tools/puppet3/modules/agent/files/README.txt
+++ b/tools/puppet3/modules/agent/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-python-cartridge-agent-4.1.2.zip
+>activemq  apache-stratos-python-cartridge-agent-<java-agent-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the agent's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/puppet3/modules/haproxy/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/haproxy/files/README.txt b/tools/puppet3/modules/haproxy/files/README.txt
index 834a1df..0045c1c 100644
--- a/tools/puppet3/modules/haproxy/files/README.txt
+++ b/tools/puppet3/modules/haproxy/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-haproxy-extension-4.1.2.zip
+>activemq  apache-stratos-haproxy-extension-<haproxy-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the haproxy-extension's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/puppet3/modules/lb/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/files/README.txt b/tools/puppet3/modules/lb/files/README.txt
index 72bca56..90ce24e 100644
--- a/tools/puppet3/modules/lb/files/README.txt
+++ b/tools/puppet3/modules/lb/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-load-balancer-4.1.2.zip
+>activemq  apache-stratos-load-balancer-<load-balancer-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the load balancer's repository/components/lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/puppet3/modules/python_agent/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/python_agent/files/README.txt b/tools/puppet3/modules/python_agent/files/README.txt
index 0d5686d..163193e 100644
--- a/tools/puppet3/modules/python_agent/files/README.txt
+++ b/tools/puppet3/modules/python_agent/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-python-cartridge-agent-4.1.2.zip
+>activemq  apache-stratos-python-cartridge-agent-<python-agent-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the agent's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/282dd23e/tools/stratos-installer/README.md
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/README.md b/tools/stratos-installer/README.md
index 11f6699..b20d146 100644
--- a/tools/stratos-installer/README.md
+++ b/tools/stratos-installer/README.md
@@ -1,4 +1,5 @@
-Apache Stratos 4.1.2 Installer
+------------------------------
+Apache Stratos Installer
 ------------------------------
 
 Stratos-Installer is a tool to install Stratos in Single JVM as well as in distributed setup.


[10/50] [abbrv] stratos git commit: Fix cluster activation assertion in Stratos integration tests

Posted by ra...@apache.org.
Fix cluster activation assertion in Stratos integration tests


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/6bdde45e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6bdde45e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6bdde45e

Branch: refs/heads/master
Commit: 6bdde45e9d48f350a84168a00dec989572b307a1
Parents: d72139d
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 19:51:22 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 19:51:22 2015 +0530

----------------------------------------------------------------------
 .../stratos/integration/tests/TopologyHandler.java   | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/6bdde45e/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
index 85f7817..5c911e9 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
@@ -226,9 +226,9 @@ public class TopologyHandler {
             assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
                     applicationName, serviceName, clusterId), cluster);
             boolean clusterActive = false;
-
+            int activeInstances = 0;
             for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
-                int activeInstances = 0;
+                activeInstances = 0;
                 for (Member member : cluster.getMembers()) {
                     if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
                         if (member.getStatus().equals(MemberStatus.Active)) {
@@ -236,16 +236,11 @@ public class TopologyHandler {
                         }
                     }
                 }
-                clusterActive = activeInstances >= clusterDataHolder.getMinInstances();
-
-                if (!clusterActive) {
-                    break;
-                }
             }
-            assertEquals(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
-                    clusterActive, true);
+            clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
+            assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
+                    clusterActive);
         }
-
     }
 
     /**


[02/50] [abbrv] stratos git commit: Removing ApplicationManager references in autoscaler component. AS should always refer to ApplicationHolder

Posted by ra...@apache.org.
Removing ApplicationManager references in autoscaler component. AS should always refer to ApplicationHolder


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b778c6dc
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b778c6dc
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b778c6dc

Branch: refs/heads/master
Commit: b778c6dcbda964933e99b9d00c7c62b9d7512875
Parents: 57ecc64
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 12:28:00 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 12:28:00 2015 +0530

----------------------------------------------------------------------
 .../services/impl/AutoscalerServiceImpl.java    | 148 ++++++++++++-------
 1 file changed, 91 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b778c6dc/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
index f0e797f..3ccd970 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/services/impl/AutoscalerServiceImpl.java
@@ -25,13 +25,7 @@ import org.apache.stratos.autoscaler.algorithms.networkpartition.NetworkPartitio
 import org.apache.stratos.autoscaler.applications.ApplicationHolder;
 import org.apache.stratos.autoscaler.applications.parser.ApplicationParser;
 import org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser;
-import org.apache.stratos.autoscaler.applications.pojo.ApplicationClusterContext;
-import org.apache.stratos.autoscaler.applications.pojo.ApplicationContext;
-import org.apache.stratos.autoscaler.applications.pojo.ArtifactRepositoryContext;
-import org.apache.stratos.autoscaler.applications.pojo.CartridgeContext;
-import org.apache.stratos.autoscaler.applications.pojo.ComponentContext;
-import org.apache.stratos.autoscaler.applications.pojo.GroupContext;
-import org.apache.stratos.autoscaler.applications.pojo.SubscribableInfoContext;
+import org.apache.stratos.autoscaler.applications.pojo.*;
 import org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder;
 import org.apache.stratos.autoscaler.client.AutoscalerCloudControllerClient;
 import org.apache.stratos.autoscaler.context.AutoscalerContext;
@@ -44,7 +38,6 @@ import org.apache.stratos.autoscaler.exception.*;
 import org.apache.stratos.autoscaler.exception.application.ApplicationDefinitionException;
 import org.apache.stratos.autoscaler.exception.application.InvalidApplicationPolicyException;
 import org.apache.stratos.autoscaler.exception.application.InvalidServiceGroupException;
-import org.apache.stratos.autoscaler.exception.CartridgeNotFoundException;
 import org.apache.stratos.autoscaler.exception.policy.*;
 import org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor;
 import org.apache.stratos.autoscaler.monitor.component.ApplicationMonitor;
@@ -76,7 +69,6 @@ import org.apache.stratos.messaging.domain.application.ClusterDataHolder;
 import org.apache.stratos.messaging.domain.instance.ClusterInstance;
 import org.apache.stratos.messaging.domain.topology.Cluster;
 import org.apache.stratos.messaging.domain.topology.Member;
-import org.apache.stratos.messaging.message.receiver.application.ApplicationManager;
 import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
 import org.wso2.carbon.registry.api.RegistryException;
 
@@ -165,8 +157,9 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         }
 
         if (AutoscalerContext.getInstance().getApplicationContext(applicationId) == null) {
-            String message = "Application is not found as ApplicationContext. Please add application before updating it: " +
-                    "[application-id] " + applicationId;
+            String message =
+                    "Application is not found as ApplicationContext. Please add application before updating it: " +
+                            "[application-id] " + applicationId;
             log.error(message);
             throw new ApplicationDefinitionException(message);
         }
@@ -251,7 +244,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                 application = ApplicationHolder.getApplications().getApplication(applicationId);
                 application.setApplicationPolicyId(applicationPolicyId);
                 ApplicationHolder.persistApplication(application);
-            } finally {
+            }
+            finally {
                 ApplicationHolder.releaseWriteLock();
             }
 
@@ -276,7 +270,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                     applicationId);
 
             return true;
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             ApplicationContext applicationContext = RegistryManager.getInstance().
                     getApplicationContext(applicationId);
             if (applicationContext != null) {
@@ -357,8 +352,10 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                             applicationContext.getApplicationId()));
                 }
             }
-        } catch (Exception e) {
-            String message = "Could not add application signup: [application-id]" + applicationContext.getApplicationId();
+        }
+        catch (Exception e) {
+            String message =
+                    "Could not add application signup: [application-id]" + applicationContext.getApplicationId();
             log.error(message, e);
             throw new RuntimeException(message, e);
         }
@@ -396,7 +393,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
 
             StratosManagerServiceClient serviceClient = StratosManagerServiceClient.getInstance();
 
-            ApplicationSignUp applicationSignUp[] = serviceClient.getApplicationSignUps(applicationContext.getApplicationId());
+            ApplicationSignUp applicationSignUp[] =
+                    serviceClient.getApplicationSignUps(applicationContext.getApplicationId());
             if (applicationSignUp != null) {
                 for (ApplicationSignUp appSignUp : applicationSignUp) {
                     if (appSignUp != null) {
@@ -405,7 +403,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                 }
             }
 
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not remove application signup(s)";
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -437,7 +436,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         }
     }
 
-    private void updateArtifactRepositoryList(List<ArtifactRepository> artifactRepositoryList, CartridgeContext[] cartridgeContexts) {
+    private void updateArtifactRepositoryList(List<ArtifactRepository> artifactRepositoryList,
+                                              CartridgeContext[] cartridgeContexts) {
 
         if (cartridgeContexts == null) {
             return;
@@ -445,7 +445,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
 
         for (CartridgeContext cartridgeContext : cartridgeContexts) {
             SubscribableInfoContext subscribableInfoContext = cartridgeContext.getSubscribableInfoContext();
-            ArtifactRepositoryContext artifactRepositoryContext = subscribableInfoContext.getArtifactRepositoryContext();
+            ArtifactRepositoryContext artifactRepositoryContext =
+                    subscribableInfoContext.getArtifactRepositoryContext();
             if (artifactRepositoryContext != null) {
 
                 ArtifactRepository artifactRepository = new ArtifactRepository();
@@ -536,7 +537,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
             if (log.isInfoEnabled()) {
                 log.info("Application undeployment process started: [application-id] " + applicationId);
             }
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not start application undeployment process: [application-id] " + applicationId;
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -546,7 +548,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
     @Override
     public boolean deleteApplication(String applicationId) {
         try {
-            ApplicationContext applicationContext = AutoscalerContext.getInstance().getApplicationContext(applicationId);
+            ApplicationContext applicationContext =
+                    AutoscalerContext.getInstance().getApplicationContext(applicationId);
             Application application = ApplicationHolder.getApplications().getApplication(applicationId);
             if ((applicationContext == null) || (application == null)) {
                 String msg = String.format("Application cannot be deleted, application not found: [application-id] %s",
@@ -570,7 +573,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
 
             ApplicationBuilder.handleApplicationRemoval(applicationId);
             log.info(String.format("Application deleted successfully: [application-id] %s", applicationId));
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = String.format("Could not delete application: [application-id] %s", applicationId);
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -714,7 +718,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
 
         try {
             RegistryManager.getInstance().updateServiceGroup(cartridgeGroup);
-        } catch (org.wso2.carbon.registry.core.exceptions.RegistryException e) {
+        }
+        catch (org.wso2.carbon.registry.core.exceptions.RegistryException e) {
             String message = (String.format("Cannot update cartridge group: [group-name] %s",
                     cartridgeGroup.getName()));
             throw new RuntimeException(message, e);
@@ -745,7 +750,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                 }
                 throw new CartridgeGroupNotFoundException(msg);
             }
-        } catch (org.wso2.carbon.registry.core.exceptions.RegistryException e) {
+        }
+        catch (org.wso2.carbon.registry.core.exceptions.RegistryException e) {
             String message = "Could not remove cartridge group: " + groupName;
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -759,15 +765,17 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         }
         try {
             return RegistryManager.getInstance().getServiceGroup(name);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             throw new AutoScalerException("Error occurred while retrieving cartridge group", e);
         }
     }
 
     @Override
     public String findClusterId(String applicationId, String alias) {
+        ApplicationHolder.acquireReadLock();
         try {
-            Application application = ApplicationManager.getApplications().getApplication(applicationId);
+            Application application = ApplicationHolder.getApplications().getApplication(applicationId);
             if (application != null) {
 
                 ClusterDataHolder clusterData = application.getClusterDataHolderRecursivelyByAlias(alias);
@@ -776,11 +784,15 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                 }
             }
             return null;
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = String.format("Could not find cluster id: [application-id] %s [alias] %s",
                     applicationId, alias);
             throw new AutoScalerException(message, e);
         }
+        finally {
+            ApplicationHolder.releaseReadLock();
+        }
     }
 
     public ServiceGroup[] getServiceGroups() throws AutoScalerException {
@@ -794,7 +806,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
     public boolean undeployServiceGroup(String name) throws AutoScalerException {
         try {
             RegistryManager.getInstance().removeServiceGroup(name);
-        } catch (RegistryException e) {
+        }
+        catch (RegistryException e) {
             throw new AutoScalerException("Error occurred while removing the cartridge groups", e);
         }
         return true;
@@ -842,7 +855,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
     }
 
     @Override
-    public boolean removeApplicationPolicy(String applicationPolicyId) throws InvalidPolicyException, UnremovablePolicyException {
+    public boolean removeApplicationPolicy(String applicationPolicyId)
+            throws InvalidPolicyException, UnremovablePolicyException {
 
         if (removableApplicationPolicy(applicationPolicyId)) {
             return PolicyManager.getInstance().removeApplicationPolicy(applicationPolicyId);
@@ -873,9 +887,11 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         }
 
         String applicationPolicyId = applicationPolicy.getId();
-        ApplicationPolicy existingApplicationPolicy = PolicyManager.getInstance().getApplicationPolicy(applicationPolicyId);
+        ApplicationPolicy existingApplicationPolicy =
+                PolicyManager.getInstance().getApplicationPolicy(applicationPolicyId);
         if (existingApplicationPolicy == null) {
-            String msg = String.format("No such application policy found [application-policy-id] %s", applicationPolicyId);
+            String msg =
+                    String.format("No such application policy found [application-policy-id] %s", applicationPolicyId);
             log.error(msg);
             throw new ApplicatioinPolicyNotExistsException(msg);
         }
@@ -899,16 +915,17 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         }
 
         Application application;
+        ApplicationHolder.acquireReadLock();
         try {
-            ApplicationManager.acquireReadLockForApplication(applicationId);
-            application = ApplicationManager.getApplications().getApplication(applicationId);
+            application = ApplicationHolder.getApplications().getApplication(applicationId);
             if (application == null) {
                 log.warn(String.format("Could not find application, thus no members to be terminated " +
                         "[application-id] %s", applicationId));
                 return;
             }
-        } finally {
-            ApplicationManager.releaseReadLockForApplication(applicationId);
+        }
+        finally {
+            ApplicationHolder.releaseReadLock();
         }
 
         Set<ClusterDataHolder> allClusters = application.getClusterDataRecursively();
@@ -920,7 +937,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
             try {
                 TopologyManager.acquireReadLockForCluster(serviceType, clusterId);
                 cluster = TopologyManager.getTopology().getService(serviceType).getCluster(clusterId);
-            } finally {
+            }
+            finally {
                 TopologyManager.releaseReadLockForCluster(serviceType, clusterId);
             }
 
@@ -950,12 +968,15 @@ public class AutoscalerServiceImpl implements AutoscalerService {
 
                 for (String memberIdToTerminate : memberListToTerminate) {
                     try {
-                        log.info(String.format("Terminating member forcefully [member-id] %s of the cluster [cluster-id] %s " +
-                                "[application-id] %s", memberIdToTerminate, clusterId, application));
+                        log.info(String.format(
+                                "Terminating member forcefully [member-id] %s of the cluster [cluster-id] %s " +
+                                        "[application-id] %s", memberIdToTerminate, clusterId, application));
                         AutoscalerCloudControllerClient.getInstance().terminateInstanceForcefully(memberIdToTerminate);
-                    } catch (Exception e) {
-                        log.error(String.format("Forceful termination of member %s has failed, but continuing forceful " +
-                                "deletion of other members", memberIdToTerminate));
+                    }
+                    catch (Exception e) {
+                        log.error(
+                                String.format("Forceful termination of member %s has failed, but continuing forceful " +
+                                        "deletion of other members", memberIdToTerminate));
                     }
                 }
             }
@@ -1016,7 +1037,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         }
 
         // deployment policy should contain at least one network partition reference
-        if (null == deploymentPolicy.getNetworkPartitionRefs() || deploymentPolicy.getNetworkPartitionRefs().length == 0) {
+        if (null == deploymentPolicy.getNetworkPartitionRefs() ||
+                deploymentPolicy.getNetworkPartitionRefs().length == 0) {
             String msg = String.format("Deployment policy does not have any network partition references: " +
                     "[deployment-policy-id] %s", deploymentPolicyId);
             log.error(msg);
@@ -1088,7 +1110,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
             PartitionRef[] partitions = networkPartitionRef.getPartitionRefs();
             if (null == partitions || partitions.length == 0) {
                 String msg = String.format("Network partition does not have any partition references: "
-                        + "[deployment-policy-id] %s [network-partition-id] %s", deploymentPolicyId, networkPartitionId);
+                        + "[deployment-policy-id] %s [network-partition-id] %s", deploymentPolicyId,
+                        networkPartitionId);
                 log.error(msg);
                 throw new InvalidDeploymentPolicyException(msg);
             }
@@ -1097,7 +1120,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
 
     @Override
     public boolean updateDeploymentPolicy(DeploymentPolicy deploymentPolicy) throws RemoteException,
-            InvalidDeploymentPolicyException, DeploymentPolicyNotExistsException, InvalidPolicyException, CloudControllerConnectionException {
+            InvalidDeploymentPolicyException, DeploymentPolicyNotExistsException, InvalidPolicyException,
+            CloudControllerConnectionException {
 
         validateDeploymentPolicy(deploymentPolicy);
 
@@ -1137,24 +1161,30 @@ public class AutoscalerServiceImpl implements AutoscalerService {
                     if (clusterLevelNetworkPartitionContext != null) {
                         try {
                             addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition,
-                                    deploymentPolicy.getDeploymentPolicyID(), clusterMonitor.getClusterContext().getServiceId());
-                        } catch (RemoteException e) {
+                                    deploymentPolicy.getDeploymentPolicyID(),
+                                    clusterMonitor.getClusterContext().getServiceId());
+                        }
+                        catch (RemoteException e) {
 
-                            String message = "Connection to cloud controller failed, Cluster monitor update failed for" +
-                                    " [deployment-policy] " + deploymentPolicy.getDeploymentPolicyID();
+                            String message =
+                                    "Connection to cloud controller failed, Cluster monitor update failed for" +
+                                            " [deployment-policy] " + deploymentPolicy.getDeploymentPolicyID();
                             log.error(message);
                             throw new CloudControllerConnectionException(message, e);
-                        } catch (CloudControllerServiceInvalidPartitionExceptionException e) {
+                        }
+                        catch (CloudControllerServiceInvalidPartitionExceptionException e) {
 
                             String message = "Invalid partition, Cluster monitor update failed for [deployment-policy] "
                                     + deploymentPolicy.getDeploymentPolicyID();
                             log.error(message);
                             throw new InvalidDeploymentPolicyException(message, e);
-                        } catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
+                        }
+                        catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
 
-                            String message = "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
-                                    + deploymentPolicy.getDeploymentPolicyID() + " [cartridge] "
-                                    + clusterMonitor.getClusterContext().getServiceId();
+                            String message =
+                                    "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
+                                            + deploymentPolicy.getDeploymentPolicyID() + " [cartridge] "
+                                            + clusterMonitor.getClusterContext().getServiceId();
                             log.error(message);
                             throw new InvalidDeploymentPolicyException(message, e);
                         }
@@ -1168,17 +1198,20 @@ public class AutoscalerServiceImpl implements AutoscalerService {
     private void removeOldPartitionsFromClusterMonitor(NetworkPartitionContext clusterLevelNetworkPartitionContext,
                                                        NetworkPartitionRef networkPartition) {
 
-        for (InstanceContext instanceContext : clusterLevelNetworkPartitionContext.getInstanceIdToInstanceContextMap().values()) {
+        for (InstanceContext instanceContext : clusterLevelNetworkPartitionContext.getInstanceIdToInstanceContextMap()
+                .values()) {
 
             ClusterInstanceContext clusterInstanceContext = (ClusterInstanceContext) instanceContext;
 
-            for (ClusterLevelPartitionContext clusterLevelPartitionContext : clusterInstanceContext.getPartitionCtxts()) {
+            for (ClusterLevelPartitionContext clusterLevelPartitionContext : clusterInstanceContext
+                    .getPartitionCtxts()) {
 
                 if (null == networkPartition.getPartitionRef(clusterLevelPartitionContext.getPartitionId())) {
 
                     //It has found that this partition context which is in cluster monitor is removed in updated policy
                     clusterLevelPartitionContext.setIsObsoletePartition(true);
-                    Iterator<MemberContext> memberContextIterator = clusterLevelPartitionContext.getActiveMembers().iterator();
+                    Iterator<MemberContext> memberContextIterator =
+                            clusterLevelPartitionContext.getActiveMembers().iterator();
                     while (memberContextIterator.hasNext()) {
 
                         clusterLevelPartitionContext.moveActiveMemberToTerminationPendingMembers(
@@ -1265,7 +1298,8 @@ public class AutoscalerServiceImpl implements AutoscalerService {
         try {
             Collection<DeploymentPolicy> deploymentPolicies = PolicyManager.getInstance().getDeploymentPolicies();
             return deploymentPolicies.toArray(new DeploymentPolicy[deploymentPolicies.size()]);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not get deployment policies";
             log.error(message);
             throw new AutoScalerException(message, e);


[49/50] [abbrv] stratos git commit: Merging with stratos-4.1.x branch: contains fixes done for 4.1.2-rc1 release

Posted by ra...@apache.org.
Merging with stratos-4.1.x branch: contains fixes done for 4.1.2-rc1 release


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/9b1d2720
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/9b1d2720
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/9b1d2720

Branch: refs/heads/master
Commit: 9b1d272074ece69a35cc3f90933b2e145c1dc4ec
Parents: 52f6245
Author: Akila Perera <ra...@gmail.com>
Authored: Sun Aug 30 23:31:17 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 23:31:17 2015 +0530

----------------------------------------------------------------------
 .../agent/test/JavaCartridgeAgentTest.java      |  5 ++--
 .../console/README.md                           |  2 +-
 .../rest/endpoint/api/StratosApiV41.java        |  2 +-
 extensions/cep/modules/distribution/pom.xml     |  2 +-
 .../cep/modules/stratos-cep-extension/pom.xml   |  2 +-
 extensions/cep/pom.xml                          |  4 +--
 .../modules/haproxy-extension/pom.xml           |  1 +
 .../load-balancer/modules/lvs-extension/pom.xml |  1 +
 .../modules/nginx-extension/pom.xml             |  1 +
 .../python-cartridge-agent/distribution/pom.xml |  1 -
 .../python-cartridge-agent/integration/pom.xml  |  2 +-
 .../stratos-cli/modules/distribution/pom.xml    |  1 +
 products/stratos-cli/pom.xml                    |  1 -
 .../tests/StratosTestServerManager.java         | 28 +++++++++++++-------
 tools/config-scripts/ec2/config.sh              |  2 +-
 tools/config-scripts/gce/config.sh              |  1 -
 tools/config-scripts/openstack/config.sh        |  2 +-
 .../base-image/Dockerfile                       | 12 ++++-----
 tools/puppet3/modules/agent/files/README.txt    |  2 +-
 tools/puppet3/modules/haproxy/files/README.txt  |  2 +-
 tools/puppet3/modules/lb/files/README.txt       |  2 +-
 .../modules/python_agent/files/README.txt       |  2 +-
 tools/stratos-installer/README.md               |  3 ++-
 23 files changed, 47 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
index e78a6e9..7db8f70 100644
--- a/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
+++ b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
@@ -77,7 +77,8 @@ public class JavaCartridgeAgentTest {
     private static final String PARTITION_ID = "partition-1";
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "php";
-    public static final String AGENT_NAME = "apache-stratos-cartridge-agent-4.2.0-SNAPSHOT";
+    public static final String AGENT_NAME = "distribution.name";
+    public static final String AGENT_VERSION = "distribution.version";
     private static HashMap<String, Executor> executorList;
     private static ArrayList<ServerSocket> serverSocketList;
     private final ArtifactUpdatedEvent artifactUpdatedEvent;
@@ -263,7 +264,7 @@ public class JavaCartridgeAgentTest {
             }
 
             log.info("Copying agent jar");
-            String agentJar = "org.apache.stratos.cartridge.agent-4.2.0-SNAPSHOT.jar";
+            String agentJar = "org.apache.stratos.cartridge.agent-" + agentVersion + ".jar";
             String agentJarSource = getResourcesFolderPath() + "/../" + agentJar;
             String agentJarDest = agentHome.getCanonicalPath() + "/lib/" + agentJar;
             FileUtils.copyFile(new File(agentJarSource), new File(agentJarDest));

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/components/org.apache.stratos.manager.console/console/README.md
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/README.md b/components/org.apache.stratos.manager.console/console/README.md
index 583a542..1249ae3 100644
--- a/components/org.apache.stratos.manager.console/console/README.md
+++ b/components/org.apache.stratos.manager.console/console/README.md
@@ -1,4 +1,4 @@
-##Stratos 4.2.0 New UXD Implemantation##
+##Stratos UXD##
 ====================================
 
 ### Features ###

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 8216d55..af0ff89 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -65,7 +65,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Stratos API v4.1 for Stratos 4.2.0 release.
+ * Stratos API v4.1
  */
 @Path("/")
 public class StratosApiV41 extends AbstractApi {

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/extensions/cep/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/pom.xml b/extensions/cep/modules/distribution/pom.xml
index 276ec40..d22c8a3 100644
--- a/extensions/cep/modules/distribution/pom.xml
+++ b/extensions/cep/modules/distribution/pom.xml
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-extensions</artifactId>
+        <artifactId>cep-extensions</artifactId>
         <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/extensions/cep/modules/stratos-cep-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/pom.xml b/extensions/cep/modules/stratos-cep-extension/pom.xml
index b80d022..7d0a0f0 100644
--- a/extensions/cep/modules/stratos-cep-extension/pom.xml
+++ b/extensions/cep/modules/stratos-cep-extension/pom.xml
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-extensions</artifactId>
+        <artifactId>cep-extensions</artifactId>
         <version>4.2.0-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/extensions/cep/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/pom.xml b/extensions/cep/pom.xml
index 7c82bdf..58bbc49 100644
--- a/extensions/cep/pom.xml
+++ b/extensions/cep/pom.xml
@@ -22,8 +22,8 @@
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-parent</artifactId>
-        <version>4.1.2</version>
+        <artifactId>stratos-extensions</artifactId>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>cep-extensions</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/extensions/load-balancer/modules/haproxy-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/pom.xml b/extensions/load-balancer/modules/haproxy-extension/pom.xml
index ecd1af1..5f35e79 100644
--- a/extensions/load-balancer/modules/haproxy-extension/pom.xml
+++ b/extensions/load-balancer/modules/haproxy-extension/pom.xml
@@ -25,6 +25,7 @@
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-load-balancer-extensions</artifactId>
         <version>4.2.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
 
     <artifactId>apache-stratos-haproxy-extension</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/extensions/load-balancer/modules/lvs-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/lvs-extension/pom.xml b/extensions/load-balancer/modules/lvs-extension/pom.xml
index 60c6c7e..b70fd29 100644
--- a/extensions/load-balancer/modules/lvs-extension/pom.xml
+++ b/extensions/load-balancer/modules/lvs-extension/pom.xml
@@ -25,6 +25,7 @@
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-load-balancer-extensions</artifactId>
         <version>4.2.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
 
     <artifactId>apache-stratos-lvs-extension</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/extensions/load-balancer/modules/nginx-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/pom.xml b/extensions/load-balancer/modules/nginx-extension/pom.xml
index 355e371..1c37cd6 100644
--- a/extensions/load-balancer/modules/nginx-extension/pom.xml
+++ b/extensions/load-balancer/modules/nginx-extension/pom.xml
@@ -25,6 +25,7 @@
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-load-balancer-extensions</artifactId>
         <version>4.2.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
 
     <artifactId>apache-stratos-nginx-extension</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/products/python-cartridge-agent/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/pom.xml b/products/python-cartridge-agent/distribution/pom.xml
index f41d891..74d1003 100644
--- a/products/python-cartridge-agent/distribution/pom.xml
+++ b/products/python-cartridge-agent/distribution/pom.xml
@@ -24,7 +24,6 @@
         <groupId>org.apache.stratos</groupId>
         <artifactId>python-cartridge-agent-parent</artifactId>
         <version>4.2.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
     </parent>
 
     <artifactId>python-cartridge-agent-distribution</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
index 9b0922a..b9583b1 100755
--- a/products/python-cartridge-agent/integration/pom.xml
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.stratos</groupId>
         <artifactId>python-cartridge-agent-parent</artifactId>
-        <version>4.1.2</version>
+        <version>4.2.0-SNAPSHOT</version>
     </parent>
 
     <artifactId>python-agent-integration</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/products/stratos-cli/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/pom.xml b/products/stratos-cli/modules/distribution/pom.xml
index 5a967aa..57ba1d9 100644
--- a/products/stratos-cli/modules/distribution/pom.xml
+++ b/products/stratos-cli/modules/distribution/pom.xml
@@ -24,6 +24,7 @@
         <groupId>org.apache.stratos</groupId>
         <artifactId>apache-stratos-cli-parent</artifactId>
         <version>4.2.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
     </parent>
 
     <artifactId>apache-stratos-cli</artifactId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/products/stratos-cli/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/pom.xml b/products/stratos-cli/pom.xml
index 18accfe..a269fd2 100644
--- a/products/stratos-cli/pom.xml
+++ b/products/stratos-cli/pom.xml
@@ -23,7 +23,6 @@
         <groupId>org.apache.stratos</groupId>
         <artifactId>stratos-products-parent</artifactId>
         <version>4.2.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
index 83d333a..ea3d8f9 100755
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
@@ -47,15 +47,25 @@ import static org.testng.Assert.assertNotNull;
  */
 public class StratosTestServerManager extends TestServerManager {
     private static final Log log = LogFactory.getLog(StratosTestServerManager.class);
-
-    private final static String CARBON_ZIP = SampleApplicationsTest.class.getResource("/").getPath() +
-            "/../../../distribution/target/apache-stratos-4.2.0-SNAPSHOT.zip";
-    private final static int PORT_OFFSET = 0;
-    private static final String ACTIVEMQ_BIND_ADDRESS = "tcp://localhost:61617";
-    private static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
-    private static final String SCALING_DROOL_FILE = "scaling.drl";
-    private static final String JNDI_PROPERTIES_FILE = "jndi.properties";
-    private static final String JMS_OUTPUT_ADAPTER_FILE = "JMSOutputAdaptor.xml";
+    private static Properties integrationProperties;
+    public static final String BASE_PATH = StratosTestServerManager.class.getResource("/").getPath();
+    public static final String STRATOS_DISTRIBUTION_NAME = "distribution.path";
+    public final static String PORT_OFFSET = "carbon.port.offset";
+    public static final String ACTIVEMQ_BIND_ADDRESS = "activemq.bind.address";
+    public static final String STRATOS_ENDPOINT = "stratos.endpoint";
+    public static final String ADMIN_USERNAME = "stratos.admin.username";
+    public static final String ADMIN_PASSWORD = "stratos.admin.password";
+    public static final String MOCK_IAAS_XML_FILE = "mock-iaas.xml";
+    public static final String SCALING_DROOL_FILE = "scaling.drl";
+    public static final String JNDI_PROPERTIES_FILE = "jndi.properties";
+    public static final String JMS_OUTPUT_ADAPTER_FILE = "JMSOutputAdaptor.xml";
+
+    protected String distributionName;
+    protected int portOffset;
+    protected String adminUsername;
+    protected String adminPassword;
+    protected String stratosEndpoint;
+    protected String activemqBindAddress;
     protected RestClient restClient;
     private BrokerService broker = new BrokerService();
     private TestLogAppender testLogAppender = new TestLogAppender();

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/config-scripts/ec2/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/ec2/config.sh b/tools/config-scripts/ec2/config.sh
index 21b43de..e981fb8 100755
--- a/tools/config-scripts/ec2/config.sh
+++ b/tools/config-scripts/ec2/config.sh
@@ -33,7 +33,7 @@ CP=`which cp`
 MV=`which mv`
 
 HOSTSFILE=/etc/hosts
-LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.2.0/wso2carbon.lck
+LOCKFILE=/mnt/apache-stratos-cartridge-agent/wso2carbon.lck
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/config-scripts/gce/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/gce/config.sh b/tools/config-scripts/gce/config.sh
index c8b8ee2..95eb6e0 100644
--- a/tools/config-scripts/gce/config.sh
+++ b/tools/config-scripts/gce/config.sh
@@ -36,7 +36,6 @@ CURL=`which curl`
 HOSTSFILE=/etc/hosts
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
-LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.2.0/wso2carbon.lck
 
 function valid_ip()
 {

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/config-scripts/openstack/config.sh
----------------------------------------------------------------------
diff --git a/tools/config-scripts/openstack/config.sh b/tools/config-scripts/openstack/config.sh
index 21b43de..e981fb8 100755
--- a/tools/config-scripts/openstack/config.sh
+++ b/tools/config-scripts/openstack/config.sh
@@ -33,7 +33,7 @@ CP=`which cp`
 MV=`which mv`
 
 HOSTSFILE=/etc/hosts
-LOCKFILE=/mnt/apache-stratos-cartridge-agent-4.2.0/wso2carbon.lck
+LOCKFILE=/mnt/apache-stratos-cartridge-agent/wso2carbon.lck
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/base-image/Dockerfile b/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
index 50bd112..47bf233 100644
--- a/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
@@ -22,7 +22,7 @@
 FROM debian:7.8
 MAINTAINER dev@stratos.apache.org
 
-ENV PCA_DISTRIBUTION_NAME apache-stratos-python-cartridge-agent-4.1.2
+ENV PCA_DISTRIBUTION_NAME apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT
 # ------------------
 # Setup ssh server
 # ------------------
@@ -49,13 +49,13 @@ RUN pip install yapsy
 # -------------------------
 WORKDIR /mnt/
 
-ADD packs/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
-RUN unzip -q /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip -d /mnt/
-RUN rm /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
+ADD packs/${PCA_DISTRIBUTION_NAME}.zip /mnt/${PCA_DISTRIBUTION_NAME}.zip
+RUN unzip -q /mnt/${PCA_DISTRIBUTION_NAME}.zip -d /mnt/
+RUN rm /mnt/${PCA_DISTRIBUTION_NAME}.zip
 
-RUN mkdir -p /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT/payload
+RUN mkdir -p /mnt/${PCA_DISTRIBUTION_NAME}/payload
 
-RUN chmod +x /mnt/apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT/extensions/bash/*
+RUN chmod +x /mnt/${PCA_DISTRIBUTION_NAME}/extensions/bash/*
 RUN mkdir -p /var/log/apache-stratos/
 RUN touch /var/log/apache-stratos/cartridge-agent-extensions.log
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/puppet3/modules/agent/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/files/README.txt b/tools/puppet3/modules/agent/files/README.txt
index 7526a8d..c988d4d 100644
--- a/tools/puppet3/modules/agent/files/README.txt
+++ b/tools/puppet3/modules/agent/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
+>activemq  apache-stratos-python-cartridge-agent-<java-agent-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the agent's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/puppet3/modules/haproxy/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/haproxy/files/README.txt b/tools/puppet3/modules/haproxy/files/README.txt
index d1306c3..0045c1c 100644
--- a/tools/puppet3/modules/haproxy/files/README.txt
+++ b/tools/puppet3/modules/haproxy/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-haproxy-extension-4.2.0-SNAPSHOT.zip
+>activemq  apache-stratos-haproxy-extension-<haproxy-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the haproxy-extension's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/puppet3/modules/lb/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/files/README.txt b/tools/puppet3/modules/lb/files/README.txt
index 3953149..90ce24e 100644
--- a/tools/puppet3/modules/lb/files/README.txt
+++ b/tools/puppet3/modules/lb/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-load-balancer-4.2.0-SNAPSHOT.zip
+>activemq  apache-stratos-load-balancer-<load-balancer-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the load balancer's repository/components/lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/puppet3/modules/python_agent/files/README.txt
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/python_agent/files/README.txt b/tools/puppet3/modules/python_agent/files/README.txt
index 7526a8d..163193e 100644
--- a/tools/puppet3/modules/python_agent/files/README.txt
+++ b/tools/puppet3/modules/python_agent/files/README.txt
@@ -7,6 +7,6 @@ This folder should have following:
 eg:
 if $mb_type = activemq, folder structure of this folder would be:
 >$ls
->activemq  apache-stratos-python-cartridge-agent-4.2.0-SNAPSHOT.zip
+>activemq  apache-stratos-python-cartridge-agent-<python-agent-version>.zip
 
 3. Under $mb_type folder, please add all the client jars, that should be copied to the agent's lib directory.

http://git-wip-us.apache.org/repos/asf/stratos/blob/9b1d2720/tools/stratos-installer/README.md
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/README.md b/tools/stratos-installer/README.md
index ee39f98..61665fe 100644
--- a/tools/stratos-installer/README.md
+++ b/tools/stratos-installer/README.md
@@ -1,4 +1,5 @@
-Apache Stratos 4.2.0 Installer
+------------------------------
+Apache Stratos Installer
 ------------------------------
 
 Stratos-Installer is a tool to install Stratos in Single JVM as well as in distributed setup.


[42/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml b/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
new file mode 100644
index 0000000..0fa4a0a
--- /dev/null
+++ b/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
@@ -0,0 +1,68 @@
+<?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.
+
+-->
+
+<executionPlan name="SecondDerivativeOfHealthRequest"
+  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
+  <description>This will find the second derivative of health stats over a minute.</description>
+  <siddhiConfiguration>
+    <property name="siddhi.enable.distributed.processing">false</property>
+    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+  </siddhiConfiguration>
+  <importedStreams>
+    <stream as="health_second_der_request" name="cartridge_agent_health_stats" version="1.0.0"/>
+  </importedStreams>
+  <queryExpressions><![CDATA[ 
+	 from health_second_der_request
+		select member_id, cluster_id, cluster_instance_id, network_partition_id, health_description, value,
+		stratos:concat(cluster_id, '-' ,cluster_instance_id) as health_second_der_cluster_network
+		insert into health_second_der_concat;
+	define partition health_second_der_cluster_partition  by health_second_der_concat.health_second_der_cluster_network;
+	from health_second_der_concat [health_description == 'memory_consumption'] 
+		#window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_memory_consumption
+		insert into second_derivative_memory_consumption_stats 
+		partition by health_second_der_cluster_partition;
+	from health_second_der_concat [health_description == 'load_average'] 
+		#window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_load_average
+		insert into second_derivative_load_average_stats 
+		partition by health_second_der_cluster_partition;
+	define partition health_second_der_member_partition by health_second_der_request.member_id;
+	from health_second_der_request [health_description == 'memory_consumption'] 
+		#window.stratos:secondDerivative(1 min, value) 
+		select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_memory_consumption
+		insert into member_second_derivative_memory_consumption_stats 
+		partition by health_second_der_member_partition;
+	from health_second_der_request [health_description == 'load_average'] 
+		#window.stratos:secondDerivative(1 min, value)
+		select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_load_average
+		 insert into member_second_derivative_load_average_stats 
+		partition by health_second_der_member_partition;]]></queryExpressions>
+  <exportedStreams>
+    <stream name="second_derivative_memory_consumption_stats"
+      valueOf="second_derivative_memory_consumption_stats" version="1.0.0"/>
+    <stream name="second_derivative_load_average_stats"
+      valueOf="second_derivative_load_average_stats" version="1.0.0"/>
+    <stream name="member_second_derivative_memory_consumption_stats"
+      valueOf="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
+    <stream name="member_second_derivative_load_average_stats"
+      valueOf="member_second_derivative_load_average_stats" version="1.0.0"/>
+  </exportedStreams>
+</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml b/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
new file mode 100644
index 0000000..c8e4ed5
--- /dev/null
+++ b/extensions/cep/modules/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+
+<executionPlan name="SecondDerivativeOfRequestsInFlightFinder"
+  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
+  <description>This will find the second derivative of the number of requests in flight over a minute.</description>
+  <siddhiConfiguration>
+    <property name="siddhi.enable.distributed.processing">false</property>
+    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
+  </siddhiConfiguration>
+  <importedStreams>
+    <stream as="second_der_rif" name="in_flight_requests" version="1.0.0"/>
+  </importedStreams>
+  <queryExpressions><![CDATA[ 
+	from second_der_rif
+		select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
+		stratos:concat(cluster_id, '-' ,network_partition_id) as rif_second_der_cluster_network
+		insert into rif_second_der_concat;
+	define partition rif_second_der_cluster_partition by rif_second_der_concat.rif_second_der_cluster_network;
+	from rif_second_der_concat#window.stratos:secondDerivative(1 min, in_flight_request_count)
+		select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
+		insert into second_derivative_in_flight_requests 
+		partition by rif_second_der_cluster_partition;
+  ]]></queryExpressions>
+  <exportedStreams>
+    <stream name="second_derivative_in_flight_requests"
+            valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
+  </exportedStreams>
+</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml b/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
new file mode 100644
index 0000000..77af463
--- /dev/null
+++ b/extensions/cep/modules/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
@@ -0,0 +1,24 @@
+<?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.
+
+-->
+
+<inputEventAdaptor name="DefaultWSO2EventInputAdaptor"
+  statistics="disable" trace="enable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml b/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
new file mode 100644
index 0000000..4438d2c
--- /dev/null
+++ b/extensions/cep/modules/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
@@ -0,0 +1,29 @@
+<?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.
+
+-->
+
+<outputEventAdaptor name="DefaultWSO2EventOutputAdaptor"
+  statistics="disable" trace="disable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager">
+  <property name="username">admin</property>
+  <property name="receiverURL">tcp://localhost:7661</property>
+  <property name="password">admin</property>
+  <property name="authenticatorURL">ssl://localhost:7761</property>
+</outputEventAdaptor>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml b/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
new file mode 100644
index 0000000..59c3653
--- /dev/null
+++ b/extensions/cep/modules/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+
+<outputEventAdaptor name="JMSOutputAdaptor" statistics="disable"
+  trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
+  <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property-->
+  <property name="java.naming.provider.url">tcp://localhost:61616</property>
+  <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
+  <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
+  <property name="transport.jms.DestinationType">topic</property>
+</outputEventAdaptor>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml b/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
new file mode 100644
index 0000000..4c4c7e0
--- /dev/null
+++ b/extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml
@@ -0,0 +1,309 @@
+<?xml version='1.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.
+
+-->
+
+<streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager">
+    <!-- in-flight requests stream definitions start -->
+    <streamDefinition name="in_flight_requests" version="1.0.0">
+         <description>in-flight request count</description>
+         <nickName>in-flight requests</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="in_flight_request_count" type="double"/>
+         </payloadData>
+     </streamDefinition> 
+
+    <streamDefinition name="gradient_in_flight_requests" version="1.0.0">
+         <description>gradient of in flight request count</description>
+         <nickName>gradient in flight requests</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="count" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="average_in_flight_requests" version="1.0.0">
+         <description>average of in-flight request count</description>
+         <nickName>average in-flight requests</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="count" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="second_derivative_in_flight_requests" version="1.0.0">
+         <description>second derivative of in-flight request count</description>
+         <nickName>second derivative in-flight requests</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="count" type="double"/>
+         </payloadData>
+    </streamDefinition>
+    <!-- in-flight requests stream definitions end -->
+
+    <!-- cartridge agent health stats stream definitions start -->
+    <streamDefinition name="cartridge_agent_health_stats" version="1.0.0">
+         <description>agent health stats</description>
+         <nickName>agent health stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+	         <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_id" type="String" />
+             <property name="partition_id" type="String" />
+             <property name="health_description" type="String"/>
+             <property name="value" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="average_load_average_stats" version="1.0.0">
+         <description>average load average stats</description>
+         <nickName>average load average stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+	     <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="average_load_average" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="average_memory_consumption_stats" version="1.0.0">
+         <description>average memory consumption stats</description>
+         <nickName>average memory consumption stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="average_memory_consumption" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="gradient_load_average_stats" version="1.0.0">
+         <description>gradient load average stats</description>
+         <nickName>gradient load average stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+	     <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="gradient_load_average" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="gradient_memory_consumption_stats" version="1.0.0">
+         <description>gradient memoryconsumption stats</description>
+         <nickName>gradient memoryconsumption stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+	     <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="gradient_memory_consumption" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="second_derivative_memory_consumption_stats" version="1.0.0">
+         <description>second derivative memory consumption stats</description>
+         <nickName>second derivative memory consumption stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+	     <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="second_derivative_memory_consumption" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="second_derivative_load_average_stats" version="1.0.0">
+         <description>second derivative load average stats</description>
+         <nickName>second derivative load average stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+	     <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="second_derivative_load_average" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="fault_message" version="1.0.0">
+         <description>fault message</description>
+         <nickName>fault message</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_id" type="String"/>
+             <property name="partition_id" type="String"/>
+         </payloadData>
+    </streamDefinition>
+    <!-- cartridge agent health stats stream definitions end -->
+
+    <!-- This is for member_id wise grouping-->
+    <streamDefinition name="member_average_load_average_stats" version="1.0.0">
+         <description>average load average stats</description>
+         <nickName>average load average stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="member_id" type="String" />
+             <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_average_load_average" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="member_average_memory_consumption_stats" version="1.0.0">
+         <description>average memory consumption stats</description>
+         <nickName>average memory consumption stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="member_id" type="String"/>
+             <property name="cluster_id" type="String"/>
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_average_memory_consumption" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="member_gradient_load_average_stats" version="1.0.0">
+         <description>gradient load average stats</description>
+         <nickName>gradient load average stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="member_id" type="String" />
+             <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_gradient_load_average" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="member_gradient_memory_consumption_stats" version="1.0.0">
+         <description>gradient memoryconsumption stats</description>
+         <nickName>gradient memoryconsumption stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="member_id" type="String" />
+             <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_gradient_memory_consumption" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="member_second_derivative_memory_consumption_stats" version="1.0.0">
+         <description>second derivative memory consumption stats</description>
+         <nickName>second derivative memory consumption stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="member_id" type="String" />
+             <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_second_derivative_memory_consumption" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+    <streamDefinition name="member_second_derivative_load_average_stats" version="1.0.0">
+         <description>second derivative load average stats</description>
+         <nickName>second derivative load average stats</nickName>
+         <metaData>
+         </metaData>
+         <correlationData>
+         </correlationData>
+         <payloadData>
+             <property name="member_id" type="String" />
+             <property name="cluster_id" type="String" />
+             <property name="cluster_instance_id" type="String"/>
+             <property name="network_partition_id" type="String"/>
+             <property name="member_second_derivative_load_average" type="double"/>
+         </payloadData>
+     </streamDefinition>
+
+</streamManagerConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/distribution/README.md
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/README.md b/extensions/cep/modules/distribution/README.md
new file mode 100755
index 0000000..ebf6bf2
--- /dev/null
+++ b/extensions/cep/modules/distribution/README.md
@@ -0,0 +1,12 @@
+# Apache Stratos CEP Extensions
+
+Apache Stratos Complex Event Processor (CEP) extensions include Window Processors for processing 
+health statistic events. These extensions are available in Stratos binary distribution, in a 
+distributed deployment where CEP is run externally, these extensions need to be deployed manually.
+
+Please refer below link for more information on WSO2 CEP.
+http://wso2.com/products/complex-event-processor/
+
+
+Thank you for using Apache Stratos!
+The Stratos Team
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/pom.xml b/extensions/cep/modules/distribution/pom.xml
new file mode 100644
index 0000000..1fe52f0
--- /dev/null
+++ b/extensions/cep/modules/distribution/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ 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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>cep-extensions</artifactId>
+        <version>4.1.2</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>apache-stratos-cep-artifacts</artifactId>
+    <packaging>pom</packaging>
+    <name>Apache Stratos CEP artifacts</name>
+    <description>Apache Stratos CEP artifacts</description>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>4-dist</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>attached</goal>
+                                </goals>
+                                <configuration>
+                                    <descriptors>
+                                        <descriptor>${basedir}/src/assembly/bin.xml</descriptor>
+                                    </descriptors>
+                                    <appendAssemblyId>false</appendAssemblyId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/src/assembly/bin.xml b/extensions/cep/modules/distribution/src/assembly/bin.xml
new file mode 100755
index 0000000..509a6e2
--- /dev/null
+++ b/extensions/cep/modules/distribution/src/assembly/bin.xml
@@ -0,0 +1,59 @@
+<?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.
+  -->
+<assembly>
+    <id>bin</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>../artifacts/</directory>
+            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <includes>
+                <include>**/*.xml</include>
+            </includes>
+            <excludes>
+                <exclude>pom.xml</exclude>
+                <exclude>src/**</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+    <files>
+        <file>
+            <source>${project.basedir}/README.md</source>
+            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <filtered>true</filtered>
+            <fileMode>644</fileMode>
+        </file>
+        <file>
+            <source>src/main/notice/NOTICE</source>
+            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <filtered>true</filtered>
+            <fileMode>644</fileMode>
+        </file>
+        <file>
+            <source>src/main/license/LICENSE</source>
+            <outputDirectory>${project.artifactId}-${project.version}</outputDirectory>
+            <filtered>true</filtered>
+            <fileMode>644</fileMode>
+        </file>
+    </files>
+</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/src/main/license/LICENSE b/extensions/cep/modules/distribution/src/main/license/LICENSE
new file mode 100644
index 0000000..25202d8
--- /dev/null
+++ b/extensions/cep/modules/distribution/src/main/license/LICENSE
@@ -0,0 +1,204 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+===================================================================================

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/distribution/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/distribution/src/main/notice/NOTICE b/extensions/cep/modules/distribution/src/main/notice/NOTICE
new file mode 100644
index 0000000..46ddddd
--- /dev/null
+++ b/extensions/cep/modules/distribution/src/main/notice/NOTICE
@@ -0,0 +1,7 @@
+Apache Stratos CEP Extensions
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+================================================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/pom.xml b/extensions/cep/modules/stratos-cep-extension/pom.xml
new file mode 100644
index 0000000..1905ed4
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/pom.xml
@@ -0,0 +1,63 @@
+<?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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>cep-extensions</artifactId>
+        <version>4.1.2</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>org.apache.stratos.cep.extension</artifactId>
+    <name>Apache Stratos - CEP Extensions</name>
+    <description>Apache Stratos CEP Extensions</description>
+
+    <repositories>
+        <repository>
+            <id>wso2-maven2-repository</id>
+            <name>WSO2 Maven2 Repository</name>
+            <url>http://dist.wso2.org/maven2</url>
+        </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.wso2.siddhi</groupId>
+            <artifactId>siddhi-core</artifactId>
+            <version>2.0.0-wso2v5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.messaging</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
new file mode 100644
index 0000000..59c70c5
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/CEPTopologyEventReceiver.java
@@ -0,0 +1,99 @@
+/*
+ * 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.cep.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberActivatedEvent;
+import org.apache.stratos.messaging.event.topology.MemberTerminatedEvent;
+import org.apache.stratos.messaging.listener.topology.CompleteTopologyEventListener;
+import org.apache.stratos.messaging.listener.topology.MemberActivatedEventListener;
+import org.apache.stratos.messaging.listener.topology.MemberTerminatedEventListener;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+
+/**
+ * CEP Topology Receiver for Fault Handling Window Processor.
+ */
+public class CEPTopologyEventReceiver extends TopologyEventReceiver {
+
+    private static final Log log = LogFactory.getLog(CEPTopologyEventReceiver.class);
+
+    private FaultHandlingWindowProcessor faultHandler;
+
+    public CEPTopologyEventReceiver(FaultHandlingWindowProcessor faultHandler) {
+        this.faultHandler = faultHandler;
+        addEventListeners();
+    }
+
+    @Override
+    public void execute() {
+        super.execute();
+        log.info("CEP topology event receiver thread started");
+    }
+
+    private void addEventListeners() {
+        // Load member time stamp map from the topology as a one time task
+        addEventListener(new CompleteTopologyEventListener() {
+            private boolean initialized;
+
+            @Override
+            protected void onEvent(Event event) {
+                if (!initialized) {
+                    try {
+                        TopologyManager.acquireReadLock();
+                        log.debug("Complete topology event received to fault handling window processor.");
+                        CompleteTopologyEvent completeTopologyEvent = (CompleteTopologyEvent) event;
+                        initialized = faultHandler.loadTimeStampMapFromTopology(completeTopologyEvent.getTopology());
+                    } catch (Exception e) {
+                        log.error("Error loading member time stamp map from complete topology event.", e);
+                    } finally {
+                        TopologyManager.releaseReadLock();
+                    }
+                }
+            }
+        });
+
+        // Remove member from the time stamp map when MemberTerminated event is received.
+        addEventListener(new MemberTerminatedEventListener() {
+            @Override
+            protected void onEvent(Event event) {
+                MemberTerminatedEvent memberTerminatedEvent = (MemberTerminatedEvent) event;
+                faultHandler.getMemberTimeStampMap().remove(memberTerminatedEvent.getMemberId());
+                log.debug("Member was removed from the timestamp map: [member] " + memberTerminatedEvent.getMemberId());
+            }
+        });
+
+        // Add member to time stamp map whenever member is activated
+        addEventListener(new MemberActivatedEventListener() {
+            @Override
+            protected void onEvent(Event event) {
+                MemberActivatedEvent memberActivatedEvent = (MemberActivatedEvent) event;
+
+                // do not put this member if we have already received a health event
+                faultHandler.getMemberTimeStampMap().putIfAbsent(memberActivatedEvent.getMemberId(),
+                        System.currentTimeMillis());
+                log.debug("Member was added to the timestamp map: [member] " + memberActivatedEvent.getMemberId());
+            }
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
new file mode 100644
index 0000000..699f036
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/ConcatWindowProcessor.java
@@ -0,0 +1,54 @@
+/*
+ *     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.cep.extension;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.executor.function.FunctionExecutor;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+@SiddhiExtension(namespace = "stratos", function = "concat")
+public class ConcatWindowProcessor extends FunctionExecutor {
+    Attribute.Type returnType = Attribute.Type.STRING;
+    @Override
+    public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
+    }
+
+    @Override
+    protected Object process(Object obj) {
+        if (obj instanceof Object[]) {
+            StringBuffer sb=new StringBuffer();
+            for (Object aObj : (Object[]) obj) {
+                sb.append(aObj);
+            }
+            return sb.toString();
+        } else {
+            return obj.toString();
+        }
+
+    }
+
+    @Override
+    public void destroy() {
+    }
+
+    @Override
+    public Attribute.Type getReturnType() {
+        return returnType;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
new file mode 100644
index 0000000..0aa01ed
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/FaultHandlingWindowProcessor.java
@@ -0,0 +1,349 @@
+/*
+ * 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.cep.extension;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.health.stat.MemberFaultEvent;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+import org.apache.stratos.messaging.util.MessagingUtil;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.persistence.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * CEP window processor to handle faulty member instances. This window processor is responsible for
+ * publishing MemberFault event if health stats are not received within a given time window.
+ */
+@SiddhiExtension(namespace = "stratos", function = "faultHandling")
+public class FaultHandlingWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+	private static final Logger log = Logger.getLogger(FaultHandlingWindowProcessor.class);
+
+    private static final int TIME_OUT = 60 * 1000;
+    public static final String CEP_EXTENSION_THREAD_POOL_KEY = "cep.extension.thread.pool";
+    public static final int CEP_EXTENSION_THREAD_POOL_SIZE = 10;
+
+    private ExecutorService executorService;
+    private ScheduledExecutorService faultHandleScheduler;
+    private ScheduledFuture<?> lastSchedule;
+	private ThreadBarrier threadBarrier;
+	private long timeToKeep;
+	private ISchedulerSiddhiQueue<StreamEvent> window;
+	private EventPublisher healthStatPublisher =
+			EventPublisherPool.getPublisher(MessagingUtil.Topics.HEALTH_STAT_TOPIC.getTopicName());
+	private Map<String, Object> MemberFaultEventMap = new HashMap<String, Object>();
+	private Map<String, Object> memberFaultEventMessageMap = new HashMap<String, Object>();
+
+	// Map of member id's to their last received health event time stamp
+	private ConcurrentHashMap<String, Long> memberTimeStampMap = new ConcurrentHashMap<String, Long>();
+
+	// Event receiver to receive topology events published by cloud-controller
+	private CEPTopologyEventReceiver cepTopologyEventReceiver = new CEPTopologyEventReceiver(this);
+
+	// Stratos member id attribute index in stream execution plan
+	private int memberIdAttrIndex;
+
+	@Override
+	protected void processEvent(InEvent event) {
+		addDataToMap(event);
+	}
+
+	@Override
+	protected void processEvent(InListEvent listEvent) {
+		for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+			addDataToMap((InEvent) listEvent.getEvent(i));
+		}
+	}
+
+	/**
+	 * Add new entry to time stamp map from the received event.
+	 *
+	 * @param event Event received by Siddhi.
+	 */
+	protected void addDataToMap(InEvent event) {
+		String id = (String) event.getData()[memberIdAttrIndex];
+		//checking whether this member is the topology.
+		//sometimes there can be a delay between publishing member terminated events
+		//and actually terminating instances. Hence CEP might get events for already terminated members
+		//so we are checking the topology for the member existence
+		Member member = getMemberFromId(id);
+		if (null == member) {
+			log.debug("Member not found in the topology. Event rejected");
+			return;
+		}
+        if (StringUtils.isNotEmpty(id)) {
+            memberTimeStampMap.put(id, event.getTimeStamp());
+        } else {
+            log.warn("NULL member id found in the event received. Event rejected.");
+        }
+        if (log.isDebugEnabled()){
+            log.debug("Event received from [member-id] " + id + " [time-stamp] " + event.getTimeStamp());
+        }
+    }
+
+    @Override
+    public Iterator<StreamEvent> iterator() {
+        return window.iterator();
+    }
+
+    @Override
+    public Iterator<StreamEvent> iterator(String predicate) {
+        if (siddhiContext.isDistributedProcessingEnabled()) {
+            return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+        } else {
+            return window.iterator();
+        }
+    }
+
+    /**
+     *  Retrieve the current activated members from the topology and initialize the timestamp map.
+     *  This will allow the system to recover from a restart
+     *
+     *  @param topology Topology model object
+     */
+    boolean loadTimeStampMapFromTopology(Topology topology){
+
+        long currentTimeStamp = System.currentTimeMillis();
+        if (topology == null || topology.getServices() == null){
+            return false;
+        }
+        // TODO make this efficient by adding APIs to messaging component
+        for (Service service : topology.getServices()) {
+            if (service.getClusters() != null) {
+                for (Cluster cluster : service.getClusters()) {
+                    if (cluster.getMembers() != null) {
+                        for (Member member : cluster.getMembers()) {
+                            // we are checking faulty status only in previously activated members
+                            if (member != null && MemberStatus.Active.equals(member.getStatus())) {
+                                // Initialize the member time stamp map from the topology at the beginning
+                                memberTimeStampMap.putIfAbsent(member.getMemberId(), currentTimeStamp);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        if (log.isDebugEnabled()){
+            log.debug("Member timestamps were successfully loaded from the topology: [timestamps] " +
+                    memberTimeStampMap);
+        }
+        return true;
+    }
+
+    private Member getMemberFromId(String memberId){
+        if (StringUtils.isEmpty(memberId)){
+            return null;
+        }
+        if (TopologyManager.getTopology().isInitialized()){
+        	try {
+                TopologyManager.acquireReadLock();
+                if (TopologyManager.getTopology().getServices() == null){
+                    return null;
+                }
+                // TODO make this efficient by adding APIs to messaging component
+                for (Service service : TopologyManager.getTopology().getServices()) {
+                    if (service.getClusters() != null) {
+                        for (Cluster cluster : service.getClusters()) {
+                            if (cluster.getMembers() != null) {
+                                for (Member member : cluster.getMembers()){
+                                    if (memberId.equals(member.getMemberId())){
+                                        return member;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+        	} catch (Exception e) {
+        		log.error("Error while reading topology" + e);
+        	} finally {
+        		TopologyManager.releaseReadLock();
+        	}
+        }
+        return null;
+    }
+
+    private void publishMemberFault(String memberId){
+        Member member = getMemberFromId(memberId);
+        if (member == null){
+            log.warn("Failed to publish member fault event. Member having [member-id] " + memberId +
+                    " does not exist in topology");
+            return;
+        }
+        log.info("Publishing member fault event for [member-id] " + memberId);
+
+        MemberFaultEvent memberFaultEvent = new MemberFaultEvent(member.getClusterId(), member.getClusterInstanceId(),
+                member.getMemberId(), member.getPartitionId(),
+                member.getNetworkPartitionId(), 0);
+
+        memberFaultEventMessageMap.put("message", memberFaultEvent);
+        healthStatPublisher.publish(MemberFaultEventMap, true);
+    }
+
+    @Override
+    public void run() {
+        try {
+            threadBarrier.pass();
+
+            for (Object o : memberTimeStampMap.entrySet()) {
+                Map.Entry pair = (Map.Entry) o;
+                long currentTime = System.currentTimeMillis();
+                Long eventTimeStamp = (Long) pair.getValue();
+
+                if ((currentTime - eventTimeStamp) > TIME_OUT) {
+                    log.info("Faulty member detected [member-id] " + pair.getKey() + " with [last time-stamp] " +
+                            eventTimeStamp + " [time-out] " + TIME_OUT + " milliseconds");
+                    publishMemberFault((String) pair.getKey());
+                }
+            }
+            if (log.isDebugEnabled()){
+                log.debug("Fault handling processor iteration completed with [time-stamp map length] " +
+                        memberTimeStampMap.size() + " [time-stamp map] " + memberTimeStampMap);
+            }
+        } catch (Throwable t) {
+            log.error(t.getMessage(), t);
+        } finally {
+            if (lastSchedule != null) {
+                lastSchedule.cancel(false);
+            }
+            lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+        }
+    }
+
+    @Override
+    protected Object[] currentState() {
+        return new Object[]{window.currentState()};
+    }
+
+    @Override
+    protected void restoreState(Object[] data) {
+        window.restoreState(data);
+        window.restoreState((Object[]) data[0]);
+        window.reSchedule();
+    }
+
+    @Override
+    protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor,
+                        AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+
+        if (parameters[0] instanceof IntConstant) {
+            timeToKeep = ((IntConstant) parameters[0]).getValue();
+        } else {
+            timeToKeep = ((LongConstant) parameters[0]).getValue();
+        }
+
+        String memberIdAttrName = ((Variable) parameters[1]).getAttributeName();
+        memberIdAttrIndex = streamDefinition.getAttributePosition(memberIdAttrName);
+
+        if (this.siddhiContext.isDistributedProcessingEnabled()) {
+            window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+        } else {
+            window = new SchedulerSiddhiQueue<StreamEvent>(this);
+        }
+        MemberFaultEventMap.put("org.apache.stratos.messaging.event.health.stat.MemberFaultEvent", memberFaultEventMessageMap);
+
+	    executorService = StratosThreadPool.getExecutorService(CEP_EXTENSION_THREAD_POOL_KEY,
+                CEP_EXTENSION_THREAD_POOL_SIZE);
+	    cepTopologyEventReceiver.setExecutorService(executorService);
+        cepTopologyEventReceiver.execute();
+
+        //Ordinary scheduling
+        window.schedule();
+        if (log.isDebugEnabled()){
+            log.debug("Fault handling window processor initialized with [timeToKeep] " + timeToKeep +
+                    ", [memberIdAttrName] " + memberIdAttrName + ", [memberIdAttrIndex] " + memberIdAttrIndex +
+                    ", [distributed-enabled] " + this.siddhiContext.isDistributedProcessingEnabled());
+        }
+    }
+
+    @Override
+    public void schedule() {
+        if (lastSchedule != null) {
+            lastSchedule.cancel(false);
+        }
+        lastSchedule = faultHandleScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+    }
+
+    @Override
+    public void scheduleNow() {
+        if (lastSchedule != null) {
+            lastSchedule.cancel(false);
+        }
+        lastSchedule = faultHandleScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+    }
+
+    @Override
+    public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+        this.faultHandleScheduler = scheduledExecutorService;
+    }
+
+    @Override
+    public void setThreadBarrier(ThreadBarrier threadBarrier) {
+        this.threadBarrier = threadBarrier;
+    }
+
+    @Override
+    public void destroy(){
+        // terminate topology listener thread
+        cepTopologyEventReceiver.terminate();
+        window = null;
+
+        // Shutdown executor service
+        if(executorService != null) {
+            try {
+                executorService.shutdownNow();
+            } catch (Exception e) {
+                log.warn("An error occurred while shutting down cep extension executor service", e);
+            }
+        }
+    }
+
+    public ConcurrentHashMap<String, Long> getMemberTimeStampMap() {
+        return memberTimeStampMap;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
new file mode 100644
index 0000000..dff0f79
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/GradientFinderWindowProcessor.java
@@ -0,0 +1,283 @@
+/*
+ * 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.cep.extension;
+
+import org.apache.log4j.Logger;
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.event.StreamEvent;
+import org.wso2.siddhi.core.event.in.InEvent;
+import org.wso2.siddhi.core.event.in.InListEvent;
+import org.wso2.siddhi.core.event.remove.RemoveEvent;
+import org.wso2.siddhi.core.event.remove.RemoveListEvent;
+import org.wso2.siddhi.core.persistence.ThreadBarrier;
+import org.wso2.siddhi.core.query.QueryPostProcessingElement;
+import org.wso2.siddhi.core.query.processor.window.RunnableWindowProcessor;
+import org.wso2.siddhi.core.query.processor.window.WindowProcessor;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.ISchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueue;
+import org.wso2.siddhi.core.util.collection.queue.scheduler.SchedulerSiddhiQueueGrid;
+import org.wso2.siddhi.query.api.definition.AbstractDefinition;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.definition.Attribute.Type;
+import org.wso2.siddhi.query.api.expression.Expression;
+import org.wso2.siddhi.query.api.expression.Variable;
+import org.wso2.siddhi.query.api.expression.constant.IntConstant;
+import org.wso2.siddhi.query.api.expression.constant.LongConstant;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+
+@SiddhiExtension(namespace = "stratos", function = "gradient")
+public class GradientFinderWindowProcessor extends WindowProcessor implements RunnableWindowProcessor {
+
+    static final Logger log = Logger.getLogger(GradientFinderWindowProcessor.class);
+    private ScheduledExecutorService eventRemoverScheduler;
+    private ScheduledFuture<?> lastSchedule;
+    private long timeToKeep;
+    private int subjectedAttrIndex;
+    private Attribute.Type subjectedAttrType;
+    private List<InEvent> newEventList;
+    private List<RemoveEvent> oldEventList;
+    private ThreadBarrier threadBarrier;
+    private ISchedulerSiddhiQueue<StreamEvent> window;
+
+    @Override
+    protected void processEvent(InEvent event) {
+        acquireLock();
+        try {
+            newEventList.add(event);
+        } finally {
+            releaseLock();
+        }
+    }
+
+    @Override
+    protected void processEvent(InListEvent listEvent) {
+        acquireLock();
+        try {
+            System.out.println(listEvent);
+            for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {
+                newEventList.add((InEvent) listEvent.getEvent(i));
+            }
+        } finally {
+            releaseLock();
+        }
+    }
+
+    @Override
+    public Iterator<StreamEvent> iterator() {
+        return window.iterator();
+    }
+
+    @Override
+    public Iterator<StreamEvent> iterator(String predicate) {
+        if (siddhiContext.isDistributedProcessingEnabled()) {
+            return ((SchedulerSiddhiQueueGrid<StreamEvent>) window).iterator(predicate);
+        } else {
+            return window.iterator();
+        }
+    }
+
+
+    @Override
+	public void run() {
+		acquireLock();
+		try {
+			long scheduledTime = System.currentTimeMillis();
+			try {
+				oldEventList.clear();
+				while (true) {
+					threadBarrier.pass();
+					RemoveEvent removeEvent = (RemoveEvent) window.poll();
+					if (removeEvent == null) {
+						if (oldEventList.size() > 0) {
+							nextProcessor.process(new RemoveListEvent(
+							                                          oldEventList.toArray(new RemoveEvent[oldEventList.size()])));
+							oldEventList.clear();
+						}
+
+						if (newEventList.size() > 0) {
+							InEvent[] inEvents =
+							                     newEventList.toArray(new InEvent[newEventList.size()]);
+							for (InEvent inEvent : inEvents) {
+								window.put(new RemoveEvent(inEvent, -1));
+							}
+							
+							InEvent[] gradientEvents = gradient(inEvents[0], inEvents[newEventList.size() - 1]);
+							
+							for (InEvent inEvent : gradientEvents) {
+	                            window.put(new RemoveEvent(inEvent, -1));
+                            }
+							nextProcessor.process(new InListEvent(gradientEvents));
+
+							newEventList.clear();
+						}
+
+						long diff = timeToKeep - (System.currentTimeMillis() - scheduledTime);
+						if (diff > 0) {
+                            try {
+                                if (lastSchedule != null) {
+                                    lastSchedule.cancel(false);
+                                }
+                                lastSchedule = eventRemoverScheduler.schedule(this, diff, TimeUnit.MILLISECONDS);
+                            } catch (RejectedExecutionException ex) {
+								log.warn("scheduling cannot be accepted for execution: elementID " +
+								         elementId);
+							}
+							break;
+						}
+						scheduledTime = System.currentTimeMillis();
+					} else {
+						oldEventList.add(new RemoveEvent(removeEvent, System.currentTimeMillis()));
+					}
+				}
+			} catch (Throwable t) {
+				log.error(t.getMessage(), t);
+			}
+		} finally {
+			releaseLock();
+		}
+	}
+
+
+    /**
+     * This function will calculate the linear gradient (per second) of the events received during
+     * a specified time period.
+     */
+	private InEvent[] gradient(InEvent firstInEvent, InEvent lastInEvent) {
+		double firstVal = 0.0, lastVal = 0.0;
+		// FIXME I'm not sure whether there's some other good way to do correct casting,
+		// based on the type.
+		if (Type.DOUBLE.equals(subjectedAttrType)) {
+			firstVal = (Double) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Double) lastInEvent.getData()[subjectedAttrIndex];
+		} else if (Type.INT.equals(subjectedAttrType)) {
+			firstVal = (Integer) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Integer) lastInEvent.getData()[subjectedAttrIndex];
+		} else if (Type.LONG.equals(subjectedAttrType)) {
+			firstVal = (Long) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Long) lastInEvent.getData()[subjectedAttrIndex];
+		} else if (Type.FLOAT.equals(subjectedAttrType)) {
+			firstVal = (Float) firstInEvent.getData()[subjectedAttrIndex];
+			lastVal = (Float) lastInEvent.getData()[subjectedAttrIndex];
+		}
+		
+		long t1 = firstInEvent.getTimeStamp();
+		long t2 = lastInEvent.getTimeStamp();
+		long millisecondsForASecond = 1000;
+		long tGap = t2 - t1 > millisecondsForASecond ? t2 - t1 : millisecondsForASecond;
+		double gradient = 0.0;
+		if (tGap > 0) {
+			gradient = ((lastVal - firstVal) * millisecondsForASecond) / tGap;
+		}
+		if (log.isDebugEnabled()) {
+            log.debug("Gradient: " + gradient + " Last val: " + lastVal +
+                    " First val: " + firstVal + " Time Gap: " + tGap + " t1: "+t1+ " t2: "+
+                    t2+" hash: "+this.hashCode());
+        }
+		Object[] data = firstInEvent.getData().clone();
+		data[subjectedAttrIndex] = gradient;
+		InEvent gradientEvent =
+		                        new InEvent(firstInEvent.getStreamId(), (t1+t2)/2,
+		                                    data);
+		InEvent[] output = new InEvent[1];
+		output[0] = gradientEvent;
+		return output;
+	}
+
+	@Override
+    protected Object[] currentState() {
+        return new Object[]{window.currentState(), oldEventList, newEventList};
+    }
+
+    @Override
+    protected void restoreState(Object[] data) {
+        window.restoreState(data);
+        window.restoreState((Object[]) data[0]);
+        oldEventList = ((ArrayList<RemoveEvent>) data[1]);
+        newEventList = ((ArrayList<InEvent>) data[2]);
+        window.reSchedule();
+    }
+
+    @Override
+    protected void init(Expression[] parameters, QueryPostProcessingElement nextProcessor, AbstractDefinition streamDefinition, String elementId, boolean async, SiddhiContext siddhiContext) {
+        if (parameters[0] instanceof IntConstant) {
+            timeToKeep = ((IntConstant) parameters[0]).getValue();
+        } else {
+            timeToKeep = ((LongConstant) parameters[0]).getValue();
+        }
+        
+        String subjectedAttr = ((Variable)parameters[1]).getAttributeName();
+        subjectedAttrIndex = streamDefinition.getAttributePosition(subjectedAttr);
+        subjectedAttrType = streamDefinition.getAttributeType(subjectedAttr);
+
+        oldEventList = new ArrayList<RemoveEvent>();
+        if (this.siddhiContext.isDistributedProcessingEnabled()) {
+            newEventList = this.siddhiContext.getHazelcastInstance().getList(elementId + "-newEventList");
+        } else {
+            newEventList = new ArrayList<InEvent>();
+        }
+
+        if (this.siddhiContext.isDistributedProcessingEnabled()) {
+            window = new SchedulerSiddhiQueueGrid<StreamEvent>(elementId, this, this.siddhiContext, this.async);
+        } else {
+            window = new SchedulerSiddhiQueue<StreamEvent>(this);
+        }
+        //Ordinary scheduling
+        window.schedule();
+
+    }
+
+    @Override
+    public void schedule() {
+        if (lastSchedule != null) {
+            lastSchedule.cancel(false);
+            }
+        lastSchedule = eventRemoverScheduler.schedule(this, timeToKeep, TimeUnit.MILLISECONDS);
+    }
+
+    public void scheduleNow() {
+        if (lastSchedule != null) {
+            lastSchedule.cancel(false);
+        }
+        lastSchedule = eventRemoverScheduler.schedule(this, 0, TimeUnit.MILLISECONDS);
+    }
+
+    @Override
+    public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
+        this.eventRemoverScheduler = scheduledExecutorService;
+    }
+
+    public void setThreadBarrier(ThreadBarrier threadBarrier) {
+        this.threadBarrier = threadBarrier;
+    }
+
+    @Override
+    public void destroy(){
+    	oldEventList = null;
+    	newEventList = null;
+    	window = null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
new file mode 100755
index 0000000..0dc24bd
--- /dev/null
+++ b/extensions/cep/modules/stratos-cep-extension/src/main/java/org/apache/stratos/cep/extension/MemeberRequestHandlingCapabilityWindowProcessor.java
@@ -0,0 +1,68 @@
+/*
+ *     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.cep.extension;
+
+/**
+ * Member Request Handling Capability Window Processor
+ */
+
+import org.wso2.siddhi.core.config.SiddhiContext;
+import org.wso2.siddhi.core.executor.function.FunctionExecutor;
+import org.wso2.siddhi.query.api.definition.Attribute;
+import org.wso2.siddhi.query.api.extension.annotation.SiddhiExtension;
+
+@SiddhiExtension(namespace = "stratos", function = "divider")
+public class MemeberRequestHandlingCapabilityWindowProcessor extends FunctionExecutor {
+
+    Attribute.Type returnType = Attribute.Type.DOUBLE;
+
+    @Override
+    public void init(Attribute.Type[] types, SiddhiContext siddhiContext) {
+    }
+
+    @Override
+    protected Object process(Object obj) {
+
+        double[] value = new double[2];
+        if (obj instanceof Object[]) {
+            int i=0;
+            for (Object aObj : (Object[]) obj) {
+                value[i]= Double.parseDouble(String.valueOf(aObj));
+                i++;
+            }
+        }//to do avoid deviding zero number of active instances won't be zero cz there is min
+        Double unit = (value[0] / value[1]);
+        if(!unit.isNaN() && !unit.isInfinite())
+            return unit;
+        else
+            return 0.0;
+
+    }
+
+    @Override
+    public void destroy() {
+
+    }
+
+    @Override
+    public Attribute.Type getReturnType() {
+        return returnType;
+    }
+}


[34/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/notice/NOTICE b/extensions/load-balancer/modules/nginx-extension/src/main/notice/NOTICE
new file mode 100644
index 0000000..ba9e5bd
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/notice/NOTICE
@@ -0,0 +1,402 @@
+Apache Stratos NGINX Extension
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+================================================================================
+Apache Software
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+================================================================================
+Apache Abdera Notice:
+
+Portions of Abdera were orginally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Abdera CLA".
+
+This software's test suite contains data files derived from the
+Universal Feed Parser, Copyright (c) 2002-2005, Mark Pilgrim.
+
+This software's extensions module contains a JSON writer for Atom XML
+that utilizes a JSON parser, Copyright (c) 2002, json.org. The code was 
+licensed using Apache License by the author Douglas Crockford and made 
+available at http://json.org/java/apache.zip We have included portions 
+of the code in the extensions module.
+
+===============================================================================
+Apache Ant Notice:
+
+The <sync> task is based on code Copyright (c) 2002, Landmark
+Graphics Corp that has been kindly donated to the Apache Software
+Foundation.
+
+================================================================================
+Apache Axiom Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+
+================================================================================
+Apache Axis2 Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems,
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+================================================================================
+Apache Commons-Lang Notice:
+
+This product includes software from the Spring Framework,
+under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+================================================================================
+Apache Commons-Pool Notice:
+
+The LinkedBlockingDeque implementation is based on an implementation written by
+Doug Lea with assistance from members of JCP JSR-166 Expert Group and released
+to the public domain, as explained at
+http://creativecommons.org/licenses/publicdomain
+
+================================================================================
+Apache Commons-httpclient Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache Tomcat Notice:
+
+The Windows Installer is built with the Nullsoft
+Scriptable Install System (NSIS), which is
+open source software.  The original software and
+related information is available at
+http://nsis.sourceforge.net.
+
+Java compilation software for JSP pages is provided by Eclipse,
+which is open source software.  The original software and
+related information is available at
+http://www.eclipse.org.
+
+For the bayeux implementation
+The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation
+* Copyright 2007-2008 Guy Molinari
+* Copyright 2007-2008 Filip Hanik
+* Copyright 2007 Dojo Foundation
+* Copyright 2007 Mort Bay Consulting Pty. Ltd.
+
+The original XML Schemas for Java EE Deployment Descriptors:
+ - javaee_5.xsd
+ - javaee_web_services_1_2.xsd
+ - javaee_web_services_client_1_2.xsd
+ - javaee_6.xsd
+ - javaee_web_services_1_3.xsd
+ - javaee_web_services_client_1_3.xsd
+ - jsp_2_2.xsd
+ - web-app_3_0.xsd
+ - web-common_3_0.xsd
+ - web-fragment_3_0.xsd
+ - javaee_7.xsd
+ - javaee_web_services_1_4.xsd
+ - javaee_web_services_client_1_4.xsd
+ - jsp_2_3.xsd
+ - web-app_3_1.xsd
+ - web-common_3_1.xsd
+ - web-fragment_3_1.xsd
+
+may be obtained from:
+http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
+
+================================================================================
+Apache Geranimo Notice:
+
+Apache Geronimo
+Copyright 2003-2011 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of the Web Console were orginally developed by International
+Business Machines Corporation and are licensed to the Apache Software
+Foundation under the "Software Grant and Corporate Contribution
+License Agreement", informally known as the "IBM Console CLA".
+
+Portions of the ASN1 codec implementation in
+framework/modules/geronimo-crypto/ were developed by the Bouncy Castle
+project (http://www.bouncycastle.org/).
+
+Copyright (c) 2000-2005
+The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
+
+ORB Portions of this software were developed at IONA Technologies.
+
+Object Management Group (OMG) classes used by the orb.
+The original classes are available from www.org.omg.
+
+The RMI over IIOP implementation were developed at Trifork Technologies.
+
+Copyright 2004-2009 Tranql project committers
+This product includes software developed at
+Tranql (http://tranql.codehaus.org/).
+
+This product includes software developed by the Protocol Buffers
+project (http://code.google.com/apis/protocolbuffers).
+
+This product includes also software developed by :
+  - the W3C consortium (http://www.w3c.org) ,
+  - the SAX project (http://www.saxproject.org)
+
+The <sync> task is based on code Copyright (c) 2002, Landmark
+Graphics Corp that has been kindly donated to the Apache Software
+Foundation.
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+  - voluntary contributions made by Paul Eng on behalf of the
+    Apache Software Foundation that were originally developed at iClick, Inc.,
+    software copyright (c) 1999.
+
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems,
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+This product also includes schemas and specification developed by:
+      - the W3C consortium (http://www.w3c.org)
+      (http://www.w3.org/XML/1998/namespace)
+
+This product also includes WS-* schemas developed by International
+   Business Machines Corporation, Microsoft Corporation, BEA Systems,
+   TIBCO Software, SAP AG, Sonic Software, and VeriSign
+   (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)
+   (http://schemas.xmlsoap.org/ws/2004/08/addressing/)
+   (http://schemas.xmlsoap.org/wsdl/http)
+   (http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm.xsd)
+   (http://www.w3.org/2005/08/addressing/ws-addr.xsd)
+
+Portions of Derby were originally developed by
+International Business Machines Corporation and are
+licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement",
+informally known as the "Derby CLA".
+The following copyright notice(s) were affixed to portions of the code
+with which this file is now or was at one time distributed
+and are placed here unaltered.
+
+(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
+
+(C) Copyright IBM Corp. 2003.
+
+The portion of the functionTests under 'nist' was originally
+developed by the National Institute of Standards and Technology (NIST),
+an agency of the United States Department of Commerce, and adapted by
+International Business Machines Corporation in accordance with the NIST
+Software Acknowledgment and Redistribution document at
+http://www.itl.nist.gov/div897/ctg/sql_form.htm
+
+* OpenJPA includes software written by Miroslav Nachev.
+
+* OpenJPA uses test code written by Charles Tillman.
+
+XMLSec was originally based on software copyright (c) 2001, Institute for
+Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
+
+The development of XMLSec was partly funded by the European
+Commission in the <WebSig> project in the ISIS Programme.
+
+This product also includes software developed by :
+
+  - IBM Corporation (http://www.ibm.com),
+      WSDL4J was the initial code contribution for the Apache Woden
+      project and some of the WSDL4J design and code has been reused.
+  - The W3C Consortium (http://www.w3c.org),
+      Common W3C XML Schema and DTD files are packaged with Apache Woden.
+
+Portions Copyright 2006 International Business Machines Corp.
+
+Portions of this software were originally based on the following:
+  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+Aside from contributions to the Apache XMLBeans project, this
+software also includes:
+
+ - one or more source files from the Apache Xerces-J and Apache Axis
+   products, Copyright (c) 1999-2003 Apache Software Foundation
+
+ - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
+   Consortium (Massachusetts Institute of Technology, European Research
+   Consortium for Informatics and Mathematics, Keio University)
+
+ - resolver.jar from Apache Xml Commons project,
+   Copyright (c) 2001-2003 Apache Software Foundation
+
+ - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
+   Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
+
+ - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
+   Copyright 2005 BEA under the terms of the Apache Software License 2.0
+
+This product includes software developed by the Simple XML Compiler (SXC)
+project (http://sxc.codehaus.org/project-info.html)
+
+This product includes software developed for the JAXB Reference
+Implementation project. (https://jaxb.dev.java.net/).  Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes software developed for SOAP with Attachments
+API for Java (SAAJ). The software is available from the GlassFish project
+(https://saaj.dev.java.net/).  Apache Geronimo elects to include this
+software in this distribution under the CDDL license.
+
+This product includes software developed for Java API for XML Web Services
+project (JAX-WS) (https://jax-ws.dev.java.net/).  Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes software developed for the Java Server Pages Tag
+Library project (https://jstl.dev.java.net/).   Apache Geronimo elects
+to include this software in this distribution under the CDDL license.
+
+This product includes schema files developed for the Glassfish Java EE
+reference implementation (http://java.sun.com/xml/ns/j2ee/).
+Apache Geronimo elects to include this software in this distribution
+under the CDDL license.  You can obtain a copy of the License at:
+    https://glassfish.dev.java.net/public/CDDL+GPL.html
+The source code is available at:
+    https://glassfish.dev.java.net/source/browse/glassfish/
+
+The following schemas are included:
+
+----------------------------------
+  application-client_1_4.xsd
+  application_1_4.xsd
+  connector_1_5.xsd
+  datatypes.dtd
+  ejb-jar_2_1.xsd
+  j2ee_1_4.xsd
+  j2ee_jaxrpc_mapping_1_1.xsd
+  j2ee_web_services_1_1.xsd
+  j2ee_web_services_client_1_1.xsd
+  jsp_2_0.xsd
+  web-app_2_4.xsd
+  web-jsptaglibrary_2_0.xsd
+  application-client_5.xsd
+  application_5.xsd
+  ejb-jar_3_0.xsd
+  handler-chain.xsd
+  javaee_5.xsd
+  javaee_web_services_1_2.xsd
+  javaee_web_services_client_1_2.xsd
+  jsp_2_1.xsd
+  persistence_1_0.xsd
+  web-app_2_5.xsd
+  web-facelettaglibrary_2_0.xsd
+  web-facesconfig_2_0.xsd
+  web-partialresponse_2_0.xsd
+  web-jsptaglibrary_2_1.xsd
+  application_6.xsd
+  application-client_6.xsd
+  connector_1_6.xsd
+  ejb-jar_3_1.xsd
+  javaee_6.xsd
+  javaee_web_services_1_3.xsd
+  javaee_web_services_client_1_3.xsd
+  jsp_2_2.xsd
+  persistence_2_0.xsd
+  web-app_3_0.xsd
+  web-common_3_0.xsd
+  web-fragment_3_0.xsd
+--------------------------------
+
+This product includes software developed at
+the OSGi Alliance (http://www.osgi.org/).
+
+ This product includes software developed at
+ OPS4J (http://www.ops4j.org/).
+-------------------------------------------------------------------------------
+
+The product contains the software developed in javassist.org (http://www.javassist.org) 
+which is released under both the Mozilla Public License 
+(http://www.mozilla.org/MPL/MPL-1.1.html) and the GNU Lesser General Public 
+License (http://www.gnu.org/licenses/lgpl-2.1.html).  
+
+The Apache Geronimo project elects to distribute this software under the terms of 
+the Mozilla Public License. 
+
+-------------------------------------------------------------------------------
+
+The product contains the software developed in json.org which released under the following license.
+
+http://www.json.org/license.html
+
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+================================================================================
+Apache Httpclient Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+================================================================================
+Apache Httpcore Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache POI Notice:
+
+This product contains the DOM4J library (http://www.dom4j.org).
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+This product contains parts that were originally based on software from BEA.
+Copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
+World Wide Web Consortium (Massachusetts Institute of Technology, European
+Research Consortium for Informatics and Mathematics, Keio University)
+
+This product contains the Piccolo XML Parser for Java
+(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
+
+This product contains the chunks_parse_cmds.tbl file from the vsdump program.
+Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/resources/velocity.properties b/extensions/load-balancer/modules/nginx-extension/src/main/resources/velocity.properties
new file mode 100644
index 0000000..437aec5
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/resources/velocity.properties
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+resource.loader=class, file
+class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
+file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
+runtime.log.logsystem.log4j.category=velocity
+input.encoding=UTF-8
+output.encoding=UTF-8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/security/client-truststore.jks
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/security/client-truststore.jks b/extensions/load-balancer/modules/nginx-extension/src/main/security/client-truststore.jks
new file mode 100644
index 0000000..be441f3
Binary files /dev/null and b/extensions/load-balancer/modules/nginx-extension/src/main/security/client-truststore.jks differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/templates/nginx.cfg.template
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/templates/nginx.cfg.template b/extensions/load-balancer/modules/nginx-extension/src/main/templates/nginx.cfg.template
new file mode 100644
index 0000000..54f9648
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/templates/nginx.cfg.template
@@ -0,0 +1,8 @@
+events {
+    worker_connections  1024;
+}
+
+$configuration
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/INSTALL.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/INSTALL.md b/extensions/load-balancer/nginx-extension/INSTALL.md
deleted file mode 100644
index 3e0aa5a..0000000
--- a/extensions/load-balancer/nginx-extension/INSTALL.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Installing Apache Stratos Nginx Extension
-
-Apache Stratos Nginx Extension could be used for integrating Nginx load balancer with Apache Stratos. Please follow
-below steps to proceed with the installation:
-
-1. Download and extract Nginx binary distribution to a desired location: <nginx-home>.
-
-2. Extract org.apache.stratos.nginx.extension-<version>.zip to a desired location: <nginx-extension-home>.
-
-3. Open <nginx-extension-home>/bin/nginx-extension.sh file in a text editor and update following system properties:
-   ```
-   # Define nginx host private ip address:
-   -Dnginx.private.ip=127.0.0.1
-
-   # Define the nginx executable file path:
-   -Dexecutable.file.path=<nginx-home>/nginx
-
-   # Enable/disable cep statistics publisher:
-   -Dcep.stats.publisher.enabled=false
-
-   # If cep statistics publisher is enabled define the following properties:
-   -Dthrift.receiver.ip=127.0.0.1
-   -Dthrift.receiver.port=7615
-   -Dnetwork.partition.id=network-partition-1
-   ```
-
-4. Open <nginx-extension-home>/conf/jndi.properties file in a text editor and update message broker information:
-   ```
-   java.naming.provider.url=tcp://localhost:61616
-   ```
-
-5. Run <nginx-extension-home>/bin/nginx-extension.sh as the root user.
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/README.md b/extensions/load-balancer/nginx-extension/README.md
deleted file mode 100644
index cfbe2a3..0000000
--- a/extensions/load-balancer/nginx-extension/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Apache Stratos Nginx Extension
-
-Apache Stratos Nginx extension is a load balancer extension for Nginx. It is an executable program
-which can manage the life-cycle of a Nginx instance according to the topology, composite application model,
-tenant application signups and domain mapping information received from Stratos via the message broker.
-
-## How it works
-1. Wait for the complete topology event message to initialize the topology.
-2. Configure and start an instance of Nginx.
-3. Listen to topology, application, application signup, domain mapping events.
-4. Reload Nginx instance with the new topology configuration.
-5. Periodically publish statistics to Complex Event Processor (CEP).
-
-## Statistics publishing
-Set cep.stats.publisher.enabled to true in nginx-extension.sh file to enable statistics publishing. Please note that
-Nginx must be compiled with HttpStubStatusModule module to read statistics. Execute the following command to make
- sure that HttpStubStatusModule module is installed:
-```
-nginx -V 2>&1 | grep -o with-http_stub_status_module
-```
-If HttpStubStatusModule is installed the following output will be given:
-```
-with-http_stub_status_module
-```
-
-## Installation
-Please refer INSTALL.md for information on the installation process.

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/pom.xml b/extensions/load-balancer/nginx-extension/pom.xml
deleted file mode 100644
index 88e6bc0..0000000
--- a/extensions/load-balancer/nginx-extension/pom.xml
+++ /dev/null
@@ -1,109 +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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-load-balancer-extensions</artifactId>
-        <version>4.1.2</version>
-    </parent>
-
-    <artifactId>apache-stratos-nginx-extension</artifactId>
-    <name>Apache Stratos - Nginx Extension</name>
-    <description>Apache Stratos Nginx Extension for Load Balancing</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>1.7.5</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.messaging</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.velocity</groupId>
-            <artifactId>velocity</artifactId>
-            <version>1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.andes.wso2</groupId>
-            <artifactId>andes-client</artifactId>
-            <version>0.13.wso2v8</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>org.apache.stratos.nginx.extension.Main</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <descriptors>
-                        <descriptor>src/main/assembly/bin.xml</descriptor>
-                    </descriptors>
-                    <archiverConfig>
-                        <fileMode>420</fileMode>
-                        <directoryMode>493</directoryMode>
-                        <defaultDirectoryMode>493</defaultDirectoryMode>
-                    </archiverConfig>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/assembly/bin.xml b/extensions/load-balancer/nginx-extension/src/main/assembly/bin.xml
deleted file mode 100644
index 2cf5942..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,106 +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.
-  -->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-    <id>bin</id>
-    <formats>
-        <format>zip</format>
-    </formats>
-    <fileSets>
-        <fileSet>
-            <directory>${project.basedir}/src/main/bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>nginx-extension.sh</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/conf</directory>
-            <outputDirectory>/conf</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>jndi.properties</include>
-                <include>log4j.properties</include>
-                <include>thrift-client-config.xml</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/security</directory>
-            <outputDirectory>/security</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>client-truststore.jks</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/templates</directory>
-            <outputDirectory>/templates</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>nginx.cfg.template</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/scripts</directory>
-            <outputDirectory>/scripts</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>get-weight.sh</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>DISCLAIMER</include>
-                <include>README*</include>
-                <include>LICENSE*</include>
-                <include>INSTALL*</include>
-            </includes>
-        </fileSet>
-	<fileSet>
-            <directory>${project.basedir}/src/main/license</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/notice</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-        </fileSet>
-    </fileSets>
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>/lib</outputDirectory>
-	        <excludes>
-                <exclude>*:icu4j*</exclude>
-                <exclude>*:jaxen*</exclude>
-                <exclude>*:jboss-transaction-api*</exclude>
-                <exclude>*:wrapper*</exclude>
-                <exclude>*:xom*</exclude>
-            </excludes>
-            <useProjectArtifact>true</useProjectArtifact>
-            <scope>runtime</scope>
-        </dependencySet>
-    </dependencySets>
-</assembly>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/bin/nginx-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/bin/nginx-extension.sh b/extensions/load-balancer/nginx-extension/src/main/bin/nginx-extension.sh
deleted file mode 100755
index 5deb433..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/bin/nginx-extension.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-echo "Starting nginx extension..."
-script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-lib_path=${script_path}/../lib/
-class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
-properties="-Dnginx.private.ip=127.0.0.1
-            -Dexecutable.file.path=nginx
-            -Djndi.properties.dir=${script_path}/../conf
-            -Dtemplates.path=${script_path}/../templates
-            -Dtemplates.name=nginx.cfg.template
-            -Dscripts.path=${script_path}/../scripts
-            -Dconf.file.path=/tmp/nginx.cfg
-            -Dstats.socket.file.path=/tmp/nginx-stats.socket
-            -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
-            -Djavax.net.ssl.trustStore=${script_path}/../security/client-truststore.jks
-            -Djavax.net.ssl.trustStorePassword=wso2carbon
-            -Dthrift.client.config.file.path=${script_path}/../conf/thrift-client-config.xml
-            -Dcep.stats.publisher.enabled=false
-            -Dthrift.receiver.ip=127.0.0.1
-            -Dthrift.receiver.port=7615
-            -Dnetwork.partition.id=network-partition-1
-            -Dcluster.id=cluster-1
-            -Dservice.name=service-1"
-
-
-# Uncomment below line to enable remote debugging
-#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
-
-java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.nginx.extension.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/conf/jndi.properties b/extensions/load-balancer/nginx-extension/src/main/conf/jndi.properties
deleted file mode 100644
index 21d7420..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/conf/jndi.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61616
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/conf/log4j.properties b/extensions/load-balancer/nginx-extension/src/main/conf/log4j.properties
deleted file mode 100644
index ad6b80a..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/conf/log4j.properties
+++ /dev/null
@@ -1,40 +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.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=logs/nginx-extension.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.nginx.extension=INFO
-log4j.logger.org.apache.stratos.load.balancer.extension.api=INFO
-log4j.logger.org.apache.stratos.messaging=INFO
-log4j.logger.org.wso2.andes.client=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/nginx-extension/src/main/conf/thrift-client-config.xml
deleted file mode 100644
index 5cacada..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/conf/thrift-client-config.xml
+++ /dev/null
@@ -1,27 +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.
-  -->
-
-<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
-<thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java
deleted file mode 100644
index 6f56c52..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java
+++ /dev/null
@@ -1,39 +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.nginx.extension;
-
-/**
- * Nginx extension constants.
- */
-public class Constants {
-    public static final String NGINX_PRIVATE_IP = "nginx.private.ip";
-    public static final String EXECUTABLE_FILE_PATH = "executable.file.path";
-    public static final String TEMPLATES_PATH = "templates.path";
-    public static final String TEMPLATES_NAME = "templates.name";
-    public static final String SCRIPTS_PATH = "scripts.path";
-    public static final String CONF_FILE_PATH = "conf.file.path";
-    public static final String STATS_SOCKET_FILE_PATH = "stats.socket.file.path";
-    public static final String CEP_STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
-    public static final String THRIFT_RECEIVER_IP = "thrift.receiver.ip";
-    public static final String THRIFT_RECEIVER_PORT = "thrift.receiver.port";
-    public static final String NETWORK_PARTITION_ID = "network.partition.id";
-    public static final String CLUSTER_ID = "cluster.id";
-    public static final String SERVICE_NAME = "service.name";
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java
deleted file mode 100644
index ab0eb7a..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java
+++ /dev/null
@@ -1,85 +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.nginx.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
-import org.apache.stratos.load.balancer.extension.api.LoadBalancerExtension;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * Nginx extension main class.
- */
-public class Main {
-	private static final Log log = LogFactory.getLog(Main.class);
-	private static ExecutorService executorService;
-
-	public static void main(String[] args) {
-
-		LoadBalancerExtension extension = null;
-		try {
-			// Configure log4j properties
-			PropertyConfigurator.configure(System.getProperty("log4j.properties.file.path"));
-
-			if (log.isInfoEnabled()) {
-				log.info("Nginx extension started");
-			}
-
-            // Add shutdown hook
-            final Thread mainThread = Thread.currentThread();
-            final LoadBalancerExtension finalExtension = extension;
-            Runtime.getRuntime().addShutdownHook(new Thread() {
-                public void run() {
-                    try {
-                        if(finalExtension != null) {
-                            log.info("Shutting nginx instance...");
-                            finalExtension.stop();
-                        }
-                        mainThread.join();
-                    } catch (Exception e) {
-                        log.error(e);
-                    }
-                }
-            });
-
-			executorService = StratosThreadPool.getExecutorService("nginx.extension.thread.pool", 10);
-			// Validate runtime parameters
-			NginxContext.getInstance().validate();
-            TopologyProvider topologyProvider = new TopologyProvider();
-            NginxStatisticsReader statisticsReader = NginxContext.getInstance().isCEPStatsPublisherEnabled() ?
-                    new NginxStatisticsReader(topologyProvider) : null;
-            extension = new LoadBalancerExtension(new Nginx(), statisticsReader, topologyProvider);
-			extension.setExecutorService(executorService);
-			extension.execute();
-		} catch (Exception e) {
-			if (log.isErrorEnabled()) {
-				log.error(e);
-			}
-			if (extension != null) {
-                log.info("Shutting nginx instance...");
-				extension.stop();
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java
deleted file mode 100644
index f73c0b7..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java
+++ /dev/null
@@ -1,140 +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.nginx.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.util.CommandUtils;
-import org.apache.stratos.load.balancer.extension.api.LoadBalancer;
-import org.apache.stratos.load.balancer.extension.api.exception.LoadBalancerExtensionException;
-import org.apache.stratos.load.balancer.common.domain.Topology;
-
-import java.io.File;
-
-/**
- * Nginx load balancer life-cycle implementation.
- */
-public class Nginx implements LoadBalancer {
-
-    private static final Log log = LogFactory.getLog(Nginx.class);
-
-    private String executableFilePath;
-    private String processIdFilePath;
-    private String templatePath;
-    private String templateName;
-    private String confFilePath;
-    private String statsSocketFilePath;
-
-    public Nginx() {
-        this.executableFilePath = NginxContext.getInstance().getExecutableFilePath();
-        this.templatePath = NginxContext.getInstance().getTemplatePath();
-        this.templateName = NginxContext.getInstance().getTemplateName();
-        this.confFilePath = NginxContext.getInstance().getConfFilePath();
-        this.processIdFilePath = confFilePath.replace(".cfg", ".pid");
-        this.statsSocketFilePath = NginxContext.getInstance().getStatsSocketFilePath();
-    }
-
-    /**
-     * Configure nginx instance according to topology given
-     * @param topology
-     * @throws LoadBalancerExtensionException
-     */
-    public boolean configure(Topology topology) throws LoadBalancerExtensionException {
-        try {
-            log.info("Generating nginx configuration...");
-            NginxConfigWriter writer = new NginxConfigWriter(templatePath, templateName, confFilePath, statsSocketFilePath);
-            if(writer.write(topology)) {
-                return true;
-            }
-            return false;
-        } catch (Exception e) {
-            log.error("Could not generate nginx configuration");
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Start nginx instance
-     * @throws LoadBalancerExtensionException
-     */
-    public void start() throws LoadBalancerExtensionException {
-        log.info("Starting nginx instance...");
-        // Check for configuration file
-        File conf = new File(confFilePath);
-        if (!conf.exists()) {
-            throw new LoadBalancerExtensionException("Could not find nginx configuration file");
-        }
-
-        // Start nginx and write pid to processIdFilePath
-        try {
-            String command = executableFilePath + " -c " + confFilePath;
-            CommandUtils.executeCommand(command);
-            log.info("nginx instance started");
-        } catch (Exception e) {
-            log.error("Could not start nginx instance");
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Reload nginx instance according to the configuration written in configure() method.
-     * @throws LoadBalancerExtensionException
-     */
-    public void reload() throws LoadBalancerExtensionException {
-        try {
-            log.info("Reloading configuration...");
-
-            // Execute hot configuration deployment
-            String command = executableFilePath + " -c " + confFilePath + " -s reload";
-            CommandUtils.executeCommand(command);
-            if (log.isInfoEnabled()) {
-                log.info("Configuration done");
-            }
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error("Reconfiguration failed");
-            }
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Stop nginx instance
-     * @throws LoadBalancerExtensionException
-     */
-    public void stop() throws LoadBalancerExtensionException {
-
-        try {
-            log.info("Stopping nginx...");
-
-            // Execute hot configuration deployment
-            String command = executableFilePath + " -s stop";
-            CommandUtils.executeCommand(command);
-            if (log.isInfoEnabled()) {
-                log.info("Nginx stopped");
-            }
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error("Could not stop nginx");
-            }
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
deleted file mode 100644
index 6f6a77c..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
+++ /dev/null
@@ -1,181 +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.nginx.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.load.balancer.common.domain.*;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.RuntimeConstants;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.Collection;
-
-/**
- * Nginx load balancer configuration writer.
- */
-public class NginxConfigWriter {
-
-    private static final Log log = LogFactory.getLog(Main.class);
-    private static final String NEW_LINE = System.getProperty("line.separator");
-    private static final String TAB = "    ";
-
-    private String templatePath;
-    private String templateName;
-    private String confFilePath;
-    private String statsSocketFilePath;
-
-    public NginxConfigWriter(String templatePath, String templateName, String confFilePath,
-                             String statsSocketFilePath) {
-
-        this.templatePath = templatePath;
-        this.templateName = templateName;
-        this.confFilePath = confFilePath;
-        this.statsSocketFilePath = statsSocketFilePath;
-    }
-
-    public boolean write(Topology topology) {
-
-        StringBuilder configurationBuilder = new StringBuilder();
-
-        for (Service service : topology.getServices()) {
-            for (Cluster cluster : service.getClusters()) {
-                generateConfigurationForCluster(cluster, configurationBuilder);
-            }
-        }
-
-        // Start velocity engine
-        VelocityEngine ve = new VelocityEngine();
-        ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatePath);
-        ve.init();
-
-        // Open the template
-        Template t = ve.getTemplate(templateName);
-
-        // Insert strings into the template
-        VelocityContext context = new VelocityContext();
-        context.put("configuration", configurationBuilder.toString());
-
-        // Create a new string from the template
-        StringWriter stringWriter = new StringWriter();
-        t.merge(context, stringWriter);
-        String configuration = stringWriter.toString();
-
-        // Write configuration file
-        try {
-            BufferedWriter writer = new BufferedWriter(new FileWriter(confFilePath));
-            writer.write(configuration);
-            writer.close();
-
-            if (log.isInfoEnabled()) {
-                log.info(String.format("Configuration written to file: %s", confFilePath));
-            }
-            return true;
-        } catch (IOException e) {
-            if (log.isErrorEnabled()) {
-                log.error(String.format("Could not write configuration file: %s", confFilePath));
-            }
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Generate configuration for a cluster with the following format:
-     *
-     * <transport> {
-     *     upstream <cluster-hostname> {
-     *         server <hostname>:<port>;
-     *         server <hostname>:<port>;
-     *     }
-     *     server {
-     *         listen <proxy-port>;
-     *         server_name <cluster-hostname>;
-     *         location / {
-     *             proxy_pass    http://<cluster-hostname>
-     *         }
-     *         location /nginx_status {
-     *            stub_status on;
-     *            access_log off;
-     *            allow 127.0.0.1;
-     *            deny all;
-     *         }
-     *     }
-     * }
-     * @param cluster
-     * @param text
-     */
-    private void generateConfigurationForCluster(Cluster cluster, StringBuilder text) {
-
-        if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
-            return;
-        }
-
-        // Find port mappings
-        Member firstMember = (Member) cluster.getMembers().toArray()[0];
-        Collection<Port> ports = firstMember.getPorts();
-
-        for (Port port : ports) {
-            for (String hostname : cluster.getHostNames()) {
-                // Start transport block
-                text.append(port.getProtocol()).append(" {").append(NEW_LINE);
-
-                // Start upstream block
-                text.append(TAB).append("upstream ").append(hostname).append(" {").append(NEW_LINE);
-                for (Member member : cluster.getMembers()) {
-                    // Start upstream server block
-                    text.append(TAB).append(TAB).append("server ").append(member.getHostName()).append(":")
-                            .append(port.getValue()).append(";").append(NEW_LINE);
-                    // End upstream server block
-                }
-                text.append(TAB).append("}").append(NEW_LINE);
-                // End upstream block
-
-                // Start server block
-                text.append(NEW_LINE);
-                text.append(TAB).append("server {").append(NEW_LINE);
-                text.append(TAB).append(TAB).append("listen ").append(port.getProxy()).append(";").append(NEW_LINE);
-                text.append(TAB).append(TAB).append("server_name ").append(hostname).append(";").append(NEW_LINE);
-
-                text.append(TAB).append(TAB).append("location / {").append(NEW_LINE);
-                text.append(TAB).append(TAB).append(TAB).append("proxy_pass").append(TAB)
-                        .append("http://").append(hostname).append(";").append(NEW_LINE);
-                text.append(TAB).append(TAB).append("}").append(NEW_LINE);
-
-                text.append(TAB).append(TAB).append("location /nginx_status {").append(NEW_LINE);
-                text.append(TAB).append(TAB).append(TAB).append("stub_status on;").append(NEW_LINE);
-                text.append(TAB).append(TAB).append(TAB).append("access_log off;").append(NEW_LINE);
-                text.append(TAB).append(TAB).append(TAB).append("allow 127.0.0.1;").append(NEW_LINE);
-                text.append(TAB).append(TAB).append(TAB).append("deny all;").append(NEW_LINE);
-                text.append(TAB).append(TAB).append("}").append(NEW_LINE);
-
-                text.append(TAB).append("}").append(NEW_LINE);
-                // End server block
-
-                text.append("}").append(NEW_LINE);
-                // End transport block
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java
deleted file mode 100644
index 7cceeea..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java
+++ /dev/null
@@ -1,157 +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.nginx.extension;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Nginx context to read and store system properties.
- */
-public class NginxContext {
-    private static final Log log = LogFactory.getLog(NginxContext.class);
-    private static volatile NginxContext context;
-
-    private String nginxPrivateIp;
-    private String executableFilePath;
-    private String templatePath;
-    private String templateName;
-    private String scriptsPath;
-    private String confFilePath;
-    private String statsSocketFilePath;
-    private boolean cepStatsPublisherEnabled;
-    private String thriftReceiverIp;
-    private String thriftReceiverPort;
-    private String networkPartitionId;
-    private String clusterId;
-    private String serviceName;
-
-    private NginxContext() {
-        this.nginxPrivateIp = System.getProperty(Constants.NGINX_PRIVATE_IP);
-        this.executableFilePath = System.getProperty(Constants.EXECUTABLE_FILE_PATH);
-        this.templatePath = System.getProperty(Constants.TEMPLATES_PATH);
-        this.templateName = System.getProperty(Constants.TEMPLATES_NAME);
-        this.scriptsPath = System.getProperty(Constants.SCRIPTS_PATH);
-        this.confFilePath = System.getProperty(Constants.CONF_FILE_PATH);
-        this.statsSocketFilePath = System.getProperty(Constants.STATS_SOCKET_FILE_PATH);
-        this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED);
-        this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP);
-        this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT);
-        this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID);
-        this.clusterId = System.getProperty(Constants.CLUSTER_ID);
-        this.serviceName = System.getProperty(Constants.SERVICE_NAME);
-
-        if (log.isDebugEnabled()) {
-            log.debug(Constants.NGINX_PRIVATE_IP + " = " + nginxPrivateIp);
-            log.debug(Constants.EXECUTABLE_FILE_PATH + " = " + executableFilePath);
-            log.debug(Constants.TEMPLATES_PATH + " = " + templatePath);
-            log.debug(Constants.TEMPLATES_NAME + " = " + templateName);
-            log.debug(Constants.SCRIPTS_PATH + " = " + scriptsPath);
-            log.debug(Constants.CONF_FILE_PATH + " = " + confFilePath);
-            log.debug(Constants.STATS_SOCKET_FILE_PATH + " = " + statsSocketFilePath);
-            log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled);
-            log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp);
-            log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort);
-            log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId);
-            log.debug(Constants.CLUSTER_ID + " = " + clusterId);
-        }
-    }
-
-    public static NginxContext getInstance() {
-        if (context == null) {
-            synchronized (NginxContext.class) {
-                if (context == null) {
-                    context = new NginxContext();
-                }
-            }
-        }
-        return context;
-    }
-
-    public void validate() {
-        validateSystemProperty(Constants.NGINX_PRIVATE_IP);
-        validateSystemProperty(Constants.EXECUTABLE_FILE_PATH);
-        validateSystemProperty(Constants.TEMPLATES_PATH);
-        validateSystemProperty(Constants.TEMPLATES_NAME);
-        validateSystemProperty(Constants.SCRIPTS_PATH);
-        validateSystemProperty(Constants.CONF_FILE_PATH);
-        validateSystemProperty(Constants.STATS_SOCKET_FILE_PATH);
-        validateSystemProperty(Constants.CEP_STATS_PUBLISHER_ENABLED);
-        validateSystemProperty(Constants.CLUSTER_ID);
-
-        if (cepStatsPublisherEnabled) {
-            validateSystemProperty(Constants.THRIFT_RECEIVER_IP);
-            validateSystemProperty(Constants.THRIFT_RECEIVER_PORT);
-            validateSystemProperty(Constants.NETWORK_PARTITION_ID);
-        }
-    }
-
-    private void validateSystemProperty(String propertyName) {
-        String value = System.getProperty(propertyName);
-        if (StringUtils.isEmpty(value)) {
-            throw new RuntimeException("System property was not found: " + propertyName);
-        }
-    }
-
-    public String getNginxPrivateIp() {
-        return nginxPrivateIp;
-    }
-
-    public String getExecutableFilePath() {
-        return executableFilePath;
-    }
-
-    public String getTemplatePath() {
-        return templatePath;
-    }
-
-    public String getTemplateName() {
-        return templateName;
-    }
-
-    public String getScriptsPath() {
-        return scriptsPath;
-    }
-
-    public String getConfFilePath() {
-        return confFilePath;
-    }
-
-    public String getStatsSocketFilePath() {
-        return statsSocketFilePath;
-    }
-
-    public boolean isCEPStatsPublisherEnabled() {
-        return cepStatsPublisherEnabled;
-    }
-
-    public String getNetworkPartitionId() {
-        return networkPartitionId;
-    }
-
-    public String getClusterId() {
-        return clusterId;
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java b/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java
deleted file mode 100644
index d45aa8f..0000000
--- a/extensions/load-balancer/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java
+++ /dev/null
@@ -1,124 +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.nginx.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.conn.HttpHostConnectException;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.stratos.common.constants.StratosConstants;
-import org.apache.stratos.load.balancer.common.domain.Cluster;
-import org.apache.stratos.load.balancer.common.domain.Port;
-import org.apache.stratos.load.balancer.common.domain.Service;
-import org.apache.stratos.load.balancer.common.statistics.LoadBalancerStatisticsReader;
-import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Nginx statistics reader.
- */
-public class NginxStatisticsReader implements LoadBalancerStatisticsReader {
-
-    private static final Log log = LogFactory.getLog(NginxStatisticsReader.class);
-
-    private TopologyProvider topologyProvider;
-    private String clusterInstanceId;
-
-    public NginxStatisticsReader(TopologyProvider topologyProvider) {
-        this.topologyProvider = topologyProvider;
-        this.clusterInstanceId = System.getProperty(StratosConstants.CLUSTER_INSTANCE_ID, StratosConstants.NOT_DEFINED);
-    }
-
-    @Override
-    public String getClusterInstanceId() {
-        return clusterInstanceId;
-    }
-
-    @Override
-    public int getInFlightRequestCount(String clusterId) {
-        Cluster cluster = topologyProvider.getClusterByClusterId(clusterId);
-        if(cluster != null) {
-            String serviceName = cluster.getServiceName();
-            Service service = topologyProvider.getTopology().getService(serviceName);
-            if(service != null) {
-                int inFlightRequestCount = 0;
-                for(Port port : service.getPorts()) {
-                    inFlightRequestCount += findWritingCount(port.getProxy());
-                }
-                if(log.isDebugEnabled()) {
-                    log.debug(String.format("In-flight request count: [cluster-id] %s [value] %d",
-                            clusterId, inFlightRequestCount));
-                }
-                return inFlightRequestCount;
-            }
-        }
-        return 0;
-    }
-
-    /**
-     * Make a http request to http://127.0.0.1:<proxy-port>/nginx_status and find writing count.
-     * @param proxyPort
-     * @return
-     */
-    private int findWritingCount(int proxyPort) {
-        try {
-            URL url = new URL("http", "127.0.0.1", proxyPort, "/nginx_status");
-            DefaultHttpClient httpClient = new DefaultHttpClient();
-            HttpUriRequest request = new HttpGet(url.toURI());
-            HttpResponse response = httpClient.execute(request);
-            if (response.getStatusLine().getStatusCode() != 200) {
-                throw new RuntimeException("http://127.0.0.1:" + proxyPort + "/nginx_status was not found");
-            }
-            BufferedReader reader = new BufferedReader(new InputStreamReader(
-                    (response.getEntity().getContent())));
-            String output, result = "";
-            while ((output = reader.readLine()) != null) {
-                result += output;
-            }
-            Pattern pattern = Pattern.compile("(Writing: )([0-1]*)");
-            Matcher matcher = pattern.matcher(result);
-            if (matcher.find()) {
-                // Deduct one to remove the above request
-                int writingCount = Integer.parseInt(matcher.group(2)) - 1;
-                if(log.isDebugEnabled()) {
-                    log.debug(String.format("Writing count: [proxy] %d [value] %d", proxyPort, writingCount));
-                }
-                return writingCount;
-            }
-            throw new RuntimeException("Writing block was not found in nginx_status response");
-        } catch (HttpHostConnectException ignore) {
-            if(ignore.getMessage().contains("Connection refused")) {
-                log.warn("Could not find in-flight request count, connection refused: " +
-                        "http://127.0.0.1:" + proxyPort + "/nginx_status");
-            }
-        } catch (Exception e) {
-            log.error("Could not find in-flight request count: http://127.0.0.1:" + proxyPort + "/nginx_status", e);
-        }
-        return 0;
-    }
-}


[50/50] [abbrv] stratos git commit: Resolve conflicts

Posted by ra...@apache.org.
Resolve conflicts


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/08dac042
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/08dac042
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/08dac042

Branch: refs/heads/master
Commit: 08dac042ea2215ee8664dd8ca1b4adee466b9acb
Parents: 9b1d272 eefef71
Author: Akila Perera <ra...@gmail.com>
Authored: Sun Aug 30 23:45:41 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 23:45:41 2015 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------



[17/50] [abbrv] stratos git commit: Using tenant id to query application sign up availability

Posted by ra...@apache.org.
Using tenant id to query application sign up availability


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f7d6649f
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f7d6649f
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f7d6649f

Branch: refs/heads/master
Commit: f7d6649fe05809fad7702b22d5f80c8eed8f0402
Parents: 2951d40
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Aug 28 12:44:31 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Aug 28 12:44:46 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/f7d6649f/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 148a3e6..b584cfe 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -1854,8 +1854,9 @@ public class StratosApiV41Utils {
                         ApplicationBean applicationDefinition =
                                 ObjectConverter.convertStubApplicationContextToApplicationDefinition(applicationContext);
                         if(applicationDefinition.isMultiTenant()) {
+                            int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
                             boolean hasSignUps = StratosManagerServiceClient.getInstance().
-                                    applicationSignUpsExist(applicationDefinition.getApplicationId());
+                                    applicationSignUpExist(applicationDefinition.getApplicationId(), tenantId);
                             applicationDefinition.setSignUpsExist(hasSignUps);
                         }
                         applicationDefinitions.add(applicationDefinition);


[22/50] [abbrv] stratos git commit: Fixing port mapping issue in haproxy extension

Posted by ra...@apache.org.
Fixing port mapping issue in haproxy extension


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/cb50e9a4
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/cb50e9a4
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/cb50e9a4

Branch: refs/heads/master
Commit: cb50e9a447e0e7573c5758b55ea941637896c2dc
Parents: 6436832
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Aug 28 18:39:10 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Aug 28 18:39:23 2015 +0530

----------------------------------------------------------------------
 .../haproxy/extension/HAProxyConfigWriter.java       | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/cb50e9a4/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
index d3ed8ef..7a0d531 100644
--- a/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
+++ b/extensions/load-balancer/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
@@ -31,6 +31,7 @@ import java.io.BufferedWriter;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.util.Collection;
 
 /**
  * HAProxy load balancer configuration writer.
@@ -65,7 +66,7 @@ public class HAProxyConfigWriter {
 
         for (Service service : topology.getServices()) {
             for (Cluster cluster : service.getClusters()) {
-                createConfig(service, cluster, frontendCollection, backendCollection);
+                createConfig(cluster, frontendCollection, backendCollection);
             }
         }
 
@@ -106,14 +107,18 @@ public class HAProxyConfigWriter {
         }
     }
 
-    private void createConfig(Service service, Cluster cluster, StringBuilder frontendCollection,
+    private void createConfig(Cluster cluster, StringBuilder frontendCollection,
                               StringBuilder backendCollection) {
 
-        if ((service.getPorts() == null) || (service.getPorts().size() == 0)) {
-            throw new RuntimeException(String.format("No ports found in service: %s", service.getServiceName()));
+        if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
+            return;
         }
 
-        for (Port port : service.getPorts()) {
+        // Find port mappings
+        Member firstMember = (Member) cluster.getMembers().toArray()[0];
+        Collection<Port> ports = firstMember.getPorts();
+
+        for (Port port : ports) {
             // Frontend block start
             String protocol = port.getProtocol();
             String frontendId = protocol + "_" + port.getValue() + "_frontend";


[26/50] [abbrv] stratos git commit: add member status logs to assertClusterActivation

Posted by ra...@apache.org.
add member status logs to assertClusterActivation


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/dee118bd
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/dee118bd
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/dee118bd

Branch: refs/heads/master
Commit: dee118bdf22d909eaf12004e2820ee1cbd2c2b4f
Parents: 90b030a
Author: Akila Perera <ra...@gmail.com>
Authored: Sat Aug 29 00:45:16 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Aug 29 00:45:16 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/integration/tests/TopologyHandler.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/dee118bd/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
index a0aea77..3a1e6c6 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
@@ -225,9 +225,10 @@ public class TopologyHandler {
             assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
                     applicationName, serviceName, clusterId), cluster);
             for (Member member : cluster.getMembers()) {
-                log.info(String.format("Member [member-id] %s found in cluster instance [cluster-instance] %s of " +
-                        "cluster [cluster-id] %s", member
-                        .getMemberId(), member.getClusterInstanceId(), member.getClusterId()));
+                log.info(String.format(
+                        "Member [member-id] %s in [status] %s found in [cluster-instance] %s of [cluster-id] %s",
+                        member.getMemberId(), member.getStatus(), member.getClusterInstanceId(),
+                        member.getClusterId()));
             }
             boolean clusterActive = false;
             int activeInstances;


[30/50] [abbrv] stratos git commit: Restructuring Docker files

Posted by ra...@apache.org.
Restructuring Docker files


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/fb5383d7
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/fb5383d7
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/fb5383d7

Branch: refs/heads/master
Commit: fb5383d712e2b3212f096d9ba2960e1c2c609478
Parents: 96c7935
Author: Akila Perera <ra...@gmail.com>
Authored: Sun Aug 30 02:01:53 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 14:09:53 2015 +0530

----------------------------------------------------------------------
 .../base-image/Dockerfile                       | 13 +++----
 .../service-images/php/Dockerfile               |  4 +--
 .../php/packs/plugins/PhpServerStarterPlugin.py | 36 -------------------
 .../plugins/PhpServerStarterPlugin.yapsy-plugin | 26 --------------
 .../php/plugins/PhpServerStarterPlugin.py       | 36 +++++++++++++++++++
 .../plugins/PhpServerStarterPlugin.yapsy-plugin | 26 ++++++++++++++
 .../service-images/tomcat/Dockerfile            |  2 +-
 .../service-images/tomcat/packs/.gitignore      |  4 +++
 .../packs/plugins/TomcatServerStarterPlugin.py  | 38 --------------------
 .../TomcatServerStarterPlugin.yapsy-plugin      | 25 -------------
 .../tomcat/plugins/TomcatServerStarterPlugin.py | 38 ++++++++++++++++++++
 .../TomcatServerStarterPlugin.yapsy-plugin      | 25 +++++++++++++
 12 files changed, 139 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/base-image/Dockerfile b/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
index 0fafed2..7076fae 100644
--- a/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/base-image/Dockerfile
@@ -19,9 +19,10 @@
 #
 # --------------------------------------------------------------
 
-FROM debian:7.7
+FROM debian:7.8
 MAINTAINER dev@stratos.apache.org
 
+ENV PCA_DISTRIBUTION_NAME apache-stratos-python-cartridge-agent-4.1.2
 # ------------------
 # Setup ssh server
 # ------------------
@@ -48,13 +49,13 @@ RUN pip install yapsy
 # -------------------------
 WORKDIR /mnt/
 
-ADD packs/apache-stratos-python-cartridge-agent-4.1.2.zip /mnt/apache-stratos-python-cartridge-agent-4.1.2.zip
-RUN unzip -q /mnt/apache-stratos-python-cartridge-agent-4.1.2.zip -d /mnt/
-RUN rm /mnt/apache-stratos-python-cartridge-agent-4.1.2.zip
+ADD packs/${PCA_DISTRIBUTION_NAME}.zip /mnt/${PCA_DISTRIBUTION_NAME}.zip
+RUN unzip -q /mnt/${PCA_DISTRIBUTION_NAME}.zip -d /mnt/
+RUN rm /mnt/${PCA_DISTRIBUTION_NAME}.zip
 
-RUN mkdir -p /mnt/apache-stratos-python-cartridge-agent-4.1.2/payload
+RUN mkdir -p /mnt/${PCA_DISTRIBUTION_NAME}/payload
 
-RUN chmod +x /mnt/apache-stratos-python-cartridge-agent-4.1.2/extensions/bash/*
+RUN chmod +x /mnt/${PCA_DISTRIBUTION_NAME}/extensions/bash/*
 RUN mkdir -p /var/log/apache-stratos/
 RUN touch /var/log/apache-stratos/cartridge-agent-extensions.log
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile b/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
index 0ca5c3f..3795e9c 100644
--- a/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/service-images/php/Dockerfile
@@ -25,14 +25,14 @@ MAINTAINER dev@stratos.apache.org
 # ----------------
 # Install PHP
 # ----------------
-RUN apt-get install -y apache2 php5 zip stress
+RUN apt-get update && apt-get install -y apache2 php5 zip stress
 RUN rm -f /etc/apache2/sites-enabled/000-default.conf
 ADD files/000-default.conf /etc/apache2/sites-enabled/000-default.conf
 
 #------------------------
 # Copy PHP related PCA plugins
 #-----------------------
-ADD packs/plugins /mnt/plugins
+ADD plugins /mnt/plugins
 
 EXPOSE 80
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.py
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.py b/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.py
deleted file mode 100644
index 13d165c..0000000
--- a/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.py
+++ /dev/null
@@ -1,36 +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.
-
-import mdsclient
-from plugins.contracts import ICartridgeAgentPlugin
-import time
-import zipfile
-import subprocess
-from modules.util.log import LogFactory
-import os
-
-
-class PhpServerStarterPlugin(ICartridgeAgentPlugin):
-
-    def run_plugin(self, values):
-        log = LogFactory().get_log(__name__)
-        # php_start_command = "/usr/sbin/apache2ctl -D FOREGROUND"
-        php_start_command = "/etc/init.d/apache2 restart"
-        p = subprocess.Popen(php_start_command, shell=True)
-        output, errors = p.communicate()
-        log.debug("Apache server started: [command] %s, [output] %s" % (php_start_command, output))
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.yapsy-plugin
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.yapsy-plugin b/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.yapsy-plugin
deleted file mode 100644
index 0fb7a01..0000000
--- a/tools/docker-images/cartridge-docker-images/service-images/php/packs/plugins/PhpServerStarterPlugin.yapsy-plugin
+++ /dev/null
@@ -1,26 +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.
-
-[Core]
-Name = PhpServerStarterPlugin to start Apache server with PHP
-Module = PhpServerStarterPlugin
-
-[Documentation]
-Description = ArtifactUpdatedEvent
-Author = Op1
-Version = 0.1
-Website = stratos.apache.org
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.py
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.py b/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.py
new file mode 100644
index 0000000..13d165c
--- /dev/null
+++ b/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.py
@@ -0,0 +1,36 @@
+# 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.
+
+import mdsclient
+from plugins.contracts import ICartridgeAgentPlugin
+import time
+import zipfile
+import subprocess
+from modules.util.log import LogFactory
+import os
+
+
+class PhpServerStarterPlugin(ICartridgeAgentPlugin):
+
+    def run_plugin(self, values):
+        log = LogFactory().get_log(__name__)
+        # php_start_command = "/usr/sbin/apache2ctl -D FOREGROUND"
+        php_start_command = "/etc/init.d/apache2 restart"
+        p = subprocess.Popen(php_start_command, shell=True)
+        output, errors = p.communicate()
+        log.debug("Apache server started: [command] %s, [output] %s" % (php_start_command, output))
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.yapsy-plugin
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.yapsy-plugin b/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.yapsy-plugin
new file mode 100644
index 0000000..0fb7a01
--- /dev/null
+++ b/tools/docker-images/cartridge-docker-images/service-images/php/plugins/PhpServerStarterPlugin.yapsy-plugin
@@ -0,0 +1,26 @@
+# 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.
+
+[Core]
+Name = PhpServerStarterPlugin to start Apache server with PHP
+Module = PhpServerStarterPlugin
+
+[Documentation]
+Description = ArtifactUpdatedEvent
+Author = Op1
+Version = 0.1
+Website = stratos.apache.org
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile b/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
index faf962b..fd47a81 100644
--- a/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
+++ b/tools/docker-images/cartridge-docker-images/service-images/tomcat/Dockerfile
@@ -58,7 +58,7 @@ RUN chmod +x /tmp/env && \
 #------------------------
 # Copy Tomcat related PCA plugins
 #-----------------------
-ADD packs/plugins /mnt/plugins
+ADD plugins /mnt/plugins
 
 
 EXPOSE 8080

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/.gitignore
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/.gitignore b/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/.gitignore
new file mode 100644
index 0000000..5e7d273
--- /dev/null
+++ b/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/.gitignore
@@ -0,0 +1,4 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.py
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.py b/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.py
deleted file mode 100644
index 6509865..0000000
--- a/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.py
+++ /dev/null
@@ -1,38 +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.
-
-import mdsclient
-from plugins.contracts import ICartridgeAgentPlugin
-import time
-import zipfile
-import subprocess
-from modules.util.log import LogFactory
-import os
-
-
-class TomcatServerStarterPlugin(ICartridgeAgentPlugin):
-
-    def run_plugin(self, values):
-        log = LogFactory().get_log(__name__)
-        # start tomcat
-        tomcat_start_command = "exec ${CATALINA_HOME}/bin/startup.sh"
-        log.info("Starting Tomcat server: [command] %s" % tomcat_start_command)
-
-        p = subprocess.Popen(tomcat_start_command, shell=True)
-        output, errors = p.communicate()
-        log.debug("Tomcat server started: [command] %s, [output] %s" % (p.args, output))
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.yapsy-plugin
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.yapsy-plugin b/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.yapsy-plugin
deleted file mode 100644
index 6c80de9..0000000
--- a/tools/docker-images/cartridge-docker-images/service-images/tomcat/packs/plugins/TomcatServerStarterPlugin.yapsy-plugin
+++ /dev/null
@@ -1,25 +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.
-[Core]
-Name = TomcatServerStarterPlugin to read SAML SSO related metadata needed to configure SAML SSO for apps and start tomcat
-Module = TomcatServerStarterPlugin
-
-[Documentation]
-Description = ArtifactUpdatedEvent
-Author = Op1
-Version = 0.1
-Website = stratos.apache.org
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.py
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.py b/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.py
new file mode 100644
index 0000000..6509865
--- /dev/null
+++ b/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.py
@@ -0,0 +1,38 @@
+# 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.
+
+import mdsclient
+from plugins.contracts import ICartridgeAgentPlugin
+import time
+import zipfile
+import subprocess
+from modules.util.log import LogFactory
+import os
+
+
+class TomcatServerStarterPlugin(ICartridgeAgentPlugin):
+
+    def run_plugin(self, values):
+        log = LogFactory().get_log(__name__)
+        # start tomcat
+        tomcat_start_command = "exec ${CATALINA_HOME}/bin/startup.sh"
+        log.info("Starting Tomcat server: [command] %s" % tomcat_start_command)
+
+        p = subprocess.Popen(tomcat_start_command, shell=True)
+        output, errors = p.communicate()
+        log.debug("Tomcat server started: [command] %s, [output] %s" % (p.args, output))
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/fb5383d7/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.yapsy-plugin
----------------------------------------------------------------------
diff --git a/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.yapsy-plugin b/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.yapsy-plugin
new file mode 100644
index 0000000..6c80de9
--- /dev/null
+++ b/tools/docker-images/cartridge-docker-images/service-images/tomcat/plugins/TomcatServerStarterPlugin.yapsy-plugin
@@ -0,0 +1,25 @@
+# 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.
+[Core]
+Name = TomcatServerStarterPlugin to read SAML SSO related metadata needed to configure SAML SSO for apps and start tomcat
+Module = TomcatServerStarterPlugin
+
+[Documentation]
+Description = ArtifactUpdatedEvent
+Author = Op1
+Version = 0.1
+Website = stratos.apache.org
\ No newline at end of file


[14/50] [abbrv] stratos git commit: Adding integration test to PCA to validate Git artifact distribution

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
index 165508e..5b98406 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
@@ -1 +1 @@
-APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' 	,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
 ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
 MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
 0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
+APPLICATION_ID=application-1,APPLICATION_PATH=/tmp/pca-test-suite-1,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' 	,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,
 KUBERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=45
 00,MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWm
 VIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
index 136433d..f05a00e 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
@@ -27,7 +27,7 @@ cep.stats.publisher.enabled           =true
 lb.private.ip                         =
 lb.public.ip                          =
 enable.artifact.update                =true
-auto.commit                           =false
+auto.commit                           =true
 auto.checkout                         =true
 artifact.update.interval              =15
 artifact.clone.retries                =5
@@ -40,7 +40,7 @@ monitoring.server.secure.port         =7712
 monitoring.server.admin.username      =admin
 monitoring.server.admin.password      =admin
 #log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths                        =/tmp/agent.screen.log
+log.file.paths                        =/tmp/agent.screen-adc-test.log
 metadata.service.url                  =https://localhost:9443
 super.tenant.repository.path          =/repository/deployment/server/
 tenant.repository.path                =/repository/tenants/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
index 0d29753..aa4fcc3 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
@@ -1,18 +1 @@
-# 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.
-
-APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file
+APPLICATION_ID=application1,SERVICE_NAME=tomcat,HOST_NAME=tomcat.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-2,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null
\ No newline at end of file


[39/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/README.md b/extensions/load-balancer/lvs-extension/README.md
deleted file mode 100644
index 13de2e0..0000000
--- a/extensions/load-balancer/lvs-extension/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Apache Stratos LVS Extension
-
-Apache Stratos LVS extension is a load balancer extension for LVS. It is an executable program
-which can manage the life-cycle of a LVS instance according to the topology, composite application model,
-tenant application signups and domain mapping information received from Stratos via the message broker.
-
-## How it works
-1. Wait for the complete topology event message to initialize the topology.
-2. Configure Keepalived
-3. Listen to topology, application, application signup, domain mapping events.
-4. Reload Keepalived instance with the new topology configuration.
-5. Periodically publish statistics to Complex Event Processor (CEP).
-
-## Statistics publishing
-Set cep.stats.publisher.enabled to true in lvs-extension.sh file to enable statistics publishing.
-
-## Installation
-Please refer INSTALL.md for information on the installation process.

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/pom.xml b/extensions/load-balancer/lvs-extension/pom.xml
deleted file mode 100644
index 8bfe1db..0000000
--- a/extensions/load-balancer/lvs-extension/pom.xml
+++ /dev/null
@@ -1,109 +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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.stratos</groupId>
-        <artifactId>stratos-load-balancer-extensions</artifactId>
-        <version>4.1.2</version>
-    </parent>
-
-    <artifactId>apache-stratos-lvs-extension</artifactId>
-    <name>Apache Stratos - LVS Extension</name>
-    <description>Apache Stratos LVS Extension for Load Balancing</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>1.7.5</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.messaging</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.stratos</groupId>
-            <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.velocity</groupId>
-            <artifactId>velocity</artifactId>
-            <version>1.7</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.andes.wso2</groupId>
-            <artifactId>andes-client</artifactId>
-            <version>0.13.wso2v8</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>org.apache.stratos.lvs.extension.Main</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <descriptors>
-                        <descriptor>src/main/assembly/bin.xml</descriptor>
-                    </descriptors>
-                    <archiverConfig>
-                        <fileMode>420</fileMode>
-                        <directoryMode>493</directoryMode>
-                        <defaultDirectoryMode>493</defaultDirectoryMode>
-                    </archiverConfig>
-                    <appendAssemblyId>false</appendAssemblyId>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/assembly/bin.xml b/extensions/load-balancer/lvs-extension/src/main/assembly/bin.xml
deleted file mode 100644
index 5569074..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,106 +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.
-  -->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
-    <id>bin</id>
-    <formats>
-        <format>zip</format>
-    </formats>
-    <fileSets>
-        <fileSet>
-            <directory>${project.basedir}/src/main/bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>lvs-extension.sh</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/conf</directory>
-            <outputDirectory>/conf</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>jndi.properties</include>
-                <include>log4j.properties</include>
-                <include>thrift-client-config.xml</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/security</directory>
-            <outputDirectory>/security</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>client-truststore.jks</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/templates</directory>
-            <outputDirectory>/templates</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>keepalived.conf.template</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/scripts</directory>
-            <outputDirectory>/scripts</outputDirectory>
-            <fileMode>0755</fileMode>
-            <includes>
-                <include>get-weight.sh</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-            <includes>
-                <include>DISCLAIMER</include>
-                <include>README*</include>
-                <include>LICENSE*</include>
-                <include>INSTALL*</include>
-            </includes>
-        </fileSet>
-	<fileSet>
-            <directory>${project.basedir}/src/main/license</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/src/main/notice</directory>
-            <outputDirectory>/</outputDirectory>
-            <fileMode>0600</fileMode>
-        </fileSet>
-    </fileSets>
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>/lib</outputDirectory>
-	        <excludes>
-                <exclude>*:icu4j*</exclude>
-                <exclude>*:jaxen*</exclude>
-                <exclude>*:jboss-transaction-api*</exclude>
-                <exclude>*:wrapper*</exclude>
-                <exclude>*:xom*</exclude>
-            </excludes>
-            <useProjectArtifact>true</useProjectArtifact>
-            <scope>runtime</scope>
-        </dependencySet>
-    </dependencySets>
-</assembly>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/bin/lvs-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/bin/lvs-extension.sh b/extensions/load-balancer/lvs-extension/src/main/bin/lvs-extension.sh
deleted file mode 100755
index e769c32..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/bin/lvs-extension.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-echo "Starting lvs extension..."
-script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-lib_path=${script_path}/../lib/
-class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
-properties="-Dlvs.private.ip=127.0.0.1
-            -Dexecutable.file.path=lvs
-            -Djndi.properties.dir=${script_path}/../conf
-            -Dtemplates.path=${script_path}/../templates
-            -Dtemplates.name=keepalived.conf.template
-            -Dscripts.path=${script_path}/../scripts
-            -Dconf.file.path=/tmp/keepalived.conf
-            -Dstats.socket.file.path=/tmp/nginx-stats.socket
-            -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
-            -Djavax.net.ssl.trustStore=${script_path}/../security/client-truststore.jks
-            -Djavax.net.ssl.trustStorePassword=wso2carbon
-            -Dthrift.client.config.file.path=${script_path}/../conf/thrift-client-config.xml
-            -Dcep.stats.publisher.enabled=false
-            -Dthrift.receiver.ip=127.0.0.1
-            -Dthrift.receiver.port=7615
-            -Dnetwork.partition.id=network-partition-1
-            -Dcluster.id=cluster-1
-            -Dservice.name=service-1
-            -Dlvs.service.virtualip.set=tomcat2|192.168.56.40,tomcat1|192.168.56.41
-            -Dschedule.algorithm=rr
-            -Dserver.state=MASTER
-            -Dkeepalived=false"
-
-
-# Uncomment below line to enable remote debugging
-#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
-
-java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.lvs.extension.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/conf/jndi.properties b/extensions/load-balancer/lvs-extension/src/main/conf/jndi.properties
deleted file mode 100644
index 21d7420..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/conf/jndi.properties
+++ /dev/null
@@ -1,22 +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.
-#
-
-connectionfactoryName=TopicConnectionFactory
-java.naming.provider.url=tcp://localhost:61616
-java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/conf/log4j.properties b/extensions/load-balancer/lvs-extension/src/main/conf/log4j.properties
deleted file mode 100644
index ad6b80a..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/conf/log4j.properties
+++ /dev/null
@@ -1,40 +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.
-#
-
-# Set root logger level and appenders
-log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
-
-# CONSOLE_APPENDER is set to be a ConsoleAppender.
-log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
-
-# The standard error log where all the warnings, errors and fatal errors will be logged
-log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
-log4j.appender.FILE_APPENDER.File=logs/nginx-extension.log
-log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
-log4j.appender.FILE_APPENDER.threshold=DEBUG
-
-# CONSOLE_APPENDER uses PatternLayout.
-log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
-
-log4j.logger.org.apache.stratos.nginx.extension=INFO
-log4j.logger.org.apache.stratos.load.balancer.extension.api=INFO
-log4j.logger.org.apache.stratos.messaging=INFO
-log4j.logger.org.wso2.andes.client=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/lvs-extension/src/main/conf/thrift-client-config.xml
deleted file mode 100644
index 86a5fc6..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/conf/thrift-client-config.xml
+++ /dev/null
@@ -1,25 +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.
-  -->
-
-<thriftClientConfiguration>
-    <username>admin</username>
-    <password>admin</password>
-    <ip>localhost</ip>
-    <port>7611</port>
-</thriftClientConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java
deleted file mode 100644
index ce0f267..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Constants.java
+++ /dev/null
@@ -1,43 +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.lvs.extension;
-
-/**
- * LVS extension constants.
- */
-public class Constants {
-    public static final String LVS_PRIVATE_IP = "lvs.private.ip";
-    public static final String EXECUTABLE_FILE_PATH = "executable.file.path";
-    public static final String TEMPLATES_PATH = "templates.path";
-    public static final String TEMPLATES_NAME = "templates.name";
-    public static final String SCRIPTS_PATH = "scripts.path";
-    public static final String CONF_FILE_PATH = "conf.file.path";
-    public static final String STATS_SOCKET_FILE_PATH = "stats.socket.file.path";
-    public static final String CEP_STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
-    public static final String THRIFT_RECEIVER_IP = "thrift.receiver.ip";
-    public static final String THRIFT_RECEIVER_PORT = "thrift.receiver.port";
-    public static final String NETWORK_PARTITION_ID = "network.partition.id";
-    public static final String CLUSTER_ID = "cluster.id";
-    public static final String SERVICE_NAME = "service.name";
-	public static final String VIRTUALIPS_FOR_SERVICES = "lvs.service.virtualip.set" ;
-	public static final String KEEPALIVED_START_COMMAND = "service keepalived restart";
-	public static final String SERVER_STATE ="server.state" ;
-	public static final String LVS_SCHEDULE_ALGO = "schedule.algorithm";
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java
deleted file mode 100644
index 9494510..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVS.java
+++ /dev/null
@@ -1,158 +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.lvs.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.util.CommandUtils;
-import org.apache.stratos.load.balancer.extension.api.LoadBalancer;
-import org.apache.stratos.load.balancer.extension.api.exception.LoadBalancerExtensionException;
-import org.apache.stratos.load.balancer.common.domain.Topology;
-
-import java.io.File;
-
-/**
- * Lvs load balancer life-cycle implementation.
- */
-public class LVS implements LoadBalancer {
-
-    private static final Log log = LogFactory.getLog(LVS.class);
-
-    private String executableFilePath;
-    private String processIdFilePath;
-    private String templatePath;
-    private String templateName;
-    private String confFilePath;
-    private String statsSocketFilePath;
-	private String virtualIPsForServices;
-	private String keepAlivedStartCommand;
-	private String serverState;
-	private String scheduleAlgo;
-	private boolean isKeepAlivedUsed;
-
-    public LVS() {
-        this.executableFilePath = LVSContext.getInstance().getExecutableFilePath();
-        this.templatePath = LVSContext.getInstance().getTemplatePath();
-        this.templateName = LVSContext.getInstance().getTemplateName();
-        this.confFilePath = LVSContext.getInstance().getConfFilePath();
-        this.processIdFilePath = confFilePath.replace(".cfg", ".pid");
-        this.statsSocketFilePath = LVSContext.getInstance().getStatsSocketFilePath();
-	    this.virtualIPsForServices= LVSContext.getInstance().getVirtualIPsForServices();
-	    this.keepAlivedStartCommand=LVSContext.getInstance().getKeepAlivedStartCommand();
-	    this.serverState=LVSContext.getInstance().getServerState();
-	    this.scheduleAlgo=LVSContext.getInstance().getLvsScheduleAlgo();
-	    this.isKeepAlivedUsed=LVSContext.getInstance().getIsKeepAlivedUsed();
-
-    }
-
-    /**
-     * Configure lvs instance according to topology given
-     * @param topology
-     * @throws LoadBalancerExtensionException
-     */
-    public boolean configure(Topology topology) throws LoadBalancerExtensionException {
-        try {
-            log.info("Generating lvs configuration...");
-            LVSConfigWriter writer = new LVSConfigWriter(templatePath, templateName, confFilePath, statsSocketFilePath,
-                                                         virtualIPsForServices,serverState,scheduleAlgo);
-            if(writer.write(topology)) {
-                return true;
-            }
-            return false;
-        } catch (Exception e) {
-            log.error("Could not generate lvs configuration");
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Start lvs instance
-     * @throws LoadBalancerExtensionException
-     */
-    public void start() throws LoadBalancerExtensionException {
-        log.info("Starting lvs instance...");
-        // Check for configuration file
-        File conf = new File(confFilePath);
-        if (!conf.exists()) {
-            throw new LoadBalancerExtensionException("Could not find lvs configuration file");
-        }
-
-        // Start nginx and write pid to processIdFilePath
-        try {
-	        if(isKeepAlivedUsed) {
-		        String command = keepAlivedStartCommand;
-		        CommandUtils.executeCommand(command);
-	        }
-            log.info("lvs instance started");
-        } catch (Exception e) {
-            log.error("Could not start lvs instance");
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Reload lvs instance according to the configuration written in configure() method.
-     * @throws LoadBalancerExtensionException
-     */
-    public void reload() throws LoadBalancerExtensionException {
-        try {
-            log.info("Reloading configuration...");
-
-            if(isKeepAlivedUsed) {
-	            // Execute hot configuration deployment
-		        String command = "service keepalived restart";
-		        CommandUtils.executeCommand(command);
-	        }
-            if (log.isInfoEnabled()) {
-                log.info("Configuration done");
-            }
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error("Reconfiguration failed");
-            }
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-
-    /**
-     * Stop lvs instance
-     * @throws LoadBalancerExtensionException
-     */
-    public void stop() throws LoadBalancerExtensionException {
-
-        try {
-            log.info("Stopping lvs...");
-
-	        if(isKeepAlivedUsed) {
-		        // Execute hot configuration deployment
-		        String command = "service keepalived stop";
-		        CommandUtils.executeCommand(command);
-	        }
-            if (log.isInfoEnabled()) {
-                log.info("LVS stopped");
-            }
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error("Could not stop lvs");
-            }
-            throw new LoadBalancerExtensionException(e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
deleted file mode 100644
index 1a09c5c..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
+++ /dev/null
@@ -1,241 +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.lvs.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.util.CommandUtils;
-import org.apache.stratos.load.balancer.common.domain.*;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.RuntimeConstants;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.Collection;
-
-/**
- * LVS load balancer configuration writer.
- */
-public class LVSConfigWriter {
-
-	private static final Log log = LogFactory.getLog(Main.class);
-	private static final String NEW_LINE = System.getProperty("line.separator");
-	private static final String TAB = "    ";
-
-	private String templatePath;
-	private String templateName;
-	private String confFilePath;
-	private String statsSocketFilePath;
-	private String virtualIPsForServices;
-	private String serverState;
-	private String scheduleAlgo;
-	private boolean isKeepAlived=false;
-
-	public LVSConfigWriter(String templatePath, String templateName, String confFilePath,
-	                       String statsSocketFilePath, String virtualIPsForServices, String serverState,
-	                       String scheduleAlgo) {
-
-		this.templatePath = templatePath;
-		this.templateName = templateName;
-		this.confFilePath = confFilePath;
-		this.statsSocketFilePath = statsSocketFilePath;
-		this.virtualIPsForServices = virtualIPsForServices;
-		this.serverState = serverState;
-		this.scheduleAlgo = scheduleAlgo;
-	}
-
-	public boolean write(Topology topology) {
-
-		StringBuilder configurationBuilder = new StringBuilder();
-		StringBuilder virtualIPBuilder = new StringBuilder();
-		String state;
-		for (Service service : topology.getServices()) {
-			for (Cluster cluster : service.getClusters()) {
-				generateConfigurationForCluster(cluster, configurationBuilder, virtualIPBuilder,
-				                                virtualIPsForServices, scheduleAlgo,isKeepAlived);
-			}
-		}
-
-		// Start velocity engine
-		VelocityEngine ve = new VelocityEngine();
-		ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatePath);
-		ve.init();
-
-		// Open the template
-		Template t = ve.getTemplate(templateName);
-
-		// Insert strings into the template
-		VelocityContext context = new VelocityContext();
-		context.put("configuration", configurationBuilder.toString());
-		context.put("virtualips", virtualIPBuilder.toString());
-		context.put("state", serverState);
-
-		// Create a new string from the template
-		StringWriter stringWriter = new StringWriter();
-		t.merge(context, stringWriter);
-		String configuration = stringWriter.toString();
-
-		// Write configuration file
-		try {
-			BufferedWriter writer = new BufferedWriter(new FileWriter(confFilePath));
-			writer.write(configuration);
-			writer.close();
-
-			if (log.isInfoEnabled()) {
-				log.info(String.format("Configuration written to file: %s", confFilePath));
-			}
-			return true;
-		} catch (IOException e) {
-			if (log.isErrorEnabled()) {
-				log.error(String.format("Could not write configuration file: %s", confFilePath));
-			}
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * Generate configuration for a cluster with the following format:
-	 * <p/>
-	 * virtual_server 10.10.10.10 80 {
-	 * delay_loop 10
-	 * lvs_sched wlc
-	 * lvs_method DR
-	 * persistence_timeout 5
-	 * protocol TCP
-	 * <p/>
-	 * real_server 10.10.10.41 80 {
-	 * weight 50
-	 * TCP_CHECK {
-	 * connect_timeout 3
-	 * }
-	 * }
-	 * <p/>
-	 * real_server 10.10.10.42 80 {
-	 * weight 50
-	 * TCP_CHECK {
-	 * connect_timeout 3
-	 * }
-	 * }
-	 * }
-	 *
-	 * @param cluster
-	 * @param text
-	 */
-	private void generateConfigurationForCluster(Cluster cluster, StringBuilder text,
-	                                             StringBuilder virtualIPs, String virtualIPsForServices,
-	                                             String scheduleAlgo,boolean isKeepAlived) {
-
-		if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
-			return;
-		}
-
-		// Find port mappings
-		Member firstMember = (Member) cluster.getMembers().toArray()[0];
-		Collection<Port> ports = firstMember.getPorts();
-
-		String commandClear = "ipvsadm --clear";
-		try {
-			CommandUtils.executeCommand(commandClear);
-		} catch (IOException e) {
-			if (log.isErrorEnabled()) {
-				log.error(String.format("Could not run the command: %s", commandClear));
-			}
-			throw new RuntimeException(e);
-		}
-
-		String[] virtualIPForServiceArray;
-		if (virtualIPsForServices.contains(",")) {
-			virtualIPForServiceArray = virtualIPsForServices.split(",");
-		} else {
-			virtualIPForServiceArray = new String[1];
-			virtualIPForServiceArray[0] = virtualIPsForServices;
-		}
-		boolean isServiceAvailable = false;
-		for (int i = 0; i < virtualIPForServiceArray.length; i++) {
-			String[] virtualIpForService = virtualIPForServiceArray[i].split("\\|");
-		    for (Port port : ports) {
-			    String command = "ipvsadm -A -t " + virtualIpForService[1]+":" + port.getProxy()+ " -s " + scheduleAlgo;
-
-			    try {
-				    CommandUtils.executeCommand(command);
-			    } catch (IOException e) {
-				    if (log.isErrorEnabled()) {
-					    log.error(String.format("Could not run the command: %s", command));
-				    }
-				    throw new RuntimeException(e);
-			    }
-
-			    for (String hostname : cluster.getHostNames()) {
-				    if (virtualIpForService[0].equals(cluster.getServiceName())) {
-
-					    text.append("virtual_server ").append(virtualIpForService[1]).append(" ")
-					        .append(port.getProxy()).append(
-							    " {").append(
-							    NEW_LINE);
-					    text.append(TAB).append("delay_loop 10").append(NEW_LINE);
-					    text.append(TAB).append("lvs_sched ").append(scheduleAlgo).append(NEW_LINE);
-					    text.append(TAB).append("lvs_method DR").append(NEW_LINE);
-					    text.append(TAB).append("persistence_timeout 5").append(NEW_LINE);
-					    text.append(TAB).append("protocol TCP").append(NEW_LINE).append(NEW_LINE);
-
-					    //Start real servers block
-
-					    for (Member member : cluster.getMembers()) {
-						    // Start upstream server block
-						    text.append(TAB).append("real_server ").append(member.getHostName()).append(" ")
-						        .append(port.getValue()).append(" {")
-						        .append(NEW_LINE);
-						    text.append(TAB).append(TAB).append("weight 50").append(NEW_LINE);
-						    text.append(TAB).append(TAB).append("TCP_CHECK {").append(NEW_LINE);
-						    text.append(TAB).append(TAB).append(TAB).append("connect_timeout 3").append(NEW_LINE);
-						    text.append(TAB).append(TAB).append("}").append(NEW_LINE);
-						    text.append(TAB).append("}").append(NEW_LINE);
-						    String commandMember =
-								    "ipvsadm -a -t " + virtualIpForService[1] + ":" + port.getProxy() + " -r " +
-								    member.getHostName() + ":" + port.getValue() + " -m";
-
-						    try {
-							    CommandUtils.executeCommand(commandMember);
-						    } catch (IOException e) {
-							    if (log.isErrorEnabled()) {
-								    log.error(String.format("Could not run the command: %s", commandMember));
-							    }
-							    throw new RuntimeException(e);
-						    }
-					    }
-					    text.append("}").append(NEW_LINE);
-					    isServiceAvailable = true;
-					    virtualIPs.append(TAB).append(TAB).append(virtualIpForService[1]).append(NEW_LINE);
-
-				    }
-
-			    }
-		    }
-			if (!isServiceAvailable) {
-				log.warn(String.format("Given service is not available in the topology %s", virtualIpForService[0]));
-			}
-		}
-
-	}
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java
deleted file mode 100644
index 08feb71..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSContext.java
+++ /dev/null
@@ -1,203 +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.lvs.extension;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * LVS context to read and store system properties.
- */
-public class LVSContext {
-    private static final Log log = LogFactory.getLog(LVSContext.class);
-    private static volatile LVSContext context;
-
-    private String lvsPrivateIp;
-    private String executableFilePath;
-    private String templatePath;
-    private String templateName;
-    private String scriptsPath;
-    private String confFilePath;
-    private String statsSocketFilePath;
-    private boolean cepStatsPublisherEnabled;
-    private String thriftReceiverIp;
-    private String thriftReceiverPort;
-    private String networkPartitionId;
-    private String clusterId;
-    private String serviceName;
-	private String virtualIPsForServices;
-	private String keepAlivedStartCommand;
-	private String serverState;
-	private String lvsScheduleAlgo;
-
-    private LVSContext() {
-        this.lvsPrivateIp = System.getProperty(Constants.LVS_PRIVATE_IP);
-        this.executableFilePath = System.getProperty(Constants.EXECUTABLE_FILE_PATH);
-        this.templatePath = System.getProperty(Constants.TEMPLATES_PATH);
-        this.templateName = System.getProperty(Constants.TEMPLATES_NAME);
-        this.scriptsPath = System.getProperty(Constants.SCRIPTS_PATH);
-        this.confFilePath = System.getProperty(Constants.CONF_FILE_PATH);
-        this.statsSocketFilePath = System.getProperty(Constants.STATS_SOCKET_FILE_PATH);
-        this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED);
-        this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP);
-        this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT);
-        this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID);
-        this.clusterId = System.getProperty(Constants.CLUSTER_ID);
-        this.serviceName = System.getProperty(Constants.SERVICE_NAME);
-	    this.virtualIPsForServices=System.getProperty(Constants.VIRTUALIPS_FOR_SERVICES);
-	    this.keepAlivedStartCommand=Constants.KEEPALIVED_START_COMMAND;
-	    this.serverState=System.getProperty(Constants.SERVER_STATE);
-	    this.lvsScheduleAlgo = System.getProperty(Constants.LVS_SCHEDULE_ALGO);
-
-        if (log.isDebugEnabled()) {
-            log.debug(Constants.LVS_PRIVATE_IP + " = " + lvsPrivateIp);
-            log.debug(Constants.EXECUTABLE_FILE_PATH + " = " + executableFilePath);
-            log.debug(Constants.TEMPLATES_PATH + " = " + templatePath);
-            log.debug(Constants.TEMPLATES_NAME + " = " + templateName);
-            log.debug(Constants.SCRIPTS_PATH + " = " + scriptsPath);
-            log.debug(Constants.CONF_FILE_PATH + " = " + confFilePath);
-            log.debug(Constants.STATS_SOCKET_FILE_PATH + " = " + statsSocketFilePath);
-            log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled);
-            log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp);
-            log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort);
-            log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId);
-            log.debug(Constants.CLUSTER_ID + " = " + clusterId);
-	        log.debug(Constants.VIRTUALIPS_FOR_SERVICES + " = " + virtualIPsForServices);
-	        log.debug(Constants.LVS_SCHEDULE_ALGO + " = " + lvsScheduleAlgo);
-        }
-    }
-
-    public static LVSContext getInstance() {
-        if (context == null) {
-            synchronized (LVSContext.class) {
-                if (context == null) {
-                    context = new LVSContext();
-                }
-            }
-        }
-        return context;
-    }
-
-    public void validate() {
-        validateSystemProperty(Constants.LVS_PRIVATE_IP);
-        validateSystemProperty(Constants.EXECUTABLE_FILE_PATH);
-        validateSystemProperty(Constants.TEMPLATES_PATH);
-        validateSystemProperty(Constants.TEMPLATES_NAME);
-        validateSystemProperty(Constants.SCRIPTS_PATH);
-        validateSystemProperty(Constants.CONF_FILE_PATH);
-        validateSystemProperty(Constants.STATS_SOCKET_FILE_PATH);
-        validateSystemProperty(Constants.CEP_STATS_PUBLISHER_ENABLED);
-        validateSystemProperty(Constants.CLUSTER_ID);
-
-        if (cepStatsPublisherEnabled) {
-            validateSystemProperty(Constants.THRIFT_RECEIVER_IP);
-            validateSystemProperty(Constants.THRIFT_RECEIVER_PORT);
-            validateSystemProperty(Constants.NETWORK_PARTITION_ID);
-        }
-    }
-
-    private void validateSystemProperty(String propertyName) {
-        String value = System.getProperty(propertyName);
-        if (StringUtils.isEmpty(value)) {
-            throw new RuntimeException("System property was not found: " + propertyName);
-        }
-    }
-
-    public String getLvsPrivateIp() {
-        return lvsPrivateIp;
-    }
-
-    public String getExecutableFilePath() {
-        return executableFilePath;
-    }
-
-    public String getTemplatePath() {
-        return templatePath;
-    }
-
-    public String getTemplateName() {
-        return templateName;
-    }
-
-    public String getScriptsPath() {
-        return scriptsPath;
-    }
-
-    public String getConfFilePath() {
-        return confFilePath;
-    }
-
-    public String getStatsSocketFilePath() {
-        return statsSocketFilePath;
-    }
-
-    public boolean isCEPStatsPublisherEnabled() {
-        return cepStatsPublisherEnabled;
-    }
-
-    public String getNetworkPartitionId() {
-        return networkPartitionId;
-    }
-
-    public String getClusterId() {
-        return clusterId;
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-	public String getVirtualIPsForServices() {
-		return virtualIPsForServices;
-	}
-
-	public void setVirtualIPsForServices(String virtualIPsForServices) {
-		this.virtualIPsForServices = virtualIPsForServices;
-	}
-
-	public String getKeepAlivedStartCommand() {
-		return keepAlivedStartCommand;
-	}
-
-	public void setKeepAlivedStartCommand(String keepAlivedStartCommand) {
-		this.keepAlivedStartCommand = keepAlivedStartCommand;
-	}
-
-	public String getServerState() {
-		return serverState;
-	}
-
-	public void setServerState(String serverState) {
-		this.serverState = serverState;
-	}
-
-	public String getLvsScheduleAlgo() {
-		return lvsScheduleAlgo;
-	}
-
-	public void setLvsScheduleAlgo(String lvsScheduleAlgo) {
-		this.lvsScheduleAlgo = lvsScheduleAlgo;
-	}
-
-	public boolean getIsKeepAlivedUsed() {
-		return false;
-	}
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
deleted file mode 100644
index 0cb771c..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSStatisticsReader.java
+++ /dev/null
@@ -1,80 +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.lvs.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.util.CommandUtils;
-import org.apache.stratos.load.balancer.common.statistics.LoadBalancerStatisticsReader;
-import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
-
-import java.io.IOException;
-
-/**
- * LVS statistics reader.
- */
-public class LVSStatisticsReader implements LoadBalancerStatisticsReader {
-
-	private static final Log log = LogFactory.getLog(LVSStatisticsReader.class);
-	private static final String IPVSADM_STATS_COMMAND = "sudo ipvsadm -L -n |grep Route";
-			//"ipvsadm -l --stats | grep TCP"
-
-	private TopologyProvider topologyProvider;
-	private String clusterInstanceId;
-
-	public LVSStatisticsReader(TopologyProvider topologyProvider) {
-		this.topologyProvider = topologyProvider;
-	}
-
-	@Override public String getClusterInstanceId() {
-		return clusterInstanceId;
-	}
-
-	@Override
-	public int getInFlightRequestCount(String clusterId) {
-		String output;
-		String[] array;
-		int totalWeight = 0, weight;
-
-		// Command to get the statistics : sudo ipvsadm -l --stats | grep TCP
-		String[] command = { "/bin/sh", "-c", IPVSADM_STATS_COMMAND };
-		try {
-			output = CommandUtils.executeCommand(command);
-			if ((output != null) && (output.length() > 0)) {
-				array = output.split("\n");
-				for (int i = 0; i < array.length; i++) {
-					weight = Integer.parseInt(array[i].substring(46, 50).toString().trim());
-					totalWeight += weight;
-				}
-			}
-		} catch (IOException e) {
-			if (log.isErrorEnabled()) {
-				log.error(e);
-			}
-		}
-		if (log.isInfoEnabled()) {
-			log.info(String.format("Cluster weight found: [cluster] %s [weight] %d", clusterId,
-			                       totalWeight));
-
-		}
-		return totalWeight;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java
deleted file mode 100644
index 52463e0..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/Main.java
+++ /dev/null
@@ -1,85 +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.lvs.extension;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
-import org.apache.stratos.load.balancer.extension.api.LoadBalancerExtension;
-
-import java.util.concurrent.ExecutorService;
-
-/**
- * LVS extension main class.
- */
-public class Main {
-	private static final Log log = LogFactory.getLog(Main.class);
-	private static ExecutorService executorService;
-
-	public static void main(String[] args) {
-
-		LoadBalancerExtension extension = null;
-		try {
-			// Configure log4j properties
-			PropertyConfigurator.configure(System.getProperty("log4j.properties.file.path"));
-
-			if (log.isInfoEnabled()) {
-				log.info("LVS extension started");
-			}
-
-            // Add shutdown hook
-            final Thread mainThread = Thread.currentThread();
-            final LoadBalancerExtension finalExtension = extension;
-            Runtime.getRuntime().addShutdownHook(new Thread() {
-                public void run() {
-                    try {
-                        if(finalExtension != null) {
-                            log.info("Shutting lvs instance...");
-                            finalExtension.stop();
-                        }
-                        mainThread.join();
-                    } catch (Exception e) {
-                        log.error(e);
-                    }
-                }
-            });
-
-			executorService = StratosThreadPool.getExecutorService("lvs.extension.thread.pool", 10);
-			// Validate runtime parameters
-			LVSContext.getInstance().validate();
-            TopologyProvider topologyProvider = new TopologyProvider();
-            LVSStatisticsReader statisticsReader = LVSContext.getInstance().isCEPStatsPublisherEnabled() ?
-                    new LVSStatisticsReader(topologyProvider) : null;
-            extension = new LoadBalancerExtension(new LVS(), statisticsReader, topologyProvider);
-			extension.setExecutorService(executorService);
-			extension.execute();
-		} catch (Exception e) {
-			if (log.isErrorEnabled()) {
-				log.error(e);
-			}
-			if (extension != null) {
-                log.info("Shutting lvs instance...");
-				extension.stop();
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/license/LICENSE b/extensions/load-balancer/lvs-extension/src/main/license/LICENSE
deleted file mode 100644
index 5a78fc9..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/license/LICENSE
+++ /dev/null
@@ -1,481 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-===================================================================================
-
-===================================================================================
-The Apache Stratos distribution includes a number of run time dependencies with 
-separate copyright notices and license terms. Your use of the Apache Stratos code
-is subject to the terms and conditions of the following licenses.
-===================================================================================
-
-===============================================================================
-The following components come under Apache Software License 2.0
-===============================================================================
-
-org.wso2.carbon.base-4.2.0.jar
-org.wso2.carbon.bootstrap-4.2.0.jar
-org.wso2.carbon.core-4.2.0.jar
-org.wso2.carbon.core.common-4.2.0.jar
-org.wso2.carbon.databridge.agent.thrift-4.2
-org.wso2.carbon.databridge.commons-4.2.
-org.wso2.carbon.databridge.commons.thrif
-org.wso2.carbon.logging-4.2.0.jar
-org.wso2.carbon.ndatasource.common-4.2.
-org.wso2.carbon.ndatasource.rdbms-4.2.0.j
-org.wso2.carbon.queuing-4.2.0.jar
-org.wso2.carbon.registry.api-4.2.0.jar
-org.wso2.carbon.registry.core-4.2.0.jar
-org.wso2.carbon.registry.xboot-4.2.0.jar
-org.wso2.carbon.securevault-4.2.0.jar
-org.wso2.carbon.user.api-4.2.0.jar
-org.wso2.carbon.user.core-4.2.0.jar
-org.wso2.carbon.user.mgt-4.2.0.jar
-org.wso2.carbon.user.mgt.common-4.2.0.ja
-org.wso2.carbon.utils-4.2.0.jar
-org.wso2.securevault-1.0.0-wso2v2.jar
-abdera-1.0.0.wso2v3.jar
-andes-client-0.13.wso2v8.jar
-annotations-1.3.2.jar
-ant-1.7.0.jar
-ant-launcher-1.7.0.jar
-axiom-1.2.11.wso2v4.jar
-axiom-api-1.2.11.jar
-axiom-impl-1.2.11.jar
-axis2-1.6.1.wso2v10.jar
-commons-cli-1.0.jar
-commons-codec-1.2.jar
-commons-collections-3.2.0.wso2v
-commons-collections-3.2.1.jar
-commons-dbcp-1.4.0.wso2v1.jar
-commons-fileupload-1.2.0.wso2v1
-commons-fileupload-1.2.jar
-commons-httpclient-3.1.0.wso2v2.
-commons-httpclient-3.1.jar
-commons-io-2.0.0.wso2v2.jar
-commons-io-2.0.jar
-commons-lang-2.4.jar
-commons-lang-2.6.0.wso2v1.jar
-commons-lang3-3.1.jar
-commons-logging-1.1.1.jar
-commons-pool-1.5.6.jar
-commons-pool-1.5.6.wso2v1.jar
-compass-2.0.1.wso2v2.jar
-geronimo-activation_1.1_spec-1.0.2.jar
-geronimo-javamail_1.4_spec-1.6.jar
-geronimo-jms_1.1_spec-1.1.jar
-geronimo-stax-api_1.0_spec-1.0.1.jar
-gson-2.2.4.jar
-hazelcast-3.0.1.jar
-hazelcast-3.0.1.wso2v1.jar
-httpclient-4.1.1-wso2v1.jar
-httpclient-4.2.5.jar
-httpcore-4.1.0-wso2v1.jar
-httpcore-4.2.4.jar
-javax.cache.wso2-4.2.0.jar
-java-xmlbuilder-0.6.jar
-javax.servlet-3.0.0.v201112011016.jar
-jdbc-pool-7.0.34.wso2v1.jar
-jdom-1.0.jar
-tomcat-catalina-ha-7.0.34.jar
-tomcat-ha-7.0.34.wso2v1.jar
-tomcat-jdbc-7.0.34.jar
-tomcat-juli-7.0.34.jar
-tomcat-tribes-7.0.34.jar
-tomcat-util-7.0.34.jar
-velocity-1.7.jar
-json-2.0.0.wso2v1.jar
-libthrift-0.7.wso2v1.jar
-libthrift-0.9.1.jar
-log4j-1.2.17.jar
-neethi-2.0.4.wso2v4.jar
-not-yet-commons-ssl-0.3.9.jar
-opencsv-1.8.wso2v1.jar
-org.apache.log4j-1.2.13.v200706111418.jar
-org.apache.stratos.common-4.0.0.jar
-org.apache.stratos.load.balancer.common-4.0.0.jar
-org.apache.stratos.load.balancer.extension.api-4.0.0.jar
-org.apache.stratos.messaging-4.0.0.jar
-poi-3.9.jar
-poi-ooxml-3.9.0.wso2v1.jar
-poi-ooxml-3.9.jar
-poi-ooxml-schemas-3.9.jar
-poi-scratchpad-3.9.0.wso2v1.jar
-poi-scratchpad-3.9.jar
-smack-3.0.4.wso2v1.jar
-smackx-3.0.4.wso2v1.jar
-stax-api-1.0.1.jar
-tomcat-annotations-api-7.0.34.jar
-tomcat-api-7.0.34.jar
-tomcat-catalina-7.0.34.jar
-
-
-===============================================================================
-The following components come under Public Domain License
-===============================================================================
-
-For base64-2.3.8.jar
-
-===============================================================================
-The following components come under BouncyCastle License
-===============================================================================
-
-For bcprov-jdk15-132.jar
-
-Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-===============================================================================
-The following components are Licensed under BSD license
-===============================================================================
-
-For dom4j-1.6.1.jar, 
-jline-0.9.94.jar, 
-jsch-0.1.49.jar
-jaxen-1.1.1.jar
-
-Copyright (c) 2010 Terence Parr
-All rights reserved.
-
-[The BSD License]
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of JiBX nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=============================================================================== 
-The following components are licensed under EPL
-=============================================================================== 
-
-For junit-3.8.1.jar,
-org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
-org.eclipse.osgi-3.8.1.v20120830-144521.jar,
-org.eclipse.osgi.services-3.3.100.v20120522-1822.jar
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of the Program.
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-
-=============================================================================== 
-The following components are licensed under MIT license
-=============================================================================== 
-
-For slf4j-1.5.10.wso2v1.jar,
-slf4j-api-1.7.5.jar,
-slf4j-log4j12-1.7.5.jar
-
-The MIT License (MIT)
-
-Copyright (c) 2004-2013 QOS.ch
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-
-


[06/50] [abbrv] stratos git commit: Fixing issue of checkout not working for ST path

Posted by ra...@apache.org.
Fixing issue of checkout not working for ST path


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/19ca4d72
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/19ca4d72
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/19ca4d72

Branch: refs/heads/master
Commit: 19ca4d726bfe9b3273f94bc552483c0863a20426
Parents: 3df27e0
Author: lasinducharith <la...@gmail.com>
Authored: Wed Aug 26 15:45:58 2015 +0530
Committer: lasinducharith <la...@gmail.com>
Committed: Wed Aug 26 15:45:58 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/cartridge.agent/modules/event/eventhandler.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/19ca4d72/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
index c72c70a..9fe6ae9 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
@@ -27,7 +27,7 @@ from entity import *
 from ..util.log import LogFactory
 import constants
 
-SUPER_TENANT_ID = -1234
+SUPER_TENANT_ID = "-1234"
 SUPER_TENANT_REPO_PATH = "/repository/deployment/server/"
 TENANT_REPO_PATH = "/repository/tenants/"
 


[35/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/assembly/bin.xml b/extensions/load-balancer/modules/nginx-extension/src/main/assembly/bin.xml
new file mode 100644
index 0000000..2cf5942
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/assembly/bin.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ 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.
+  -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>bin</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/src/main/bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>nginx-extension.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/conf</directory>
+            <outputDirectory>/conf</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>jndi.properties</include>
+                <include>log4j.properties</include>
+                <include>thrift-client-config.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/security</directory>
+            <outputDirectory>/security</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>client-truststore.jks</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/templates</directory>
+            <outputDirectory>/templates</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>nginx.cfg.template</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/scripts</directory>
+            <outputDirectory>/scripts</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>get-weight.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>DISCLAIMER</include>
+                <include>README*</include>
+                <include>LICENSE*</include>
+                <include>INSTALL*</include>
+            </includes>
+        </fileSet>
+	<fileSet>
+            <directory>${project.basedir}/src/main/license</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/notice</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+        </fileSet>
+    </fileSets>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib</outputDirectory>
+	        <excludes>
+                <exclude>*:icu4j*</exclude>
+                <exclude>*:jaxen*</exclude>
+                <exclude>*:jboss-transaction-api*</exclude>
+                <exclude>*:wrapper*</exclude>
+                <exclude>*:xom*</exclude>
+            </excludes>
+            <useProjectArtifact>true</useProjectArtifact>
+            <scope>runtime</scope>
+        </dependencySet>
+    </dependencySets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/bin/nginx-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/bin/nginx-extension.sh b/extensions/load-balancer/modules/nginx-extension/src/main/bin/nginx-extension.sh
new file mode 100755
index 0000000..5deb433
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/bin/nginx-extension.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+
+echo "Starting nginx extension..."
+script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
+lib_path=${script_path}/../lib/
+class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
+properties="-Dnginx.private.ip=127.0.0.1
+            -Dexecutable.file.path=nginx
+            -Djndi.properties.dir=${script_path}/../conf
+            -Dtemplates.path=${script_path}/../templates
+            -Dtemplates.name=nginx.cfg.template
+            -Dscripts.path=${script_path}/../scripts
+            -Dconf.file.path=/tmp/nginx.cfg
+            -Dstats.socket.file.path=/tmp/nginx-stats.socket
+            -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
+            -Djavax.net.ssl.trustStore=${script_path}/../security/client-truststore.jks
+            -Djavax.net.ssl.trustStorePassword=wso2carbon
+            -Dthrift.client.config.file.path=${script_path}/../conf/thrift-client-config.xml
+            -Dcep.stats.publisher.enabled=false
+            -Dthrift.receiver.ip=127.0.0.1
+            -Dthrift.receiver.port=7615
+            -Dnetwork.partition.id=network-partition-1
+            -Dcluster.id=cluster-1
+            -Dservice.name=service-1"
+
+
+# Uncomment below line to enable remote debugging
+#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
+
+java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.nginx.extension.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/conf/jndi.properties b/extensions/load-balancer/modules/nginx-extension/src/main/conf/jndi.properties
new file mode 100644
index 0000000..21d7420
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/conf/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61616
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/conf/log4j.properties b/extensions/load-balancer/modules/nginx-extension/src/main/conf/log4j.properties
new file mode 100644
index 0000000..ad6b80a
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/conf/log4j.properties
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=logs/nginx-extension.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.nginx.extension=INFO
+log4j.logger.org.apache.stratos.load.balancer.extension.api=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.wso2.andes.client=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
new file mode 100644
index 0000000..5cacada
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/conf/thrift-client-config.xml
@@ -0,0 +1,27 @@
+<?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.
+  -->
+
+<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
+<thriftClientConfiguration>
+    <username>admin</username>
+    <password>admin</password>
+    <ip>localhost</ip>
+    <port>7611</port>
+</thriftClientConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java
new file mode 100644
index 0000000..6f56c52
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Constants.java
@@ -0,0 +1,39 @@
+/*
+ * 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.nginx.extension;
+
+/**
+ * Nginx extension constants.
+ */
+public class Constants {
+    public static final String NGINX_PRIVATE_IP = "nginx.private.ip";
+    public static final String EXECUTABLE_FILE_PATH = "executable.file.path";
+    public static final String TEMPLATES_PATH = "templates.path";
+    public static final String TEMPLATES_NAME = "templates.name";
+    public static final String SCRIPTS_PATH = "scripts.path";
+    public static final String CONF_FILE_PATH = "conf.file.path";
+    public static final String STATS_SOCKET_FILE_PATH = "stats.socket.file.path";
+    public static final String CEP_STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
+    public static final String THRIFT_RECEIVER_IP = "thrift.receiver.ip";
+    public static final String THRIFT_RECEIVER_PORT = "thrift.receiver.port";
+    public static final String NETWORK_PARTITION_ID = "network.partition.id";
+    public static final String CLUSTER_ID = "cluster.id";
+    public static final String SERVICE_NAME = "service.name";
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java
new file mode 100644
index 0000000..ab0eb7a
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Main.java
@@ -0,0 +1,85 @@
+/*
+ * 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.nginx.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
+import org.apache.stratos.load.balancer.extension.api.LoadBalancerExtension;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * Nginx extension main class.
+ */
+public class Main {
+	private static final Log log = LogFactory.getLog(Main.class);
+	private static ExecutorService executorService;
+
+	public static void main(String[] args) {
+
+		LoadBalancerExtension extension = null;
+		try {
+			// Configure log4j properties
+			PropertyConfigurator.configure(System.getProperty("log4j.properties.file.path"));
+
+			if (log.isInfoEnabled()) {
+				log.info("Nginx extension started");
+			}
+
+            // Add shutdown hook
+            final Thread mainThread = Thread.currentThread();
+            final LoadBalancerExtension finalExtension = extension;
+            Runtime.getRuntime().addShutdownHook(new Thread() {
+                public void run() {
+                    try {
+                        if(finalExtension != null) {
+                            log.info("Shutting nginx instance...");
+                            finalExtension.stop();
+                        }
+                        mainThread.join();
+                    } catch (Exception e) {
+                        log.error(e);
+                    }
+                }
+            });
+
+			executorService = StratosThreadPool.getExecutorService("nginx.extension.thread.pool", 10);
+			// Validate runtime parameters
+			NginxContext.getInstance().validate();
+            TopologyProvider topologyProvider = new TopologyProvider();
+            NginxStatisticsReader statisticsReader = NginxContext.getInstance().isCEPStatsPublisherEnabled() ?
+                    new NginxStatisticsReader(topologyProvider) : null;
+            extension = new LoadBalancerExtension(new Nginx(), statisticsReader, topologyProvider);
+			extension.setExecutorService(executorService);
+			extension.execute();
+		} catch (Exception e) {
+			if (log.isErrorEnabled()) {
+				log.error(e);
+			}
+			if (extension != null) {
+                log.info("Shutting nginx instance...");
+				extension.stop();
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java
new file mode 100644
index 0000000..f73c0b7
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/Nginx.java
@@ -0,0 +1,140 @@
+/*
+ * 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.nginx.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommandUtils;
+import org.apache.stratos.load.balancer.extension.api.LoadBalancer;
+import org.apache.stratos.load.balancer.extension.api.exception.LoadBalancerExtensionException;
+import org.apache.stratos.load.balancer.common.domain.Topology;
+
+import java.io.File;
+
+/**
+ * Nginx load balancer life-cycle implementation.
+ */
+public class Nginx implements LoadBalancer {
+
+    private static final Log log = LogFactory.getLog(Nginx.class);
+
+    private String executableFilePath;
+    private String processIdFilePath;
+    private String templatePath;
+    private String templateName;
+    private String confFilePath;
+    private String statsSocketFilePath;
+
+    public Nginx() {
+        this.executableFilePath = NginxContext.getInstance().getExecutableFilePath();
+        this.templatePath = NginxContext.getInstance().getTemplatePath();
+        this.templateName = NginxContext.getInstance().getTemplateName();
+        this.confFilePath = NginxContext.getInstance().getConfFilePath();
+        this.processIdFilePath = confFilePath.replace(".cfg", ".pid");
+        this.statsSocketFilePath = NginxContext.getInstance().getStatsSocketFilePath();
+    }
+
+    /**
+     * Configure nginx instance according to topology given
+     * @param topology
+     * @throws LoadBalancerExtensionException
+     */
+    public boolean configure(Topology topology) throws LoadBalancerExtensionException {
+        try {
+            log.info("Generating nginx configuration...");
+            NginxConfigWriter writer = new NginxConfigWriter(templatePath, templateName, confFilePath, statsSocketFilePath);
+            if(writer.write(topology)) {
+                return true;
+            }
+            return false;
+        } catch (Exception e) {
+            log.error("Could not generate nginx configuration");
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Start nginx instance
+     * @throws LoadBalancerExtensionException
+     */
+    public void start() throws LoadBalancerExtensionException {
+        log.info("Starting nginx instance...");
+        // Check for configuration file
+        File conf = new File(confFilePath);
+        if (!conf.exists()) {
+            throw new LoadBalancerExtensionException("Could not find nginx configuration file");
+        }
+
+        // Start nginx and write pid to processIdFilePath
+        try {
+            String command = executableFilePath + " -c " + confFilePath;
+            CommandUtils.executeCommand(command);
+            log.info("nginx instance started");
+        } catch (Exception e) {
+            log.error("Could not start nginx instance");
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Reload nginx instance according to the configuration written in configure() method.
+     * @throws LoadBalancerExtensionException
+     */
+    public void reload() throws LoadBalancerExtensionException {
+        try {
+            log.info("Reloading configuration...");
+
+            // Execute hot configuration deployment
+            String command = executableFilePath + " -c " + confFilePath + " -s reload";
+            CommandUtils.executeCommand(command);
+            if (log.isInfoEnabled()) {
+                log.info("Configuration done");
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Reconfiguration failed");
+            }
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Stop nginx instance
+     * @throws LoadBalancerExtensionException
+     */
+    public void stop() throws LoadBalancerExtensionException {
+
+        try {
+            log.info("Stopping nginx...");
+
+            // Execute hot configuration deployment
+            String command = executableFilePath + " -s stop";
+            CommandUtils.executeCommand(command);
+            if (log.isInfoEnabled()) {
+                log.info("Nginx stopped");
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Could not stop nginx");
+            }
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
new file mode 100644
index 0000000..6f6a77c
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxConfigWriter.java
@@ -0,0 +1,181 @@
+/*
+ * 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.nginx.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.load.balancer.common.domain.*;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Collection;
+
+/**
+ * Nginx load balancer configuration writer.
+ */
+public class NginxConfigWriter {
+
+    private static final Log log = LogFactory.getLog(Main.class);
+    private static final String NEW_LINE = System.getProperty("line.separator");
+    private static final String TAB = "    ";
+
+    private String templatePath;
+    private String templateName;
+    private String confFilePath;
+    private String statsSocketFilePath;
+
+    public NginxConfigWriter(String templatePath, String templateName, String confFilePath,
+                             String statsSocketFilePath) {
+
+        this.templatePath = templatePath;
+        this.templateName = templateName;
+        this.confFilePath = confFilePath;
+        this.statsSocketFilePath = statsSocketFilePath;
+    }
+
+    public boolean write(Topology topology) {
+
+        StringBuilder configurationBuilder = new StringBuilder();
+
+        for (Service service : topology.getServices()) {
+            for (Cluster cluster : service.getClusters()) {
+                generateConfigurationForCluster(cluster, configurationBuilder);
+            }
+        }
+
+        // Start velocity engine
+        VelocityEngine ve = new VelocityEngine();
+        ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatePath);
+        ve.init();
+
+        // Open the template
+        Template t = ve.getTemplate(templateName);
+
+        // Insert strings into the template
+        VelocityContext context = new VelocityContext();
+        context.put("configuration", configurationBuilder.toString());
+
+        // Create a new string from the template
+        StringWriter stringWriter = new StringWriter();
+        t.merge(context, stringWriter);
+        String configuration = stringWriter.toString();
+
+        // Write configuration file
+        try {
+            BufferedWriter writer = new BufferedWriter(new FileWriter(confFilePath));
+            writer.write(configuration);
+            writer.close();
+
+            if (log.isInfoEnabled()) {
+                log.info(String.format("Configuration written to file: %s", confFilePath));
+            }
+            return true;
+        } catch (IOException e) {
+            if (log.isErrorEnabled()) {
+                log.error(String.format("Could not write configuration file: %s", confFilePath));
+            }
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Generate configuration for a cluster with the following format:
+     *
+     * <transport> {
+     *     upstream <cluster-hostname> {
+     *         server <hostname>:<port>;
+     *         server <hostname>:<port>;
+     *     }
+     *     server {
+     *         listen <proxy-port>;
+     *         server_name <cluster-hostname>;
+     *         location / {
+     *             proxy_pass    http://<cluster-hostname>
+     *         }
+     *         location /nginx_status {
+     *            stub_status on;
+     *            access_log off;
+     *            allow 127.0.0.1;
+     *            deny all;
+     *         }
+     *     }
+     * }
+     * @param cluster
+     * @param text
+     */
+    private void generateConfigurationForCluster(Cluster cluster, StringBuilder text) {
+
+        if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
+            return;
+        }
+
+        // Find port mappings
+        Member firstMember = (Member) cluster.getMembers().toArray()[0];
+        Collection<Port> ports = firstMember.getPorts();
+
+        for (Port port : ports) {
+            for (String hostname : cluster.getHostNames()) {
+                // Start transport block
+                text.append(port.getProtocol()).append(" {").append(NEW_LINE);
+
+                // Start upstream block
+                text.append(TAB).append("upstream ").append(hostname).append(" {").append(NEW_LINE);
+                for (Member member : cluster.getMembers()) {
+                    // Start upstream server block
+                    text.append(TAB).append(TAB).append("server ").append(member.getHostName()).append(":")
+                            .append(port.getValue()).append(";").append(NEW_LINE);
+                    // End upstream server block
+                }
+                text.append(TAB).append("}").append(NEW_LINE);
+                // End upstream block
+
+                // Start server block
+                text.append(NEW_LINE);
+                text.append(TAB).append("server {").append(NEW_LINE);
+                text.append(TAB).append(TAB).append("listen ").append(port.getProxy()).append(";").append(NEW_LINE);
+                text.append(TAB).append(TAB).append("server_name ").append(hostname).append(";").append(NEW_LINE);
+
+                text.append(TAB).append(TAB).append("location / {").append(NEW_LINE);
+                text.append(TAB).append(TAB).append(TAB).append("proxy_pass").append(TAB)
+                        .append("http://").append(hostname).append(";").append(NEW_LINE);
+                text.append(TAB).append(TAB).append("}").append(NEW_LINE);
+
+                text.append(TAB).append(TAB).append("location /nginx_status {").append(NEW_LINE);
+                text.append(TAB).append(TAB).append(TAB).append("stub_status on;").append(NEW_LINE);
+                text.append(TAB).append(TAB).append(TAB).append("access_log off;").append(NEW_LINE);
+                text.append(TAB).append(TAB).append(TAB).append("allow 127.0.0.1;").append(NEW_LINE);
+                text.append(TAB).append(TAB).append(TAB).append("deny all;").append(NEW_LINE);
+                text.append(TAB).append(TAB).append("}").append(NEW_LINE);
+
+                text.append(TAB).append("}").append(NEW_LINE);
+                // End server block
+
+                text.append("}").append(NEW_LINE);
+                // End transport block
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java
new file mode 100644
index 0000000..7cceeea
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxContext.java
@@ -0,0 +1,157 @@
+/*
+ * 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.nginx.extension;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Nginx context to read and store system properties.
+ */
+public class NginxContext {
+    private static final Log log = LogFactory.getLog(NginxContext.class);
+    private static volatile NginxContext context;
+
+    private String nginxPrivateIp;
+    private String executableFilePath;
+    private String templatePath;
+    private String templateName;
+    private String scriptsPath;
+    private String confFilePath;
+    private String statsSocketFilePath;
+    private boolean cepStatsPublisherEnabled;
+    private String thriftReceiverIp;
+    private String thriftReceiverPort;
+    private String networkPartitionId;
+    private String clusterId;
+    private String serviceName;
+
+    private NginxContext() {
+        this.nginxPrivateIp = System.getProperty(Constants.NGINX_PRIVATE_IP);
+        this.executableFilePath = System.getProperty(Constants.EXECUTABLE_FILE_PATH);
+        this.templatePath = System.getProperty(Constants.TEMPLATES_PATH);
+        this.templateName = System.getProperty(Constants.TEMPLATES_NAME);
+        this.scriptsPath = System.getProperty(Constants.SCRIPTS_PATH);
+        this.confFilePath = System.getProperty(Constants.CONF_FILE_PATH);
+        this.statsSocketFilePath = System.getProperty(Constants.STATS_SOCKET_FILE_PATH);
+        this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED);
+        this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP);
+        this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT);
+        this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID);
+        this.clusterId = System.getProperty(Constants.CLUSTER_ID);
+        this.serviceName = System.getProperty(Constants.SERVICE_NAME);
+
+        if (log.isDebugEnabled()) {
+            log.debug(Constants.NGINX_PRIVATE_IP + " = " + nginxPrivateIp);
+            log.debug(Constants.EXECUTABLE_FILE_PATH + " = " + executableFilePath);
+            log.debug(Constants.TEMPLATES_PATH + " = " + templatePath);
+            log.debug(Constants.TEMPLATES_NAME + " = " + templateName);
+            log.debug(Constants.SCRIPTS_PATH + " = " + scriptsPath);
+            log.debug(Constants.CONF_FILE_PATH + " = " + confFilePath);
+            log.debug(Constants.STATS_SOCKET_FILE_PATH + " = " + statsSocketFilePath);
+            log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled);
+            log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp);
+            log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort);
+            log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId);
+            log.debug(Constants.CLUSTER_ID + " = " + clusterId);
+        }
+    }
+
+    public static NginxContext getInstance() {
+        if (context == null) {
+            synchronized (NginxContext.class) {
+                if (context == null) {
+                    context = new NginxContext();
+                }
+            }
+        }
+        return context;
+    }
+
+    public void validate() {
+        validateSystemProperty(Constants.NGINX_PRIVATE_IP);
+        validateSystemProperty(Constants.EXECUTABLE_FILE_PATH);
+        validateSystemProperty(Constants.TEMPLATES_PATH);
+        validateSystemProperty(Constants.TEMPLATES_NAME);
+        validateSystemProperty(Constants.SCRIPTS_PATH);
+        validateSystemProperty(Constants.CONF_FILE_PATH);
+        validateSystemProperty(Constants.STATS_SOCKET_FILE_PATH);
+        validateSystemProperty(Constants.CEP_STATS_PUBLISHER_ENABLED);
+        validateSystemProperty(Constants.CLUSTER_ID);
+
+        if (cepStatsPublisherEnabled) {
+            validateSystemProperty(Constants.THRIFT_RECEIVER_IP);
+            validateSystemProperty(Constants.THRIFT_RECEIVER_PORT);
+            validateSystemProperty(Constants.NETWORK_PARTITION_ID);
+        }
+    }
+
+    private void validateSystemProperty(String propertyName) {
+        String value = System.getProperty(propertyName);
+        if (StringUtils.isEmpty(value)) {
+            throw new RuntimeException("System property was not found: " + propertyName);
+        }
+    }
+
+    public String getNginxPrivateIp() {
+        return nginxPrivateIp;
+    }
+
+    public String getExecutableFilePath() {
+        return executableFilePath;
+    }
+
+    public String getTemplatePath() {
+        return templatePath;
+    }
+
+    public String getTemplateName() {
+        return templateName;
+    }
+
+    public String getScriptsPath() {
+        return scriptsPath;
+    }
+
+    public String getConfFilePath() {
+        return confFilePath;
+    }
+
+    public String getStatsSocketFilePath() {
+        return statsSocketFilePath;
+    }
+
+    public boolean isCEPStatsPublisherEnabled() {
+        return cepStatsPublisherEnabled;
+    }
+
+    public String getNetworkPartitionId() {
+        return networkPartitionId;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java
new file mode 100644
index 0000000..d45aa8f
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/java/org/apache/stratos/nginx/extension/NginxStatisticsReader.java
@@ -0,0 +1,124 @@
+/*
+ * 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.nginx.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.conn.HttpHostConnectException;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.load.balancer.common.domain.Cluster;
+import org.apache.stratos.load.balancer.common.domain.Port;
+import org.apache.stratos.load.balancer.common.domain.Service;
+import org.apache.stratos.load.balancer.common.statistics.LoadBalancerStatisticsReader;
+import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Nginx statistics reader.
+ */
+public class NginxStatisticsReader implements LoadBalancerStatisticsReader {
+
+    private static final Log log = LogFactory.getLog(NginxStatisticsReader.class);
+
+    private TopologyProvider topologyProvider;
+    private String clusterInstanceId;
+
+    public NginxStatisticsReader(TopologyProvider topologyProvider) {
+        this.topologyProvider = topologyProvider;
+        this.clusterInstanceId = System.getProperty(StratosConstants.CLUSTER_INSTANCE_ID, StratosConstants.NOT_DEFINED);
+    }
+
+    @Override
+    public String getClusterInstanceId() {
+        return clusterInstanceId;
+    }
+
+    @Override
+    public int getInFlightRequestCount(String clusterId) {
+        Cluster cluster = topologyProvider.getClusterByClusterId(clusterId);
+        if(cluster != null) {
+            String serviceName = cluster.getServiceName();
+            Service service = topologyProvider.getTopology().getService(serviceName);
+            if(service != null) {
+                int inFlightRequestCount = 0;
+                for(Port port : service.getPorts()) {
+                    inFlightRequestCount += findWritingCount(port.getProxy());
+                }
+                if(log.isDebugEnabled()) {
+                    log.debug(String.format("In-flight request count: [cluster-id] %s [value] %d",
+                            clusterId, inFlightRequestCount));
+                }
+                return inFlightRequestCount;
+            }
+        }
+        return 0;
+    }
+
+    /**
+     * Make a http request to http://127.0.0.1:<proxy-port>/nginx_status and find writing count.
+     * @param proxyPort
+     * @return
+     */
+    private int findWritingCount(int proxyPort) {
+        try {
+            URL url = new URL("http", "127.0.0.1", proxyPort, "/nginx_status");
+            DefaultHttpClient httpClient = new DefaultHttpClient();
+            HttpUriRequest request = new HttpGet(url.toURI());
+            HttpResponse response = httpClient.execute(request);
+            if (response.getStatusLine().getStatusCode() != 200) {
+                throw new RuntimeException("http://127.0.0.1:" + proxyPort + "/nginx_status was not found");
+            }
+            BufferedReader reader = new BufferedReader(new InputStreamReader(
+                    (response.getEntity().getContent())));
+            String output, result = "";
+            while ((output = reader.readLine()) != null) {
+                result += output;
+            }
+            Pattern pattern = Pattern.compile("(Writing: )([0-1]*)");
+            Matcher matcher = pattern.matcher(result);
+            if (matcher.find()) {
+                // Deduct one to remove the above request
+                int writingCount = Integer.parseInt(matcher.group(2)) - 1;
+                if(log.isDebugEnabled()) {
+                    log.debug(String.format("Writing count: [proxy] %d [value] %d", proxyPort, writingCount));
+                }
+                return writingCount;
+            }
+            throw new RuntimeException("Writing block was not found in nginx_status response");
+        } catch (HttpHostConnectException ignore) {
+            if(ignore.getMessage().contains("Connection refused")) {
+                log.warn("Could not find in-flight request count, connection refused: " +
+                        "http://127.0.0.1:" + proxyPort + "/nginx_status");
+            }
+        } catch (Exception e) {
+            log.error("Could not find in-flight request count: http://127.0.0.1:" + proxyPort + "/nginx_status", e);
+        }
+        return 0;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE b/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
new file mode 100644
index 0000000..60e7f41
--- /dev/null
+++ b/extensions/load-balancer/modules/nginx-extension/src/main/license/LICENSE
@@ -0,0 +1,481 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+===================================================================================
+
+===================================================================================
+The Apache Stratos distribution includes a number of run time dependencies with 
+separate copyright notices and license terms. Your use of the Apache Stratos code
+is subject to the terms and conditions of the following licenses.
+===================================================================================
+
+===============================================================================
+The following components come under Apache Software License 2.0
+===============================================================================
+
+org.wso2.carbon.base-4.2.0.jar
+org.wso2.carbon.bootstrap-4.2.0.jar
+org.wso2.carbon.core-4.2.0.jar
+org.wso2.carbon.core.common-4.2.0.jar
+org.wso2.carbon.databridge.agent.thrift-4.2
+org.wso2.carbon.databridge.commons-4.2.
+org.wso2.carbon.databridge.commons.thrif
+org.wso2.carbon.logging-4.2.0.jar
+org.wso2.carbon.ndatasource.common-4.2.
+org.wso2.carbon.ndatasource.rdbms-4.2.0.j
+org.wso2.carbon.queuing-4.2.0.jar
+org.wso2.carbon.registry.api-4.2.0.jar
+org.wso2.carbon.registry.core-4.2.0.jar
+org.wso2.carbon.registry.xboot-4.2.0.jar
+org.wso2.carbon.securevault-4.2.0.jar
+org.wso2.carbon.user.api-4.2.0.jar
+org.wso2.carbon.user.core-4.2.0.jar
+org.wso2.carbon.user.mgt-4.2.0.jar
+org.wso2.carbon.user.mgt.common-4.2.0.ja
+org.wso2.carbon.utils-4.2.0.jar
+org.wso2.securevault-1.0.0-wso2v2.jar
+abdera-1.0.0.wso2v3.jar
+andes-client-0.13.wso2v8.jar
+annotations-1.3.2.jar
+ant-1.7.0.jar
+ant-launcher-1.7.0.jar
+axiom-1.2.11.wso2v4.jar
+axiom-api-1.2.11.jar
+axiom-impl-1.2.11.jar
+axis2-1.6.1.wso2v10.jar
+commons-cli-1.0.jar
+commons-codec-1.2.jar
+commons-collections-3.2.0.wso2v
+commons-collections-3.2.1.jar
+commons-dbcp-1.4.0.wso2v1.jar
+commons-fileupload-1.2.0.wso2v1
+commons-fileupload-1.2.jar
+commons-httpclient-3.1.0.wso2v2.
+commons-httpclient-3.1.jar
+commons-io-2.0.0.wso2v2.jar
+commons-io-2.0.jar
+commons-lang-2.4.jar
+commons-lang-2.6.0.wso2v1.jar
+commons-lang3-3.1.jar
+commons-logging-1.1.1.jar
+commons-pool-1.5.6.jar
+commons-pool-1.5.6.wso2v1.jar
+compass-2.0.1.wso2v2.jar
+geronimo-activation_1.1_spec-1.0.2.jar
+geronimo-javamail_1.4_spec-1.6.jar
+geronimo-jms_1.1_spec-1.1.jar
+geronimo-stax-api_1.0_spec-1.0.1.jar
+gson-2.2.4.jar
+hazelcast-3.0.1.jar
+hazelcast-3.0.1.wso2v1.jar
+httpclient-4.1.1-wso2v1.jar
+httpclient-4.2.5.jar
+httpcore-4.1.0-wso2v1.jar
+httpcore-4.2.4.jar
+javax.cache.wso2-4.2.0.jar
+java-xmlbuilder-0.6.jar
+javax.servlet-3.0.0.v201112011016.jar
+jdbc-pool-7.0.34.wso2v1.jar
+jdom-1.0.jar
+tomcat-catalina-ha-7.0.34.jar
+tomcat-ha-7.0.34.wso2v1.jar
+tomcat-jdbc-7.0.34.jar
+tomcat-juli-7.0.34.jar
+tomcat-tribes-7.0.34.jar
+tomcat-util-7.0.34.jar
+velocity-1.7.jar
+json-2.0.0.wso2v1.jar
+libthrift-0.7.wso2v1.jar
+libthrift-0.9.1.jar
+log4j-1.2.17.jar
+neethi-2.0.4.wso2v4.jar
+not-yet-commons-ssl-0.3.9.jar
+opencsv-1.8.wso2v1.jar
+org.apache.log4j-1.2.13.v200706111418.jar
+org.apache.stratos.common-4.1.2.jar
+org.apache.stratos.load.balancer.common-4.1.2.jar
+org.apache.stratos.load.balancer.extension.api-4.1.2.jar
+org.apache.stratos.messaging-4.1.2.jar
+poi-3.9.jar
+poi-ooxml-3.9.0.wso2v1.jar
+poi-ooxml-3.9.jar
+poi-ooxml-schemas-3.9.jar
+poi-scratchpad-3.9.0.wso2v1.jar
+poi-scratchpad-3.9.jar
+smack-3.0.4.wso2v1.jar
+smackx-3.0.4.wso2v1.jar
+stax-api-1.0.1.jar
+tomcat-annotations-api-7.0.34.jar
+tomcat-api-7.0.34.jar
+tomcat-catalina-7.0.34.jar
+
+
+===============================================================================
+The following components come under Public Domain License
+===============================================================================
+
+For base64-2.3.8.jar
+
+===============================================================================
+The following components come under BouncyCastle License
+===============================================================================
+
+For bcprov-jdk15-132.jar
+
+Copyright (c) 2000 - 2013 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
+
+===============================================================================
+The following components are Licensed under BSD license
+===============================================================================
+
+For dom4j-1.6.1.jar, 
+jline-0.9.94.jar, 
+jsch-0.1.49.jar
+jaxen-1.1.1.jar
+
+Copyright (c) 2010 Terence Parr
+All rights reserved.
+
+[The BSD License]
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+ * Neither the name of JiBX nor the names of its contributors may be used
+   to endorse or promote products derived from this software without specific
+   prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=============================================================================== 
+The following components are licensed under EPL
+=============================================================================== 
+
+For junit-3.8.1.jar,
+org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
+org.eclipse.osgi-3.8.1.v20120830-144521.jar,
+org.eclipse.osgi.services-3.3.100.v20120522-1822.jar
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+=============================================================================== 
+The following components are licensed under MIT license
+=============================================================================== 
+
+For slf4j-1.5.10.wso2v1.jar,
+slf4j-api-1.7.5.jar,
+slf4j-log4j12-1.7.5.jar
+
+The MIT License (MIT)
+
+Copyright (c) 2004-2013 QOS.ch
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+


[44/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
Fixing pom modules structure. Make it consistent


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d97d9c78
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d97d9c78
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d97d9c78

Branch: refs/heads/master
Commit: d97d9c78cf0f0cb8c1e144b0bafe00751460ebe6
Parents: fb5383d
Author: Akila Perera <ra...@gmail.com>
Authored: Sun Aug 30 14:08:15 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 14:09:53 2015 +0530

----------------------------------------------------------------------
 .../HealthStatisticsEventBuilder.xml            |  31 -
 .../LoadBalancerStatisticsEventBuilder.xml      |  31 -
 .../AverageInFlightRequestsEventFormatter.xml   |  32 -
 .../AverageLoadAverageEventFormatter.xml        |  32 -
 .../AverageMemoryConsumptionEventFormatter.xml  |  32 -
 .../FaultMessageEventFormatter.xml              |  32 -
 .../GradientInFlightRequestsEventFormatter.xml  |  32 -
 .../GradientLoadAverageEventFormatter.xml       |  32 -
 .../GradientMemoryConsumptionEventFormatter.xml |  32 -
 .../MemberAverageLoadAverageEventFormatter.xml  |  32 -
 ...erAverageMemoryConsumptionEventFormatter.xml |  32 -
 .../MemberGradientLoadAverageEventFormatter.xml |  32 -
 ...rGradientMemoryConsumptionEventFormatter.xml |  32 -
 ...econdDerivativeLoadAverageEventFormatter.xml |  32 -
 ...erivativeMemoryConsumptionEventFormatter.xml |  32 -
 ...DerivativeInFlightRequestsEventFormatter.xml |  32 -
 ...econdDerivativeLoadAverageEventFormatter.xml |  32 -
 ...erivativeMemoryConsumptionEventFormatter.xml |  32 -
 .../executionplans/AverageHeathRequest.xml      |  71 --
 .../AverageInFlightRequestsFinder.xml           |  48 --
 .../executionplans/GradientOfHealthRequest.xml  |  71 --
 .../GradientOfRequestsInFlightFinder.xml        |  48 --
 .../SecondDerivativeOfHealthRequest.xml         |  68 --
 ...SecondDerivativeOfRequestsInFlightFinder.xml |  48 --
 .../DefaultWSO2EventInputAdaptor.xml            |  24 -
 .../DefaultWSO2EventOutputAdaptor.xml           |  29 -
 .../outputeventadaptors/JMSOutputAdaptor.xml    |  30 -
 .../streamdefinitions/stream-manager-config.xml | 309 -------
 extensions/cep/distribution/README.md           |  12 -
 extensions/cep/distribution/pom.xml             |  66 --
 .../cep/distribution/src/assembly/bin.xml       |  59 --
 .../cep/distribution/src/main/license/LICENSE   | 204 -----
 .../cep/distribution/src/main/notice/NOTICE     |   7 -
 .../HealthStatisticsEventBuilder.xml            |  31 +
 .../LoadBalancerStatisticsEventBuilder.xml      |  31 +
 .../AverageInFlightRequestsEventFormatter.xml   |  32 +
 .../AverageLoadAverageEventFormatter.xml        |  32 +
 .../AverageMemoryConsumptionEventFormatter.xml  |  32 +
 .../FaultMessageEventFormatter.xml              |  32 +
 .../GradientInFlightRequestsEventFormatter.xml  |  32 +
 .../GradientLoadAverageEventFormatter.xml       |  32 +
 .../GradientMemoryConsumptionEventFormatter.xml |  32 +
 .../MemberAverageLoadAverageEventFormatter.xml  |  32 +
 ...erAverageMemoryConsumptionEventFormatter.xml |  32 +
 .../MemberGradientLoadAverageEventFormatter.xml |  32 +
 ...rGradientMemoryConsumptionEventFormatter.xml |  32 +
 ...econdDerivativeLoadAverageEventFormatter.xml |  32 +
 ...erivativeMemoryConsumptionEventFormatter.xml |  32 +
 ...DerivativeInFlightRequestsEventFormatter.xml |  32 +
 ...econdDerivativeLoadAverageEventFormatter.xml |  32 +
 ...erivativeMemoryConsumptionEventFormatter.xml |  32 +
 .../executionplans/AverageHeathRequest.xml      |  71 ++
 .../AverageInFlightRequestsFinder.xml           |  48 ++
 .../executionplans/GradientOfHealthRequest.xml  |  71 ++
 .../GradientOfRequestsInFlightFinder.xml        |  48 ++
 .../SecondDerivativeOfHealthRequest.xml         |  68 ++
 ...SecondDerivativeOfRequestsInFlightFinder.xml |  48 ++
 .../DefaultWSO2EventInputAdaptor.xml            |  24 +
 .../DefaultWSO2EventOutputAdaptor.xml           |  29 +
 .../outputeventadaptors/JMSOutputAdaptor.xml    |  30 +
 .../streamdefinitions/stream-manager-config.xml | 309 +++++++
 extensions/cep/modules/distribution/README.md   |  12 +
 extensions/cep/modules/distribution/pom.xml     |  66 ++
 .../modules/distribution/src/assembly/bin.xml   |  59 ++
 .../distribution/src/main/license/LICENSE       | 204 +++++
 .../modules/distribution/src/main/notice/NOTICE |   7 +
 .../cep/modules/stratos-cep-extension/pom.xml   |  63 ++
 .../cep/extension/CEPTopologyEventReceiver.java |  99 +++
 .../cep/extension/ConcatWindowProcessor.java    |  54 ++
 .../extension/FaultHandlingWindowProcessor.java | 349 ++++++++
 .../GradientFinderWindowProcessor.java          | 283 +++++++
 ...equestHandlingCapabilityWindowProcessor.java |  68 ++
 .../SecondDerivativeFinderWindowProcessor.java  | 301 +++++++
 extensions/cep/pom.xml                          |  38 +
 extensions/cep/stratos-cep-extension/pom.xml    |  63 --
 .../cep/extension/CEPTopologyEventReceiver.java |  99 ---
 .../cep/extension/ConcatWindowProcessor.java    |  54 --
 .../extension/FaultHandlingWindowProcessor.java | 349 --------
 .../GradientFinderWindowProcessor.java          | 283 -------
 ...equestHandlingCapabilityWindowProcessor.java |  68 --
 .../SecondDerivativeFinderWindowProcessor.java  | 301 -------
 .../load-balancer/haproxy-extension/INSTALL.md  |  32 -
 .../load-balancer/haproxy-extension/README.md   |  20 -
 .../load-balancer/haproxy-extension/pom.xml     | 109 ---
 .../haproxy-extension/src/main/assembly/bin.xml | 106 ---
 .../src/main/bin/haproxy-extension.sh           |  50 --
 .../src/main/conf/jndi.properties               |  22 -
 .../src/main/conf/log4j.properties              |  40 -
 .../src/main/conf/thrift-client-config.xml      |  27 -
 .../stratos/haproxy/extension/Constants.java    |  39 -
 .../stratos/haproxy/extension/HAProxy.java      | 158 ----
 .../haproxy/extension/HAProxyConfigWriter.java  | 152 ----
 .../haproxy/extension/HAProxyContext.java       | 157 ----
 .../extension/HAProxyStatisticsReader.java      | 108 ---
 .../apache/stratos/haproxy/extension/Main.java  |  85 --
 .../haproxy-extension/src/main/license/LICENSE  | 481 -----------
 .../haproxy-extension/src/main/notice/NOTICE    | 402 ---------
 .../src/main/resources/velocity.properties      |  26 -
 .../src/main/scripts/get-weight.sh              |  23 -
 .../src/main/security/client-truststore.jks     | Bin 35240 -> 0 bytes
 .../src/main/templates/haproxy.cfg.template     |  17 -
 .../load-balancer/lvs-extension/INSTALL.md      |  37 -
 .../load-balancer/lvs-extension/README.md       |  18 -
 extensions/load-balancer/lvs-extension/pom.xml  | 109 ---
 .../lvs-extension/src/main/assembly/bin.xml     | 106 ---
 .../lvs-extension/src/main/bin/lvs-extension.sh |  54 --
 .../lvs-extension/src/main/conf/jndi.properties |  22 -
 .../src/main/conf/log4j.properties              |  40 -
 .../src/main/conf/thrift-client-config.xml      |  25 -
 .../apache/stratos/lvs/extension/Constants.java |  43 -
 .../org/apache/stratos/lvs/extension/LVS.java   | 158 ----
 .../stratos/lvs/extension/LVSConfigWriter.java  | 241 ------
 .../stratos/lvs/extension/LVSContext.java       | 203 -----
 .../lvs/extension/LVSStatisticsReader.java      |  80 --
 .../org/apache/stratos/lvs/extension/Main.java  |  85 --
 .../lvs-extension/src/main/license/LICENSE      | 481 -----------
 .../lvs-extension/src/main/notice/NOTICE        | 395 ---------
 .../src/main/resources/velocity.properties      |  26 -
 .../src/main/security/client-truststore.jks     | Bin 35240 -> 0 bytes
 .../src/main/templates/keepalived.conf.template |  59 --
 .../modules/haproxy-extension/INSTALL.md        |  32 +
 .../modules/haproxy-extension/README.md         |  20 +
 .../modules/haproxy-extension/pom.xml           | 110 +++
 .../haproxy-extension/src/main/assembly/bin.xml | 106 +++
 .../src/main/bin/haproxy-extension.sh           |  50 ++
 .../src/main/conf/jndi.properties               |  22 +
 .../src/main/conf/log4j.properties              |  40 +
 .../src/main/conf/thrift-client-config.xml      |  27 +
 .../stratos/haproxy/extension/Constants.java    |  39 +
 .../stratos/haproxy/extension/HAProxy.java      | 158 ++++
 .../haproxy/extension/HAProxyConfigWriter.java  | 152 ++++
 .../haproxy/extension/HAProxyContext.java       | 157 ++++
 .../extension/HAProxyStatisticsReader.java      | 108 +++
 .../apache/stratos/haproxy/extension/Main.java  |  85 ++
 .../haproxy-extension/src/main/license/LICENSE  | 481 +++++++++++
 .../haproxy-extension/src/main/notice/NOTICE    | 402 +++++++++
 .../src/main/resources/velocity.properties      |  26 +
 .../src/main/scripts/get-weight.sh              |  23 +
 .../src/main/security/client-truststore.jks     | Bin 0 -> 35240 bytes
 .../src/main/templates/haproxy.cfg.template     |  17 +
 .../modules/lvs-extension/INSTALL.md            |  37 +
 .../modules/lvs-extension/README.md             |  18 +
 .../load-balancer/modules/lvs-extension/pom.xml | 110 +++
 .../lvs-extension/src/main/assembly/bin.xml     | 106 +++
 .../lvs-extension/src/main/bin/lvs-extension.sh |  54 ++
 .../lvs-extension/src/main/conf/jndi.properties |  22 +
 .../src/main/conf/log4j.properties              |  40 +
 .../src/main/conf/thrift-client-config.xml      |  25 +
 .../apache/stratos/lvs/extension/Constants.java |  43 +
 .../org/apache/stratos/lvs/extension/LVS.java   | 158 ++++
 .../stratos/lvs/extension/LVSConfigWriter.java  | 241 ++++++
 .../stratos/lvs/extension/LVSContext.java       | 203 +++++
 .../lvs/extension/LVSStatisticsReader.java      |  80 ++
 .../org/apache/stratos/lvs/extension/Main.java  |  85 ++
 .../lvs-extension/src/main/license/LICENSE      | 481 +++++++++++
 .../lvs-extension/src/main/notice/NOTICE        | 395 +++++++++
 .../src/main/resources/velocity.properties      |  26 +
 .../src/main/security/client-truststore.jks     | Bin 0 -> 35240 bytes
 .../src/main/templates/keepalived.conf.template |  59 ++
 .../modules/nginx-extension/INSTALL.md          |  33 +
 .../modules/nginx-extension/README.md           |  27 +
 .../modules/nginx-extension/pom.xml             | 110 +++
 .../nginx-extension/src/main/assembly/bin.xml   | 106 +++
 .../src/main/bin/nginx-extension.sh             |  50 ++
 .../src/main/conf/jndi.properties               |  22 +
 .../src/main/conf/log4j.properties              |  40 +
 .../src/main/conf/thrift-client-config.xml      |  27 +
 .../stratos/nginx/extension/Constants.java      |  39 +
 .../apache/stratos/nginx/extension/Main.java    |  85 ++
 .../apache/stratos/nginx/extension/Nginx.java   | 140 ++++
 .../nginx/extension/NginxConfigWriter.java      | 181 ++++
 .../stratos/nginx/extension/NginxContext.java   | 157 ++++
 .../nginx/extension/NginxStatisticsReader.java  | 124 +++
 .../nginx-extension/src/main/license/LICENSE    | 481 +++++++++++
 .../nginx-extension/src/main/notice/NOTICE      | 402 +++++++++
 .../src/main/resources/velocity.properties      |  26 +
 .../src/main/security/client-truststore.jks     | Bin 0 -> 35240 bytes
 .../src/main/templates/nginx.cfg.template       |   8 +
 .../load-balancer/nginx-extension/INSTALL.md    |  33 -
 .../load-balancer/nginx-extension/README.md     |  27 -
 .../load-balancer/nginx-extension/pom.xml       | 109 ---
 .../nginx-extension/src/main/assembly/bin.xml   | 106 ---
 .../src/main/bin/nginx-extension.sh             |  50 --
 .../src/main/conf/jndi.properties               |  22 -
 .../src/main/conf/log4j.properties              |  40 -
 .../src/main/conf/thrift-client-config.xml      |  27 -
 .../stratos/nginx/extension/Constants.java      |  39 -
 .../apache/stratos/nginx/extension/Main.java    |  85 --
 .../apache/stratos/nginx/extension/Nginx.java   | 140 ----
 .../nginx/extension/NginxConfigWriter.java      | 181 ----
 .../stratos/nginx/extension/NginxContext.java   | 157 ----
 .../nginx/extension/NginxStatisticsReader.java  | 124 ---
 .../nginx-extension/src/main/license/LICENSE    | 481 -----------
 .../nginx-extension/src/main/notice/NOTICE      | 402 ---------
 .../src/main/resources/velocity.properties      |  26 -
 .../src/main/security/client-truststore.jks     | Bin 35240 -> 0 bytes
 .../src/main/templates/nginx.cfg.template       |   8 -
 extensions/load-balancer/pom.xml                |   8 +-
 extensions/pom.xml                              |   3 +-
 products/stratos-cli/distribution/INSTALL.txt   |  42 -
 products/stratos-cli/distribution/README.txt    |  75 --
 products/stratos-cli/distribution/pom.xml       |  84 --
 .../distribution/src/main/assembly/bin.xml      |  88 --
 .../distribution/src/main/bin/stratos.bat       |  80 --
 .../distribution/src/main/bin/stratos.sh        |  42 -
 .../distribution/src/main/conf/log4j.properties |  37 -
 .../distribution/src/main/license/LICENSE       | 836 -------------------
 .../distribution/src/main/notice/NOTICE         |  85 --
 .../modules/distribution/INSTALL.txt            |  42 +
 .../stratos-cli/modules/distribution/README.txt |  75 ++
 .../stratos-cli/modules/distribution/pom.xml    |  85 ++
 .../distribution/src/main/assembly/bin.xml      |  88 ++
 .../distribution/src/main/bin/stratos.bat       |  80 ++
 .../distribution/src/main/bin/stratos.sh        |  42 +
 .../distribution/src/main/conf/log4j.properties |  37 +
 .../distribution/src/main/license/LICENSE       | 836 +++++++++++++++++++
 .../modules/distribution/src/main/notice/NOTICE |  85 ++
 products/stratos-cli/pom.xml                    |   4 +-
 218 files changed, 10596 insertions(+), 10555 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml b/extensions/cep/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
deleted file mode 100644
index 92f8d8a..0000000
--- a/extensions/cep/artifacts/eventbuilders/HealthStatisticsEventBuilder.xml
+++ /dev/null
@@ -1,31 +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.
-
--->
-
-<eventBuilder name="HealthStatisticsEventBuilder" statistics="disable"
-    trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
-    <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
-        <property name="stream">cartridge_agent_health_stats</property>
-        <property name="version">1.0.0</property>
-    </from>
-    <mapping customMapping="disable" type="wso2event"/>
-    <to streamName="cartridge_agent_health_stats" version="1.0.0"/>
-</eventBuilder>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml b/extensions/cep/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
deleted file mode 100644
index 8090e63..0000000
--- a/extensions/cep/artifacts/eventbuilders/LoadBalancerStatisticsEventBuilder.xml
+++ /dev/null
@@ -1,31 +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.
-
--->
-
-<eventBuilder name="LoadBalancerStatisticsEventBuilder"
-    statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
-    <from eventAdaptorName="DefaultWSO2EventInputAdaptor" eventAdaptorType="wso2event">
-        <property name="stream">in_flight_requests</property>
-        <property name="version">1.0.0</property>
-    </from>
-    <mapping customMapping="disable" type="wso2event"/>
-    <to streamName="in_flight_requests" version="1.0.0"/>
-</eventBuilder>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml b/extensions/cep/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
deleted file mode 100644
index 5955866..0000000
--- a/extensions/cep/artifacts/eventformatters/AverageInFlightRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="AverageRequestsInflightEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="average_in_flight_requests" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
deleted file mode 100644
index a0e2052..0000000
--- a/extensions/cep/artifacts/eventformatters/AverageLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="AverageLoadAverageEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="average_load_average_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.AverageLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_load_average}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml b/extensions/cep/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index cbcab0a..0000000
--- a/extensions/cep/artifacts/eventformatters/AverageMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="AverageMemoryConsumptionEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="average_memory_consumption_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.AverageMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{average_memory_consumption}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/FaultMessageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/FaultMessageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/FaultMessageEventFormatter.xml
deleted file mode 100644
index 96264ca..0000000
--- a/extensions/cep/artifacts/eventformatters/FaultMessageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="FaultMessageEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="fault_message" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberFaultEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","memberId":"{{member_id}}","partitionId":"{{partition_id}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml b/extensions/cep/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
deleted file mode 100644
index 2b5045b..0000000
--- a/extensions/cep/artifacts/eventformatters/GradientInFlightRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="GradientInFlightRequestsEventFormatter" statistics="disable"
-  trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="gradient_in_flight_requests" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
deleted file mode 100644
index 7fa3d7a..0000000
--- a/extensions/cep/artifacts/eventformatters/GradientLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="GradientLoadAverageEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="gradient_load_average_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_load_average}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml b/extensions/cep/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 8c3b871..0000000
--- a/extensions/cep/artifacts/eventformatters/GradientMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="GradientMemoryConsumptionEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="gradient_memory_consumption_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.GradientOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{gradient_memory_consumption}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
deleted file mode 100644
index cab6df6..0000000
--- a/extensions/cep/artifacts/eventformatters/MemberAverageLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="MemberAverageLoadAverageEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="member_average_load_average_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_load_average}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml b/extensions/cep/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 7f6e1f8..0000000
--- a/extensions/cep/artifacts/eventformatters/MemberAverageMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="MemberAverageMemoryConsumptionEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="member_average_memory_consumption_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberAverageMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_average_memory_consumption}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
deleted file mode 100644
index af73b46..0000000
--- a/extensions/cep/artifacts/eventformatters/MemberGradientLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="MemberGradientLoadAverageEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="member_gradient_load_average_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_load_average}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml b/extensions/cep/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 702f149..0000000
--- a/extensions/cep/artifacts/eventformatters/MemberGradientMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="MemberGradientMemoryConsumptionEventFormatter"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="member_gradient_memory_consumption_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberGradientOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_gradient_memory_consumption}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
deleted file mode 100644
index 5281652..0000000
--- a/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="MemberSecondDerivativeLoadAverageEventFormatter"
-  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="member_second_derivative_load_average_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfLoadAverageEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_load_average}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index 2e32be3..0000000
--- a/extensions/cep/artifacts/eventformatters/MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="MemberSecondDerivativeMemoryConsumptionEventFormatter"
-  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfMemoryConsumptionEvent":{"message":{"memberId":"{{member_id}}","clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{member_second_derivative_memory_consumption}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml b/extensions/cep/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
deleted file mode 100644
index 61862d1..0000000
--- a/extensions/cep/artifacts/eventformatters/SecondDerivativeInFlightRequestsEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="SecondDerivativeEventFormatter"
-  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="second_derivative_in_flight_requests" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfRequestsInFlightEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{count}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml b/extensions/cep/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
deleted file mode 100644
index 3dc4a74..0000000
--- a/extensions/cep/artifacts/eventformatters/SecondDerivativeLoadAverageEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="SecondDerivativeLoadAverageEventFormatter"
-  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="second_derivative_load_average_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfLoadAverageEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_load_average}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml b/extensions/cep/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
deleted file mode 100644
index bb0f70c..0000000
--- a/extensions/cep/artifacts/eventformatters/SecondDerivativeMemoryConsumptionEventFormatter.xml
+++ /dev/null
@@ -1,32 +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.
-
--->
-
-<eventFormatter name="SecondDerivativeMemoryConsumptionEventFormatter"
-  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventformatter">
-  <from streamName="second_derivative_memory_consumption_stats" version="1.0.0"/>
-  <mapping customMapping="enable" type="json">
-    <inline>{"org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfMemoryConsumptionEvent":{"message":{"clusterId":"{{cluster_id}}","clusterInstanceId":"{{cluster_instance_id}}","networkPartitionId":"{{network_partition_id}}","value":"{{second_derivative_memory_consumption}}"}}}</inline>
-  </mapping>
-  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
-    <property name="transport.jms.Destination">summarized-health-stats</property>
-  </to>
-</eventFormatter>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml b/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
deleted file mode 100644
index b60a0bf..0000000
--- a/extensions/cep/artifacts/executionplans/AverageHeathRequest.xml
+++ /dev/null
@@ -1,71 +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.
-
--->
-
-<executionPlan name="AverageHeathRequest" statistics="disable"
-  trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
-  <description>This will average health stats of an instance over a minute.</description>
-  <siddhiConfiguration>
-    <property name="siddhi.enable.distributed.processing">false</property>
-    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
-  </siddhiConfiguration>
-  <importedStreams>
-    <stream as="health_avg_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
-  </importedStreams>
-  <queryExpressions><![CDATA[
- 	from health_avg_processsor [health_description == 'ports_not_open'] 
-		select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id insert into fault_message;
-	from health_avg_processsor
-  		select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
-		stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
-  		insert into health_avg_concatinator;
-  	define partition health_avg_cluster_partition by   health_avg_concatinator.health_grad_cluster_network;
-  	define partition member_health_avg_cluster_partition by  health_avg_processsor.member_id;
-  	from health_avg_concatinator [health_description == 'load_average'] 
-		#window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_load_average
-		insert into average_load_average_stats 
-		partition by health_avg_cluster_partition;
-  	from health_avg_processsor [health_description == 'load_average'] 
-		#window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_load_average
-		insert into member_average_load_average_stats 
-		partition by member_health_avg_cluster_partition;
-  	from health_avg_processsor [health_description == 'memory_consumption'] 
-		#window.timeBatch(1 min) select member_id, cluster_id, cluster_instance_id, network_partition_id, avg(value) as member_average_memory_consumption
-		insert into member_average_memory_consumption_stats 
-		partition by member_health_avg_cluster_partition;
-  	from health_avg_concatinator [health_description == 'memory_consumption'] 
-		#window.timeBatch(1 min) select cluster_id, cluster_instance_id, network_partition_id, avg(value) as average_memory_consumption
-		insert into average_memory_consumption_stats 
-		partition by health_avg_cluster_partition;
-  ]]></queryExpressions>
-  <exportedStreams>
-    <stream name="average_load_average_stats" passthroughFlow="disable"
-      valueOf="average_load_average_stats" version="1.0.0"/>
-    <stream name="member_average_load_average_stats" passthroughFlow="disable"
-      valueOf="member_average_load_average_stats" version="1.0.0"/>
-    <stream name="member_average_memory_consumption_stats" passthroughFlow="disable"
-      valueOf="member_average_memory_consumption_stats" version="1.0.0"/>
-    <stream name="average_memory_consumption_stats" passthroughFlow="disable"
-      valueOf="average_memory_consumption_stats" version="1.0.0"/>
-    <stream name="fault_message" passthroughFlow="disable"
-      valueOf="fault_message" version="1.0.0"/>
-  </exportedStreams>
-</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml b/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
deleted file mode 100644
index 20b94da..0000000
--- a/extensions/cep/artifacts/executionplans/AverageInFlightRequestsFinder.xml
+++ /dev/null
@@ -1,48 +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.
-
--->
-
-<executionPlan name="AverageInFlightRequestsFinder" statistics="disable"
-               trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
-    <description>This will average the number of requests in flight over a minute.</description>
-    <siddhiConfiguration>
-        <property name="siddhi.enable.distributed.processing">false</property>
-        <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
-    </siddhiConfiguration>
-    <importedStreams>
-        <stream as="avg_rif_stat" name="in_flight_requests" version="1.0.0"/>
-    </importedStreams>
-    <queryExpressions><![CDATA[
-	from avg_rif_stat
-		select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
-		stratos:concat(cluster_id, '-' ,cluster_instance_id) as avg_rif_cluster_network
-		insert into avg_rif_concat;
-	define partition avg_rif_cluster_partition by avg_rif_concat.avg_rif_cluster_network;
-	from avg_rif_concat#window.timeBatch(1 min)
-		select cluster_id, cluster_instance_id, network_partition_id, avg(in_flight_request_count) as count
-		insert into average_in_flight_requests 
-		partition by avg_rif_cluster_partition;
-    ]]></queryExpressions>
-    <exportedStreams>
-        <stream name="average_in_flight_requests"
-                valueOf="average_in_flight_requests" version="1.0.0"/>
-    </exportedStreams>
-</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml b/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
deleted file mode 100644
index fcbc24e..0000000
--- a/extensions/cep/artifacts/executionplans/GradientOfHealthRequest.xml
+++ /dev/null
@@ -1,71 +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.
-
--->
-
-<executionPlan name="GradientOfHealthRequest" statistics="disable"
-  trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
-  <description>This will find the gradient of the heath request over a minute.</description>
-  <siddhiConfiguration>
-    <property name="siddhi.enable.distributed.processing">false</property>
-    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
-  </siddhiConfiguration>
-  <importedStreams>
-    <stream as="health_grad_processsor" name="cartridge_agent_health_stats" version="1.0.0"/>
-  </importedStreams>
-  <queryExpressions><![CDATA[
-  	from health_grad_processsor 
-  		#window.stratos:faultHandling(1min, member_id) select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id
-		group by cluster_id, network_partition_id 
-  		insert into fault_message;
-  	from health_grad_processsor
-  		select cluster_id, cluster_instance_id, network_partition_id, member_id, partition_id, health_description, value,
-		stratos:concat(cluster_id, '-' , cluster_instance_id) as health_grad_cluster_network
-  		insert into health_grad_concatinator;
-  	define partition health_grad_cluster_partition by  health_grad_concatinator.health_grad_cluster_network;
- 	define partition member_health_grad_cluster_partition by health_grad_processsor.member_id;
-  	from health_grad_concatinator [health_description == 'load_average'] 
-		#window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_load_average
-		insert into gradient_load_average_stats 
-		partition by health_grad_cluster_partition;
-  	from health_grad_processsor [health_description == 'load_average'] 
-		#window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_load_average
-		insert into member_gradient_load_average_stats 
-		partition by member_health_grad_cluster_partition;
-  	from health_grad_processsor [health_description == 'memory_consumption'] 
-		#window.stratos:gradient(1 min, value) select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_gradient_memory_consumption
-		insert into member_gradient_memory_consumption_stats  partition by member_health_grad_cluster_partition;
-  	from health_grad_concatinator [health_description == 'memory_consumption'] 
-		#window.stratos:gradient(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as gradient_memory_consumption
-		insert into gradient_memory_consumption_stats 
-		partition by health_grad_cluster_partition;]]></queryExpressions>
-  <exportedStreams>
-    <stream name="gradient_load_average_stats"
-      valueOf="gradient_load_average_stats" version="1.0.0"/>
-    <stream name="gradient_memory_consumption_stats"
-      valueOf="gradient_memory_consumption_stats" version="1.0.0"/>
-    <stream name="member_gradient_load_average_stats"
-      valueOf="member_gradient_load_average_stats" version="1.0.0"/>
-    <stream name="member_gradient_memory_consumption_stats"
-      valueOf="member_gradient_memory_consumption_stats" version="1.0.0"/>
-    <stream name="fault_message" passthroughFlow="disable"
-      valueOf="fault_message" version="1.0.0"/>
-  </exportedStreams>
-</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml b/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
deleted file mode 100644
index fff4a8a..0000000
--- a/extensions/cep/artifacts/executionplans/GradientOfRequestsInFlightFinder.xml
+++ /dev/null
@@ -1,48 +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.
-
--->
-
-<executionPlan name="GradientOfRequestsInFlightFinder"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
-  <description>This will find the gradient of the number of requests in flight over a minute.</description>
-  <siddhiConfiguration>
-    <property name="siddhi.enable.distributed.processing">false</property>
-    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
-  </siddhiConfiguration>
-  <importedStreams>
-    <stream as="gradient_rif_processor" name="in_flight_requests" version="1.0.0"/>
-  </importedStreams>
-  <queryExpressions><![CDATA[
-	from gradient_rif_processor 
-                select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
-                stratos:concat(cluster_id, '-' , network_partition_id) as request_grad_cluster_network 
-                insert into gradient_rif_concatinator;
-        define partition request_grad_cluster_partition  by gradient_rif_concatinator.request_grad_cluster_network;
-        from gradient_rif_concatinator
-                #window.stratos:gradient(1 min, in_flight_request_count)
-                select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
-                insert into gradient_in_flight_requests 
-                partition by request_grad_cluster_partition;
-]]></queryExpressions>
-  <exportedStreams>
-    <stream name="gradient_in_flight_requests" valueOf="gradient_in_flight_requests" version="1.0.0"/>
-  </exportedStreams>
-</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml b/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
deleted file mode 100644
index 0fa4a0a..0000000
--- a/extensions/cep/artifacts/executionplans/SecondDerivativeOfHealthRequest.xml
+++ /dev/null
@@ -1,68 +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.
-
--->
-
-<executionPlan name="SecondDerivativeOfHealthRequest"
-  statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
-  <description>This will find the second derivative of health stats over a minute.</description>
-  <siddhiConfiguration>
-    <property name="siddhi.enable.distributed.processing">false</property>
-    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
-  </siddhiConfiguration>
-  <importedStreams>
-    <stream as="health_second_der_request" name="cartridge_agent_health_stats" version="1.0.0"/>
-  </importedStreams>
-  <queryExpressions><![CDATA[ 
-	 from health_second_der_request
-		select member_id, cluster_id, cluster_instance_id, network_partition_id, health_description, value,
-		stratos:concat(cluster_id, '-' ,cluster_instance_id) as health_second_der_cluster_network
-		insert into health_second_der_concat;
-	define partition health_second_der_cluster_partition  by health_second_der_concat.health_second_der_cluster_network;
-	from health_second_der_concat [health_description == 'memory_consumption'] 
-		#window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_memory_consumption
-		insert into second_derivative_memory_consumption_stats 
-		partition by health_second_der_cluster_partition;
-	from health_second_der_concat [health_description == 'load_average'] 
-		#window.stratos:secondDerivative(1 min, value) select cluster_id, cluster_instance_id, network_partition_id, value as second_derivative_load_average
-		insert into second_derivative_load_average_stats 
-		partition by health_second_der_cluster_partition;
-	define partition health_second_der_member_partition by health_second_der_request.member_id;
-	from health_second_der_request [health_description == 'memory_consumption'] 
-		#window.stratos:secondDerivative(1 min, value) 
-		select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_memory_consumption
-		insert into member_second_derivative_memory_consumption_stats 
-		partition by health_second_der_member_partition;
-	from health_second_der_request [health_description == 'load_average'] 
-		#window.stratos:secondDerivative(1 min, value)
-		select member_id, cluster_id, cluster_instance_id, network_partition_id, value as member_second_derivative_load_average
-		 insert into member_second_derivative_load_average_stats 
-		partition by health_second_der_member_partition;]]></queryExpressions>
-  <exportedStreams>
-    <stream name="second_derivative_memory_consumption_stats"
-      valueOf="second_derivative_memory_consumption_stats" version="1.0.0"/>
-    <stream name="second_derivative_load_average_stats"
-      valueOf="second_derivative_load_average_stats" version="1.0.0"/>
-    <stream name="member_second_derivative_memory_consumption_stats"
-      valueOf="member_second_derivative_memory_consumption_stats" version="1.0.0"/>
-    <stream name="member_second_derivative_load_average_stats"
-      valueOf="member_second_derivative_load_average_stats" version="1.0.0"/>
-  </exportedStreams>
-</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml b/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
deleted file mode 100644
index c8e4ed5..0000000
--- a/extensions/cep/artifacts/executionplans/SecondDerivativeOfRequestsInFlightFinder.xml
+++ /dev/null
@@ -1,48 +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.
-
--->
-
-<executionPlan name="SecondDerivativeOfRequestsInFlightFinder"
-  statistics="disable" trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
-  <description>This will find the second derivative of the number of requests in flight over a minute.</description>
-  <siddhiConfiguration>
-    <property name="siddhi.enable.distributed.processing">false</property>
-    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
-  </siddhiConfiguration>
-  <importedStreams>
-    <stream as="second_der_rif" name="in_flight_requests" version="1.0.0"/>
-  </importedStreams>
-  <queryExpressions><![CDATA[ 
-	from second_der_rif
-		select cluster_id, cluster_instance_id, network_partition_id, in_flight_request_count,
-		stratos:concat(cluster_id, '-' ,network_partition_id) as rif_second_der_cluster_network
-		insert into rif_second_der_concat;
-	define partition rif_second_der_cluster_partition by rif_second_der_concat.rif_second_der_cluster_network;
-	from rif_second_der_concat#window.stratos:secondDerivative(1 min, in_flight_request_count)
-		select cluster_id, cluster_instance_id, network_partition_id,in_flight_request_count as count
-		insert into second_derivative_in_flight_requests 
-		partition by rif_second_der_cluster_partition;
-  ]]></queryExpressions>
-  <exportedStreams>
-    <stream name="second_derivative_in_flight_requests"
-            valueOf="second_derivative_in_flight_requests" version="1.0.0"/>
-  </exportedStreams>
-</executionPlan>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml b/extensions/cep/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
deleted file mode 100644
index 77af463..0000000
--- a/extensions/cep/artifacts/inputeventadaptors/DefaultWSO2EventInputAdaptor.xml
+++ /dev/null
@@ -1,24 +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.
-
--->
-
-<inputEventAdaptor name="DefaultWSO2EventInputAdaptor"
-  statistics="disable" trace="enable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager"/>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml b/extensions/cep/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
deleted file mode 100644
index 4438d2c..0000000
--- a/extensions/cep/artifacts/outputeventadaptors/DefaultWSO2EventOutputAdaptor.xml
+++ /dev/null
@@ -1,29 +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.
-
--->
-
-<outputEventAdaptor name="DefaultWSO2EventOutputAdaptor"
-  statistics="disable" trace="disable" type="wso2event" xmlns="http://wso2.org/carbon/eventadaptormanager">
-  <property name="username">admin</property>
-  <property name="receiverURL">tcp://localhost:7661</property>
-  <property name="password">admin</property>
-  <property name="authenticatorURL">ssl://localhost:7761</property>
-</outputEventAdaptor>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/cep/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/extensions/cep/artifacts/outputeventadaptors/JMSOutputAdaptor.xml b/extensions/cep/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
deleted file mode 100644
index 59c3653..0000000
--- a/extensions/cep/artifacts/outputeventadaptors/JMSOutputAdaptor.xml
+++ /dev/null
@@ -1,30 +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.
-
--->
-
-<outputEventAdaptor name="JMSOutputAdaptor" statistics="disable"
-  trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
-  <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property-->
-  <property name="java.naming.provider.url">tcp://localhost:61616</property>
-  <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
-  <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
-  <property name="transport.jms.DestinationType">topic</property>
-</outputEventAdaptor>


[23/50] [abbrv] stratos git commit: Fixing port mapping issue in lvs extension

Posted by ra...@apache.org.
Fixing port mapping issue in lvs extension


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/31cbfd51
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/31cbfd51
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/31cbfd51

Branch: refs/heads/master
Commit: 31cbfd5166ab187bfa50038d2233e82fa6f6c34e
Parents: cb50e9a
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Aug 28 18:41:05 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Aug 28 18:41:05 2015 +0530

----------------------------------------------------------------------
 .../stratos/lvs/extension/LVSConfigWriter.java    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/31cbfd51/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
index c3beb30..1a09c5c 100644
--- a/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
+++ b/extensions/load-balancer/lvs-extension/src/main/java/org/apache/stratos/lvs/extension/LVSConfigWriter.java
@@ -72,11 +72,7 @@ public class LVSConfigWriter {
 		String state;
 		for (Service service : topology.getServices()) {
 			for (Cluster cluster : service.getClusters()) {
-				if ((service.getPorts() == null) || (service.getPorts().size() == 0)) {
-					throw new RuntimeException(
-							String.format("No ports found in service: %s", service.getServiceName()));
-				}
-				generateConfigurationForCluster(cluster, service.getPorts(), configurationBuilder, virtualIPBuilder,
+				generateConfigurationForCluster(cluster, configurationBuilder, virtualIPBuilder,
 				                                virtualIPsForServices, scheduleAlgo,isKeepAlived);
 			}
 		}
@@ -144,12 +140,20 @@ public class LVSConfigWriter {
 	 * }
 	 *
 	 * @param cluster
-	 * @param ports
 	 * @param text
 	 */
-	private void generateConfigurationForCluster(Cluster cluster, Collection<Port> ports, StringBuilder text,
+	private void generateConfigurationForCluster(Cluster cluster, StringBuilder text,
 	                                             StringBuilder virtualIPs, String virtualIPsForServices,
 	                                             String scheduleAlgo,boolean isKeepAlived) {
+
+		if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
+			return;
+		}
+
+		// Find port mappings
+		Member firstMember = (Member) cluster.getMembers().toArray()[0];
+		Collection<Port> ports = firstMember.getPorts();
+
 		String commandClear = "ipvsadm --clear";
 		try {
 			CommandUtils.executeCommand(commandClear);


[38/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/notice/NOTICE b/extensions/load-balancer/lvs-extension/src/main/notice/NOTICE
deleted file mode 100644
index 8624fcc..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/notice/NOTICE
+++ /dev/null
@@ -1,395 +0,0 @@
-Apache Software
-Copyright 2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-================================================================================
-Apache Abdera Notice:
-
-Portions of Abdera were orginally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Abdera CLA".
-
-This software's test suite contains data files derived from the
-Universal Feed Parser, Copyright (c) 2002-2005, Mark Pilgrim.
-
-This software's extensions module contains a JSON writer for Atom XML
-that utilizes a JSON parser, Copyright (c) 2002, json.org. The code was 
-licensed using Apache License by the author Douglas Crockford and made 
-available at http://json.org/java/apache.zip We have included portions 
-of the code in the extensions module.
-
-===============================================================================
-Apache Ant Notice:
-
-The <sync> task is based on code Copyright (c) 2002, Landmark
-Graphics Corp that has been kindly donated to the Apache Software
-Foundation.
-
-================================================================================
-Apache Axiom Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-
-================================================================================
-Apache Axis2 Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems,
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-================================================================================
-Apache Commons-Lang Notice:
-
-This product includes software from the Spring Framework,
-under the Apache License 2.0 (see: StringUtils.containsWhitespace())
-
-================================================================================
-Apache Commons-Pool Notice:
-
-The LinkedBlockingDeque implementation is based on an implementation written by
-Doug Lea with assistance from members of JCP JSR-166 Expert Group and released
-to the public domain, as explained at
-http://creativecommons.org/licenses/publicdomain
-
-================================================================================
-Apache Commons-httpclient Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache Tomcat Notice:
-
-The Windows Installer is built with the Nullsoft
-Scriptable Install System (NSIS), which is
-open source software.  The original software and
-related information is available at
-http://nsis.sourceforge.net.
-
-Java compilation software for JSP pages is provided by Eclipse,
-which is open source software.  The original software and
-related information is available at
-http://www.eclipse.org.
-
-For the bayeux implementation
-The org.apache.cometd.bayeux API is derivative work originating at the Dojo Foundation
-* Copyright 2007-2008 Guy Molinari
-* Copyright 2007-2008 Filip Hanik
-* Copyright 2007 Dojo Foundation
-* Copyright 2007 Mort Bay Consulting Pty. Ltd.
-
-The original XML Schemas for Java EE Deployment Descriptors:
- - javaee_5.xsd
- - javaee_web_services_1_2.xsd
- - javaee_web_services_client_1_2.xsd
- - javaee_6.xsd
- - javaee_web_services_1_3.xsd
- - javaee_web_services_client_1_3.xsd
- - jsp_2_2.xsd
- - web-app_3_0.xsd
- - web-common_3_0.xsd
- - web-fragment_3_0.xsd
- - javaee_7.xsd
- - javaee_web_services_1_4.xsd
- - javaee_web_services_client_1_4.xsd
- - jsp_2_3.xsd
- - web-app_3_1.xsd
- - web-common_3_1.xsd
- - web-fragment_3_1.xsd
-
-may be obtained from:
-http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
-
-================================================================================
-Apache Geranimo Notice:
-
-Apache Geronimo
-Copyright 2003-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-Portions of the Web Console were orginally developed by International
-Business Machines Corporation and are licensed to the Apache Software
-Foundation under the "Software Grant and Corporate Contribution
-License Agreement", informally known as the "IBM Console CLA".
-
-Portions of the ASN1 codec implementation in
-framework/modules/geronimo-crypto/ were developed by the Bouncy Castle
-project (http://www.bouncycastle.org/).
-
-Copyright (c) 2000-2005
-The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
-
-ORB Portions of this software were developed at IONA Technologies.
-
-Object Management Group (OMG) classes used by the orb.
-The original classes are available from www.org.omg.
-
-The RMI over IIOP implementation were developed at Trifork Technologies.
-
-Copyright 2004-2009 Tranql project committers
-This product includes software developed at
-Tranql (http://tranql.codehaus.org/).
-
-This product includes software developed by the Protocol Buffers
-project (http://code.google.com/apis/protocolbuffers).
-
-This product includes also software developed by :
-  - the W3C consortium (http://www.w3c.org) ,
-  - the SAX project (http://www.saxproject.org)
-
-The <sync> task is based on code Copyright (c) 2002, Landmark
-Graphics Corp that has been kindly donated to the Apache Software
-Foundation.
-
-Portions of this software were originally based on the following:
-  - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-  - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-  - voluntary contributions made by Paul Eng on behalf of the
-    Apache Software Foundation that were originally developed at iClick, Inc.,
-    software copyright (c) 1999.
-
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems,
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-This product also includes schemas and specification developed by:
-      - the W3C consortium (http://www.w3c.org)
-      (http://www.w3.org/XML/1998/namespace)
-
-This product also includes WS-* schemas developed by International
-   Business Machines Corporation, Microsoft Corporation, BEA Systems,
-   TIBCO Software, SAP AG, Sonic Software, and VeriSign
-   (http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd)
-   (http://schemas.xmlsoap.org/ws/2004/08/addressing/)
-   (http://schemas.xmlsoap.org/wsdl/http)
-   (http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm.xsd)
-   (http://www.w3.org/2005/08/addressing/ws-addr.xsd)
-
-Portions of Derby were originally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Derby CLA".
-The following copyright notice(s) were affixed to portions of the code
-with which this file is now or was at one time distributed
-and are placed here unaltered.
-
-(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
-
-(C) Copyright IBM Corp. 2003.
-
-The portion of the functionTests under 'nist' was originally
-developed by the National Institute of Standards and Technology (NIST),
-an agency of the United States Department of Commerce, and adapted by
-International Business Machines Corporation in accordance with the NIST
-Software Acknowledgment and Redistribution document at
-http://www.itl.nist.gov/div897/ctg/sql_form.htm
-
-* OpenJPA includes software written by Miroslav Nachev.
-
-* OpenJPA uses test code written by Charles Tillman.
-
-XMLSec was originally based on software copyright (c) 2001, Institute for
-Data Communications Systems, <http://www.nue.et-inf.uni-siegen.de/>.
-
-The development of XMLSec was partly funded by the European
-Commission in the <WebSig> project in the ISIS Programme.
-
-This product also includes software developed by :
-
-  - IBM Corporation (http://www.ibm.com),
-      WSDL4J was the initial code contribution for the Apache Woden
-      project and some of the WSDL4J design and code has been reused.
-  - The W3C Consortium (http://www.w3c.org),
-      Common W3C XML Schema and DTD files are packaged with Apache Woden.
-
-Portions Copyright 2006 International Business Machines Corp.
-
-Portions of this software were originally based on the following:
-  - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-Aside from contributions to the Apache XMLBeans project, this
-software also includes:
-
- - one or more source files from the Apache Xerces-J and Apache Axis
-   products, Copyright (c) 1999-2003 Apache Software Foundation
-
- - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
-   Consortium (Massachusetts Institute of Technology, European Research
-   Consortium for Informatics and Mathematics, Keio University)
-
- - resolver.jar from Apache Xml Commons project,
-   Copyright (c) 2001-2003 Apache Software Foundation
-
- - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
-   Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
-
- - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
-   Copyright 2005 BEA under the terms of the Apache Software License 2.0
-
-This product includes software developed by the Simple XML Compiler (SXC)
-project (http://sxc.codehaus.org/project-info.html)
-
-This product includes software developed for the JAXB Reference
-Implementation project. (https://jaxb.dev.java.net/).  Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes software developed for SOAP with Attachments
-API for Java (SAAJ). The software is available from the GlassFish project
-(https://saaj.dev.java.net/).  Apache Geronimo elects to include this
-software in this distribution under the CDDL license.
-
-This product includes software developed for Java API for XML Web Services
-project (JAX-WS) (https://jax-ws.dev.java.net/).  Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes software developed for the Java Server Pages Tag
-Library project (https://jstl.dev.java.net/).   Apache Geronimo elects
-to include this software in this distribution under the CDDL license.
-
-This product includes schema files developed for the Glassfish Java EE
-reference implementation (http://java.sun.com/xml/ns/j2ee/).
-Apache Geronimo elects to include this software in this distribution
-under the CDDL license.  You can obtain a copy of the License at:
-    https://glassfish.dev.java.net/public/CDDL+GPL.html
-The source code is available at:
-    https://glassfish.dev.java.net/source/browse/glassfish/
-
-The following schemas are included:
-
-----------------------------------
-  application-client_1_4.xsd
-  application_1_4.xsd
-  connector_1_5.xsd
-  datatypes.dtd
-  ejb-jar_2_1.xsd
-  j2ee_1_4.xsd
-  j2ee_jaxrpc_mapping_1_1.xsd
-  j2ee_web_services_1_1.xsd
-  j2ee_web_services_client_1_1.xsd
-  jsp_2_0.xsd
-  web-app_2_4.xsd
-  web-jsptaglibrary_2_0.xsd
-  application-client_5.xsd
-  application_5.xsd
-  ejb-jar_3_0.xsd
-  handler-chain.xsd
-  javaee_5.xsd
-  javaee_web_services_1_2.xsd
-  javaee_web_services_client_1_2.xsd
-  jsp_2_1.xsd
-  persistence_1_0.xsd
-  web-app_2_5.xsd
-  web-facelettaglibrary_2_0.xsd
-  web-facesconfig_2_0.xsd
-  web-partialresponse_2_0.xsd
-  web-jsptaglibrary_2_1.xsd
-  application_6.xsd
-  application-client_6.xsd
-  connector_1_6.xsd
-  ejb-jar_3_1.xsd
-  javaee_6.xsd
-  javaee_web_services_1_3.xsd
-  javaee_web_services_client_1_3.xsd
-  jsp_2_2.xsd
-  persistence_2_0.xsd
-  web-app_3_0.xsd
-  web-common_3_0.xsd
-  web-fragment_3_0.xsd
---------------------------------
-
-This product includes software developed at
-the OSGi Alliance (http://www.osgi.org/).
-
- This product includes software developed at
- OPS4J (http://www.ops4j.org/).
--------------------------------------------------------------------------------
-
-The product contains the software developed in javassist.org (http://www.javassist.org) 
-which is released under both the Mozilla Public License 
-(http://www.mozilla.org/MPL/MPL-1.1.html) and the GNU Lesser General Public 
-License (http://www.gnu.org/licenses/lgpl-2.1.html).  
-
-The Apache Geronimo project elects to distribute this software under the terms of 
-the Mozilla Public License. 
-
--------------------------------------------------------------------------------
-
-The product contains the software developed in json.org which released under the following license.
-
-http://www.json.org/license.html
-
-Copyright (c) 2002 JSON.org
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-================================================================================
-Apache Httpclient Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-================================================================================
-Apache Httpcore Notice:
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-===============================================================================
-Apache POI Notice:
-
-This product contains the DOM4J library (http://www.dom4j.org).
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-This product contains parts that were originally based on software from BEA.
-Copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-This product contains W3C XML Schema documents. Copyright 2001-2003 (c)
-World Wide Web Consortium (Massachusetts Institute of Technology, European
-Research Consortium for Informatics and Mathematics, Keio University)
-
-This product contains the Piccolo XML Parser for Java
-(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren.
-
-This product contains the chunks_parse_cmds.tbl file from the vsdump program.
-Copyright (C) 2006-2007 Valek Filippov (frob@df.ru)
-
-
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/resources/velocity.properties b/extensions/load-balancer/lvs-extension/src/main/resources/velocity.properties
deleted file mode 100644
index 437aec5..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/resources/velocity.properties
+++ /dev/null
@@ -1,26 +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.
-#
-
-resource.loader=class, file
-class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
-file.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader
-runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
-runtime.log.logsystem.log4j.category=velocity
-input.encoding=UTF-8
-output.encoding=UTF-8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/security/client-truststore.jks
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/security/client-truststore.jks b/extensions/load-balancer/lvs-extension/src/main/security/client-truststore.jks
deleted file mode 100644
index be441f3..0000000
Binary files a/extensions/load-balancer/lvs-extension/src/main/security/client-truststore.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/lvs-extension/src/main/templates/keepalived.conf.template
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/lvs-extension/src/main/templates/keepalived.conf.template b/extensions/load-balancer/lvs-extension/src/main/templates/keepalived.conf.template
deleted file mode 100644
index 682598f..0000000
--- a/extensions/load-balancer/lvs-extension/src/main/templates/keepalived.conf.template
+++ /dev/null
@@ -1,59 +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.
-!
-! This is a generated file and will be overwritten at the next load balancer startup.
-! Please use loadbalancer.conf for updating mb-ip, mb-port and templates/jndi.properties.template
-! file for updating other configurations.
-!
-
-! Configuration File for keepalived
-
-global_defs {
-   notification_email {
-       your_email@admin.com
-   }
-   notification_email_from loadbalancer1@admin.com
-   smtp_server localhost
-   smtp_connect_timeout 30
-! UNIQUE:
-   router_id LVS_PRI
-}
-
-! ***********************************************************************
-! *************************   WEB SERVICES VIP  *************************
-! ***********************************************************************
-vrrp_instance VirtIP_10 {
-    state $state
-    interface eth0
-    virtual_router_id 10
-! UNIQUE:
-    priority 150
-    advert_int 3
-    smtp_alert
-    authentication {
-        auth_type PASS
-        auth_pass MY_PASS
-    }
-    virtual_ipaddress {
-$virtualips
-    }
-
-    lvs_sync_daemon_interface eth0
-}
-
-
-$configuration
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/INSTALL.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/INSTALL.md b/extensions/load-balancer/modules/haproxy-extension/INSTALL.md
new file mode 100644
index 0000000..826419f
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/INSTALL.md
@@ -0,0 +1,32 @@
+# Installing Apache Stratos HAProxy Extension
+
+Apache Stratos HAProxy Extension could be used for integrating HAProxy load balancer with Apache Stratos. Please follow
+below steps to proceed with the installation:
+
+1. Download and extract HAProxy binary distribution to a desired location: <haproxy-home>.
+
+2. Extract org.apache.stratos.haproxy.extension-<version>.zip to a desired location: <haproxy-extension-home>.
+
+3. Open <haproxy-extension-home>/bin/haproxy-extension.sh file in a text editor and update following system properties:
+   ```
+   # Define haproxy host private ip address:
+   -Dhaproxy.private.ip=127.0.0.1
+
+   # Define the haproxy executable file path:
+   -Dexecutable.file.path=<haproxy-home>/haproxy
+
+   # Enable/disable cep statistics publisher:
+   -Dcep.stats.publisher.enabled=false
+
+   # If cep statistics publisher is enabled define the following properties:
+   -Dthrift.receiver.ip=127.0.0.1
+   -Dthrift.receiver.port=7615
+   -Dnetwork.partition.id=network-partition-1
+   ```
+
+4. Open <haproxy-extension-home>/conf/jndi.properties file in a text editor and update message broker information:
+   ```
+   java.naming.provider.url=tcp://localhost:61616
+   ```
+5. Run <haproxy-extension-home>/bin/haproxy-extension.sh as the root user.
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/README.md
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/README.md b/extensions/load-balancer/modules/haproxy-extension/README.md
new file mode 100644
index 0000000..50a49a1
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/README.md
@@ -0,0 +1,20 @@
+# Apache Stratos HAProxy Extension
+
+Apache Stratos HAProxy extension is a load balancer extension for HAProxy. It is an executable program
+which can manage the life-cycle of a HAProxy instance according to the topology, composite application model,
+tenant application signups and domain mapping information received from Stratos via the message broker.
+
+## How it works
+1. Wait for the complete topology event message to initialize the topology.
+2. Configure and start an instance of HAProxy.
+3. Listen to topology, application, application signup, domain mapping events.
+4. Reload HAProxy instance with the new topology configuration.
+5. Periodically publish statistics to Complex Event Processor (CEP).
+
+## Installation
+Please refer INSTALL.md for information on the installation process.
+
+Thanks to Vaadin for HAProxyController implementation:
+https://vaadin.com/license
+http://dev.vaadin.com/browser/svn/incubator/Arvue/ArvueMaster/src/org/vaadin/arvue/arvuemaster/HAProxyController.java
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/pom.xml b/extensions/load-balancer/modules/haproxy-extension/pom.xml
new file mode 100644
index 0000000..c15ceba
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/pom.xml
@@ -0,0 +1,110 @@
+<?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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-load-balancer-extensions</artifactId>
+        <version>4.1.2</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>apache-stratos-haproxy-extension</artifactId>
+    <name>Apache Stratos - HAProxy Extension</name>
+    <description>Apache Stratos HAProxy Extension for Load Balancing</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.7.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.messaging</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.andes.wso2</groupId>
+            <artifactId>andes-client</artifactId>
+            <version>0.13.wso2v8</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.stratos.haproxy.extension.Main</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptors>
+                        <descriptor>src/main/assembly/bin.xml</descriptor>
+                    </descriptors>
+                    <archiverConfig>
+                        <fileMode>420</fileMode>
+                        <directoryMode>493</directoryMode>
+                        <defaultDirectoryMode>493</defaultDirectoryMode>
+                    </archiverConfig>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/assembly/bin.xml b/extensions/load-balancer/modules/haproxy-extension/src/main/assembly/bin.xml
new file mode 100644
index 0000000..5bfa02e
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/assembly/bin.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ 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.
+  -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+    <id>bin</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/src/main/bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>haproxy-extension.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/conf</directory>
+            <outputDirectory>/conf</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>jndi.properties</include>
+                <include>log4j.properties</include>
+                <include>thrift-client-config.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/security</directory>
+            <outputDirectory>/security</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>client-truststore.jks</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/templates</directory>
+            <outputDirectory>/templates</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>haproxy.cfg.template</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/scripts</directory>
+            <outputDirectory>/scripts</outputDirectory>
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>get-weight.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+            <includes>
+                <include>DISCLAIMER</include>
+                <include>README*</include>
+                <include>LICENSE*</include>
+                <include>INSTALL*</include>
+            </includes>
+        </fileSet>
+	<fileSet>
+            <directory>${project.basedir}/src/main/license</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/notice</directory>
+            <outputDirectory>/</outputDirectory>
+            <fileMode>0600</fileMode>
+        </fileSet>
+    </fileSets>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>/lib</outputDirectory>
+	    <excludes>
+                <exclude>*:icu4j*</exclude>
+                <exclude>*:jaxen*</exclude>
+                <exclude>*:jboss-transaction-api*</exclude>
+                <exclude>*:wrapper*</exclude>
+                <exclude>*:xom*</exclude>
+            </excludes>
+            <useProjectArtifact>true</useProjectArtifact>
+            <scope>runtime</scope>
+        </dependencySet>
+    </dependencySets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/bin/haproxy-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/bin/haproxy-extension.sh b/extensions/load-balancer/modules/haproxy-extension/src/main/bin/haproxy-extension.sh
new file mode 100755
index 0000000..bc17399
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/bin/haproxy-extension.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+
+echo "Starting haproxy extension..."
+script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
+lib_path=${script_path}/../lib/
+class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
+properties="-Dhaproxy.private.ip=127.0.0.1
+            -Dexecutable.file.path=haproxy
+            -Djndi.properties.dir=${script_path}/../conf
+            -Dtemplates.path=${script_path}/../templates
+            -Dtemplates.name=haproxy.cfg.template
+            -Dscripts.path=${script_path}/../scripts
+            -Dconf.file.path=/tmp/haproxy.cfg
+            -Dstats.socket.file.path=/tmp/haproxy-stats.socket
+            -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
+            -Djavax.net.ssl.trustStore=${script_path}/../security/client-truststore.jks
+            -Djavax.net.ssl.trustStorePassword=wso2carbon
+            -Dthrift.client.config.file.path=${script_path}/../conf/thrift-client-config.xml
+            -Dcep.stats.publisher.enabled=false
+            -Dthrift.receiver.ip=127.0.0.1
+            -Dthrift.receiver.port=7615
+            -Dnetwork.partition.id=network-partition-1
+            -Dcluster.id=cluster-1
+            -Dservice.name=service-1"
+
+
+# Uncomment below line to enable remote debugging
+#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
+
+java -cp "${class_path}" ${properties} ${debug} org.apache.stratos.haproxy.extension.Main $*

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/conf/jndi.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/conf/jndi.properties b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/jndi.properties
new file mode 100644
index 0000000..21d7420
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61616
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/conf/log4j.properties b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/log4j.properties
new file mode 100644
index 0000000..ec45878
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/log4j.properties
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Set root logger level and appenders
+log4j.rootLogger=INFO, CONSOLE_APPENDER, FILE_APPENDER
+
+# CONSOLE_APPENDER is set to be a ConsoleAppender.
+log4j.appender.CONSOLE_APPENDER=org.apache.log4j.ConsoleAppender
+
+# The standard error log where all the warnings, errors and fatal errors will be logged
+log4j.appender.FILE_APPENDER=org.apache.log4j.FileAppender
+log4j.appender.FILE_APPENDER.File=logs/haproxy-extension.log
+log4j.appender.FILE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
+log4j.appender.FILE_APPENDER.threshold=DEBUG
+
+# CONSOLE_APPENDER uses PatternLayout.
+log4j.appender.CONSOLE_APPENDER.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE_APPENDER.layout.ConversionPattern=[%d{ISO8601}] %5p - [%c{1}] %m%n
+
+log4j.logger.org.apache.stratos.haproxy.extension=INFO
+log4j.logger.org.apache.stratos.load.balancer.extension.api=INFO
+log4j.logger.org.apache.stratos.messaging=INFO
+log4j.logger.org.wso2.andes.client=ERROR
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
new file mode 100644
index 0000000..5cacada
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/conf/thrift-client-config.xml
@@ -0,0 +1,27 @@
+<?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.
+  -->
+
+<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
+<thriftClientConfiguration>
+    <username>admin</username>
+    <password>admin</password>
+    <ip>localhost</ip>
+    <port>7611</port>
+</thriftClientConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java
new file mode 100644
index 0000000..464f093
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Constants.java
@@ -0,0 +1,39 @@
+/*
+ * 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.haproxy.extension;
+
+/**
+ * HA proxy extension constants.
+ */
+public class Constants {
+    public static final String HAPROXY_PRIVATE_IP = "haproxy.private.ip";
+    public static final String EXECUTABLE_FILE_PATH = "executable.file.path";
+    public static final String TEMPLATES_PATH = "templates.path";
+    public static final String TEMPLATES_NAME = "templates.name";
+    public static final String SCRIPTS_PATH = "scripts.path";
+    public static final String CONF_FILE_PATH = "conf.file.path";
+    public static final String STATS_SOCKET_FILE_PATH = "stats.socket.file.path";
+    public static final String CEP_STATS_PUBLISHER_ENABLED = "cep.stats.publisher.enabled";
+    public static final String THRIFT_RECEIVER_IP = "thrift.receiver.ip";
+    public static final String THRIFT_RECEIVER_PORT = "thrift.receiver.port";
+    public static final String NETWORK_PARTITION_ID = "network.partition.id";
+    public static final String CLUSTER_ID = "cluster.id";
+    public static final String SERVICE_NAME = "service.name";
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java
new file mode 100644
index 0000000..18f005d
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxy.java
@@ -0,0 +1,158 @@
+/*
+ * 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.haproxy.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.util.CommandUtils;
+import org.apache.stratos.load.balancer.extension.api.LoadBalancer;
+import org.apache.stratos.load.balancer.extension.api.exception.LoadBalancerExtensionException;
+import org.apache.stratos.load.balancer.common.domain.Topology;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.Vector;
+
+/**
+ * HAProxy load balancer life-cycle implementation.
+ */
+public class HAProxy implements LoadBalancer {
+
+    private static final Log log = LogFactory.getLog(HAProxy.class);
+
+    private String executableFilePath;
+    private String processIdFilePath;
+    private String templatePath;
+    private String templateName;
+    private String confFilePath;
+    private String statsSocketFilePath;
+
+    public HAProxy() {
+        this.executableFilePath = HAProxyContext.getInstance().getExecutableFilePath();
+        this.templatePath = HAProxyContext.getInstance().getTemplatePath();
+        this.templateName = HAProxyContext.getInstance().getTemplateName();
+        this.confFilePath = HAProxyContext.getInstance().getConfFilePath();
+        this.processIdFilePath = confFilePath.replace(".cfg", ".pid");
+        this.statsSocketFilePath = HAProxyContext.getInstance().getStatsSocketFilePath();
+    }
+
+    /**
+     * Configure haproxy instance according to topology given
+     * @param topology
+     * @throws LoadBalancerExtensionException
+     */
+    public boolean configure(Topology topology) throws LoadBalancerExtensionException {
+        try {
+            log.info("Generating haproxy configuration...");
+            HAProxyConfigWriter writer = new HAProxyConfigWriter(templatePath, templateName, confFilePath, statsSocketFilePath);
+            if(writer.write(topology)) {
+                return true;
+            }
+            return false;
+        } catch (Exception e) {
+            log.error("Could not generate haproxy configuration");
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Start haproxy instance
+     * @throws LoadBalancerExtensionException
+     */
+    public void start() throws LoadBalancerExtensionException {
+        log.info("Starting haproxy instance...");
+        // Check for configuration file
+        File conf = new File(confFilePath);
+        if (!conf.exists()) {
+            throw new LoadBalancerExtensionException("Could not find haproxy configuration file");
+        }
+
+        // Start haproxy and write pid to processIdFilePath
+        try {
+            String command = executableFilePath + " -f " + confFilePath + " -p " + processIdFilePath;
+            CommandUtils.executeCommand(command);
+            log.info("haproxy instance started");
+        } catch (Exception e) {
+            log.error("Could not start haproxy instance");
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Reload haproxy instance according to the configuration written in configure() method.
+     * @throws LoadBalancerExtensionException
+     */
+    public void reload() throws LoadBalancerExtensionException {
+        try {
+            log.info("Reloading configuration...");
+
+            // Read pid
+            String pid = "";
+            BufferedReader reader = new BufferedReader(new FileReader(processIdFilePath));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                pid += line + " ";
+            }
+
+            // Execute hot configuration deployment
+            String command = executableFilePath + " -f " + confFilePath + " -p " + processIdFilePath + " -sf " + pid;
+            CommandUtils.executeCommand(command);
+            if (log.isInfoEnabled()) {
+                log.info("Configuration done");
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Reconfiguration failed");
+            }
+            throw new LoadBalancerExtensionException(e);
+        }
+    }
+
+    /**
+     * Stop haproxy instance
+     * @throws LoadBalancerExtensionException
+     */
+    public void stop() throws LoadBalancerExtensionException {
+
+        try {
+            // Read the PIDs
+            Vector<String> pids = new Vector<String>();
+            BufferedReader reader = new BufferedReader(new FileReader(processIdFilePath));
+            String pid_;
+            while ((pid_ = reader.readLine()) != null) {
+                pids.add(pid_);
+            }
+
+            // Kill all haproxy processes
+            for (String pid : pids) {
+                String command = "kill -s 9 " + pid;
+                CommandUtils.executeCommand(command);
+                if (log.isInfoEnabled()) {
+                    log.info(String.format("haproxy instance stopped [pid] %s", pid));
+                }
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Could not stop haproxy instance", e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
new file mode 100644
index 0000000..7a0d531
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyConfigWriter.java
@@ -0,0 +1,152 @@
+/*
+ * 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.haproxy.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.load.balancer.common.domain.*;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Collection;
+
+/**
+ * HAProxy load balancer configuration writer.
+ */
+public class HAProxyConfigWriter {
+
+    private static final Log log = LogFactory.getLog(Main.class);
+    private static final String NEW_LINE = System.getProperty("line.separator");
+
+    private String templatePath;
+    private String templateName;
+    private String confFilePath;
+    private String statsSocketFilePath;
+
+    public HAProxyConfigWriter(String templatePath, String templateName, String confFilePath,
+                               String statsSocketFilePath) {
+
+        this.templatePath = templatePath;
+        this.templateName = templateName;
+        this.confFilePath = confFilePath;
+        this.statsSocketFilePath = statsSocketFilePath;
+    }
+
+    public boolean write(Topology topology) {
+        // Prepare global parameters
+        StringBuilder globalParameters = new StringBuilder();
+        globalParameters.append("stats socket ");
+        globalParameters.append(statsSocketFilePath);
+
+        StringBuilder frontendCollection = new StringBuilder();
+        StringBuilder backendCollection = new StringBuilder();
+
+        for (Service service : topology.getServices()) {
+            for (Cluster cluster : service.getClusters()) {
+                createConfig(cluster, frontendCollection, backendCollection);
+            }
+        }
+
+        // Start velocity engine
+        VelocityEngine ve = new VelocityEngine();
+        ve.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templatePath);
+        ve.init();
+
+        // Open the template
+        Template t = ve.getTemplate(templateName);
+
+        // Insert strings into the template
+        VelocityContext context = new VelocityContext();
+        context.put("global_parameters", globalParameters.toString());
+        context.put("frontend_collection", frontendCollection.toString());
+        context.put("backend_collection", backendCollection.toString());
+
+        // Create a new string from the template
+        StringWriter stringWriter = new StringWriter();
+        t.merge(context, stringWriter);
+        String configuration = stringWriter.toString();
+
+        // Write configuration file
+        try {
+            BufferedWriter writer = new BufferedWriter(new FileWriter(confFilePath));
+            writer.write(configuration);
+            writer.close();
+
+            if (log.isInfoEnabled()) {
+                log.info(String.format("Configuration written to file: %s", confFilePath));
+            }
+            return true;
+        } catch (IOException e) {
+            if (log.isErrorEnabled()) {
+                log.error(String.format("Could not write configuration file: %s", confFilePath));
+            }
+            throw new RuntimeException(e);
+        }
+    }
+
+    private void createConfig(Cluster cluster, StringBuilder frontendCollection,
+                              StringBuilder backendCollection) {
+
+        if((cluster.getMembers() == null) || (cluster.getMembers().size() == 0)) {
+            return;
+        }
+
+        // Find port mappings
+        Member firstMember = (Member) cluster.getMembers().toArray()[0];
+        Collection<Port> ports = firstMember.getPorts();
+
+        for (Port port : ports) {
+            // Frontend block start
+            String protocol = port.getProtocol();
+            String frontendId = protocol + "_" + port.getValue() + "_frontend";
+
+            frontendCollection.append("frontend ").append(frontendId).append(NEW_LINE);
+            frontendCollection.append("\tbind ").append(HAProxyContext.getInstance().getHAProxyPrivateIp())
+                    .append(":").append(port.getProxy()).append(NEW_LINE);
+            frontendCollection.append("\tmode ").append(protocol).append(NEW_LINE);
+
+            for (String hostname : cluster.getHostNames()) {
+                String backendId = hostname + "_" + protocol + "_" + port.getValue() + "_backend";
+
+                frontendCollection.append("\tacl ").append("is_").append(hostname).append(" hdr_beg(host) -i ")
+                        .append(hostname).append(NEW_LINE);
+                frontendCollection.append("\tuse_backend ").append(backendId).append(" if is_")
+                        .append(hostname).append(NEW_LINE);
+                // Front end block end
+
+                // Backend block start
+                backendCollection.append("backend ").append(backendId).append(NEW_LINE);
+                backendCollection.append("\tmode ").append(protocol).append(NEW_LINE);
+                for (Member member : cluster.getMembers()) {
+                    backendCollection.append("\tserver ").append(member.getMemberId()).append(" ")
+                            .append(member.getHostName()).append(":").append(port.getValue()).append(NEW_LINE);
+                }
+                backendCollection.append(NEW_LINE);
+                // Backend block end
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java
new file mode 100644
index 0000000..3019c94
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyContext.java
@@ -0,0 +1,157 @@
+/*
+ * 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.haproxy.extension;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * HAProxy context to read and store system properties.
+ */
+public class HAProxyContext {
+    private static final Log log = LogFactory.getLog(HAProxyContext.class);
+    private static volatile HAProxyContext context;
+
+    private String haProxyPrivateIp;
+    private String executableFilePath;
+    private String templatePath;
+    private String templateName;
+    private String scriptsPath;
+    private String confFilePath;
+    private String statsSocketFilePath;
+    private boolean cepStatsPublisherEnabled;
+    private String thriftReceiverIp;
+    private String thriftReceiverPort;
+    private String networkPartitionId;
+    private String clusterId;
+    private String serviceName;
+
+    private HAProxyContext() {
+        this.haProxyPrivateIp = System.getProperty(Constants.HAPROXY_PRIVATE_IP);
+        this.executableFilePath = System.getProperty(Constants.EXECUTABLE_FILE_PATH);
+        this.templatePath = System.getProperty(Constants.TEMPLATES_PATH);
+        this.templateName = System.getProperty(Constants.TEMPLATES_NAME);
+        this.scriptsPath = System.getProperty(Constants.SCRIPTS_PATH);
+        this.confFilePath = System.getProperty(Constants.CONF_FILE_PATH);
+        this.statsSocketFilePath = System.getProperty(Constants.STATS_SOCKET_FILE_PATH);
+        this.cepStatsPublisherEnabled = Boolean.getBoolean(Constants.CEP_STATS_PUBLISHER_ENABLED);
+        this.thriftReceiverIp = System.getProperty(Constants.THRIFT_RECEIVER_IP);
+        this.thriftReceiverPort = System.getProperty(Constants.THRIFT_RECEIVER_PORT);
+        this.networkPartitionId = System.getProperty(Constants.NETWORK_PARTITION_ID);
+        this.clusterId = System.getProperty(Constants.CLUSTER_ID);
+        this.serviceName = System.getProperty(Constants.SERVICE_NAME);
+
+        if (log.isDebugEnabled()) {
+            log.debug(Constants.HAPROXY_PRIVATE_IP + " = " + haProxyPrivateIp);
+            log.debug(Constants.EXECUTABLE_FILE_PATH + " = " + executableFilePath);
+            log.debug(Constants.TEMPLATES_PATH + " = " + templatePath);
+            log.debug(Constants.TEMPLATES_NAME + " = " + templateName);
+            log.debug(Constants.SCRIPTS_PATH + " = " + scriptsPath);
+            log.debug(Constants.CONF_FILE_PATH + " = " + confFilePath);
+            log.debug(Constants.STATS_SOCKET_FILE_PATH + " = " + statsSocketFilePath);
+            log.debug(Constants.CEP_STATS_PUBLISHER_ENABLED + " = " + cepStatsPublisherEnabled);
+            log.debug(Constants.THRIFT_RECEIVER_IP + " = " + thriftReceiverIp);
+            log.debug(Constants.THRIFT_RECEIVER_PORT + " = " + thriftReceiverPort);
+            log.debug(Constants.NETWORK_PARTITION_ID + " = " + networkPartitionId);
+            log.debug(Constants.CLUSTER_ID + " = " + clusterId);
+        }
+    }
+
+    public static HAProxyContext getInstance() {
+        if (context == null) {
+            synchronized (HAProxyContext.class) {
+                if (context == null) {
+                    context = new HAProxyContext();
+                }
+            }
+        }
+        return context;
+    }
+
+    public void validate() {
+        validateSystemProperty(Constants.HAPROXY_PRIVATE_IP);
+        validateSystemProperty(Constants.EXECUTABLE_FILE_PATH);
+        validateSystemProperty(Constants.TEMPLATES_PATH);
+        validateSystemProperty(Constants.TEMPLATES_NAME);
+        validateSystemProperty(Constants.SCRIPTS_PATH);
+        validateSystemProperty(Constants.CONF_FILE_PATH);
+        validateSystemProperty(Constants.STATS_SOCKET_FILE_PATH);
+        validateSystemProperty(Constants.CEP_STATS_PUBLISHER_ENABLED);
+        validateSystemProperty(Constants.CLUSTER_ID);
+
+        if (cepStatsPublisherEnabled) {
+            validateSystemProperty(Constants.THRIFT_RECEIVER_IP);
+            validateSystemProperty(Constants.THRIFT_RECEIVER_PORT);
+            validateSystemProperty(Constants.NETWORK_PARTITION_ID);
+        }
+    }
+
+    private void validateSystemProperty(String propertyName) {
+        String value = System.getProperty(propertyName);
+        if (StringUtils.isEmpty(value)) {
+            throw new RuntimeException("System property was not found: " + propertyName);
+        }
+    }
+
+    public String getHAProxyPrivateIp() {
+        return haProxyPrivateIp;
+    }
+
+    public String getExecutableFilePath() {
+        return executableFilePath;
+    }
+
+    public String getTemplatePath() {
+        return templatePath;
+    }
+
+    public String getTemplateName() {
+        return templateName;
+    }
+
+    public String getScriptsPath() {
+        return scriptsPath;
+    }
+
+    public String getConfFilePath() {
+        return confFilePath;
+    }
+
+    public String getStatsSocketFilePath() {
+        return statsSocketFilePath;
+    }
+
+    public boolean isCEPStatsPublisherEnabled() {
+        return cepStatsPublisherEnabled;
+    }
+
+    public String getNetworkPartitionId() {
+        return networkPartitionId;
+    }
+
+    public String getClusterId() {
+        return clusterId;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java
new file mode 100644
index 0000000..7dec489
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/HAProxyStatisticsReader.java
@@ -0,0 +1,108 @@
+/*
+ * 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.haproxy.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.constants.StratosConstants;
+import org.apache.stratos.common.util.CommandUtils;
+import org.apache.stratos.load.balancer.common.domain.Cluster;
+import org.apache.stratos.load.balancer.common.domain.Member;
+import org.apache.stratos.load.balancer.common.domain.Port;
+import org.apache.stratos.load.balancer.common.domain.Service;
+import org.apache.stratos.load.balancer.common.statistics.LoadBalancerStatisticsReader;
+import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
+
+import java.io.IOException;
+
+/**
+ * HAProxy statistics reader.
+ */
+public class HAProxyStatisticsReader implements LoadBalancerStatisticsReader {
+
+    private static final Log log = LogFactory.getLog(HAProxyStatisticsReader.class);
+
+    private String scriptsPath;
+    private String statsSocketFilePath;
+    private TopologyProvider topologyProvider;
+    private String clusterInstanceId;
+
+    public HAProxyStatisticsReader(TopologyProvider topologyProvider) {
+        this.scriptsPath = HAProxyContext.getInstance().getScriptsPath();
+        this.statsSocketFilePath = HAProxyContext.getInstance().getStatsSocketFilePath();
+        this.topologyProvider = topologyProvider;
+        this.clusterInstanceId = System.getProperty(StratosConstants.CLUSTER_INSTANCE_ID, StratosConstants.NOT_DEFINED);
+    }
+
+    @Override
+    public String getClusterInstanceId() {
+        return clusterInstanceId;
+    }
+
+    @Override
+    public int getInFlightRequestCount(String clusterId) {
+        String frontendId, backendId, command, output;
+        String[] array;
+        int totalWeight, weight;
+
+        for (Service service : topologyProvider.getTopology().getServices()) {
+            for (Cluster cluster : service.getClusters()) {
+                if (cluster.getClusterId().equals(clusterId)) {
+                    totalWeight = 0;
+                    if ((service.getPorts() == null) || (service.getPorts().size() == 0)) {
+                        throw new RuntimeException(String.format("No ports found in service: %s", service.getServiceName()));
+                    }
+
+                    for (Port port : service.getPorts()) {
+                        for(String hostname : cluster.getHostNames()) {
+                            backendId = hostname+"-http-members";
+                            for (Member member : cluster.getMembers()) {
+                                // echo "get weight <backend>/<server>" | socat stdio <stats-socket>
+                                command = String.format("%s/get-weight.sh %s %s %s", scriptsPath, backendId, member.getMemberId(), statsSocketFilePath);
+                                try {
+                                    output = CommandUtils.executeCommand(command);
+                                    if ((output != null) && (output.length() > 0)) {
+                                        array = output.split(" ");
+                                        if ((array != null) && (array.length > 0)) {
+                                            weight = Integer.parseInt(array[0]);
+                                            if (log.isDebugEnabled()) {
+                                                log.debug(String.format("Member weight found: [cluster] %s [member] %s [weight] %d", member.getClusterId(), member.getMemberId(), weight));
+                                            }
+                                            totalWeight += weight;
+                                        }
+                                    }
+                                } catch (IOException e) {
+                                    if (log.isErrorEnabled()) {
+                                        log.error(e);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    if (log.isInfoEnabled()) {
+                        log.info(String.format("Cluster weight found: [cluster] %s [weight] %d", cluster.getClusterId(), totalWeight));
+                    }
+                    return totalWeight;
+                }
+            }
+        }
+        return 0;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java
new file mode 100644
index 0000000..f56541d
--- /dev/null
+++ b/extensions/load-balancer/modules/haproxy-extension/src/main/java/org/apache/stratos/haproxy/extension/Main.java
@@ -0,0 +1,85 @@
+/*
+ * 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.haproxy.extension;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.load.balancer.common.topology.TopologyProvider;
+import org.apache.stratos.load.balancer.extension.api.LoadBalancerExtension;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * HAProxy extension main class.
+ */
+public class Main {
+	private static final Log log = LogFactory.getLog(Main.class);
+	private static ExecutorService executorService;
+
+	public static void main(String[] args) {
+
+		LoadBalancerExtension extension = null;
+		try {
+			// Configure log4j properties
+			PropertyConfigurator.configure(System.getProperty("log4j.properties.file.path"));
+
+			if (log.isInfoEnabled()) {
+				log.info("HAProxy extension started");
+			}
+
+            // Add shutdown hook
+            final Thread mainThread = Thread.currentThread();
+            final LoadBalancerExtension finalExtension = extension;
+            Runtime.getRuntime().addShutdownHook(new Thread() {
+                public void run() {
+                    try {
+                        if(finalExtension != null) {
+                            log.info("Shutting haproxy instance...");
+                            finalExtension.stop();
+                        }
+                        mainThread.join();
+                    } catch (Exception e) {
+                        log.error(e);
+                    }
+                }
+            });
+
+			executorService = StratosThreadPool.getExecutorService("haproxy.extension.thread.pool", 10);
+			// Validate runtime parameters
+			HAProxyContext.getInstance().validate();
+            TopologyProvider topologyProvider = new TopologyProvider();
+            HAProxyStatisticsReader statisticsReader = HAProxyContext.getInstance().isCEPStatsPublisherEnabled() ?
+                    new HAProxyStatisticsReader(topologyProvider) : null;
+            extension = new LoadBalancerExtension(new HAProxy(), statisticsReader, topologyProvider);
+			extension.setExecutorService(executorService);
+			extension.execute();
+		} catch (Exception e) {
+			if (log.isErrorEnabled()) {
+				log.error(e);
+			}
+			if (extension != null) {
+                log.info("Shutting haproxy instance...");
+				extension.stop();
+			}
+		}
+	}
+}


[24/50] [abbrv] stratos git commit: Fix for agent health stat publisher and introducing integration test to verify PCA stat publisher

Posted by ra...@apache.org.
Fix for agent health stat publisher and introducing integration test to verify PCA stat publisher


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/8bd92e89
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/8bd92e89
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/8bd92e89

Branch: refs/heads/master
Commit: 8bd92e89a678a2dad14665e5b4ce4b9e769b834b
Parents: 31cbfd5
Author: Akila Perera <ra...@gmail.com>
Authored: Fri Aug 28 23:50:59 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Fri Aug 28 23:51:15 2015 +0530

----------------------------------------------------------------------
 .../python/cartridge.agent/cartridge.agent/healthstats.py |  3 +--
 .../cartridge.agent/modules/databridge/agent.py           | 10 ++++------
 .../modules/databridge/thrift/publisher.py                |  1 -
 products/python-cartridge-agent/integration/pom.xml       |  9 +++++++--
 .../stratos/python.cartridge.agent/test/ADCMTAppTest.java |  4 ++--
 .../stratos/python.cartridge.agent/test/ADCTest.java      |  3 +--
 .../python.cartridge.agent/test/AgentStartupTest.java     |  9 +++++++--
 .../test/PythonAgentTestManager.java                      | 10 ++++++++--
 8 files changed, 30 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
index dddee70..f661294 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
@@ -66,7 +66,7 @@ class HealthStatisticsPublisherManager(Thread):
                 self.log.debug("Publishing load average: %r" % cartridge_stats.load_avg)
                 self.publisher.publish_load_average(cartridge_stats.load_avg)
             except ThriftReceiverOfflineException:
-                self.log.error("Couldn't publish health statistics to CEP. Thrift Receiver offline. Reconnecting...")
+                self.log.exception("Couldn't publish health statistics to CEP. Thrift Receiver offline. Reconnecting...")
                 self.publisher = HealthStatisticsPublisher()
 
         self.publisher.publisher.disconnect()
@@ -124,7 +124,6 @@ class HealthStatisticsPublisher:
             cep_admin_username,
             cep_admin_password,
             self.stream_definition)
-        self.publisher.start()
 
         HealthStatisticsPublisher.log.debug("HealthStatisticsPublisher initialized")
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
index 533cf20..d94688f 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
@@ -115,7 +115,7 @@ class ThriftEvent:
         """:type : list[T]"""
 
 
-class ThriftPublisher(Thread):
+class ThriftPublisher():
     """
     Handles publishing events to BAM/CEP through thrift using the provided address and credentials
     """
@@ -136,14 +136,15 @@ class ThriftPublisher(Thread):
         :return: ThriftPublisher object
         :rtype: ThriftPublisher
         """
-        Thread.__init__(self)
         try:
             port_number = int(port)
         except ValueError:
             raise RuntimeError("Port number for Thrift Publisher is invalid: %r" % port)
 
         self.__publisher = Publisher(ip, port_number, stream_definition)
-        #self.__publisher.defineStream(str(stream_definition))
+        self.__publisher.connect(username, password)
+        self.__publisher.defineStream(str(stream_definition))
+        ThriftPublisher.log.debug("ThriftPublisher initializing with stream definition: " + str(stream_definition))
         self.stream_definition = stream_definition
         self.stream_id = self.__publisher.streamId
         self.ip = ip
@@ -151,9 +152,6 @@ class ThriftPublisher(Thread):
         self.username = username
         self.password = password
 
-    def run(self):
-        self.__publisher.connect(self.username, self.password)
-
     def publish(self, event):
         """
         Publishes the given event by creating the event bundle from the log event

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
index e607d1b..de96ced 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
@@ -50,7 +50,6 @@ class Publisher:
         self.socket.open()
         self.transport.open()
         self.sessionId = Publisher.client.connect(username, password)
-        self.streamId = Publisher.client.defineStream(self.sessionId, self.streamDef)
 
     def defineStream(self, streamDef):
         # Create Stream Definition

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
index 52cc286..707a4ae 100755
--- a/products/python-cartridge-agent/integration/pom.xml
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -78,7 +78,7 @@
                             </excludes>
                         </configuration>
                         <executions>
-                            <!--execution>
+                            <execution>
                                 <id>default-test</id>
                                 <goals>
                                     <goal>test</goal>
@@ -103,7 +103,7 @@
                                     </suiteXmlFiles>
                                     <workingDirectory>${basedir}/target</workingDirectory>
                                 </configuration>
-                            </execution-->
+                            </execution>
                             <execution>
                                 <id>adc-mt-test</id>
                                 <goals>
@@ -196,5 +196,10 @@
             <artifactId>org.apache.stratos.messaging</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>0.9.2</version>
+        </dependency>
     </dependencies>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
index 3104281..2a4c8b5 100644
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTest.java
@@ -51,7 +51,7 @@ public class ADCMTAppTest extends PythonAgentTestManager {
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "tomcat-mt";
 
-    private static boolean hasADCTestCompleted = false;
+    private boolean hasADCTestCompleted = false;
 
     @BeforeSuite
     public void setupADCMTAppTest() {
@@ -95,7 +95,7 @@ public class ADCMTAppTest extends PythonAgentTestManager {
                             if (line.contains("Git clone executed")) {
                                 log.info("Agent has completed git clone. Asserting the operation...");
                                 assertRepoClone(getArtifactUpdatedEventForPublicRepo());
-                                //hasADCTestCompleted = true;
+                                hasADCTestCompleted = true;
                             }
                         }
                     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
index 99dc217..de5be67 100755
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -53,7 +53,7 @@ public class ADCTest extends PythonAgentTestManager {
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "tomcat";
 
-    private static boolean hasADCTestCompleted = false;
+    private boolean hasADCTestCompleted = false;
 
     @BeforeSuite
     public void setupADCTest() {
@@ -107,7 +107,6 @@ public class ADCTest extends PythonAgentTestManager {
                                 }
                             }
                             if (line.contains("Pushed artifacts for tenant")) {
-                                // TODO: Get rid of static var
                                 log.info("ADC Test completed");
                                 hasADCTestCompleted = true;
                             }

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
index 83fc227..c08ab5c 100755
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/AgentStartupTest.java
@@ -35,7 +35,7 @@ import java.util.Properties;
 
 public class AgentStartupTest extends PythonAgentTestManager {
     private static final Log log = LogFactory.getLog(AgentStartupTest.class);
-    private static final int STARTUP_TIMEOUT = 30000;
+    private static final int STARTUP_TIMEOUT = 60000;
     private static final String RESOURCES_PATH = "/suite-1";
     private static final String CLUSTER_ID = "php.php.domain";
     private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
@@ -47,6 +47,7 @@ public class AgentStartupTest extends PythonAgentTestManager {
     private static final String PARTITION_ID = "partition-1";
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "php";
+    private boolean startupTestCompleted = false;
 
     @BeforeSuite
     public void setupAgentStartupTest() {
@@ -101,6 +102,10 @@ public class AgentStartupTest extends PythonAgentTestManager {
                                 publishEvent(memberInitializedEvent);
                                 log.info("Member initialized event published");
                             }
+                            // TODO: properly mock the CEP server
+                            if (line.contains("Published event to thrift stream")) {
+                                startupTestCompleted = true;
+                            }
                         }
                     }
                     sleep(1000);
@@ -110,7 +115,7 @@ public class AgentStartupTest extends PythonAgentTestManager {
 
         startupTestThread.start();
 
-        while (!instanceStarted || !instanceActivated) {
+        while (!instanceStarted || !instanceActivated || !startupTestCompleted) {
             // wait until the instance activated event is received.
             // this will assert whether instance got activated within timeout period; no need for explicit assertions
             sleep(2000);

http://git-wip-us.apache.org/repos/asf/stratos/blob/8bd92e89/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
index 6ed4bb3..5ba6c6a 100644
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonAgentTestManager.java
@@ -110,8 +110,9 @@ public class PythonAgentTestManager {
 
             this.eventReceiverInitiated = true;
         }
-        // Simulate CEP server socket
-        startServerSocket(cepPort);
+        // Simulate CEP Thrift server
+        //startServerSocket(cepPort);
+        // TODO: create a mock thrift server; sockets will not work with health stats publisher
         String agentPath = setupPythonAgent(resourcePath);
         log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
         log.info("Starting python cartridge agent...");
@@ -120,6 +121,7 @@ public class PythonAgentTestManager {
                 "/cartridge-agent-console.log");
     }
 
+
     protected void tearDown() {
         tearDown(null);
     }
@@ -266,6 +268,10 @@ public class PythonAgentTestManager {
     }
 
 
+    protected static String getResourcesPath() {
+        return PythonAgentTestManager.class.getResource("/").getPath() + "/../../src/test/resources";
+    }
+
     protected static String getResourcesPath(String resourcesPath) {
         return PythonAgentTestManager.class.getResource("/").getPath() + "/../../src/test/resources" + resourcesPath;
     }


[08/50] [abbrv] stratos git commit: Merge branch 'stratos-4.1.x' of https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x

Posted by ra...@apache.org.
Merge branch 'stratos-4.1.x' of https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7520d694
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7520d694
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7520d694

Branch: refs/heads/master
Commit: 7520d6943198e287917b5a12aad75bd7de14c920
Parents: 99d5cdc 19ca4d7
Author: gayangunarathne <ga...@wso2.com>
Authored: Wed Aug 26 15:54:41 2015 +0530
Committer: gayangunarathne <ga...@wso2.com>
Committed: Wed Aug 26 15:54:41 2015 +0530

----------------------------------------------------------------------
 README.md                                       |   2 +-
 .../applications/topic/ApplicationBuilder.java  |   1 -
 .../services/impl/AutoscalerServiceImpl.java    | 150 ++++++++++++-------
 .../org.apache.stratos.cartridge.agent/pom.xml  |   2 -
 .../agent/test/JavaCartridgeAgentTest.java      |  23 ++-
 .../test/resources/test-conf/test.properties    |  20 +++
 .../console/README.md                           |  10 +-
 .../modules/event/eventhandler.py               |   2 +-
 .../rest/endpoint/api/StratosApiV41.java        |   2 +-
 pom.xml                                         |   3 +
 .../modules/distribution/pom.xml                |   5 +-
 .../distribution/src/main/assembly/bin.xml      |   1 -
 .../python-cartridge-agent/distribution/pom.xml |   3 +-
 .../distribution/src/main/assembly/bin.xml      |   6 +-
 tools/config-scripts/ec2/config.sh              |   5 -
 tools/config-scripts/gce/config.sh              |   4 -
 tools/config-scripts/openstack/config.sh        |   5 -
 tools/puppet3/modules/agent/files/README.txt    |   2 +-
 tools/puppet3/modules/haproxy/files/README.txt  |   2 +-
 tools/puppet3/modules/lb/files/README.txt       |   2 +-
 .../modules/python_agent/files/README.txt       |   2 +-
 tools/stratos-installer/README.md               |   3 +-
 22 files changed, 157 insertions(+), 98 deletions(-)
----------------------------------------------------------------------



[09/50] [abbrv] stratos git commit: Fixing intermittent issue in group termination behavior integration test: adding assertions for member termination

Posted by ra...@apache.org.
Fixing intermittent issue in group termination behavior integration test: adding assertions for member termination


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d72139dc
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d72139dc
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d72139dc

Branch: refs/heads/master
Commit: d72139dcd303ffbb8de4793444d516410c1dac6d
Parents: 7520d69
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 18:15:08 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 18:15:25 2015 +0530

----------------------------------------------------------------------
 .../mock/iaas/client/MockIaasApiClient.java     |   4 +-
 .../integration/tests/TopologyHandler.java      | 130 +++++++++++++------
 .../GroupTerminationBehaviorTest.java           |  73 +++++++----
 .../tests/rest/IntegrationMockClient.java       |   7 +-
 .../src/test/resources/stratos-testing.xml      |  32 ++---
 5 files changed, 156 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d72139dc/components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java b/components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java
index b76bc14..47bbd17 100644
--- a/components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java
+++ b/components/org.apache.stratos.mock.iaas.client/src/main/java/org/apache/stratos/mock/iaas/client/MockIaasApiClient.java
@@ -75,7 +75,7 @@ public class MockIaasApiClient {
         }
     }
 
-    public void terminateInstance(String instanceId) {
+    public boolean terminateInstance(String instanceId) {
         try {
             if (log.isDebugEnabled()) {
                 log.debug(String.format("Terminate instance: [instance-id] %s", instanceId));
@@ -84,7 +84,7 @@ public class MockIaasApiClient {
             HttpResponse response = restClient.doDelete(uri);
             if (response != null) {
                 if ((response.getStatusCode() >= 200) && (response.getStatusCode() < 300)) {
-                    return;
+                    return false;
                 } else {
                     GsonBuilder gsonBuilder = new GsonBuilder();
                     Gson gson = gsonBuilder.create();

http://git-wip-us.apache.org/repos/asf/stratos/blob/d72139dc/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
index 9c9764b..85f7817 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
@@ -45,6 +45,7 @@ import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
 import java.io.File;
 import java.rmi.RemoteException;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
@@ -60,6 +61,7 @@ public class TopologyHandler {
 
     public static final int APPLICATION_ACTIVATION_TIMEOUT = 360000;
     public static final int APPLICATION_UNDEPLOYMENT_TIMEOUT = 120000;
+    public static final int MEMBER_TERMINATION_TIMEOUT = 120000;
     public static final int APPLICATION_TOPOLOGY_TIMEOUT = 90000;
     public static final String APPLICATION_STATUS_CREATED = "Created";
     public static final String APPLICATION_STATUS_UNDEPLOYING = "Undeploying";
@@ -129,14 +131,16 @@ public class TopologyHandler {
         while (!applicationTopologyInitialized) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             applicationTopologyInitialized = ApplicationManager.getApplications().isInitialized();
             if ((System.currentTimeMillis() - startTime) > APPLICATION_TOPOLOGY_TIMEOUT) {
                 break;
             }
         }
-        assertEquals(String.format("Application Topology didn't get initialized "), applicationTopologyInitialized, true);
+        assertEquals(String.format("Application Topology didn't get initialized "), applicationTopologyInitialized,
+                true);
     }
 
     /**
@@ -148,7 +152,8 @@ public class TopologyHandler {
         while (!topologyInitialized) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             topologyInitialized = TopologyManager.getTopology().isInitialized();
             if ((System.currentTimeMillis() - startTime) > APPLICATION_TOPOLOGY_TIMEOUT) {
@@ -169,7 +174,8 @@ public class TopologyHandler {
         while (!((application != null) && (application.getStatus() == status))) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             application = ApplicationManager.getApplications().getApplication(applicationName);
             if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) {
@@ -243,20 +249,20 @@ public class TopologyHandler {
     }
 
     /**
-     * Assert application activation
+     * Get all the members that belongs to the cluster identified by cartridge name and application name in the
+     * topology
      *
+     * @param cartridgeName
      * @param applicationName
      */
-    public void terminateMemberFromCluster(String cartridgeName, String applicationName,
-                                           IntegrationMockClient mockIaasApiClient) {
+    public Map<String, Member> getMembersForCluster(String cartridgeName, String applicationName) {
         Application application = ApplicationManager.getApplications().getApplication(applicationName);
-        assertNotNull(String.format("Application is not found: [application-id] %s",
-                applicationName), application);
-
+        assertNotNull(String.format("Application is not found: [application-id] %s", applicationName), application);
         Set<ClusterDataHolder> clusterDataHolderSet = application.getClusterDataRecursively();
+        Map<String, Member> memberMap = new HashMap<String, Member>();
         for (ClusterDataHolder clusterDataHolder : clusterDataHolderSet) {
             String serviceName = clusterDataHolder.getServiceType();
-            if(cartridgeName.equals(serviceName)) {
+            if (cartridgeName.equals(serviceName)) {
                 String clusterId = clusterDataHolder.getClusterId();
                 Service service = TopologyManager.getTopology().getService(serviceName);
                 assertNotNull(String.format("Service is not found: [application-id] %s [service] %s",
@@ -265,29 +271,56 @@ public class TopologyHandler {
                 Cluster cluster = service.getCluster(clusterId);
                 assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
                         applicationName, serviceName, clusterId), cluster);
-                boolean memberTerminated = false;
-
                 for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
                     for (Member member : cluster.getMembers()) {
-                        if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
-                            if (member.getStatus().equals(MemberStatus.Active)) {
-                                mockIaasApiClient.terminateInstance(member.getMemberId());
-                                memberTerminated = true;
-                                break;
-                            }
-                        }
+                        memberMap.put(member.getMemberId(), member);
                     }
+                }
+            }
+        }
+        return memberMap;
+    }
 
-                    if(memberTerminated) {
-                        break;
-                    }
+    /**
+     * Terminate a member in mock iaas directly without involving Stratos REST API
+     * This is similar to manually terminating an instance in an IaaS. This could be used to simulate member failures
+     *
+     * @param memberId
+     * @param mockIaasApiClient
+     */
+    public void terminateMemberInMockIaas(String memberId, IntegrationMockClient mockIaasApiClient) {
+        boolean memberTerminated = false;
+        memberTerminated = mockIaasApiClient.terminateInstance(memberId);
+        assertTrue(String.format("Member [member-id] %s couldn't be terminated from the mock IaaS", memberId),
+                memberTerminated);
+    }
 
+    public void assertMemberTermination(String memberId) {
+        long startTime = System.currentTimeMillis();
+        assertNotNull(String.format("Member id is not found: [member-id] %s", memberId));
+        boolean hasMemberRemoved = false;
+        while (!hasMemberRemoved) {
+            // Wait until the member gets removed by MemberTerminatedEvent topology receiver
+            if (getTerminatingMembers().get(memberId) == null &&
+                    getInActiveMembers().get(memberId) == null &&
+                    getActivateddMembers().get(memberId) == null &&
+                    getCreatedMembers().get(memberId) == null) {
+                getTerminatedMembers().remove(memberId);
+                hasMemberRemoved = true;
+            } else {
+                if (getTerminatedMembers().get(memberId) - startTime > MEMBER_TERMINATION_TIMEOUT) {
+                    break;
                 }
-                assertTrue("Any member couldn't be terminated from the mock IaaS client", memberTerminated);
             }
-
+            try {
+                Thread.sleep(1000);
+            }
+            catch (InterruptedException e) {
+                log.error("Could not sleep", e);
+            }
         }
-
+        assertTrue(String.format("Member [member-id] %s did not get removed from the topology", memberId),
+                hasMemberRemoved);
     }
 
     public void assertClusterMinMemberCount(String applicationName, int minMembers) {
@@ -324,7 +357,8 @@ public class TopologyHandler {
                 while (!clusterActive) {
                     try {
                         Thread.sleep(1000);
-                    } catch (InterruptedException ignore) {
+                    }
+                    catch (InterruptedException ignore) {
                     }
                     service = TopologyManager.getTopology().getService(serviceName);
                     assertNotNull(String.format("Service is not found: [application-id] %s [service] %s",
@@ -340,8 +374,9 @@ public class TopologyHandler {
                         }
                     }
                     clusterActive = activeInstances >= minMembers;
-                    assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
-                            applicationName, serviceName, clusterId), cluster);
+                    assertNotNull(
+                            String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
+                                    applicationName, serviceName, clusterId), cluster);
 
                     if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) {
                         break;
@@ -366,19 +401,22 @@ public class TopologyHandler {
         ApplicationContext applicationContext = null;
         try {
             applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationName);
-        } catch (RemoteException e) {
+        }
+        catch (RemoteException e) {
             log.error("Error while getting the application context for [application] " + applicationName);
         }
         while (((application != null) && application.getInstanceContextCount() > 0) ||
                 (applicationContext == null || applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING))) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             application = ApplicationManager.getApplications().getApplication(applicationName);
             try {
                 applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationName);
-            } catch (RemoteException e) {
+            }
+            catch (RemoteException e) {
                 log.error("Error while getting the application context for [application] " + applicationName);
             }
             if ((System.currentTimeMillis() - startTime) > APPLICATION_UNDEPLOYMENT_TIMEOUT) {
@@ -396,7 +434,8 @@ public class TopologyHandler {
                 applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING)) {
             return false;
         }
-        assertEquals(String.format("Application status did not change to Created: [application-id] %s", applicationName),
+        assertEquals(
+                String.format("Application status did not change to Created: [application-id] %s", applicationName),
                 APPLICATION_STATUS_CREATED, applicationContext.getStatus());
         return true;
     }
@@ -414,7 +453,8 @@ public class TopologyHandler {
             while (group.getInstanceContextCount() != count) {
                 try {
                     Thread.sleep(1000);
-                } catch (InterruptedException ignore) {
+                }
+                catch (InterruptedException ignore) {
                 }
                 if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) {
                     break;
@@ -424,14 +464,16 @@ public class TopologyHandler {
                 while (!instance.getStatus().equals(GroupStatus.Active)) {
                     try {
                         Thread.sleep(1000);
-                    } catch (InterruptedException ignore) {
+                    }
+                    catch (InterruptedException ignore) {
                     }
                     if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) {
                         break;
                     }
                 }
             }
-            assertEquals(String.format("Application status did not change to active: [application-id] %s", applicationName),
+            assertEquals(
+                    String.format("Application status did not change to active: [application-id] %s", applicationName),
                     group.getInstanceContextCount(), count);
         }
         assertNotNull(String.format("Application is not found: [application-id] %s", applicationName), application);
@@ -440,7 +482,8 @@ public class TopologyHandler {
 
     public void assertApplicationNotExists(String applicationName) {
         Application application = ApplicationManager.getApplications().getApplication(applicationName);
-        assertNull(String.format("Application is found in the topology : [application-id] %s", applicationName), application);
+        assertNull(String.format("Application is found in the topology : [application-id] %s", applicationName),
+                application);
     }
 
     /**
@@ -459,7 +502,10 @@ public class TopologyHandler {
             protected void onEvent(Event event) {
                 MemberTerminatedEvent memberTerminatedEvent = (MemberTerminatedEvent) event;
                 getTerminatedMembers().put(memberTerminatedEvent.getMemberId(), System.currentTimeMillis());
-
+                getActivateddMembers().remove(((MemberTerminatedEvent) event).getMemberId());
+                getCreatedMembers().remove(((MemberTerminatedEvent) event).getMemberId());
+                getInActiveMembers().remove(((MemberTerminatedEvent) event).getMemberId());
+                getTerminatingMembers().remove(((MemberTerminatedEvent) event).getMemberId());
             }
         });
 
@@ -593,14 +639,14 @@ public class TopologyHandler {
 
 
     public void removeMembersFromMaps(String applicationId) {
-        for(Map.Entry<String, Long> entry: getActivateddMembers().entrySet()) {
-            if(entry.getKey().contains(applicationId)) {
+        for (Map.Entry<String, Long> entry : getActivateddMembers().entrySet()) {
+            if (entry.getKey().contains(applicationId)) {
                 getActivateddMembers().remove(entry.getKey());
             }
         }
 
-        for(Map.Entry<String, Long> entry: getTerminatedMembers().entrySet()) {
-            if(entry.getKey().contains(applicationId)) {
+        for (Map.Entry<String, Long> entry : getTerminatedMembers().entrySet()) {
+            if (entry.getKey().contains(applicationId)) {
                 getTerminatedMembers().remove(entry.getKey());
             }
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/d72139dc/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
index 3cc4ebd..6ea7150 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
@@ -27,6 +27,7 @@ import org.apache.stratos.integration.tests.RestConstants;
 import org.apache.stratos.integration.tests.StratosTestServerManager;
 import org.apache.stratos.integration.tests.TopologyHandler;
 import org.apache.stratos.messaging.domain.application.ApplicationStatus;
+import org.apache.stratos.messaging.domain.topology.Member;
 import org.testng.annotations.Test;
 
 import java.util.ArrayList;
@@ -46,7 +47,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
     @Test
     public void testTerminationBehavior() {
         try {
-            log.info("-------------------------------Started application termination behavior test case-------------------------------");
+            log.info(
+                    "-------------------------------Started application termination behavior test case-------------------------------");
 
             String autoscalingPolicyId = "autoscaling-policy-group-termination-behavior-test";
             TopologyHandler topologyHandler = TopologyHandler.getInstance();
@@ -56,24 +58,29 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
                     RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME);
             assertTrue(addedScalingPolicy);
 
-            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c1-group-termination-behavior-test.json",
+            boolean addedC1 = restClient.addEntity(
+                    RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c1-group-termination-behavior-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertTrue(addedC1);
 
-            boolean addedC2 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c2-group-termination-behavior-test.json",
+            boolean addedC2 = restClient.addEntity(
+                    RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c2-group-termination-behavior-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertTrue(addedC2);
 
-            boolean addedC3 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c3-group-termination-behavior-test.json",
+            boolean addedC3 = restClient.addEntity(
+                    RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c3-group-termination-behavior-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertTrue(addedC3);
 
-            boolean addedC4 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c4-group-termination-behavior-test.json",
+            boolean addedC4 = restClient.addEntity(
+                    RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c4-group-termination-behavior-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertTrue(addedC4);
 
             boolean addedG1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH +
-                            "/" + "cartridge-groups-group-termination-behavior-test.json", RestConstants.CARTRIDGE_GROUPS,
+                            "/" + "cartridge-groups-group-termination-behavior-test.json",
+                    RestConstants.CARTRIDGE_GROUPS,
                     RestConstants.CARTRIDGE_GROUPS_NAME);
             assertTrue(addedG1);
 
@@ -102,7 +109,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
             assertEquals(bean.getApplicationId(), "group-termination-behavior-test");
 
             boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" +
-                            "application-policy-group-termination-behavior-test.json", RestConstants.APPLICATION_POLICIES,
+                            "application-policy-group-termination-behavior-test.json",
+                    RestConstants.APPLICATION_POLICIES,
                     RestConstants.APPLICATION_POLICIES_NAME);
             assertTrue(addAppPolicy);
 
@@ -147,11 +155,15 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
             //Cluster active handling
             topologyHandler.assertClusterActivation(bean.getApplicationId());
 
-            //Terminate one member in the cluster
-            TopologyHandler.getInstance().terminateMemberFromCluster(
-                    "c3-group-termination-behavior-test",
-                    bean.getApplicationId(),
-                    mockIaasApiClient);
+            Map<String, Member> memberMap = TopologyHandler.getInstance().getMembersForCluster
+                    ("c3-group-termination-behavior-test", bean.getApplicationId());
+
+            //Terminate members in the cluster
+            for (Map.Entry<String, Member> entry : memberMap.entrySet()) {
+                String memberId = entry.getValue().getMemberId();
+                TopologyHandler.getInstance().terminateMemberInMockIaas(memberId, mockIaasApiClient);
+                TopologyHandler.getInstance().assertMemberTermination(memberId);
+            }
 
             List<String> clusterIds = new ArrayList<String>();
             clusterIds.add(clusterIdC3);
@@ -208,7 +220,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
             boolean undeploy = topologyHandler.assertApplicationUndeploy("group-termination-behavior-test");
             if (!undeploy) {
                 //Need to forcefully undeploy the application
-                log.info("Force undeployment is going to start for the [application] " + "group-termination-behavior-test");
+                log.info("Force undeployment is going to start for the [application] " +
+                        "group-termination-behavior-test");
 
                 restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + "group-termination-behavior-test" +
                         RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS);
@@ -268,9 +281,11 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
                     "network-partition-group-termination-behavior-test-1", RestConstants.NETWORK_PARTITIONS_NAME);
             assertTrue(removedNet);
 
-            log.info("-------------------------------Ended application termination behavior test case-------------------------------");
+            log.info(
+                    "-------------------------------Ended application termination behavior test case-------------------------------");
 
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             log.error("An error occurred while handling  application termination behavior", e);
             assertTrue("An error occurred while handling  application termination behavior", false);
         }
@@ -283,7 +298,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
         while (!inActiveMap.containsKey(clusterId)) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             inActiveMap = TopologyHandler.getInstance().getInActiveMembers();
             if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -295,7 +311,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
         while (!inActiveMap.containsKey(groupId)) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             inActiveMap = TopologyHandler.getInstance().getInActiveMembers();
             if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -313,7 +330,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
             while (!terminatingMembers.containsKey(clusterId)) {
                 try {
                     Thread.sleep(1000);
-                } catch (InterruptedException ignore) {
+                }
+                catch (InterruptedException ignore) {
                 }
                 terminatingMembers = TopologyHandler.getInstance().getTerminatingMembers();
                 if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -326,7 +344,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
         while (!terminatingMembers.containsKey(groupId)) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             terminatingMembers = TopologyHandler.getInstance().getTerminatingMembers();
             if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -345,7 +364,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
             while (!terminatedMembers.containsKey(clusterId)) {
                 try {
                     Thread.sleep(1000);
-                } catch (InterruptedException ignore) {
+                }
+                catch (InterruptedException ignore) {
                 }
                 terminatedMembers = TopologyHandler.getInstance().getTerminatedMembers();
                 if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -358,7 +378,8 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
         while (!terminatedMembers.containsKey(groupId)) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException ignore) {
+            }
+            catch (InterruptedException ignore) {
             }
             terminatedMembers = TopologyHandler.getInstance().getTerminatedMembers();
             if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -375,10 +396,11 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
         Map<String, Long> activeMembers = TopologyHandler.getInstance().getActivateddMembers();
         Map<String, Long> createdMembers = TopologyHandler.getInstance().getCreatedMembers();
         //Active member should be available at the time cluster is started to create.
-        while(!activeMembers.containsKey(firstNodeId)) {
+        while (!activeMembers.containsKey(firstNodeId)) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException e) {
+            }
+            catch (InterruptedException e) {
             }
             activeMembers = TopologyHandler.getInstance().getActivateddMembers();
             if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {
@@ -387,10 +409,11 @@ public class GroupTerminationBehaviorTest extends StratosTestServerManager {
         }
         assertTrue(activeMembers.containsKey(firstNodeId));
 
-        while(!createdMembers.containsKey(secondNodeId)) {
+        while (!createdMembers.containsKey(secondNodeId)) {
             try {
                 Thread.sleep(1000);
-            } catch (InterruptedException e) {
+            }
+            catch (InterruptedException e) {
             }
             createdMembers = TopologyHandler.getInstance().getCreatedMembers();
             if ((System.currentTimeMillis() - startTime) > GROUP_INACTIVE_TIMEOUT) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/d72139dc/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/IntegrationMockClient.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/IntegrationMockClient.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/IntegrationMockClient.java
index dbe21cb..0378509 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/IntegrationMockClient.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/IntegrationMockClient.java
@@ -28,11 +28,8 @@ import org.apache.http.client.utils.URIBuilder;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.impl.conn.PoolingClientConnectionManager;
 import org.apache.stratos.mock.iaas.client.MockIaasApiClient;
-import org.apache.stratos.mock.iaas.client.rest.*;
 import org.apache.stratos.mock.iaas.client.rest.HttpResponse;
 import org.apache.stratos.mock.iaas.client.rest.HttpResponseHandler;
-import org.apache.stratos.mock.iaas.client.rest.RestClient;
-import org.apache.stratos.mock.iaas.domain.*;
 
 import java.net.URI;
 
@@ -58,7 +55,7 @@ public class IntegrationMockClient extends MockIaasApiClient {
         httpClient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpClient);
     }
 
-    public void terminateInstance(String instanceId) {
+    public boolean terminateInstance(String instanceId) {
         try {
             if (log.isDebugEnabled()) {
                 log.debug(String.format("Terminate instance: [instance-id] %s", instanceId));
@@ -67,7 +64,7 @@ public class IntegrationMockClient extends MockIaasApiClient {
             org.apache.stratos.mock.iaas.client.rest.HttpResponse response = doDelete(uri);
             if (response != null) {
                 if ((response.getStatusCode() >= 200) && (response.getStatusCode() < 300)) {
-                    return;
+                    return true;
                 } else {
                     GsonBuilder gsonBuilder = new GsonBuilder();
                     Gson gson = gsonBuilder.create();

http://git-wip-us.apache.org/repos/asf/stratos/blob/d72139dc/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
index e8a48d2..2e0d2a8 100644
--- a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
+++ b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
@@ -23,72 +23,72 @@
 <suite name="StratosIntegrationSuite">
     <test name="UserTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.users.UserTest" />
+            <class name="org.apache.stratos.integration.tests.users.UserTest"/>
         </classes>
     </test>
     <test name="CartridgeTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
+            <class name="org.apache.stratos.integration.tests.group.CartridgeTest"/>
         </classes>
     </test>
-    <test name="CartridgeGroupTest" >
+    <test name="CartridgeGroupTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest" />
+            <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest"/>
         </classes>
     </test>
     <test name="NetworkPartitionTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest" />
+            <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest"/>
         </classes>
     </test>
     <test name="ApplicationPolicyTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest" />
+            <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest"/>
         </classes>
     </test>
     <test name="DeploymentPolicyTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest" />
+            <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest"/>
         </classes>
     </test>
     <test name="AutoscalingPolicyTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
+            <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest"/>
         </classes>
     </test>
     <test name="SampleApplicationsTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
+            <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest"/>
         </classes>
     </test>
     <test name="ApplicationUpdateTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest" />
+            <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest"/>
         </classes>
     </test>
     <test name="SingleClusterScalingTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
+            <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest"/>
         </classes>
     </test>
     <test name="ApplicationBurstingTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
+            <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest"/>
         </classes>
     </test>
     <test name="PartitionRoundRobinClusterTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
+            <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest"/>
         </classes>
     </test>
     <test name="GroupStartupOrderTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.GroupStartupOrderTest" />
+            <class name="org.apache.stratos.integration.tests.application.GroupStartupOrderTest"/>
         </classes>
     </test>
     <test name="GroupTerminationBehaviorTest">
         <classes>
-            <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest" />
+            <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest"/>
         </classes>
     </test>
-</suite>
+</suite>
\ No newline at end of file


[16/50] [abbrv] stratos git commit: Adding more logs to cluster activation assertion

Posted by ra...@apache.org.
Adding more logs to cluster activation assertion


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2951d403
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2951d403
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2951d403

Branch: refs/heads/master
Commit: 2951d4033410211825d9cf7557845198d203ac96
Parents: bbfa6c5
Author: Akila Perera <ra...@gmail.com>
Authored: Fri Aug 28 09:59:44 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Fri Aug 28 09:59:44 2015 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/integration/tests/TopologyHandler.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/2951d403/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
index f579718..a0aea77 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
@@ -241,6 +241,8 @@ public class TopologyHandler {
                         }
                     }
                 }
+                log.info("Active instance count of " + activeInstances + " found for [cluster-instance] " + instance
+                        .getInstanceId() + " with [min-count] " + clusterDataHolder.getMinInstances());
                 clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
                 assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
                         clusterActive);
@@ -691,4 +693,4 @@ public class TopologyHandler {
     public void setActivateddMembers(Map<String, Long> activateddMembers) {
         this.activateddMembers = activateddMembers;
     }
-}
+}
\ No newline at end of file


[46/50] [abbrv] stratos git commit: Get cep extensions from modules dir

Posted by ra...@apache.org.
Get cep extensions from modules dir


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/9807cfa4
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/9807cfa4
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/9807cfa4

Branch: refs/heads/master
Commit: 9807cfa442e9a76d03912508e95c782e26aa29d3
Parents: 100a70f
Author: Akila Perera <ra...@gmail.com>
Authored: Sun Aug 30 14:24:43 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sun Aug 30 14:24:43 2015 +0530

----------------------------------------------------------------------
 .../stratos/modules/distribution/src/assembly/bin.xml   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/9807cfa4/products/stratos/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/assembly/bin.xml b/products/stratos/modules/distribution/src/assembly/bin.xml
index 8f8b4f3..8349917 100755
--- a/products/stratos/modules/distribution/src/assembly/bin.xml
+++ b/products/stratos/modules/distribution/src/assembly/bin.xml
@@ -435,31 +435,31 @@
         <!-- cep -->
         <!--creating an empty input event adaptors directory-->
         <fileSet>
-            <directory>../../../../extensions/cep/artifacts/inputeventadaptors</directory>
+            <directory>../../../../extensions/modules/cep/artifacts/inputeventadaptors</directory>
             <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/inputeventadaptors
             </outputDirectory>
         </fileSet>
         <!--creating an empty output event adaptors directory-->
         <fileSet>
-            <directory>../../../../extensions/cep/artifacts/outputeventadaptors</directory>
+            <directory>../../../../extensions/cep/modules/artifacts/outputeventadaptors</directory>
             <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/outputeventadaptors
             </outputDirectory>
         </fileSet>
         <!--creating an empty event builders directory-->
         <fileSet>
-            <directory>../../../../extensions/cep/artifacts/eventbuilders</directory>
+            <directory>../../../../extensions/cep/modules/artifacts/eventbuilders</directory>
             <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/eventbuilders
             </outputDirectory>
         </fileSet>
         <!--creating an empty event formatters directory-->
         <fileSet>
-            <directory>../../../../extensions/cep/artifacts/eventformatters</directory>
+            <directory>../../../../extensions/cep/modules/artifacts/eventformatters</directory>
             <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/eventformatters
             </outputDirectory>
         </fileSet>
         <!--creating an empty execution plans directory-->
         <fileSet>
-            <directory>../../../../extensions/cep/artifacts/executionplans</directory>
+            <directory>../../../../extensions/cep/modules/artifacts/executionplans</directory>
             <outputDirectory>${stratos.distribution.name}-${project.version}/repository/deployment/server/executionplans
             </outputDirectory>
         </fileSet>
@@ -603,7 +603,7 @@
             <filtered>true</filtered>
         </file>
         <file>
-            <source>../../../../extensions/cep/artifacts/streamdefinitions/stream-manager-config.xml</source>
+            <source>../../../../extensions/cep/modules/artifacts/streamdefinitions/stream-manager-config.xml</source>
             <outputDirectory>${stratos.distribution.name}-${project.version}/repository/conf/</outputDirectory>
             <filtered>true</filtered>
         </file>


[12/50] [abbrv] stratos git commit: Adding integration tests to PCA

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
new file mode 100755
index 0000000..165508e
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=single_group_v1,APPLICATION_PATH=/tmp/tomcat/webapps,BASH=/bin/bash,BASHOPTS=cmdhist:complete_fullquote:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath,BASH_ALIASES=(),BASH_ARGC=(),BASH_ARGV=(),BASH_CMDS=(),BASH_LINENO=([0]="0"),BASH_SOURCE=([0]="/usr/local/bin/populate-user-data.sh"),BASH_VERSINFO=([0]="4" [1]="3" [2]="30" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu"),BASH_VERSION='4.3.30(1)-release',CARTRIDGE_ALIAS=mytomcat,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,CATALINA_HOME=/opt/tomcat,CEP_IP=54.179.197.243,CEP_PORT=7711,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single_group_v1-1,DEPENDENCY_CLUSTER_IDS=myphp.php.domain,DEPLOYMENT=default,DIRSTACK=(),EUID=0,GROUPS=(),GROUP_NAME=null,HOME=/root,HOSTNAME=mytomcat-tomcat-domain3bd3cd47-b95d-475a-aa11-3e3ddc089d49,HOSTTYPE=x86_64,HOST_NAME=mytomcat.tomcat.stratos.org,IFS=' 	,',INSTANCE_ID=null,INTERNAL=false,JAVA_HOME=/opt/jdk1.7.0_67,KUBERNETES_CLUSTER_ID=kubernetes-cluster-1,KUB
 ERNETES_PORT=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP=tcp://10.100.0.2:443,KUBERNETES_PORT_443_TCP_ADDR=10.100.0.2,KUBERNETES_PORT_443_TCP_PORT=443,KUBERNETES_PORT_443_TCP_PROTO=tcp,KUBERNETES_RO_PORT=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP=tcp://10.100.0.1:80,KUBERNETES_RO_PORT_80_TCP_ADDR=10.100.0.1,KUBERNETES_RO_PORT_80_TCP_PORT=80,KUBERNETES_RO_PORT_80_TCP_PROTO=tcp,KUBERNETES_RO_SERVICE_HOST=10.100.0.1,KUBERNETES_RO_SERVICE_PORT=80,KUBERNETES_SERVICE_HOST=10.100.0.2,KUBERNETES_SERVICE_PORT=443,LB_CLUSTER_ID=null,LOG_LEVEL=DEBUG,MACHTYPE=x86_64-pc-linux-gnu,MB_IP=54.179.197.243,MB_PORT=1883,MEMBER_ID=php.member-1,MIN_COUNT=1,MULTITENANT=false,MYPHP_PHP_DOMAIN_1_PORT=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP=tcp://10.100.171.218:4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.171.218,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYPHP_PHP_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYPHP_PHP_DOMAIN_1_SERVICE_HOST=10.100.171.218,MYPHP_PHP_DOMAIN_1_SERVICE_PORT=4500,
 MYTOMCAT_TOMCAT_DOMAIN_1_PORT=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP=tcp://10.100.16.250:4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_ADDR=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PORT=4500,MYTOMCAT_TOMCAT_DOMAIN_1_PORT_4500_TCP_PROTO=tcp,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_HOST=10.100.16.250,MYTOMCAT_TOMCAT_DOMAIN_1_SERVICE_PORT=4500,NETWORK_PARTITION_ID=network-partition-1,OPTERR=1,OPTIND=1,OSTYPE=linux-gnu,PARTITION_ID=partition-1,PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,PIPESTATUS=([0]="0"),PORTS=8080,POSIXLY_CORRECT=y,PPID=14,PRIMARY=false,PROVIDER=apache,PS4='+ ',PUPPET_DNS_AVAILABLE=null,PUPPET_ENV=false,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_IP=127.0.0.1,PWD=/opt,REPO_URL=https://github.com/imesh/stratos-tomcat-applications.git,SERVICE_NAME=php,SHELL=/bin/bash,SHELLOPTS=braceexpand:hashall:interactive-comments:posix,SHLVL=2,TENANT_ID=-1234,TENANT_RANGE='*',TERM=dumb,TOKEN=eyJhbGciOiJSUzI1NiJ9.eyJleHAiOi04NzI
 0ODEyNDEsInN1YiI6ImFkbWluIiwiYXpwIjoid3I5SllVaDNtTXd6bVhHVllqWmVIWnhCV2xFYSIsImFwcElkIjoic2luZ2xlX2dyb3VwX3YxIiwiYXVkIjpbIndyOUpZVWgzbU13em1YR1ZZalplSFp4QldsRWEiXSwiaXNzIjoiaHR0cHM6XC9cL2xvY2FsaG9zdDo5NDQzXC9vYXV0aDJlbmRwb2ludHNcL3Rva2VuIiwiaWF0IjotODcyNDgwMjQwfQ.OSa1gIXUT9amhk1YEU02Yc3JtUYqanzrXh5K1YyvRXcpSiY2Ccn2BfJO0hILF5UooRcGBihzfX3979NRcvGwcUDUvOUJ0eaGPmxFZYbu0nr3xD8lhAO3fa1QYsKAvMnMdwyu2uSgSp6R6EUdVleiwlabUoDsuEcKGkIAn_VQvG0,UID=0,_=posix,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
new file mode 100755
index 0000000..136433d
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/agent.conf
@@ -0,0 +1,46 @@
+# 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.
+
+[agent]
+mb.ip                                 =localhost
+mb.port                               =1885
+listen.address                        =localhost
+thrift.receiver.ip                    =localhost
+thrift.receiver.port                  =7712
+thrift.server.admin.username          =admin
+thrift.server.admin.password          =admin
+cep.stats.publisher.enabled           =true
+lb.private.ip                         =
+lb.public.ip                          =
+enable.artifact.update                =true
+auto.commit                           =false
+auto.checkout                         =true
+artifact.update.interval              =15
+artifact.clone.retries                =5
+artifact.clone.interval               =10
+port.check.timeout                    =600000
+enable.data.publisher                 =false
+monitoring.server.ip                  =localhost
+monitoring.server.port                =7612
+monitoring.server.secure.port         =7712
+monitoring.server.admin.username      =admin
+monitoring.server.admin.password      =admin
+#log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
+log.file.paths                        =/tmp/agent.screen.log
+metadata.service.url                  =https://localhost:9443
+super.tenant.repository.path          =/repository/deployment/server/
+tenant.repository.path                =/repository/tenants/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/logging.ini
@@ -0,0 +1,52 @@
+# 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.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
new file mode 100755
index 0000000..0d29753
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-2/payload/launch-params
@@ -0,0 +1,18 @@
+# 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.
+
+APPLICATION_ID=application1,SERVICE_NAME=php,HOST_NAME=php.php.stratos.org,MULTITENANT=false,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=php,CLUSTER_ID=php.php.domain,CLUSTER_INSTANCE_ID=single-cartridge-app-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=9080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=php.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/stratos-pca-test-app-path/,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null,MP_IP=192.168.1.4,MB_PORT=1883,LVS_VIRTUAL_IP=192.168.0.40|255.255.255.0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties b/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
new file mode 100755
index 0000000..1242841
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/test-conf/integration-test.properties
@@ -0,0 +1,26 @@
+# 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.
+
+# Stratos distribution properties added via filters during the build
+distribution.version=${project.version}
+distribution.name=${python.cartridge.agent.distribution.name}-${project.version}
+activemq.amqp.bind.address=tcp://localhost:61617
+activemq.mqtt.bind.address=mqtt://localhost:1885
+cep.port=7712
+stratos.endpoint=http://localhost:9763
+stratos.admin.username=admin
+stratos.admin.password=admin
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/ba20168a/products/python-cartridge-agent/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/pom.xml b/products/python-cartridge-agent/pom.xml
old mode 100644
new mode 100755
index f9a071c..16ba3b7
--- a/products/python-cartridge-agent/pom.xml
+++ b/products/python-cartridge-agent/pom.xml
@@ -32,8 +32,7 @@
     <description>Apache Stratos Python Cartridge Agent Product</description>
 
     <modules>
-        <module>
-            distribution
-        </module>
+        <module>distribution</module>
+        <module>integration</module>
     </modules>
 </project>
\ No newline at end of file


[15/50] [abbrv] stratos git commit: Adding integration test to PCA to validate Git artifact distribution

Posted by ra...@apache.org.
Adding integration test to PCA to validate Git artifact distribution


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/bbfa6c5b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/bbfa6c5b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/bbfa6c5b

Branch: refs/heads/master
Commit: bbfa6c5bb47ed2c644fe3be5d381682b7a683d5f
Parents: ba20168
Author: Akila Perera <ra...@gmail.com>
Authored: Fri Aug 28 02:09:45 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Fri Aug 28 02:09:45 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/cartridge.agent/entity.py   |   5 +-
 .../extensions/bash/CreateLVSDummyInterface.sh  |  26 +
 .../extensions/bash/MemberInitializedEvent.sh   |  26 +
 .../cartridge.agent/healthstats.py              |   1 +
 .../modules/artifactmgt/git/agentgithandler.py  |  26 +-
 .../cartridge.agent/modules/databridge/agent.py |  11 +-
 .../modules/event/eventhandler.py               |  31 +-
 .../cartridge.agent/publisher.py                |   1 -
 .../python-cartridge-agent/integration/pom.xml  |  35 +-
 .../python.cartridge.agent/test/ADCTest.java    | 241 +++++++-
 .../test/PythonCartridgeAgentTest.java          | 578 -------------------
 .../test/PythonTestManager.java                 | 411 +++++++++++++
 .../test/StartUpTest.java                       | 171 ++++++
 .../src/test/resources/pca-testing1.xml         |   2 +-
 .../src/test/resources/suite-1/agent.conf       |   2 +-
 .../resources/suite-1/payload/launch-params     |   2 +-
 .../src/test/resources/suite-2/agent.conf       |   4 +-
 .../resources/suite-2/payload/launch-params     |  19 +-
 18 files changed, 959 insertions(+), 633 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
index 3bb03e7..d02f670 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/entity.py
@@ -16,7 +16,7 @@
 # under the License.
 
 import constants
-
+import json
 
 class Topology:
     """
@@ -413,6 +413,9 @@ class Member:
         for port in ports:
             self.add_port(port)
 
+    def to_json(self):
+        return "{memberId: " + self.member_id + ", status: " + self.status + "}"
+
 
 class KubernetesService:
     """

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
new file mode 100644
index 0000000..0bdd6b0
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/CreateLVSDummyInterface.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when a subscription domain added
+# event is received by the cartridge agent.
+# --------------------------------------------------------------
+#
+echo `date`": Create LVS dummy interface shell extension executed"

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/MemberInitializedEvent.sh
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/MemberInitializedEvent.sh b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/MemberInitializedEvent.sh
new file mode 100755
index 0000000..4fc3da6
--- /dev/null
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/extensions/bash/MemberInitializedEvent.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+# This extension script will be executed when a subscription domain added
+# event is received by the cartridge agent.
+# --------------------------------------------------------------
+#
+echo `date`": Member initialized event shell extension executed"

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
index be45294..dddee70 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/healthstats.py
@@ -124,6 +124,7 @@ class HealthStatisticsPublisher:
             cep_admin_username,
             cep_admin_password,
             self.stream_definition)
+        self.publisher.start()
 
         HealthStatisticsPublisher.log.debug("HealthStatisticsPublisher initialized")
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
index bc82b35..22fe816 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/artifactmgt/git/agentgithandler.py
@@ -327,17 +327,20 @@ class AgentGitHandler:
         # This way, commit and push becomes an single operation. No intermediate state will be left behind.
         (init_head, init_errors) = AgentGitHandler.execute_git_command(["rev-parse", "HEAD"], git_repo.local_repo_path)
 
-        # check if modified
-        modified, unstaged_files = AgentGitHandler.get_unstaged_files(git_repo.local_repo_path)
+        # stage all untracked files
+        if AgentGitHandler.stage_all(git_repo.local_repo_path):
+            AgentGitHandler.log.info("Git staged untracked artifacts successfully")
+        else:
+            AgentGitHandler.log.info("Git could not stage untracked artifacts")
 
-        AgentGitHandler.log.debug("[Git] Modified: %s" % str(modified))
+        # check if modified files are present
+        modified = AgentGitHandler.has_modified_files(git_repo.local_repo_path)
 
+        AgentGitHandler.log.debug("[Git] Modified: %s" % str(modified))
         if not modified:
             AgentGitHandler.log.debug("No changes detected in the local repository for tenant %s" % git_repo.tenant_id)
             return
 
-        AgentGitHandler.stage_all(git_repo.local_repo_path)
-
         # commit to local repositpory
         commit_message = "tenant [%s]'s artifacts committed to local repo at %s" \
                          % (git_repo.tenant_id, git_repo.local_repo_path)
@@ -385,17 +388,14 @@ class AgentGitHandler:
                 "Pushing artifacts to remote repository failed for tenant %s: %s" % (git_repo.tenant_id, e))
 
     @staticmethod
-    def get_unstaged_files(repo_path):
-
+    def has_modified_files(repo_path):
         (output, errors) = AgentGitHandler.execute_git_command(["status"], repo_path=repo_path)
-        unstaged_files = {"modified": [], "untracked": []}
+        AgentGitHandler.log.debug("Git status output: %s", str(output))
 
         if "nothing to commit" in output:
-            return False, unstaged_files
-
-        if "Changes not staged for commit" in output:
-            # there are modified files
-            return True, unstaged_files
+            return False
+        else:
+            return True
 
     @staticmethod
     def stage_all(repo_path):

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
index 5ef794c..a17a589 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
@@ -16,6 +16,7 @@
 # under the License.
 
 from thrift.publisher import *
+from threading import Thread
 from thrift.gen.Exception.ttypes import ThriftSessionExpiredException
 from ..util.log import *
 from exception import ThriftReceiverOfflineException
@@ -114,7 +115,7 @@ class ThriftEvent:
         """:type : list[T]"""
 
 
-class ThriftPublisher:
+class ThriftPublisher(Thread):
     """
     Handles publishing events to BAM/CEP through thrift using the provided address and credentials
     """
@@ -135,15 +136,14 @@ class ThriftPublisher:
         :return: ThriftPublisher object
         :rtype: ThriftPublisher
         """
+        Thread.__init__(self)
         try:
             port_number = int(port)
         except ValueError:
             raise RuntimeError("Port number for Thrift Publisher is invalid: %r" % port)
 
         self.__publisher = Publisher(ip, port_number)
-        self.__publisher.connect(username, password)
-        self.__publisher.defineStream(str(stream_definition))
-
+        #self.__publisher.defineStream(str(stream_definition))
         self.stream_definition = stream_definition
         self.stream_id = self.__publisher.streamId
         self.ip = ip
@@ -151,6 +151,9 @@ class ThriftPublisher:
         self.username = username
         self.password = password
 
+    def run(self):
+        self.__publisher.connect(self.username, self.password)
+
     def publish(self, event):
         """
         Publishes the given event by creating the event bundle from the log event

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
index 9fe6ae9..9496951 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/eventhandler.py
@@ -91,6 +91,7 @@ class EventHandler:
 
             # checkout code
             subscribe_run, updated = AgentGitHandler.checkout(repo_info)
+
             # execute artifact updated extension
             plugin_values = {"ARTIFACT_UPDATED_CLUSTER_ID": artifacts_updated_event.cluster_id,
                              "ARTIFACT_UPDATED_TENANT_ID": artifacts_updated_event.tenant_id,
@@ -99,7 +100,10 @@ class EventHandler:
                              "ARTIFACT_UPDATED_REPO_USERNAME": artifacts_updated_event.repo_username,
                              "ARTIFACT_UPDATED_STATUS": artifacts_updated_event.status}
 
-            self.execute_event_extendables(constants.ARTIFACT_UPDATED_EVENT, plugin_values)
+            try:
+                self.execute_event_extendables(constants.ARTIFACT_UPDATED_EVENT, plugin_values)
+            except ValueError:
+                self.__log.exception("Could not execute plugins for artifact updated event.")         
 
             if subscribe_run:
                 # publish instanceActivated
@@ -109,10 +113,11 @@ class EventHandler:
                 self.on_artifact_update_scheduler_event(tenant_id)
 
             update_artifacts = Config.read_property(constants.ENABLE_ARTIFACT_UPDATE, False)
+            auto_commit = Config.is_commits_enabled
+            auto_checkout = Config.is_checkout_enabled
+            self.__log.info("ADC configuration: [update_artifacts] %s, [auto-commit] %s, [auto-checkout] %s",
+                            update_artifacts, auto_commit, auto_checkout)
             if update_artifacts:
-                auto_commit = Config.is_commits_enabled
-                auto_checkout = Config.is_checkout_enabled
-
                 try:
                     update_interval = int(Config.artifact_update_interval)
                 except ValueError:
@@ -207,6 +212,7 @@ class EventHandler:
 
         if member_exists:
             Config.initialized = True
+            self.markMemberAsInitialized(service_name_in_payload, cluster_id_in_payload, member_id_in_payload)
 
         self.execute_event_extendables(constants.MEMBER_INITIALIZED_EVENT, {})
 
@@ -276,7 +282,6 @@ class EventHandler:
         service_name_in_payload = Config.service_name
         cluster_id_in_payload = Config.cluster_id
         member_id_in_payload = Config.member_id
-
         member_initialized = self.is_member_initialized_in_topology(service_name_in_payload, cluster_id_in_payload,
                                                                  member_id_in_payload)
 
@@ -476,6 +481,7 @@ class EventHandler:
             service = topology.get_service(service_name)
             cluster = service.get_cluster(cluster_id)
             found_member = cluster.get_member(member_id)
+            self.__log.debug("Found member: " + found_member.to_json())
             if found_member.status == MemberStatus.Initialized:
                 return True
 
@@ -500,6 +506,21 @@ class EventHandler:
 
         return True
 
+    def markMemberAsInitialized(self, service_name, cluster_id, member_id):
+        topology = TopologyContext.get_topology()
+        service = topology.get_service(service_name)
+        if service is None:
+            self.__log.error("Service not found in topology [service] %s" % service_name)
+            return False
+
+        cluster = service.get_cluster(cluster_id)
+        if cluster is None:
+            self.__log.error("Cluster id not found in topology [cluster] %s" % cluster_id)
+            return False
+
+        member = cluster.get_member(member_id)
+        member.status = MemberStatus.Initialized
+
     @staticmethod
     def add_common_input_values(plugin_values):
         """

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
index 716df2d..d4365e8 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/publisher.py
@@ -116,7 +116,6 @@ def publish_instance_activated_event(health_stat_plugin):
                         interval = interval_default
                 else:
                     interval = interval_default
-
                 health_stats_publisher = healthstats.HealthStatisticsPublisherManager(interval, health_stat_plugin)
                 log.info("Starting Health statistics publisher with interval %r" % interval)
                 health_stats_publisher.start()

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
index e92bbb4..a359615 100755
--- a/products/python-cartridge-agent/integration/pom.xml
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -72,13 +72,34 @@
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
-                        <inherited>false</inherited>
-                        <configuration>
-                            <suiteXmlFiles>
-                                <suiteXmlFile>src/test/resources/pca-testing1.xml</suiteXmlFile>
-                            </suiteXmlFiles>
-                            <workingDirectory>${basedir}/target</workingDirectory>
-                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>default-test</id>
+                                <goals>
+                                    <goal>test</goal>
+                                </goals>
+                                <inherited>false</inherited>
+                                <configuration>
+                                    <suiteXmlFiles>
+                                        <suiteXmlFile>src/test/resources/pca-testing1.xml</suiteXmlFile>
+                                    </suiteXmlFiles>
+                                    <workingDirectory>${basedir}/target</workingDirectory>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>adc-test</id>
+                                <goals>
+                                    <goal>test</goal>
+                                </goals>
+                                <inherited>false</inherited>
+                                <configuration>
+                                    <suiteXmlFiles>
+                                        <suiteXmlFile>src/test/resources/pca-testing2.xml</suiteXmlFile>
+                                    </suiteXmlFiles>
+                                    <workingDirectory>${basedir}/target</workingDirectory>
+                                </configuration>
+                            </execution>
+                        </executions>
                     </plugin>
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
index 86fc7c3..e657ecc 100755
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCTest.java
@@ -17,5 +17,244 @@ package org.apache.stratos.python.cartridge.agent.test;/*
  * under the License.
  */
 
-public class ADCTest {
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.UUID;
+
+import static junit.framework.Assert.assertTrue;
+
+public class ADCTest extends PythonTestManager {
+    private static final Log log = LogFactory.getLog(ADCTest.class);
+    private static final int ADC_TIMEOUT = 180000;
+    private static final String RESOURCES_PATH = "/suite-2";
+    private static final String APPLICATION_PATH = "/tmp/pca-test-suite-2";
+    private static final String CLUSTER_ID = "tomcat.domain";
+    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-2";
+    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-2";
+    private static final String APP_ID = "application-2";
+    private static final String MEMBER_ID = "tomcat.member-1";
+    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+    private static final String NETWORK_PARTITION_ID = "network-partition-1";
+    private static final String PARTITION_ID = "partition-1";
+    private static final String TENANT_ID = "-1234";
+    private static final String SERVICE_NAME = "tomcat";
+    private static final String SOURCE_PATH = "/tmp/stratos-pca-adc-test-app-path/";
+
+    private static boolean hasADCTestCompleted = false;
+
+    @BeforeSuite
+    public void setupStartUpTest() {
+        // Set jndi.properties.dir system property for initializing event publishers and receivers
+        System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
+
+        // start Python agent with configurations provided in resource path
+        setup(RESOURCES_PATH);
+
+        // Simulate server socket
+        startServerSocket(8080);
+    }
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    @AfterSuite
+    public void tearDownStartUpTest() {
+        // TODO: app path is duplicated in Java test and payload
+        tearDown(APPLICATION_PATH);
+    }
+
+
+    @Test(timeOut = ADC_TIMEOUT)
+    public void testPythonCartridgeAgent() {
+        Thread communicatorThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (!eventReceiverInitiated) {
+                    sleep(1000);
+                }
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
+                                try {
+                                    throw new RuntimeException(line);
+                                }
+                                catch (Exception e) {
+                                    log.error("ERROR found in PCA log", e);
+                                }
+                            }
+                            if (line.contains("Subscribed to 'topology/#'")) {
+                                sleep(2000);
+                                // Send complete topology event
+                                log.info("Publishing complete topology event...");
+                                Topology topology = createTestTopology();
+                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+                                publishEvent(completeTopologyEvent);
+                                log.info("Complete topology event published");
+
+                                // Publish member initialized event
+                                log.info("Publishing member initialized event...");
+                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+                                        PARTITION_ID
+                                );
+                                publishEvent(memberInitializedEvent);
+                                log.info("Member initialized event published");
+                            }
+
+                            // Send artifact updated event to activate the instance first
+                            if (line.contains("Artifact repository found")) {
+                                publishEvent(getArtifactUpdatedEventForPrivateRepo());
+                                log.info("Artifact updated event published");
+                            }
+                            log.info(line);
+                        }
+                    }
+                    sleep(100);
+                }
+            }
+        });
+        communicatorThread.start();
+
+        while (!instanceActivated) {
+            // wait until the instance activated event is received.
+            sleep(1000);
+        }
+        assertTrue("Instance started event was not received", instanceStarted);
+        assertTrue("Instance activated event was not received", instanceActivated);
+
+        Thread adcTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                log.info("Running ADC Test thread...");
+                // Send artifact updated event
+                publishEvent(getArtifactUpdatedEventForPrivateRepo());
+                log.info("Publishing artifact updated event for repo: " +
+                        getArtifactUpdatedEventForPrivateRepo().getRepoURL());
+
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed() && !hasADCTestCompleted) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Git clone executed")) {
+                                log.info("Agent has completed git clone. Asserting the operation...");
+                                assertRepoClone(getArtifactUpdatedEventForPrivateRepo());
+                                File file = new File(APPLICATION_PATH + "/pca-live-" + UUID.randomUUID());
+                                try {
+                                    file.createNewFile();
+                                }
+                                catch (IOException e) {
+                                    log.error("Could not create file", e);
+                                }
+                            }
+                            if (line.contains("Pushed artifacts for tenant")) {
+                                // TODO: Get rid of static var
+                                log.info("ADC Test completed");
+                                hasADCTestCompleted = true;
+                            }
+                        }
+                    }
+                    sleep(100);
+                }
+            }
+        });
+        adcTestThread.start();
+
+        while (!hasADCTestCompleted) {
+            // wait until the instance activated event is received.
+            sleep(1000);
+        }
+        assertTrue("ADC Test failed", hasADCTestCompleted);
+    }
+
+    private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
+        File file = new File(APPLICATION_PATH + "/README.text");
+        assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(),
+                file.exists());
+    }
+
+    private void assertRepoPush(ArtifactUpdatedEvent artifactUpdatedEvent) {
+        File file = new File(APPLICATION_PATH + "/test1.txt");
+        assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(), file.exists());
+
+    }
+
+    /**
+     * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
+     * objects as parameters to the test
+     *
+     * @return
+     */
+    public static ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
+        ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+        publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+        return publicRepoEvent;
+    }
+
+    public static ArtifactUpdatedEvent getArtifactUpdatedEventForPrivateRepo() {
+        ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
+        privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
+        privateRepoEvent.setRepoUserName("testapache2211");
+        privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
+        return privateRepoEvent;
+    }
+
+    /**
+     * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
+     * repository URL
+     *
+     * @return
+     */
+    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+        ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+        artifactUpdatedEvent.setClusterId(CLUSTER_ID);
+        artifactUpdatedEvent.setTenantId(TENANT_ID);
+        return artifactUpdatedEvent;
+    }
+
+    /**
+     * Create test topology
+     *
+     * @return
+     */
+    private Topology createTestTopology() {
+        Topology topology = new Topology();
+        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+        topology.addService(service);
+
+        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+                AUTOSCALING_POLICY_NAME, APP_ID);
+        service.addCluster(cluster);
+
+        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+                System.currentTimeMillis());
+
+        member.setDefaultPrivateIP("10.0.0.1");
+        member.setDefaultPublicIP("20.0.0.1");
+        Properties properties = new Properties();
+        properties.setProperty("prop1", "value1");
+        member.setProperties(properties);
+        member.setStatus(MemberStatus.Created);
+        cluster.addMember(member);
+
+        return topology;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
deleted file mode 100755
index 93f4c1e..0000000
--- a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java
+++ /dev/null
@@ -1,578 +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.python.cartridge.agent.test;
-
-import org.apache.activemq.broker.BrokerService;
-import org.apache.commons.exec.*;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.output.ByteArrayOutputStream;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.common.domain.LoadBalancingIPType;
-import org.apache.stratos.common.threading.StratosThreadPool;
-import org.apache.stratos.messaging.broker.publish.EventPublisher;
-import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
-import org.apache.stratos.messaging.domain.topology.*;
-import org.apache.stratos.messaging.event.Event;
-import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
-import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
-import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
-import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
-import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
-import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
-import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
-import org.apache.stratos.messaging.util.MessagingUtil;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-import java.io.*;
-import java.net.ServerSocket;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import static junit.framework.Assert.assertTrue;
-
-public class PythonCartridgeAgentTest {
-
-    private static final Log log = LogFactory.getLog(PythonCartridgeAgentTest.class);
-    private static final String RESOURCES_PATH = "/suite-1";
-    private static final String NEW_LINE = System.getProperty("line.separator");
-    //    private static final long TIMEOUT = 1440000;
-    private static final long TIMEOUT = 120000;
-    private static final String CLUSTER_ID = "php.php.domain";
-    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
-    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
-    private static final String APP_ID = "application-1";
-    private static final String MEMBER_ID = "php.member-1";
-    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
-    private static final String NETWORK_PARTITION_ID = "network-partition-1";
-    private static final String PARTITION_ID = "partition-1";
-    private static final String TENANT_ID = "-1234";
-    private static final String SERVICE_NAME = "php";
-    public static final String SOURCE_PATH = "/tmp/stratos-pca-test-app-path/";
-
-    private static List<ServerSocket> serverSocketList;
-    private static Map<String, Executor> executorList;
-
-    private boolean instanceStarted;
-    private boolean instanceActivated;
-    private ByteArrayOutputStreamLocal outputStream;
-    private boolean eventReceiverInitiated = false;
-    private TopologyEventReceiver topologyEventReceiver;
-    private InstanceStatusEventReceiver instanceStatusEventReceiver;
-    private BrokerService broker = new BrokerService();
-    private static final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
-
-    private static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
-    private static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
-    private static final String CEP_PORT = "cep.port";
-    private static final String DISTRIBUTION_NAME = "distribution.name";
-
-    private int cepPort;
-    private String amqpBindAddress;
-    private String mqttBindAddress;
-    private String distributionName;
-    private Properties integrationProperties;
-
-    public PythonCartridgeAgentTest() {
-        if (integrationProperties == null) {
-            integrationProperties = new Properties();
-            try {
-                integrationProperties
-                        .load(PythonCartridgeAgentTest.class.getResourceAsStream("/integration-test.properties"));
-                distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
-                amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
-                mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
-                cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
-                log.info("PCA integration properties: " + integrationProperties.toString());
-            }
-            catch (IOException e) {
-                log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
-                        "exists in classpath.", e);
-            }
-        }
-    }
-
-    /**
-     * Setup method for test class
-     */
-    @BeforeSuite
-    public static void oneTimeSetUp() {
-        // Set jndi.properties.dir system property for initializing event publishers and receivers
-        System.setProperty("jndi.properties.dir", getResourcesPath());
-    }
-
-    /**
-     * Setup method for test method testPythonCartridgeAgent
-     */
-    @BeforeSuite
-    public void setup() {
-        serverSocketList = new ArrayList<ServerSocket>();
-        executorList = new HashMap<String, Executor>();
-        try {
-            broker.addConnector(amqpBindAddress);
-            broker.addConnector(mqttBindAddress);
-            broker.setBrokerName("testBroker");
-            broker.setDataDirectory(
-                    PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
-                            "/activemq-data");
-            broker.start();
-            log.info("Broker service started!");
-        }
-        catch (Exception e) {
-            log.error("Error while setting up broker service", e);
-        }
-        if (!this.eventReceiverInitiated) {
-            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
-            topologyEventReceiver = new TopologyEventReceiver();
-            topologyEventReceiver.setExecutorService(executorService);
-            topologyEventReceiver.execute();
-
-            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
-            instanceStatusEventReceiver.setExecutorService(executorService);
-            instanceStatusEventReceiver.execute();
-
-            this.instanceStarted = false;
-            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
-                @Override
-                protected void onEvent(Event event) {
-                    log.info("Instance started event received");
-                    instanceStarted = true;
-                }
-            });
-
-            this.instanceActivated = false;
-            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
-                @Override
-                protected void onEvent(Event event) {
-                    log.info("Instance activated event received");
-                    instanceActivated = true;
-                }
-            });
-
-            this.eventReceiverInitiated = true;
-        }
-        // Simulate CEP server socket
-        startServerSocket(cepPort);
-        String agentPath = setupPythonAgent();
-        log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
-        log.info("Starting python cartridge agent...");
-        this.outputStream = executeCommand("python " + agentPath + "/agent.py > " +
-                PythonCartridgeAgentTest.class.getResource(File.separator).getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
-                "/cartridge-agent.log");
-    }
-
-    /**
-     * TearDown method for test method testPythonCartridgeAgent
-     */
-    @AfterSuite
-    public void tearDown() {
-        for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
-            try {
-                String commandText = entry.getKey();
-                Executor executor = entry.getValue();
-                ExecuteWatchdog watchdog = executor.getWatchdog();
-                if (watchdog != null) {
-                    log.info("Terminating process: " + commandText);
-                    watchdog.destroyProcess();
-                }
-            }
-            catch (Exception ignore) {
-            }
-        }
-        for (ServerSocket serverSocket : serverSocketList) {
-            try {
-                log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
-                serverSocket.close();
-            }
-            catch (IOException ignore) {
-            }
-        }
-
-        try {
-            log.info("Deleting source checkout folder...");
-            FileUtils.deleteDirectory(new File(SOURCE_PATH));
-        }
-        catch (Exception ignore) {
-
-        }
-
-        this.instanceStatusEventReceiver.terminate();
-        this.topologyEventReceiver.terminate();
-
-        this.instanceActivated = false;
-        this.instanceStarted = false;
-        try {
-            broker.stop();
-        }
-        catch (Exception e) {
-            log.error("Error while stopping the broker service", e);
-        }
-    }
-
-
-    /**
-     * This method returns a collection of {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent}
-     * objects as parameters to the test
-     *
-     * @return
-     */
-
-    public static ArrayList<ArtifactUpdatedEvent> getArtifactUpdatedEventsAsParams() {
-        ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
-
-        ArtifactUpdatedEvent privateRepoEvent = createTestArtifactUpdatedEvent();
-        privateRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/testrepo.git");
-        privateRepoEvent.setRepoUserName("testapache2211");
-        privateRepoEvent.setRepoPassword("RExPDGa4GkPJj4kJDzSROQ==");
-
-        ArtifactUpdatedEvent privateRepoEvent2 = createTestArtifactUpdatedEvent();
-        privateRepoEvent2.setRepoURL("https://testapache2211@bitbucket.org/testapache2211/testrepo.git");
-        privateRepoEvent2.setRepoUserName("testapache2211");
-        privateRepoEvent2.setRepoPassword("iF7qT+BKKPE3PGV1TeDsJA==");
-
-        ArrayList<ArtifactUpdatedEvent> list = new ArrayList<ArtifactUpdatedEvent>();
-        list.add(privateRepoEvent);
-        list.add(privateRepoEvent2);
-        list.add(publicRepoEvent);
-        return list;
-    }
-
-    /**
-     * Creates an {@link org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent} object with a public
-     * repository URL
-     *
-     * @return
-     */
-    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
-        ArtifactUpdatedEvent publicRepoEvent = new ArtifactUpdatedEvent();
-        publicRepoEvent.setClusterId(CLUSTER_ID);
-        publicRepoEvent.setTenantId(TENANT_ID);
-        publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
-        publicRepoEvent.setCommitEnabled(true);
-        return publicRepoEvent;
-    }
-
-    @Test(timeOut = TIMEOUT)
-    public void testPythonCartridgeAgent() {
-        Thread communicatorThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                List<String> outputLines = new ArrayList<String>();
-                while (!outputStream.isClosed()) {
-                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
-                    if (newLines.size() > 0) {
-                        for (String line : newLines) {
-                            if (line.contains("Subscribed to 'topology/#'")) {
-                                sleep(1000);
-                                // Send complete topology event
-                                log.info("Publishing complete topology event...");
-                                Topology topology = createTestTopology();
-                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
-                                publishEvent(completeTopologyEvent);
-                                log.info("Complete topology event published");
-
-                                sleep(3000);
-                                // Publish member initialized event
-                                log.info("Publishing member initialized event...");
-                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
-                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
-                                        PARTITION_ID
-                                );
-                                publishEvent(memberInitializedEvent);
-                                log.info("Member initialized event published");
-
-                                // Simulate server socket
-                                startServerSocket(8080);
-                            }
-                            if (line.contains("Artifact repository found")) {
-                                // Send artifact updated event
-                                ArrayList<ArtifactUpdatedEvent> list = getArtifactUpdatedEventsAsParams();
-                                for (ArtifactUpdatedEvent artifactUpdatedEvent : list) {
-                                    publishEvent(artifactUpdatedEvent);
-                                }
-                            }
-
-                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
-                                //throw new RuntimeException(line);
-                            }
-                            log.info(line);
-                        }
-                    }
-                    sleep(100);
-                }
-            }
-        });
-
-        communicatorThread.start();
-
-        while (!instanceActivated) {
-            // wait until the instance activated event is received.
-            sleep(2000);
-        }
-
-        assertTrue("Instance started event was not received", instanceStarted);
-        assertTrue("Instance activated event was not received", instanceActivated);
-    }
-
-    /**
-     * Publish messaging event
-     *
-     * @param event
-     */
-    private void publishEvent(Event event) {
-        String topicName = MessagingUtil.getMessageTopicName(event);
-        EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
-        eventPublisher.publish(event);
-    }
-
-    /**
-     * Start server socket
-     *
-     * @param port
-     */
-    private void startServerSocket(final int port) {
-        Thread socketThread = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    ServerSocket serverSocket = new ServerSocket(port);
-                    serverSocketList.add(serverSocket);
-                    log.info("Server socket started on port: " + port);
-                    serverSocket.accept();
-                }
-                catch (IOException e) {
-                    String message = "Could not start server socket: [port] " + port;
-                    log.error(message, e);
-                    throw new RuntimeException(message, e);
-                }
-            }
-        });
-        socketThread.start();
-    }
-
-    /**
-     * Create test topology
-     *
-     * @return
-     */
-    private Topology createTestTopology() {
-        Topology topology = new Topology();
-        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
-        topology.addService(service);
-
-        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
-                AUTOSCALING_POLICY_NAME, APP_ID);
-        service.addCluster(cluster);
-
-        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
-                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
-                System.currentTimeMillis());
-
-        member.setDefaultPrivateIP("10.0.0.1");
-        member.setDefaultPublicIP("20.0.0.1");
-        Properties properties = new Properties();
-        properties.setProperty("prop1", "value1");
-        member.setProperties(properties);
-        member.setStatus(MemberStatus.Created);
-        cluster.addMember(member);
-
-        return topology;
-    }
-
-    /**
-     * Return new lines found in the output
-     *
-     * @param currentOutputLines current output lines
-     * @param output             output
-     * @return
-     */
-    private List<String> getNewLines(List<String> currentOutputLines, String output) {
-        List<String> newLines = new ArrayList<String>();
-
-        if (StringUtils.isNotBlank(output)) {
-            String[] lines = output.split(NEW_LINE);
-            for (String line : lines) {
-                if (!currentOutputLines.contains(line)) {
-                    currentOutputLines.add(line);
-                    newLines.add(line);
-                }
-            }
-        }
-        return newLines;
-    }
-
-    public static String getResourcesPath() {
-        return PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../../src/test/resources" + RESOURCES_PATH;
-    }
-
-    /**
-     * Sleep current thread
-     *
-     * @param time
-     */
-    private void sleep(long time) {
-        try {
-            Thread.sleep(time);
-        }
-        catch (InterruptedException ignore) {
-        }
-    }
-
-    /**
-     * Copy python agent distribution to a new folder, extract it and copy sample configuration files
-     *
-     * @return
-     */
-    private String setupPythonAgent() {
-        try {
-            log.info("Setting up python cartridge agent...");
-
-
-            String srcAgentPath = PythonCartridgeAgentTest.class.getResource("/").getPath() +
-                    "/../../../distribution/target/" + distributionName + ".zip";
-            String unzipDestPath =
-                    PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME + "/";
-            //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
-            unzip(srcAgentPath, unzipDestPath);
-            String destAgentPath = PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" +
-                    PYTHON_AGENT_DIR_NAME + "/" + distributionName;
-
-            String srcAgentConfPath = getResourcesPath() + "/agent.conf";
-            String destAgentConfPath = destAgentPath + "/agent.conf";
-            FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
-
-            String srcLoggingIniPath = getResourcesPath() + "/logging.ini";
-            String destLoggingIniPath = destAgentPath + "/logging.ini";
-            FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
-
-            String srcPayloadPath = getResourcesPath() + "/payload";
-            String destPayloadPath = destAgentPath + "/payload";
-            FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
-
-            log.info("Changing extension scripts permissions");
-            File extensionsPath = new File(destAgentPath + "/extensions/bash");
-            File[] extensions = extensionsPath.listFiles();
-            for (File extension : extensions) {
-                extension.setExecutable(true);
-            }
-
-            log.info("Python cartridge agent setup completed");
-
-            return destAgentPath;
-        }
-        catch (Exception e) {
-            String message = "Could not copy cartridge agent distribution";
-            log.error(message, e);
-            throw new RuntimeException(message, e);
-        }
-    }
-
-    public void unzip(String zipFilePath, String destDirectory) throws IOException {
-        File destDir = new File(destDirectory);
-        if (!destDir.exists()) {
-            destDir.mkdir();
-        }
-        ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
-        ZipEntry entry = zipIn.getNextEntry();
-        // iterates over entries in the zip file
-        while (entry != null) {
-            String filePath = destDirectory + File.separator + entry.getName();
-            if (!entry.isDirectory()) {
-                // if the entry is a file, extracts it
-                extractFile(zipIn, filePath);
-            } else {
-                // if the entry is a directory, make the directory
-                File dir = new File(filePath);
-                dir.mkdir();
-            }
-            zipIn.closeEntry();
-            entry = zipIn.getNextEntry();
-        }
-        zipIn.close();
-    }
-
-    private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
-        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
-        byte[] bytesIn = new byte[4096];
-        int read = 0;
-        while ((read = zipIn.read(bytesIn)) != -1) {
-            bos.write(bytesIn, 0, read);
-        }
-        bos.close();
-    }
-
-    /**
-     * Execute shell command
-     *
-     * @param commandText
-     */
-    private ByteArrayOutputStreamLocal executeCommand(final String commandText) {
-        final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
-        try {
-            CommandLine commandline = CommandLine.parse(commandText);
-            DefaultExecutor exec = new DefaultExecutor();
-            PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
-            exec.setWorkingDirectory(new File(
-                    PythonCartridgeAgentTest.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME));
-            exec.setStreamHandler(streamHandler);
-            ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
-            exec.setWatchdog(watchdog);
-            exec.execute(commandline, new ExecuteResultHandler() {
-                @Override
-                public void onProcessComplete(int i) {
-                    log.info(commandText + " process completed");
-                }
-
-                @Override
-                public void onProcessFailed(ExecuteException e) {
-                    log.error(commandText + " process failed", e);
-                }
-            });
-            executorList.put(commandText, exec);
-            return outputStream;
-        }
-        catch (Exception e) {
-            log.error(outputStream.toString(), e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Implements ByteArrayOutputStream.isClosed() method
-     */
-    private class ByteArrayOutputStreamLocal extends ByteArrayOutputStream {
-        private boolean closed;
-
-        @Override
-        public void close() throws IOException {
-            super.close();
-            closed = true;
-        }
-
-        public boolean isClosed() {
-            return closed;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java
new file mode 100644
index 0000000..68cca0c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonTestManager.java
@@ -0,0 +1,411 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * 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.
+ */
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.commons.exec.*;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.threading.StratosThreadPool;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.listener.instance.status.InstanceActivatedEventListener;
+import org.apache.stratos.messaging.listener.instance.status.InstanceStartedEventListener;
+import org.apache.stratos.messaging.message.receiver.instance.status.InstanceStatusEventReceiver;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventReceiver;
+import org.apache.stratos.messaging.util.MessagingUtil;
+
+import java.io.*;
+import java.net.ServerSocket;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+public class PythonTestManager {
+    protected final Properties integrationProperties = new Properties();
+    private static final Log log = LogFactory.getLog(PythonTestManager.class);
+    protected BrokerService broker = new BrokerService();
+
+    public final long TIMEOUT = 180000;
+    public static final String NEW_LINE = System.getProperty("line.separator");
+    public static final String ACTIVEMQ_AMQP_BIND_ADDRESS = "activemq.amqp.bind.address";
+    public static final String ACTIVEMQ_MQTT_BIND_ADDRESS = "activemq.mqtt.bind.address";
+    public static final String CEP_PORT = "cep.port";
+    public static final String DISTRIBUTION_NAME = "distribution.name";
+    protected final UUID PYTHON_AGENT_DIR_NAME = UUID.randomUUID();
+
+    protected List<ServerSocket> serverSocketList = new ArrayList<ServerSocket>();
+    protected Map<String, Executor> executorList = new HashMap<String, Executor>();
+
+    protected int cepPort;
+    protected String amqpBindAddress;
+    protected String mqttBindAddress;
+    protected String distributionName;
+
+    protected boolean eventReceiverInitiated = false;
+    protected TopologyEventReceiver topologyEventReceiver;
+    protected InstanceStatusEventReceiver instanceStatusEventReceiver;
+    protected boolean instanceStarted;
+    protected boolean instanceActivated;
+    protected ByteArrayOutputStreamLocal outputStream;
+
+    /**
+     * Setup method for test method testPythonCartridgeAgent
+     */
+    protected void setup(String resourcePath) {
+        try {
+            startBroker();
+        }
+        catch (Exception e) {
+            log.error("Error while starting MB", e);
+            return;
+        }
+        if (!this.eventReceiverInitiated) {
+            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 15);
+            topologyEventReceiver = new TopologyEventReceiver();
+            topologyEventReceiver.setExecutorService(executorService);
+            topologyEventReceiver.execute();
+
+            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
+            instanceStatusEventReceiver.setExecutorService(executorService);
+            instanceStatusEventReceiver.execute();
+
+            this.instanceStarted = false;
+            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
+                @Override
+                protected void onEvent(Event event) {
+                    log.info("Instance started event received");
+                    instanceStarted = true;
+                }
+            });
+
+            this.instanceActivated = false;
+            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
+                @Override
+                protected void onEvent(Event event) {
+                    log.info("Instance activated event received");
+                    instanceActivated = true;
+                }
+            });
+
+            this.eventReceiverInitiated = true;
+        }
+        // Simulate CEP server socket
+        startServerSocket(cepPort);
+        String agentPath = setupPythonAgent(resourcePath);
+        log.info("Python agent working directory name: " + PYTHON_AGENT_DIR_NAME);
+        log.info("Starting python cartridge agent...");
+        this.outputStream = executeCommand("python " + agentPath + "/agent.py > " +
+                PythonTestManager.class.getResource(File.separator).getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+                "/cartridge-agent-console.log");
+    }
+
+    protected void tearDown() {
+        tearDown(null);
+    }
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    protected void tearDown(String sourcePath) {
+        for (Map.Entry<String, Executor> entry : executorList.entrySet()) {
+            try {
+                String commandText = entry.getKey();
+                Executor executor = entry.getValue();
+                log.info("Terminating process: " + commandText);
+                executor.setExitValue(0);
+                executor.getWatchdog().destroyProcess();
+            }
+            catch (Exception ignore) {
+            }
+        }
+        for (ServerSocket serverSocket : serverSocketList) {
+            try {
+                log.info("Stopping socket server: " + serverSocket.getLocalSocketAddress());
+                serverSocket.close();
+            }
+            catch (IOException ignore) {
+            }
+        }
+
+        try {
+            log.info("Deleting source checkout folder...");
+            FileUtils.deleteDirectory(new File(sourcePath));
+        }
+        catch (Exception ignore) {
+        }
+
+        this.instanceStatusEventReceiver.terminate();
+        this.topologyEventReceiver.terminate();
+
+        this.instanceActivated = false;
+        this.instanceStarted = false;
+        // wait until everything cleans up to avoid connection errors
+        sleep(1000);
+        try {
+            broker.stop();
+        }
+        catch (Exception e) {
+            log.error("Error while stopping the broker service", e);
+        }
+    }
+
+    public PythonTestManager() {
+        try {
+            integrationProperties
+                    .load(PythonTestManager.class.getResourceAsStream("/integration-test.properties"));
+            distributionName = integrationProperties.getProperty(DISTRIBUTION_NAME);
+            amqpBindAddress = integrationProperties.getProperty(ACTIVEMQ_AMQP_BIND_ADDRESS);
+            mqttBindAddress = integrationProperties.getProperty(ACTIVEMQ_MQTT_BIND_ADDRESS);
+            cepPort = Integer.parseInt(integrationProperties.getProperty(CEP_PORT));
+            log.info("PCA integration properties: " + integrationProperties.toString());
+        }
+        catch (IOException e) {
+            log.error("Error loading integration-test.properties file from classpath. Please make sure that file " +
+                    "exists in classpath.", e);
+        }
+    }
+
+    protected void startBroker() throws Exception {
+        broker.addConnector(amqpBindAddress);
+        broker.addConnector(mqttBindAddress);
+        broker.setBrokerName("testBroker");
+        broker.setDataDirectory(
+                PythonTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME +
+                        "/activemq-data");
+        broker.start();
+        log.info("Broker service started!");
+    }
+
+    /**
+     * Start server socket
+     *
+     * @param port
+     */
+    protected void startServerSocket(final int port) {
+        Thread socketThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    ServerSocket serverSocket = new ServerSocket(port);
+                    serverSocketList.add(serverSocket);
+                    log.info("Server socket started on port: " + port);
+                    serverSocket.accept();
+                }
+                catch (IOException e) {
+                    String message = "Could not start server socket: [port] " + port;
+                    log.error(message, e);
+                    throw new RuntimeException(message, e);
+                }
+            }
+        });
+        socketThread.start();
+    }
+
+
+    protected static String getResourcesPath(String resourcesPath) {
+        return PythonTestManager.class.getResource("/").getPath() + "/../../src/test/resources" + resourcesPath;
+    }
+
+    /**
+     * Copy python agent distribution to a new folder, extract it and copy sample configuration files
+     *
+     * @return
+     */
+    protected String setupPythonAgent(String resourcesPath) {
+        try {
+            log.info("Setting up python cartridge agent...");
+
+
+            String srcAgentPath = PythonTestManager.class.getResource("/").getPath() +
+                    "/../../../distribution/target/" + distributionName + ".zip";
+            String unzipDestPath =
+                    PythonTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME + "/";
+            //FileUtils.copyFile(new File(srcAgentPath), new File(destAgentPath));
+            unzip(srcAgentPath, unzipDestPath);
+            String destAgentPath = PythonTestManager.class.getResource("/").getPath() + "/../" +
+                    PYTHON_AGENT_DIR_NAME + "/" + distributionName;
+
+            String srcAgentConfPath = getResourcesPath(resourcesPath) + "/agent.conf";
+            String destAgentConfPath = destAgentPath + "/agent.conf";
+            FileUtils.copyFile(new File(srcAgentConfPath), new File(destAgentConfPath));
+
+            String srcLoggingIniPath = getResourcesPath(resourcesPath) + "/logging.ini";
+            String destLoggingIniPath = destAgentPath + "/logging.ini";
+            FileUtils.copyFile(new File(srcLoggingIniPath), new File(destLoggingIniPath));
+
+            String srcPayloadPath = getResourcesPath(resourcesPath) + "/payload";
+            String destPayloadPath = destAgentPath + "/payload";
+            FileUtils.copyDirectory(new File(srcPayloadPath), new File(destPayloadPath));
+
+            log.info("Changing extension scripts permissions");
+            File extensionsPath = new File(destAgentPath + "/extensions/bash");
+            File[] extensions = extensionsPath.listFiles();
+            for (File extension : extensions) {
+                extension.setExecutable(true);
+            }
+
+            log.info("Python cartridge agent setup completed");
+
+            return destAgentPath;
+        }
+        catch (Exception e) {
+            String message = "Could not copy cartridge agent distribution";
+            log.error(message, e);
+            throw new RuntimeException(message, e);
+        }
+    }
+
+    private void unzip(String zipFilePath, String destDirectory) throws IOException {
+        File destDir = new File(destDirectory);
+        if (!destDir.exists()) {
+            destDir.mkdir();
+        }
+        ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
+        ZipEntry entry = zipIn.getNextEntry();
+        // iterates over entries in the zip file
+        while (entry != null) {
+            String filePath = destDirectory + File.separator + entry.getName();
+            if (!entry.isDirectory()) {
+                // if the entry is a file, extracts it
+                extractFile(zipIn, filePath);
+            } else {
+                // if the entry is a directory, make the directory
+                File dir = new File(filePath);
+                dir.mkdir();
+            }
+            zipIn.closeEntry();
+            entry = zipIn.getNextEntry();
+        }
+        zipIn.close();
+    }
+
+    private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
+        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
+        byte[] bytesIn = new byte[4096];
+        int read = 0;
+        while ((read = zipIn.read(bytesIn)) != -1) {
+            bos.write(bytesIn, 0, read);
+        }
+        bos.close();
+    }
+
+    /**
+     * Execute shell command
+     *
+     * @param commandText
+     */
+    protected ByteArrayOutputStreamLocal executeCommand(final String commandText) {
+        final ByteArrayOutputStreamLocal outputStream = new ByteArrayOutputStreamLocal();
+        try {
+            CommandLine commandline = CommandLine.parse(commandText);
+            DefaultExecutor exec = new DefaultExecutor();
+            PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
+            exec.setWorkingDirectory(new File(
+                    PythonTestManager.class.getResource("/").getPath() + "/../" + PYTHON_AGENT_DIR_NAME));
+            exec.setStreamHandler(streamHandler);
+            ExecuteWatchdog watchdog = new ExecuteWatchdog(TIMEOUT);
+            exec.setWatchdog(watchdog);
+            exec.execute(commandline, new ExecuteResultHandler() {
+                @Override
+                public void onProcessComplete(int i) {
+                    log.info(commandText + " process completed");
+                }
+
+                @Override
+                public void onProcessFailed(ExecuteException e) {
+                    log.error(commandText + " process failed", e);
+                }
+            });
+            executorList.put(commandText, exec);
+            return outputStream;
+        }
+        catch (Exception e) {
+            log.error(outputStream.toString(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Sleep current thread
+     *
+     * @param time
+     */
+    protected void sleep(long time) {
+        try {
+            Thread.sleep(time);
+        }
+        catch (InterruptedException ignore) {
+        }
+    }
+
+    /**
+     * Return new lines found in the output
+     *
+     * @param currentOutputLines current output lines
+     * @param output             output
+     * @return
+     */
+    protected List<String> getNewLines(List<String> currentOutputLines, String output) {
+        List<String> newLines = new ArrayList<String>();
+
+        if (StringUtils.isNotBlank(output)) {
+            String[] lines = output.split(NEW_LINE);
+            for (String line : lines) {
+                if (!currentOutputLines.contains(line)) {
+                    currentOutputLines.add(line);
+                    newLines.add(line);
+                }
+            }
+        }
+        return newLines;
+    }
+
+    /**
+     * Publish messaging event
+     *
+     * @param event
+     */
+    protected void publishEvent(Event event) {
+        String topicName = MessagingUtil.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool.getPublisher(topicName);
+        eventPublisher.publish(event);
+    }
+
+
+    /**
+     * Implements ByteArrayOutputStream.isClosed() method
+     */
+    protected class ByteArrayOutputStreamLocal extends org.apache.commons.io.output.ByteArrayOutputStream {
+        private boolean closed;
+
+        @Override
+        public void close() throws IOException {
+            super.close();
+            closed = true;
+        }
+
+        public boolean isClosed() {
+            return closed;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java
new file mode 100755
index 0000000..36a8cd5
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/StartUpTest.java
@@ -0,0 +1,171 @@
+/*
+ * 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.python.cartridge.agent.test;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertTrue;
+
+public class StartUpTest extends PythonTestManager {
+    private static final Log log = LogFactory.getLog(StartUpTest.class);
+    private static final int STARTUP_TIMEOUT = 30000;
+    private static final String RESOURCES_PATH = "/suite-1";
+    private static final String CLUSTER_ID = "php.php.domain";
+    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-1";
+    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-1";
+    private static final String APP_ID = "application-1";
+    private static final String MEMBER_ID = "php.member-1";
+    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+    private static final String NETWORK_PARTITION_ID = "network-partition-1";
+    private static final String PARTITION_ID = "partition-1";
+    private static final String TENANT_ID = "-1234";
+    private static final String SERVICE_NAME = "php";
+    private static final String SOURCE_PATH = "/tmp/stratos-pca-startup-test-app-path/";
+
+
+    @BeforeSuite
+    public void setupStartUpTest() {
+        // Set jndi.properties.dir system property for initializing event publishers and receivers
+        System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
+
+        // start Python agent with configurations provided in resource path
+        setup(RESOURCES_PATH);
+    }
+
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    @AfterSuite
+    public void tearDownStartUpTest() {
+        tearDown();
+    }
+
+    @Test(timeOut = STARTUP_TIMEOUT)
+    public void testPythonCartridgeAgent() {
+        Thread communicatorThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (!eventReceiverInitiated) {
+                    sleep(2000);
+                }
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Exception in thread") || line.contains("ERROR")) {
+                                try {
+                                    throw new RuntimeException(line);
+                                }
+                                catch (Exception e) {
+                                    log.error("ERROR found in PCA log", e);
+                                }
+                            }
+                            if (line.contains("Subscribed to 'topology/#'")) {
+                                sleep(2000);
+                                // Send complete topology event
+                                log.info("Publishing complete topology event...");
+                                Topology topology = createTestTopology();
+                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+                                publishEvent(completeTopologyEvent);
+                                log.info("Complete topology event published");
+
+                                // Publish member initialized event
+                                log.info("Publishing member initialized event...");
+                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+                                        PARTITION_ID
+                                );
+                                publishEvent(memberInitializedEvent);
+                                log.info("Member initialized event published");
+
+                                // Simulate server socket
+                                startServerSocket(8080);
+                            }
+                            /*
+                            if (line.contains("Artifact repository found")) {
+                                // Send artifact updated event
+                                ArrayList<ArtifactUpdatedEvent> list = getArtifactUpdatedEventsAsParams();
+                                for (ArtifactUpdatedEvent artifactUpdatedEvent : list) {
+                                    publishEvent(artifactUpdatedEvent);
+                                }
+                            }*/
+                            log.info(line);
+                        }
+                    }
+                    sleep(100);
+                }
+            }
+        });
+
+        communicatorThread.start();
+
+        while (!instanceActivated) {
+            // wait until the instance activated event is received.
+            sleep(2000);
+        }
+
+        assertTrue("Instance started event was not received", instanceStarted);
+        assertTrue("Instance activated event was not received", instanceActivated);
+    }
+
+
+    /**
+     * Create test topology
+     *
+     * @return
+     */
+    private Topology createTestTopology() {
+        Topology topology = new Topology();
+        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+        topology.addService(service);
+
+        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+                AUTOSCALING_POLICY_NAME, APP_ID);
+        service.addCluster(cluster);
+
+        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+                System.currentTimeMillis());
+
+        member.setDefaultPrivateIP("10.0.0.1");
+        member.setDefaultPublicIP("20.0.0.1");
+        Properties properties = new Properties();
+        properties.setProperty("prop1", "value1");
+        member.setProperties(properties);
+        member.setStatus(MemberStatus.Created);
+        cluster.addMember(member);
+
+        return topology;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
index a13f950..35e60e3 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing1.xml
@@ -23,7 +23,7 @@
 <suite name="PythonCartridgeAgentIntegrationSuite1">
     <test name="PCATest">
         <classes>
-            <class name="org.apache.stratos.python.cartridge.agent.test.PythonCartridgeAgentTest"/>
+            <class name="org.apache.stratos.python.cartridge.agent.test.StartUpTest"/>
         </classes>
     </test>
 </suite>

http://git-wip-us.apache.org/repos/asf/stratos/blob/bbfa6c5b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
index 136433d..dc34a1f 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-1/agent.conf
@@ -40,7 +40,7 @@ monitoring.server.secure.port         =7712
 monitoring.server.admin.username      =admin
 monitoring.server.admin.password      =admin
 #log.file.paths                        =/home/chamilad/dev/wso2esb-4.8.1/repository/logs/wso2carbon.log
-log.file.paths                        =/tmp/agent.screen.log
+log.file.paths                        =/tmp/agent.screen-startup-test.log
 metadata.service.url                  =https://localhost:9443
 super.tenant.repository.path          =/repository/deployment/server/
 tenant.repository.path                =/repository/tenants/
\ No newline at end of file


[21/50] [abbrv] stratos git commit: Fixing health stat publisher in PCA, adding MT app integration test to PCA

Posted by ra...@apache.org.
Fixing health stat publisher in PCA, adding MT app integration test to PCA


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/64368325
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/64368325
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/64368325

Branch: refs/heads/master
Commit: 643683259d1b240ed594c27c6ad013f655c32fcb
Parents: 6ed9bf6
Author: Akila Perera <ra...@gmail.com>
Authored: Fri Aug 28 18:37:29 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Fri Aug 28 18:38:14 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/modules/databridge/agent.py |    2 +-
 .../modules/databridge/thrift/publisher.py      |    6 +-
 .../integration/cartridge-agent.log             | 3372 ++++++++++++++++++
 .../python-cartridge-agent/integration/pom.xml  |   20 +-
 .../test/ADCMTAppTest.java                      |  213 ++
 .../python.cartridge.agent/test/ADCTest.java    |  138 +-
 .../test/AgentStartupTest.java                  |  149 +
 .../test/PythonAgentTestManager.java            |  455 +++
 .../test/PythonTestManager.java                 |  411 ---
 .../test/StartUpTest.java                       |  171 -
 .../src/test/resources/pca-testing1.xml         |    2 +-
 .../src/test/resources/pca-testing3.xml         |   29 +
 .../src/test/resources/suite-1/agent.conf       |    3 +-
 .../src/test/resources/suite-2/agent.conf       |    3 +-
 .../src/test/resources/suite-3/agent.conf       |   45 +
 .../src/test/resources/suite-3/jndi.properties  |   22 +
 .../src/test/resources/suite-3/logging.ini      |   52 +
 .../resources/suite-3/payload/launch-params     |    2 +
 18 files changed, 4422 insertions(+), 673 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
index a17a589..533cf20 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
@@ -142,7 +142,7 @@ class ThriftPublisher(Thread):
         except ValueError:
             raise RuntimeError("Port number for Thrift Publisher is invalid: %r" % port)
 
-        self.__publisher = Publisher(ip, port_number)
+        self.__publisher = Publisher(ip, port_number, stream_definition)
         #self.__publisher.defineStream(str(stream_definition))
         self.stream_definition = stream_definition
         self.stream_id = self.__publisher.streamId

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
index ea87718..e607d1b 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
@@ -31,7 +31,7 @@ from thrift.protocol import TBinaryProtocol
 class Publisher:
     client = None
 
-    def __init__(self, ip, port):
+    def __init__(self, ip, port, stream_definition):
         # Make SSL socket
         self.socket = TSSLSocket.TSSLSocket(ip, port, False)
         # Buffering is critical. Raw sockets are very slow
@@ -40,8 +40,7 @@ class Publisher:
         self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)
         self.sessionId = None
         self.streamId = None
-
-        # self.event_num = 0
+        self.streamDef = stream_definition
 
     def connect(self, username, password):
         # Create a client to use the protocol encoder
@@ -51,6 +50,7 @@ class Publisher:
         self.socket.open()
         self.transport.open()
         self.sessionId = Publisher.client.connect(username, password)
+        self.streamId = Publisher.client.defineStream(self.sessionId, self.streamDef)
 
     def defineStream(self, streamDef):
         # Create Stream Definition


[27/50] [abbrv] stratos git commit: Fixes STRATOS-1532: Kub cluster update

Posted by ra...@apache.org.
Fixes STRATOS-1532: Kub cluster update


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/8a36db5f
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/8a36db5f
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/8a36db5f

Branch: refs/heads/master
Commit: 8a36db5fdbc25113b4ac2d4b67f0dbb0a2c6dadc
Parents: dee118b
Author: Akila Perera <ra...@gmail.com>
Authored: Sat Aug 29 01:20:37 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Aug 29 01:20:37 2015 +0530

----------------------------------------------------------------------
 .../stratos/cloud/controller/context/CloudControllerContext.java | 4 ++++
 .../controller/services/impl/CloudControllerServiceImpl.java     | 1 +
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/8a36db5f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
index 708a24b..964dd73 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/context/CloudControllerContext.java
@@ -512,6 +512,10 @@ public class CloudControllerContext implements Serializable {
                 kubernetesClusterContext.getKubernetesClusterId(), kubernetesClusterContext);
     }
 
+    public void removeKubernetesClusterContext(String kubernetesClusterId){
+        kubClusterIdToKubClusterContextMap.remove(kubernetesClusterId);
+    }
+
     /**
      * Remove a registered Kubernetes cluster from registry
      */

http://git-wip-us.apache.org/repos/asf/stratos/blob/8a36db5f/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
index 55e70db..f1615c5 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
@@ -1305,6 +1305,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
             }
             // Remove entry from information model
             CloudControllerContext.getInstance().removeKubernetesCluster(kubernetesClusterId);
+            CloudControllerContext.getInstance().removeKubernetesClusterContext(kubernetesClusterId);
 
             if (log.isInfoEnabled()) {
                 log.info(String.format("Kubernetes cluster removed successfully: [id] %s", kubernetesClusterId));


[31/50] [abbrv] stratos git commit: Fixing pom modules structure. Make it consistent

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/src/main/license/LICENSE
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/license/LICENSE b/products/stratos-cli/modules/distribution/src/main/license/LICENSE
new file mode 100644
index 0000000..fa362b0
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/src/main/license/LICENSE
@@ -0,0 +1,836 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+
+===================================================================================
+The Apache Stratos distribution includes a number of run time dependencies with 
+separate copyright notices and license terms. Your use of the Apache Stratos code
+is subject to the terms and conditions of the following licenses.
+===================================================================================
+
+===============================================================================
+The following components come under Apache Software License 2.0
+===============================================================================
+
+For abdera-1.0.0.wso2v3.jar,
+activemq-client-5.10.0.jar,
+ant-1.7.0.jar,
+ant-1.7.0.wso2v1.jar,
+ant-launcher-1.7.0.jar,
+axiom-1.2.11.wso2v4.jar,
+axiom-api-1.2.11.jar,
+axiom-impl-1.2.11.jar,
+axis2-1.6.1.wso2v10.jar,
+axis2-client-1.6.1.wso2v10.jar,
+axis2-json-1.6.1.wso2v10.jar,
+commons-beanutils-1.8.3.jar,
+commons-cli-1.2.jar,
+commons-codec-1.2.jar,
+commons-codec-1.3.0.wso2v1.jar,
+commons-collections-3.2.0.wso2v1.jar,
+commons-collections-3.2.1.jar,
+commons-configuration-1.9.jar,
+commons-dbcp-1.4.0.wso2v1.jar,
+commons-digester-1.8.jar,
+commons-fileupload-1.2.0.wso2v1.jar,
+commons-httpclient-3.0.1.jar,
+commons-httpclient-3.1.0.wso2v1.jar,
+commons-io-2.0.0.wso2v2.jar,
+commons-io-2.0.jar,
+commons-lang-2.6.0.wso2v1.jar,
+commons-lang3-3.3.1.jar,
+commons-logging-1.0.3.jar,
+commons-pool-1.5.6.jar,
+commons-pool-1.5.6.wso2v1.jar,
+commons-validator-1.4.0.jar,
+geronimo-activation_1.1_spec-1.0.2.jar,
+geronimo-j2ee-management_1.1_spec-1.0.1.jar,
+geronimo-javamail_1.4_spec-1.6.jar,
+geronimo-jms_1.1_spec-1.1.jar,
+geronimo-stax-api_1.0_spec-1.0.1.jar,
+geronimo-stax-api_1.0_spec-1.0.1.wso2v1.jar,
+gson-2.2.4.jar,
+hawtbuf-1.10.jar,
+hazelcast-3.0.1.jar,
+hazelcast-3.0.1.wso2v1.jar,
+httpclient-4.1.1-wso2v1.jar,
+httpclient-4.3.3.jar,
+httpcore-4.3.0.wso2v1.jar,
+httpcore-4.3.2.jar,
+java-xmlbuilder-0.6.jar,
+javax.cache.wso2-4.2.0.jar,
+javax.servlet-3.0.0.v201112011016.jar,
+jdbc-pool-7.0.34.wso2v1.jar,
+json-2.0.0.wso2v1.jar,
+libthrift-0.7.wso2v1.jar,
+neethi-2.0.4.wso2v4.jar,
+not-yet-commons-ssl-0.3.9.jar,
+opencsv-1.8.wso2v1.jar,
+org.apache.log4j-1.2.13.v200706111418.jar,
+org.apache.stratos.autoscaler.service.stub-4.1.2.jar,
+org.apache.stratos.cli-4.1.2.jar,
+org.apache.stratos.cloud.controller.service.stub-4.1.2.jar,
+org.apache.stratos.common-4.1.2.jar,
+org.apache.stratos.manager-4.1.2.jar,
+org.apache.stratos.manager.service.stub-4.1.2.jar,
+org.apache.stratos.messaging-4.1.2.jar,
+org.eclipse.equinox.http.helper-1.1.0.wso2v1.jar,
+org.eclipse.osgi-3.8.1.v20120830-144521.jar,
+org.eclipse.osgi.services-3.3.100.v20120522-1822.jar,
+org.wso2.carbon.admin.mgt-4.2.0.jar,
+org.wso2.carbon.authenticator.proxy-4.2.0.jar,
+org.wso2.carbon.authenticator.stub-4.2.0.jar,
+org.wso2.carbon.base-4.2.0.jar,
+org.wso2.carbon.bootstrap-4.2.0.jar,
+org.wso2.carbon.captcha.mgt-4.2.0.jar,
+org.wso2.carbon.core-4.2.0.jar,
+org.wso2.carbon.core.common-4.2.0.jar,
+org.wso2.carbon.databridge.agent.thrift-4.2.0.jar,
+org.wso2.carbon.databridge.commons-4.2.0.jar,
+org.wso2.carbon.databridge.commons.thrift-4.2.0.jar,
+org.wso2.carbon.email.verification-4.2.0.jar,
+org.wso2.carbon.logging-4.2.0.jar,
+org.wso2.carbon.ndatasource.common-4.2.0.jar,
+org.wso2.carbon.ndatasource.rdbms-4.2.0.jar,
+org.wso2.carbon.ntask.common-4.2.0.jar,
+org.wso2.carbon.ntask.core-4.2.0.jar,
+org.wso2.carbon.queuing-4.2.0.jar,
+org.wso2.carbon.registry.api-4.2.0.jar,
+org.wso2.carbon.registry.core-4.2.0.jar,
+org.wso2.carbon.registry.xboot-4.2.0.jar,
+org.wso2.carbon.remote-tasks.stub-4.2.0.jar,
+org.wso2.carbon.securevault-4.2.0.jar,
+org.wso2.carbon.stratos.common-2.2.0.jar,
+org.wso2.carbon.tenant.mgt-2.2.2.jar,
+org.wso2.carbon.tenant.mgt.core-2.2.0.jar,
+org.wso2.carbon.um.ws.api-4.2.0.jar,
+org.wso2.carbon.um.ws.api.stub-4.2.0.jar,
+org.wso2.carbon.user.api-4.2.0.jar,
+org.wso2.carbon.user.core-4.2.0.jar,
+org.wso2.carbon.user.mgt-4.2.0.jar,
+org.wso2.carbon.user.mgt.common-4.2.0.jar,
+org.wso2.carbon.utils-4.2.0.jar,
+org.wso2.securevault-1.0.0-wso2v2.jar,
+poi-3.9.jar,
+poi-ooxml-3.9.0.wso2v1.jar,
+poi-ooxml-3.9.jar,
+poi-ooxml-schemas-3.9.jar,
+poi-scratchpad-3.9.0.wso2v1.jar,
+poi-scratchpad-3.9.jar,
+quartz-2.1.1.jar,
+quartz-2.1.1.wso2v1.jar,
+rampart-core-1.6.1.wso2v9.jar,
+rampart-policy-1.6.1.wso2v9.jar,
+smack-3.0.4.wso2v1.jar,
+smackx-3.0.4.wso2v1.jar,
+stax-api-1.0.1.jar,
+tomcat-annotations-api-7.0.34.jar,
+tomcat-api-7.0.34.jar,
+tomcat-catalina-7.0.34.jar,
+tomcat-catalina-ha-7.0.34.jar,
+tomcat-ha-7.0.34.wso2v1.jar,
+tomcat-jdbc-7.0.34.jar,
+tomcat-juli-7.0.34.jar,
+tomcat-tribes-7.0.34.jar,
+tomcat-util-7.0.34.jar,
+woden-1.0.0.M8-wso2v1.jar,
+wss4j-1.5.11.wso2v3.jar,
+wss4j-1.5.11.wso2v3.jar,
+wstx-asl-3.2.9.jar,
+xml-apis-1.0.b2.jar,
+xmlbeans-2.3.0.jar,
+XmlSchema-1.4.7.wso2v2.jar
+
+
+====================================================================== 
+The following components are CDDL based License 
+======================================================================
+
+For :   wsdl4j-1.6.2.wso2v4.jar
+
+
+    COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+    1. Definitions.
+
+    1.1. Contributor means each individual or entity that creates or
+    contributes to the creation of Modifications.
+
+    1.2. Contributor Version means the combination of the Original Software,
+    prior Modifications used by a Contributor (if any), and the Modifications
+    made by that particular Contributor.
+
+    1.3. Covered Software means (a) the Original Software, or
+    (b) Modifications, or (c) the combination of files containing Original
+    Software with files containing Modifications, in each case including
+    portions thereof.
+
+    1.4. Executable means the Covered Software in any form other than Source
+    Code.
+
+    1.5. Initial Developer means the individual or entity that first makes
+    Original Software available under this License.
+
+    1.6. Larger Work means a work which combines Covered Software or portions
+    thereof with code not governed by the terms of this License.
+
+    1.7. License means this document.
+
+    1.8. Licensable means having the right to grant, to the maximum extent
+    possible, whether at the time of the initial grant or subsequently
+    acquired, any and all of the rights conveyed herein.
+
+    1.9. Modifications means the Source Code and Executable form of any of
+    the following: A. Any file that results from an addition to, deletion
+    from or modification of the contents of a file containing Original
+    Software or previous Modifications; B. Any new file that contains any
+    part of the Original Software or previous Modification; or C. Any new
+    file that is contributed or otherwise made available under the terms of
+    this License.
+
+    1.10. Original Software means the Source Code and Executable form of
+    computer software code that is originally released under this License.
+
+    1.11. Patent Claims means any patent claim(s), now owned or hereafter
+    acquired, including without limitation, method, process, and apparatus
+    claims, in any patent Licensable by grantor.
+
+    1.12. Source Code means (a) the common form of computer software code in
+    which modifications are made and (b) associated documentation included in
+    or with such code.
+
+    1.13. You (or Your) means an individual or a legal entity exercising
+    rights under, and complying with all of the terms of, this License. For
+    legal entities, You includes any entity which controls, is controlled by,
+    or is under common control with You. For purposes of this definition,
+    control means (a) the power, direct or indirect, to cause the direction
+    or management of such entity, whether by contract or otherwise, or
+    (b) ownership of more than fifty percent (50%) of the outstanding shares
+    or beneficial ownership of such entity.
+
+    2. License Grants.
+
+    2.1. The Initial Developer Grant. Conditioned upon Your compliance with
+    Section 3.1 below and subject to third party intellectual property
+    claims, the Initial Developer hereby grants You a world-wide,
+    royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or trademark)
+        Licensable by Initial Developer, to use, reproduce, modify, display,
+        perform, sublicense and distribute the Original Software (or portions
+        thereof), with or without Modifications, and/or as part of a Larger
+        Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling of
+        Original Software, to make, have made, use, practice, sell, and offer
+        for sale, and/or otherwise dispose of the Original Software (or
+        portions thereof);
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective on the
+        date Initial Developer first distributes or otherwise makes the
+        Original Software available to a third party under the terms of
+        this License;
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is granted:
+        (1) for code that You delete from the Original Software, or (2) for
+        infringements caused by: (i) the modification of the Original
+        Software, or (ii) the combination of the Original Software with other
+        software or devices.
+
+    2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1
+    below and subject to third party intellectual property claims, each
+    Contributor hereby grants You a world-wide, royalty-free, non-exclusive
+    license:
+
+    (a) under intellectual property rights (other than patent or trademark)
+        Licensable by Contributor to use, reproduce, modify, display, perform,
+        sublicense and distribute the Modifications created by such
+        Contributor (or portions thereof), either on an unmodified basis,
+        with other Modifications, as Covered Software and/or as part of a
+        Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling of
+        Modifications made by that Contributor either alone and/or in
+        combination with its Contributor Version (or portions of such
+        combination), to make, use, sell, offer for sale, have made, and/or
+        otherwise dispose of: (1) Modifications made by that Contributor (or
+        portions thereof); and (2) the combination of Modifications made by
+        that Contributor with its Contributor Version (or portions of such
+        combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on
+        the date Contributor first distributes or otherwise makes the
+        Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is granted:
+        (1) for any code that Contributor has deleted from the Contributor
+        Version; (2) for infringements caused by: (i) third party
+        modifications of Contributor Version, or (ii) the combination of
+        Modifications made by that Contributor with other software (except
+        as part of the Contributor Version) or other devices; or (3) under
+        Patent Claims infringed by Covered Software in the absence of
+        Modifications made by that Contributor.
+
+    3. Distribution Obligations.
+
+    3.1. Availability of Source Code. Any Covered Software that You distribute
+    or otherwise make available in Executable form must also be made available
+    in Source Code form and that Source Code form must be distributed only
+    under the terms of this License. You must include a copy of this License
+    with every copy of the Source Code form of the Covered Software You
+    distribute or otherwise make available. You must inform recipients of any
+    such Covered Software in Executable form as to how they can obtain such
+    Covered Software in Source Code form in a reasonable manner on or through
+    a medium customarily used for software exchange.
+
+    3.2. Modifications. The Modifications that You create or to which You
+    contribute are governed by the terms of this License. You represent that
+    You believe Your Modifications are Your original creation(s) and/or You
+    have sufficient rights to grant the rights conveyed by this License.
+
+    3.3. Required Notices. You must include a notice in each of Your
+    Modifications that identifies You as the Contributor of the Modification.
+    You may not remove or alter any copyright, patent or trademark notices
+    contained within the Covered Software, or any notices of licensing or any
+    descriptive text giving attribution to any Contributor or the Initial
+    Developer.
+
+    3.4. Application of Additional Terms. You may not offer or impose any
+    terms on any Covered Software in Source Code form that alters or restricts
+    the applicable version of this License or the recipients rights hereunder.
+    You may choose to offer, and to charge a fee for, warranty, support,
+    indemnity or liability obligations to one or more recipients of Covered
+    Software. However, you may do so only on Your own behalf, and not on
+    behalf of the Initial Developer or any Contributor. You must make it
+    absolutely clear that any such warranty, support, indemnity or liability
+    obligation is offered by You alone, and You hereby agree to indemnify the
+    Initial Developer and every Contributor for any liability incurred by the
+    Initial Developer or such Contributor as a result of warranty, support,
+    indemnity or liability terms You offer.
+
+    3.5. Distribution of Executable Versions. You may distribute the
+    Executable form of the Covered Software under the terms of this License or
+    under the terms of a license of Your choice, which may contain terms
+    different from this License, provided that You are in compliance with the
+    terms of this License and that the license for the Executable form does
+    not attempt to limit or alter the recipients rights in the Source Code
+    form from the rights set forth in this License. If You distribute the
+    Covered Software in Executable form under a different license, You must
+    make it absolutely clear that any terms which differ from this License
+    are offered by You alone, not by the Initial Developer or Contributor.
+    You hereby agree to indemnify the Initial Developer and every Contributor
+    for any liability incurred by the Initial Developer or such Contributor as
+    a result of any such terms You offer.
+
+    3.6. Larger Works. You may create a Larger Work by combining Covered
+    Software with other code not governed by the terms of this License and
+    distribute the Larger Work as a single product. In such a case, You must
+    make sure the requirements of this License are fulfilled for the Covered
+    Software.
+
+    4. Versions of the License.
+
+    4.1. New Versions. Sun Microsystems, Inc. is the initial license steward
+    and may publish revised and/or new versions of this License from time to
+    time. Each version will be given a distinguishing version number. Except
+    as provided in Section 4.3, no one other than the license steward has the
+    right to modify this License.
+
+    4.2. Effect of New Versions. You may always continue to use, distribute
+    or otherwise make the Covered Software available under the terms of the
+    version of the License under which You originally received the Covered
+    Software. If the Initial Developer includes a notice in the Original
+    Software prohibiting it from being distributed or otherwise made
+    available under any subsequent version of the License, You must
+    distribute and make the Covered Software available under the terms of
+    the version of the License under which You originally received the
+    Covered Software. Otherwise, You may also choose to use, distribute or
+    otherwise make the Covered Software available under the terms of any
+    subsequent version of the License published by the license steward.
+
+    4.3. Modified Versions. When You are an Initial Developer and You want
+    to create a new license for Your Original Software, You may create and
+    use a modified version of this License if You: (a) rename the license and
+    remove any references to the name of the license steward (except to note
+    that the license differs from this License); and (b) otherwise make it
+    clear that the license contains terms which differ from this License.
+
+    5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE
+    ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+    IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
+    SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
+    OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
+    THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE
+    DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
+    CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+    CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF
+    THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER
+    EXCEPT UNDER THIS DISCLAIMER.
+
+    6. TERMINATION.
+
+    6.1. This License and the rights granted hereunder will terminate
+    automatically if You fail to comply with terms herein and fail to cure
+    such breach within 30 days of becoming aware of the breach. Provisions
+    which, by their nature, must remain in effect beyond the termination of
+    this License shall survive.
+
+    6.2. If You assert a patent infringement claim (excluding declaratory
+    judgment actions) against Initial Developer or a Contributor (the Initial
+    Developer or Contributor against whom You assert such claim is referred
+    to as Participant) alleging that the Participant Software (meaning the
+    Contributor Version where the Participant is a Contributor or the
+    Original Software where the Participant is the Initial Developer)
+    directly or indirectly infringes any patent, then any and all rights
+    granted directly or indirectly to You by such Participant, the Initial
+    Developer (if the Initial Developer is not the Participant) and all
+    Contributors under Sections 2.1 and/or 2.2 of this License shall, upon
+    60 days notice from Participant terminate prospectively and automatically
+    at the expiration of such 60 day notice period, unless if within such
+    60 day period You withdraw Your claim with respect to the Participant
+    Software against such Participant either unilaterally or pursuant to a
+    written agreement with Participant.
+
+    6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+    user licenses that have been validly granted by You or any distributor
+    hereunder prior to termination (excluding licenses granted to You by any
+    distributor) shall survive termination.
+
+    7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
+    THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
+    YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
+    COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY
+    PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF
+    ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS,
+    LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY
+    AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
+    BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+    LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+    RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+    PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
+    OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
+    AND LIMITATION MAY NOT APPLY TO YOU.
+
+    8. U.S. GOVERNMENT END USERS. The Covered Software is a commercial item,
+    as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
+    commercial computer software (as that term is defined at 48 C.F.R.
+    252.227-7014(a)(1)) and commercial computer software documentation as such
+    terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
+    12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
+    Government End Users acquire Covered Software with only those rights set
+    forth herein. This U.S. Government Rights clause is in lieu of, and
+    supersedes, any other FAR, DFAR, or other clause or provision that
+    addresses Government rights in computer software under this License.
+
+    9. MISCELLANEOUS. This License represents the complete agreement
+    concerning subject matter hereof. If any provision of this License is
+    held to be unenforceable, such provision shall be reformed only to the
+    extent necessary to make it enforceable. This License shall be governed
+    by the law of the jurisdiction specified in a notice contained within
+    the Original Software (except to the extent applicable law, if any,
+    provides otherwise), excluding such jurisdictions conflict-of-law
+    provisions. Any litigation relating to this License shall be subject to
+    the jurisdiction of the courts located in the jurisdiction and venue
+    specified in a notice contained within the Original Software, with the
+    losing party responsible for costs, including, without limitation, court
+    costs and reasonable attorneys fees and expenses. The application of the
+    United Nations Convention on Contracts for the International Sale of
+    Goods is expressly excluded. Any law or regulation which provides that
+    the language of a contract shall be construed against the drafter shall
+    not apply to this License. You agree that You alone are responsible for
+    compliance with the United States export administration regulations (and
+    the export control laws and regulation of any other countries) when You
+    use, distribute or otherwise make available any Covered Software.
+
+    10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the
+    Contributors, each party is responsible for claims and damages arising,
+    directly or indirectly, out of its utilization of rights under this
+    License and You agree to work with Initial Developer and Contributors
+    to distribute such responsibility on an equitable basis. Nothing herein
+    is intended or shall be deemed to constitute any admission of liability.
+
+    NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
+    LICENSE (CDDL) The code released under the CDDL shall be governed by the
+    laws of the State of California (excluding conflict-of-law provisions).
+    Any litigation relating to this License shall be subject to the
+    jurisdiction of the Federal Courts of the Northern District of California
+    and the state courts of the State of California, with venue lying in
+    Santa Clara County, California.
+
+==============================================================================
+
+For :   log4j-1.2.14.jar,
+slf4j-api-1.7.6.jar,
+slf4j-log4j12-1.7.6.jar
+
+
+ All rights reserved.
+
+ Permission is hereby granted, free  of charge, to any person obtaining
+ a  copy  of this  software  and  associated  documentation files  (the
+ "Software"), to  deal in  the Software without  restriction, including
+ without limitation  the rights to  use, copy, modify,  merge, publish,
+ distribute,  sublicense, and/or sell  copies of  the Software,  and to
+ permit persons to whom the Software  is furnished to do so, subject to
+ the following conditions:
+ 
+ The  above  copyright  notice  and  this permission  notice  shall  be
+ included in all copies or substantial portions of the Software.
+ 
+ THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+ EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+ MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+==============================================================================
+For :   jline:2.11
+
+Copyright (c) 2002-2006, Marc Prud'hommeaux <mw...@cornell.edu>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with
+the distribution.
+
+Neither the name of JLine nor the names of its contributors
+may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+===============================================================================
+The following components are licensed under EPL
+=============================================================================== 
+
+For c3p0-0.9.1.1.jar
+
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+
+===============================================================================
+The following components are Licensed under BSD license
+===============================================================================
+
+For dom4j-1.6.1.jar
+
+[The BSD License]
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+ * Neither the name of JiBX nor the names of its contributors may be used
+   to endorse or promote products derived from this software without specific
+   prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/modules/distribution/src/main/notice/NOTICE
----------------------------------------------------------------------
diff --git a/products/stratos-cli/modules/distribution/src/main/notice/NOTICE b/products/stratos-cli/modules/distribution/src/main/notice/NOTICE
new file mode 100644
index 0000000..073b0f0
--- /dev/null
+++ b/products/stratos-cli/modules/distribution/src/main/notice/NOTICE
@@ -0,0 +1,85 @@
+Apache Stratos CLI
+Copyright 2015 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+===============================================================================
+Apache Axiom Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+	
+Please read the different LICENSE files present in the licenses directory of
+this distribution.
+
+===============================================================================
+Apache Axis2 Notice:
+
+Portions Copyright 2006 International Business Machines Corp.
+Portions Copyright 2005-2007 WSO2, Inc.
+
+This product also includes schemas and specification developed by:
+- the W3C consortium (http://www.w3c.org)
+
+This product also includes WS-* schemas developed by International
+Business Machines Corporation, Microsoft Corporation, BEA Systems, 
+TIBCO Software, SAP AG, Sonic Software, and VeriSign
+
+This product also includes a WSDL developed by salesforce.com
+- Copyright 1999-2006 salesforce.com, inc.
+
+Portions of the included xmlbeans library were originally based on the following:
+- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
+
+Please read the different LICENSE files present in the lib directory of
+this distribution.
+
+===============================================================================
+Apache Commons Codec Notice:
+
+--------------------------------------------------------------------------------
+src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java contains 
+test data from http://aspell.sourceforge.net/test/batch0.tab.
+
+Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org). Verbatim copying
+and distribution of this entire article is permitted in any medium,
+provided this notice is preserved.
+--------------------------------------------------------------------------------
+
+===============================================================================
+Apache HttpComponents Client Notice:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+===============================================================================
+Apache Neethi Notice:
+
+This product is tested with testcases developed at W3C under the license:
+http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
+The source distribution of this product includes those testcases.
+
+
+===============================================================================
+SLF4J Notice:
+
+This product contains a modified portion of 'SLF4J', a simple logging
+facade for Java, which can be obtained at:
+
+  * LICENSE:
+    * license/LICENSE.slf4j.txt (MIT License)
+  * HOMEPAGE:
+    * http://www.slf4j.org/
+
+===============================================================================
+Woodstox Notice:
+
+This product currently only contains code developed by authors
+of specific components, as identified by the source code files.
+
+Since product implements StAX API, it has dependencies to StAX API
+classes.
+
+For additional credits (generally to people who reported problems)
+see CREDITS file.
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/d97d9c78/products/stratos-cli/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos-cli/pom.xml b/products/stratos-cli/pom.xml
index 341b304..539ea6b 100644
--- a/products/stratos-cli/pom.xml
+++ b/products/stratos-cli/pom.xml
@@ -33,6 +33,6 @@
     <description>Apache Stratos CLI</description>
 
     <modules>
-        <module>distribution</module>
+        <module>modules/distribution</module>
     </modules>
-</project>
\ No newline at end of file
+</project>


[05/50] [abbrv] stratos git commit: Removing hard coded agent properties

Posted by ra...@apache.org.
Removing hard coded agent properties


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/3df27e0b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/3df27e0b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/3df27e0b

Branch: refs/heads/master
Commit: 3df27e0b2fcef14fa0b6aa2d5a6c35436dad40b9
Parents: 282dd23
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 14:53:05 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 14:53:05 2015 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.cartridge.agent/pom.xml  |  2 --
 .../agent/test/JavaCartridgeAgentTest.java      | 23 ++++++++++++++++----
 .../test/resources/test-conf/test.properties    | 20 +++++++++++++++++
 pom.xml                                         |  3 +++
 .../modules/distribution/pom.xml                |  5 +++--
 .../distribution/src/main/assembly/bin.xml      |  1 -
 .../python-cartridge-agent/distribution/pom.xml |  3 ++-
 .../distribution/src/main/assembly/bin.xml      |  6 +++--
 8 files changed, 51 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/components/org.apache.stratos.cartridge.agent/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/pom.xml b/components/org.apache.stratos.cartridge.agent/pom.xml
index 4f094e2..accad57 100644
--- a/components/org.apache.stratos.cartridge.agent/pom.xml
+++ b/components/org.apache.stratos.cartridge.agent/pom.xml
@@ -30,7 +30,6 @@
     <packaging>jar</packaging>
     <name>Apache Stratos - Cartridge Agent</name>
     <description>Apache Stratos Cartridge Agent</description>
-    <url>http://apache.org</url>
 
     <build>
         <plugins>
@@ -92,7 +91,6 @@
         <dependency>
             <groupId>org.eclipse.jgit.wso2</groupId>
             <artifactId>org.eclipse.jgit</artifactId>
-            <!--version>2.1.0.wso2v1</version-->
             <version>2.3.1.wso2v2</version>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
index a10c323..7db8f70 100644
--- a/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
+++ b/components/org.apache.stratos.cartridge.agent/src/test/java/org/apache/stratos/cartridge/agent/test/JavaCartridgeAgentTest.java
@@ -77,7 +77,8 @@ public class JavaCartridgeAgentTest {
     private static final String PARTITION_ID = "partition-1";
     private static final String TENANT_ID = "-1234";
     private static final String SERVICE_NAME = "php";
-    public static final String AGENT_NAME = "apache-stratos-cartridge-agent-4.1.2";
+    public static final String AGENT_NAME = "distribution.name";
+    public static final String AGENT_VERSION = "distribution.version";
     private static HashMap<String, Executor> executorList;
     private static ArrayList<ServerSocket> serverSocketList;
     private final ArtifactUpdatedEvent artifactUpdatedEvent;
@@ -87,10 +88,24 @@ public class JavaCartridgeAgentTest {
     private ByteArrayOutputStreamLocal outputStream;
     private TopologyEventReceiver topologyEventReceiver;
     private InstanceStatusEventReceiver instanceStatusEventReceiver;
+    private String agentName;
+    private String agentVersion;
+    private Properties testProperties = new Properties();
 
     public JavaCartridgeAgentTest(ArtifactUpdatedEvent artifactUpdatedEvent, Boolean expectedResult) {
         this.artifactUpdatedEvent = artifactUpdatedEvent;
         this.expectedResult = expectedResult;
+        try {
+            testProperties
+                    .load(JavaCartridgeAgentTest.class.getResourceAsStream("/test.properties"));
+            agentName = testProperties.getProperty(AGENT_NAME);
+            agentVersion = testProperties.getProperty(AGENT_VERSION);
+            log.info("Java Cartridge Agent test properties: " + testProperties.toString());
+        }
+        catch (IOException e) {
+            log.error("Error loading test.properties file from classpath. Please make sure that file " +
+                    "exists in classpath.", e);
+        }
     }
 
     @BeforeClass
@@ -232,9 +247,9 @@ public class JavaCartridgeAgentTest {
     private String setupJavaAgent() {
         try {
             log.info("Setting up Java cartridge agent test setup");
-            String jcaZipSource = getResourcesFolderPath() + "/../../../../products/cartridge-agent/modules/distribution/target/" + AGENT_NAME + ".zip";
+            String jcaZipSource = getResourcesFolderPath() + "/../../../../products/cartridge-agent/modules/distribution/target/" + agentName + ".zip";
             String testHome = getResourcesFolderPath() + "/../" + UUID.randomUUID() + "/";
-            File agentHome = new File(testHome + AGENT_NAME);
+            File agentHome = new File(testHome + agentName);
             log.info("Extracting Java Cartridge Agent to test folder");
             ZipFile agentZip = new ZipFile(jcaZipSource);
             ProgressMonitor zipProgresMonitor = agentZip.getProgressMonitor();
@@ -249,7 +264,7 @@ public class JavaCartridgeAgentTest {
             }
 
             log.info("Copying agent jar");
-            String agentJar = "org.apache.stratos.cartridge.agent-4.1.2.jar";
+            String agentJar = "org.apache.stratos.cartridge.agent-" + agentVersion + ".jar";
             String agentJarSource = getResourcesFolderPath() + "/../" + agentJar;
             String agentJarDest = agentHome.getCanonicalPath() + "/lib/" + agentJar;
             FileUtils.copyFile(new File(agentJarSource), new File(agentJarDest));

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/components/org.apache.stratos.cartridge.agent/src/test/resources/test-conf/test.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/test/resources/test-conf/test.properties b/components/org.apache.stratos.cartridge.agent/src/test/resources/test-conf/test.properties
new file mode 100644
index 0000000..1aee0b8
--- /dev/null
+++ b/components/org.apache.stratos.cartridge.agent/src/test/resources/test-conf/test.properties
@@ -0,0 +1,20 @@
+# 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.
+
+# Stratos distribution properties added via filters during the build
+distribution.name=${java.cartridge.agent.distribution.name}-${project.version}
+distribution.version=${project.version}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9ba2735..479806d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -738,6 +738,9 @@
         <!-- product distribution properties -->
         <stratos.distribution.name>apache-stratos</stratos.distribution.name>
         <load.balancer.distribution.name>apache-stratos-load-balancer</load.balancer.distribution.name>
+        <java.cartridge.agent.distribution.name>apache-stratos-cartridge-agent</java.cartridge.agent.distribution.name>
+        <python.cartridge.agent.distribution.name>apache-stratos-python-cartridge-agent
+        </python.cartridge.agent.distribution.name>
 
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/products/cartridge-agent/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/pom.xml b/products/cartridge-agent/modules/distribution/pom.xml
index 15e416a..67c9c43 100644
--- a/products/cartridge-agent/modules/distribution/pom.xml
+++ b/products/cartridge-agent/modules/distribution/pom.xml
@@ -27,8 +27,8 @@
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
-    <artifactId>apache-stratos-cartridge-agent</artifactId>
-    <name>Apache Stratos - Cartridge Agent Distribution</name>
+    <artifactId>java-cartridge-agent-distribution</artifactId>
+    <name>Apache Stratos - Java Cartridge Agent Distribution</name>
 
     <dependencies>
         <dependency>
@@ -55,6 +55,7 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-assembly-plugin</artifactId>
                 <configuration>
+                    <finalName>${java.cartridge.agent.distribution.name}-${project.version}</finalName>
                     <descriptors>
                         <descriptor>src/main/assembly/bin.xml</descriptor>
                     </descriptors>

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/products/cartridge-agent/modules/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/src/main/assembly/bin.xml b/products/cartridge-agent/modules/distribution/src/main/assembly/bin.xml
index 1c8486b..2b5767f 100644
--- a/products/cartridge-agent/modules/distribution/src/main/assembly/bin.xml
+++ b/products/cartridge-agent/modules/distribution/src/main/assembly/bin.xml
@@ -16,7 +16,6 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-
 <assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
           xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/products/python-cartridge-agent/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/pom.xml b/products/python-cartridge-agent/distribution/pom.xml
index 65e3527..10826e0 100644
--- a/products/python-cartridge-agent/distribution/pom.xml
+++ b/products/python-cartridge-agent/distribution/pom.xml
@@ -27,7 +27,7 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>apache-stratos-python-cartridge-agent</artifactId>
+    <artifactId>python-cartridge-agent-distribution</artifactId>
     <packaging>pom</packaging>
     <name>Apache Stratos - Python Cartridge Agent</name>
     <description>Apache Stratos Python Cartridge Agent Distribution</description>
@@ -45,6 +45,7 @@
                             <goal>attached</goal>
                         </goals>
                         <configuration>
+                            <finalName>${python.cartridge.agent.distribution.name}-${project.version}</finalName>
                             <descriptors>
                                 <descriptor>src/main/assembly/bin.xml</descriptor>
                             </descriptors>

http://git-wip-us.apache.org/repos/asf/stratos/blob/3df27e0b/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml b/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
index bca0b25..fa8874c 100644
--- a/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
+++ b/products/python-cartridge-agent/distribution/src/main/assembly/bin.xml
@@ -24,7 +24,9 @@
     </formats>
     <fileSets>
         <fileSet>
-            <directory>${project.basedir}/../../../components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent</directory>
+            <directory>
+                ${project.basedir}/../../../components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent
+            </directory>
             <outputDirectory>.</outputDirectory>
             <includes>
                 <include>**/*</include>
@@ -52,4 +54,4 @@
             <fileMode>644</fileMode>
         </file>
     </files>
-</assembly>
+</assembly>
\ No newline at end of file


[25/50] [abbrv] stratos git commit: Adding integration test to verify repo clone for tenant users

Posted by ra...@apache.org.
Adding integration test to verify repo clone for tenant users


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/90b030a6
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/90b030a6
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/90b030a6

Branch: refs/heads/master
Commit: 90b030a6eca02a995b05434b0e7ecba233574fe9
Parents: 8bd92e8
Author: Akila Perera <ra...@gmail.com>
Authored: Sat Aug 29 00:03:21 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Aug 29 00:03:21 2015 +0530

----------------------------------------------------------------------
 .../python-cartridge-agent/integration/pom.xml  |  13 ++
 .../test/ADCMTAppTenantUserTest.java            | 213 +++++++++++++++++++
 .../src/test/resources/pca-testing4.xml         |  29 +++
 .../resources/suite-3/payload/launch-params     |   3 +-
 .../src/test/resources/suite-4/agent.conf       |  45 ++++
 .../src/test/resources/suite-4/jndi.properties  |  22 ++
 .../src/test/resources/suite-4/logging.ini      |  52 +++++
 .../resources/suite-4/payload/launch-params     |   1 +
 8 files changed, 376 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/pom.xml b/products/python-cartridge-agent/integration/pom.xml
index 707a4ae..9b0922a 100755
--- a/products/python-cartridge-agent/integration/pom.xml
+++ b/products/python-cartridge-agent/integration/pom.xml
@@ -117,6 +117,19 @@
                                     <workingDirectory>${basedir}/target</workingDirectory>
                                 </configuration>
                             </execution>
+                            <execution>
+                                <id>adc-mt-tenant-user-test</id>
+                                <goals>
+                                    <goal>test</goal>
+                                </goals>
+                                <inherited>false</inherited>
+                                <configuration>
+                                    <suiteXmlFiles>
+                                        <suiteXmlFile>src/test/resources/pca-testing4.xml</suiteXmlFile>
+                                    </suiteXmlFiles>
+                                    <workingDirectory>${basedir}/target</workingDirectory>
+                                </configuration>
+                            </execution>
                         </executions>
                     </plugin>
                     <plugin>

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java
new file mode 100644
index 0000000..a604f55
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/java/org/apache/stratos/python.cartridge.agent/test/ADCMTAppTenantUserTest.java
@@ -0,0 +1,213 @@
+package org.apache.stratos.python.cartridge.agent.test;/*
+ * 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.
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.domain.LoadBalancingIPType;
+import org.apache.stratos.messaging.domain.topology.*;
+import org.apache.stratos.messaging.event.instance.notifier.ArtifactUpdatedEvent;
+import org.apache.stratos.messaging.event.topology.CompleteTopologyEvent;
+import org.apache.stratos.messaging.event.topology.MemberInitializedEvent;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import static junit.framework.Assert.assertTrue;
+
+public class ADCMTAppTenantUserTest extends PythonAgentTestManager {
+    private static final Log log = LogFactory.getLog(ADCMTAppTenantUserTest.class);
+    private static final int ADC_TIMEOUT = 180000;
+    private static final String RESOURCES_PATH = "/suite-4";
+    private static final String APPLICATION_PATH = "/tmp/pca-test-suite-4";
+    private static final String CLUSTER_ID = "tomcat.domain";
+    private static final String DEPLOYMENT_POLICY_NAME = "deployment-policy-4";
+    private static final String AUTOSCALING_POLICY_NAME = "autoscaling-policy-4";
+    private static final String APP_ID = "application-4";
+    private static final String MEMBER_ID = "tomcat.member-1";
+    private static final String CLUSTER_INSTANCE_ID = "cluster-1-instance-1";
+    private static final String NETWORK_PARTITION_ID = "network-partition-1";
+    private static final String PARTITION_ID = "partition-1";
+    private static final String TENANT_ID = "4";
+    private static final String SERVICE_NAME = "tomcat-mt";
+
+    private boolean hasADCTestCompleted = false;
+
+    @BeforeSuite
+    public void setupADCMTAppTest() {
+        // Set jndi.properties.dir system property for initializing event publishers and receivers
+        System.setProperty("jndi.properties.dir", getResourcesPath(RESOURCES_PATH));
+
+        // start Python agent with configurations provided in resource path
+        setup(RESOURCES_PATH);
+
+        // Simulate server socket
+        startServerSocket(8080);
+    }
+
+    /**
+     * TearDown method for test method testPythonCartridgeAgent
+     */
+    @AfterSuite
+    public void tearDownADCMTAppTest() {
+        // TODO: app path is duplicated in Java test and payload
+        tearDown(APPLICATION_PATH);
+    }
+
+    @Test(timeOut = ADC_TIMEOUT)
+    public void testADCForMTApps() {
+        startCommunicatorThread();
+        assertAgentActivation();
+        Thread adcTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                log.info("Running ADC MT Test thread...");
+                // Send artifact updated event
+                publishEvent(getArtifactUpdatedEventForPublicRepo());
+                log.info("Publishing artifact updated event for repo: " +
+                        getArtifactUpdatedEventForPublicRepo().getRepoURL());
+
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed() && !hasADCTestCompleted) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Git clone executed")) {
+                                log.info("Agent has completed git clone. Asserting the operation...");
+                                assertRepoClone(getArtifactUpdatedEventForPublicRepo());
+                                hasADCTestCompleted = true;
+                            }
+                        }
+                    }
+                    sleep(1000);
+                }
+            }
+        });
+        adcTestThread.start();
+
+        while (!hasADCTestCompleted) {
+            // wait until the instance activated event is received.
+            sleep(1000);
+        }
+    }
+
+    private void assertAgentActivation() {
+        Thread startupTestThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (!eventReceiverInitiated) {
+                    sleep(1000);
+                }
+                List<String> outputLines = new ArrayList<String>();
+                while (!outputStream.isClosed()) {
+                    List<String> newLines = getNewLines(outputLines, outputStream.toString());
+                    if (newLines.size() > 0) {
+                        for (String line : newLines) {
+                            if (line.contains("Subscribed to 'topology/#'")) {
+                                sleep(2000);
+                                // Send complete topology event
+                                log.info("Publishing complete topology event...");
+                                Topology topology = createTestTopology();
+                                CompleteTopologyEvent completeTopologyEvent = new CompleteTopologyEvent(topology);
+                                publishEvent(completeTopologyEvent);
+                                log.info("Complete topology event published");
+
+                                // Publish member initialized event
+                                log.info("Publishing member initialized event...");
+                                MemberInitializedEvent memberInitializedEvent = new MemberInitializedEvent(
+                                        SERVICE_NAME, CLUSTER_ID, CLUSTER_INSTANCE_ID, MEMBER_ID, NETWORK_PARTITION_ID,
+                                        PARTITION_ID
+                                );
+                                publishEvent(memberInitializedEvent);
+                                log.info("Member initialized event published");
+                            }
+
+                            // Send artifact updated event to activate the instance first
+                            if (line.contains("Artifact repository found")) {
+                                publishEvent(getArtifactUpdatedEventForPublicRepo());
+                                log.info("Artifact updated event published");
+                            }
+                            log.info(line);
+                        }
+                    }
+                    sleep(1000);
+                }
+            }
+        });
+        startupTestThread.start();
+
+        while (!instanceStarted || !instanceActivated) {
+            // wait until the instance activated event is received.
+            // this will assert whether instance got activated within timeout period; no need for explicit assertions
+            sleep(2000);
+        }
+    }
+
+    private ArtifactUpdatedEvent getArtifactUpdatedEventForPublicRepo() {
+        ArtifactUpdatedEvent publicRepoEvent = createTestArtifactUpdatedEvent();
+        publicRepoEvent.setRepoURL("https://bitbucket.org/testapache2211/opentestrepo1.git");
+        return publicRepoEvent;
+    }
+
+    private void assertRepoClone(ArtifactUpdatedEvent artifactUpdatedEvent) {
+        File file = new File(APPLICATION_PATH + "/repository/tenants/4/test1.txt");
+        assertTrue("Git clone failed for repo [url] " + artifactUpdatedEvent.getRepoURL(),
+                file.exists());
+    }
+
+    private static ArtifactUpdatedEvent createTestArtifactUpdatedEvent() {
+        ArtifactUpdatedEvent artifactUpdatedEvent = new ArtifactUpdatedEvent();
+        artifactUpdatedEvent.setClusterId(CLUSTER_ID);
+        artifactUpdatedEvent.setTenantId(TENANT_ID);
+        return artifactUpdatedEvent;
+    }
+
+    /**
+     * Create test topology
+     *
+     * @return
+     */
+    private Topology createTestTopology() {
+        Topology topology = new Topology();
+        Service service = new Service(SERVICE_NAME, ServiceType.SingleTenant);
+        topology.addService(service);
+
+        Cluster cluster = new Cluster(service.getServiceName(), CLUSTER_ID, DEPLOYMENT_POLICY_NAME,
+                AUTOSCALING_POLICY_NAME, APP_ID);
+        service.addCluster(cluster);
+
+        Member member = new Member(service.getServiceName(), cluster.getClusterId(), MEMBER_ID,
+                CLUSTER_INSTANCE_ID, NETWORK_PARTITION_ID, PARTITION_ID, LoadBalancingIPType.Private,
+                System.currentTimeMillis());
+
+        member.setDefaultPrivateIP("10.0.0.1");
+        member.setDefaultPublicIP("20.0.0.1");
+        Properties properties = new Properties();
+        properties.setProperty("prop1", "value1");
+        member.setProperties(properties);
+        member.setStatus(MemberStatus.Created);
+        cluster.addMember(member);
+
+        return topology;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/resources/pca-testing4.xml
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/pca-testing4.xml b/products/python-cartridge-agent/integration/src/test/resources/pca-testing4.xml
new file mode 100755
index 0000000..6462774
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/pca-testing4.xml
@@ -0,0 +1,29 @@
+<?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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="PythonCartridgeAgentIntegrationSuite4">
+    <test name="PCATest">
+        <classes>
+            <class name="org.apache.stratos.python.cartridge.agent.test.ADCMTAppTenantUserTest"/>
+        </classes>
+    </test>
+</suite>

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
index ba9387b..ed8c67f 100755
--- a/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-3/payload/launch-params
@@ -1,2 +1 @@
-APPLICATION_ID=application-3,SERVICE_NAME=tomcat-mt,HOST_NAME=tomcat.stratos.org,MULTITENANT=true,TENANT_ID=-1234,
-TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-3,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null
+APPLICATION_ID=application-3,SERVICE_NAME=tomcat-mt,HOST_NAME=tomcat.stratos.org,MULTITENANT=true,TENANT_ID=-1234,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-3,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/resources/suite-4/agent.conf
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-4/agent.conf b/products/python-cartridge-agent/integration/src/test/resources/suite-4/agent.conf
new file mode 100755
index 0000000..f945968
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-4/agent.conf
@@ -0,0 +1,45 @@
+# 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.
+
+[agent]
+mb.ip                                 =localhost
+mb.port                               =1885
+listen.address                        =localhost
+thrift.receiver.ip                    =localhost
+thrift.receiver.port                  =7712
+thrift.server.admin.username          =admin
+thrift.server.admin.password          =admin
+cep.stats.publisher.enabled           =true
+lb.private.ip                         =
+lb.public.ip                          =
+enable.artifact.update                =true
+auto.commit                           =true
+auto.checkout                         =true
+artifact.update.interval              =15
+artifact.clone.retries                =5
+artifact.clone.interval               =10
+port.check.timeout                    =600000
+enable.data.publisher                 =false
+monitoring.server.ip                  =localhost
+monitoring.server.port                =7612
+monitoring.server.secure.port         =7712
+monitoring.server.admin.username      =admin
+monitoring.server.admin.password      =admin
+log.file.paths                        =/tmp/agent.screen-adc-mt-tenant-user-test.log
+metadata.service.url                  =https://localhost:9443
+super.tenant.repository.path          =/repository/deployment/server/
+tenant.repository.path                =/repository/tenants/

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/resources/suite-4/jndi.properties
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-4/jndi.properties b/products/python-cartridge-agent/integration/src/test/resources/suite-4/jndi.properties
new file mode 100755
index 0000000..beefe3c
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-4/jndi.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://localhost:61617
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/resources/suite-4/logging.ini
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-4/logging.ini b/products/python-cartridge-agent/integration/src/test/resources/suite-4/logging.ini
new file mode 100755
index 0000000..15cad9b
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-4/logging.ini
@@ -0,0 +1,52 @@
+# 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.
+
+
+[formatters]
+keys=default
+
+[formatter_default]
+format=[%(asctime)s] %(levelname)s {%(filename)s:%(funcName)s} - %(message)s
+class=logging.Formatter
+
+[handlers]
+keys=console, error_file, log_file
+
+[handler_console]
+class=logging.StreamHandler
+formatter=default
+args=tuple()
+
+[handler_log_file]
+class=logging.FileHandler
+level=DEBUG
+formatter=default
+args=("agent.log", "w")
+
+[handler_error_file]
+class=logging.FileHandler
+level=ERROR
+formatter=default
+args=("error.log", "w")
+
+[loggers]
+keys=root
+
+[logger_root]
+level=DEBUG
+formatter=default
+handlers=console,error_file,log_file
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/90b030a6/products/python-cartridge-agent/integration/src/test/resources/suite-4/payload/launch-params
----------------------------------------------------------------------
diff --git a/products/python-cartridge-agent/integration/src/test/resources/suite-4/payload/launch-params b/products/python-cartridge-agent/integration/src/test/resources/suite-4/payload/launch-params
new file mode 100755
index 0000000..b701066
--- /dev/null
+++ b/products/python-cartridge-agent/integration/src/test/resources/suite-4/payload/launch-params
@@ -0,0 +1 @@
+APPLICATION_ID=application-4,SERVICE_NAME=tomcat-mt,HOST_NAME=tomcat.stratos.org,MULTITENANT=true,TENANT_ID=4,TENANT_RANGE=*,CARTRIDGE_ALIAS=tomcat,CLUSTER_ID=tomcat.domain,CLUSTER_INSTANCE_ID=cluster-1-instance-1,CARTRIDGE_KEY=PUjpXCLujDhYr5A6,DEPLOYMENT=default,REPO_URL=https://github.com/imesh/stratos-php-applications.git,PORTS=8080,PUPPET_IP=127.0.0.1,PUPPET_HOSTNAME=puppet.apache.stratos.org,PUPPET_ENV=false,MEMBER_ID=tomcat.member-1,LB_CLUSTER_ID=null,NETWORK_PARTITION_ID=network-p1,PARTITION_ID=p1,APPLICATION_PATH=/tmp/pca-test-suite-4,MIN_COUNT=1,INTERNAL=false,CLUSTERING_PRIMARY_KEY=A,LOG_FILE_PATHS=/tmp/temp.log,PERSISTENCE_MAPPING=null