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 10:40:19 UTC

[01/15] stratos git commit: Fixing pom modules structure. Make it consistent

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x 96c7935d8 -> d97d9c78c


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>


[09/15] 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.
-
-
-


[11/15] 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


[04/15] 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;
-    }
-}


[05/15] 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.
+
+
+


[13/15] 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>


[15/15] 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/stratos-4.1.x
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


[02/15] 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


[14/15] 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/stratos-4.1.x
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>


[07/15] 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);
+        }
+    }
+}


[03/15] 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


[06/15] 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


[10/15] 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.
-


[08/15] 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();
+			}
+		}
+	}
+}


[12/15] 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;
+    }
+}