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:22 UTC

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

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;
-    }
-}