You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by sa...@apache.org on 2013/07/02 11:13:16 UTC

[1/2] Refactoring org.wso2.carbon to org.apache.stratos

Updated Branches:
  refs/heads/master b60aa93d2 -> 72985a0f7


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/pom.xml b/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/pom.xml
deleted file mode 100644
index 6f0f4a6..0000000
--- a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<!--
-  ~ Copyright 2011-2012 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.wso2.carbon</groupId>
-        <artifactId>adc-mgt</artifactId>
-        <version>2.1.0</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.apache.stratos.adc.mgt.repository.synchronizer</artifactId>
-    <version>2.1.1</version>
-    <name>Repository Synchronizer</name>
-    <description>Repository Synchronizer</description>
-    <packaging>war</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-                <version>2.3.2</version>
-            </plugin>
-            <plugin>
-                <artifactId>maven-war-plugin</artifactId>
-                <version>2.2</version>
-                <configuration>                     
-                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
-                    <warName>${project.artifactId}</warName>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-transports-http</artifactId>
-            <version>2.6.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
-            <version>2.6.2</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-httpclient</groupId>
-            <artifactId>commons-httpclient</artifactId>
-            <version>3.1</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-            <version>1.1.1</version>
-        </dependency>
-        <dependency>
-        <groupId>net.sf.json-lib</groupId>
-        <artifactId>json-lib</artifactId>
-        <version>2.4</version>
-        <classifier>jdk15</classifier>
-    </dependency>
-            
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
deleted file mode 100644
index 9454028..0000000
--- a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  ~ Copyright 2011-2012 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ 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.
-  -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
-       xsi:schemaLocation="
-         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-         http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
-
-    <jaxrs:server id="repoSynchronizer" address="/notify">
-        <jaxrs:serviceBeans>
-            <ref bean="serviceBean"/>
-        </jaxrs:serviceBeans>
-    </jaxrs:server>
-
-    <bean id="serviceBean" class="org.apache.stratos.adc.mgt.reposync.service.RepositorySynchronizer"/>
-</beans>
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml b/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 696d5cc..0000000
--- a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2011-2012 WSO2, Inc. (http://wso2.com)
-  ~
-  ~ 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.
-  -->
-
-<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
-         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
-
-    <display-name>JAX-WS/JAX-RS Webapp</display-name>
-
-    <servlet>
-        <servlet-name>JAXServlet</servlet-name>
-        <display-name>JAX-WS/JAX-RS Servlet</display-name>
-        <description>JAX-WS/JAX-RS Endpoint</description>
-        <servlet-class>
-            org.apache.cxf.transport.servlet.CXFServlet
-        </servlet-class>
-        <init-param>
-            <param-name>service-list-stylesheet</param-name>
-            <param-value>servicelist.css</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>JAXServlet</servlet-name>
-        <url-pattern>/services/*</url-pattern>
-    </servlet-mapping>
-
-    <session-config>
-        <session-timeout>60</session-timeout>
-    </session-config>
-
-</web-app>
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css b/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
deleted file mode 100644
index bbc4987..0000000
--- a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
+++ /dev/null
@@ -1,117 +0,0 @@
-@CHARSET "ISO-8859-1";
-
-/* http://meyerweb.com/eric/tools/css/reset/ 
-   v2.0 | 20110126
-   License: none (public domain)
-*/
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed, 
-figure, figcaption, footer, header, hgroup, 
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	font-size: 100%;
-	font: inherit;
-	vertical-align: baseline;
-}
-/* HTML5 display-role reset for older browsers */
-article, aside, details, figcaption, figure, 
-footer, header, hgroup, menu, nav, section {
-	display: block;
-}
-
-html {
-	background: #efefef;
-}
-
-body {
-	line-height: 1;
-	width:960px;
-	margin:auto;
-	background:white;
-	padding:10px;
-	box-shadow:0px 0px 5px #CCC;
-	font-family:"Lucida Grande","Lucida Sans","Microsoft Sans Serif", "Lucida Sans Unicode","Verdana","Sans-serif","trebuchet ms" !important;
-	
-}
-ol, ul {
-	list-style: none;
-}
-blockquote, q {
-	quotes: none;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
-	content: '';
-	content: none;
-}
-table {
-	border-collapse: collapse;
-	border-spacing: 0;
-	width:960px;
-	border:solid 1px #ccc;
-}
-
-table a {
-	font-size:12px;
-	color:#1e90ff;
-	padding:7px;
-float:left;	
-;
-}
-
-.heading {
-	font-size: 18px;
-	margin-top: 20px;
-	float:left;
-	color:#0067B1;
-	margin-bottom:20px;
-	padding-top:20px;
-}
-
-.field {
-	font-weight: normal;
-	width:120px;
-	font-size:12px;
-	float:left;
-	padding:7px;
-	clear:left;
-}
-.value {
-	font-weight: bold;
-	font-size:12px;
-	float:left;
-	padding:7px;
-	clear:right;
-}
-.porttypename {
-	font-weight: bold;
-	font-size:14px;
-}
-UL {
-	margin-top: 0;
-}
-LI {
-	font-weight: normal;
-	font-size:12px;
-	margin-top:10px;
-}
-
-TD {
-	border:1px solid #ccc;
-	vertical-align: text-top;
-	padding: 5px;
-}
-
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/pom.xml b/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/pom.xml
deleted file mode 100644
index 0b6aa8f..0000000
--- a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/pom.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~      http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.wso2.carbon</groupId>
-        <artifactId>adc-mgt</artifactId>
-        <version>2.1.0</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.wso2.carbon</groupId>
-    <artifactId>org.apache.stratos.adc.topology.mgt</artifactId>
-    <packaging>bundle</packaging>
-    <version>2.1.3</version>
-    <name>WSO2 Carbon - Topology Management</name>
-    <url>http://wso2.org</url>
-    
-    <dependencies>
-        <!-- <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.mediation.initializer</artifactId>
-            <version>${wso2carbon.version}</version>
-        </dependency> -->
-        <!-- <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.mediation.dependency.mgt</artifactId>
-            <version>${wso2carbon.version}</version>
-        </dependency> -->
-        <dependency>
-            <groupId>org.apache.synapse</groupId>
-            <artifactId>synapse-core</artifactId>
-        </dependency>
-         <!--dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-            <version>1.6.1.wso2v9</version>
-        </dependency-->
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-kernel</artifactId>
-            <version>1.6.1-wso2v9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.logging</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.utils</artifactId>
-            <version>4.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.core</artifactId>
-            <version>4.1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.lb.common</artifactId>
-            <version>4.1.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.ntask.core</artifactId>
-        </dependency>
-        <dependency>
-                <groupId>org.wso2.andes.wso2</groupId>
-                <artifactId>andes-client</artifactId>
-                <version>0.13.wso2v3</version>
-            </dependency>
-        <dependency>
-                <groupId>org.apache.geronimo.specs.wso2</groupId>
-                <artifactId>geronimo-jms_1.1_spec</artifactId>
-                <version>${orbit.version.geronimo-jms_1.1_spec}</version>
-            </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <!-- <Private-Package>
-                        	org.wso2.carbon.stratos.topology.mgt.service.impl.*
-                        </Private-Package> -->
-                        <Export-Package>
-                            org.apache.stratos.adc.topology.mgt.subscriber.*,
-                            org.apache.stratos.adc.topology.mgt.service.*,
-                            org.apache.stratos.adc.topology.mgt.group.mgt.*,
-							org.apache.stratos.adc.topology.mgt.serviceobjects.*
-                        </Export-Package>
-                        <Import-Package>
-                            org.wso2.carbon.lb.common.*; version=4.1.1,
-                            org.wso2.carbon.registry.core.service; version=1.0.1,
-                            *;resolution:=optional
-                        </Import-Package>
-                        <DynamicImport-Package>*</DynamicImport-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml b/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml
deleted file mode 100644
index ef91287..0000000
--- a/components/stratos/artifact-deployment-coordinator/org.wso2.carbon.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<serviceGroup>
-    <service name="TopologyMgtService" scope="application">
-        <parameter name="ServiceClass">org.apache.stratos.adc.topology.mgt.service.impl.TopologyManagementServiceImpl</parameter>
-        <messageReceivers>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
-    </messageReceivers>
-    </service>
-</serviceGroup> 


[2/2] git commit: Refactoring org.wso2.carbon to org.apache.stratos

Posted by sa...@apache.org.
Refactoring org.wso2.carbon to org.apache.stratos


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

Branch: refs/heads/master
Commit: 72985a0f74e1d73de98c46f6884bb0c51116e69a
Parents: b60aa93
Author: Sajith Kariyawasam <sa...@wso2.com>
Authored: Tue Jul 2 14:42:43 2013 +0530
Committer: Sajith Kariyawasam <sa...@wso2.com>
Committed: Tue Jul 2 14:42:43 2013 +0530

----------------------------------------------------------------------
 .../2.1.1/pom.xml                               |  87 ++++++
 .../service/RepositorySynchronizer.java         |  37 +++
 .../src/main/webapp/WEB-INF/cxf-servlet.xml     |  34 +++
 .../2.1.1/src/main/webapp/WEB-INF/web.xml       |  49 ++++
 .../2.1.1/src/main/webapp/servicelist.css       | 117 ++++++++
 .../2.1.3/pom.xml                               | 131 +++++++++
 .../topology/mgt/builder/TopologySyncher.java   | 114 ++++++++
 .../mgt/exception/TopologyMgtException.java     |  35 +++
 .../mgt/group/mgt/GroupMgtAgentBuilder.java     | 109 +++++++
 .../mgt/SubDomainAwareGroupManagementAgent.java |  32 ++
 .../mgt/internal/TopologyMgtDSComponent.java    | 290 +++++++++++++++++++
 .../mgt/service/TopologyManagementService.java  |  69 +++++
 .../impl/TopologyManagementServiceImpl.java     | 127 ++++++++
 .../mgt/serviceobjects/DomainContext.java       |  90 ++++++
 .../mgt/subscriber/TopicHealthChecker.java      |  67 +++++
 .../mgt/subscriber/TopologyListener.java        |  44 +++
 .../mgt/subscriber/TopologySubscriber.java      |  92 ++++++
 .../mgt/subscriber/TopologySubscriberTask.java  |   1 +
 .../adc/topology/mgt/util/ConfigHolder.java     | 197 +++++++++++++
 .../topology/mgt/util/TopologyConstants.java    |  13 +
 .../adc/topology/mgt/util/TopologyMgtUtil.java  |   5 +
 .../src/main/resources/META-INF/services.xml    |   9 +
 .../2.1.1/pom.xml                               |  87 ------
 .../src/main/webapp/WEB-INF/cxf-servlet.xml     |  34 ---
 .../2.1.1/src/main/webapp/WEB-INF/web.xml       |  49 ----
 .../2.1.1/src/main/webapp/servicelist.css       | 117 --------
 .../2.1.3/pom.xml                               | 131 ---------
 .../src/main/resources/META-INF/services.xml    |   9 -
 28 files changed, 1749 insertions(+), 427 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
new file mode 100644
index 0000000..6f0f4a6
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/pom.xml
@@ -0,0 +1,87 @@
+<!--
+  ~ Copyright 2011-2012 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.wso2.carbon</groupId>
+        <artifactId>adc-mgt</artifactId>
+        <version>2.1.0</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.adc.mgt.repository.synchronizer</artifactId>
+    <version>2.1.1</version>
+    <name>Repository Synchronizer</name>
+    <description>Repository Synchronizer</description>
+    <packaging>war</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+                <version>2.3.2</version>
+            </plugin>
+            <plugin>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>                     
+                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+                    <warName>${project.artifactId}</warName>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>2.6.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>2.6.2</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>jsr311-api</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+        <groupId>net.sf.json-lib</groupId>
+        <artifactId>json-lib</artifactId>
+        <version>2.4</version>
+        <classifier>jdk15</classifier>
+    </dependency>
+            
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java
new file mode 100644
index 0000000..937baab
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/java/org/apache/stratos/adc/mgt/reposync/service/RepositorySynchronizer.java
@@ -0,0 +1,37 @@
+/**
+ * 
+ */
+package org.apache.stratos.adc.mgt.reposync.service;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.MediaType;
+
+import net.sf.json.JSONObject;
+
+/**
+ * @author wso2
+ * 
+ */
+@Path("/reposyncservice/")
+public class RepositorySynchronizer {
+
+	@POST
+	@Path("/notify/")
+	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+	public void execute(@FormParam("payload") String payload) {
+		Map jsonObject = JSONObject.fromObject(payload);
+		System.out.println("Printing......");
+		Map repoMap = (Map) jsonObject.get("repository");
+		System.out.println("-------------");
+		System.out.println("Repo URL : " + repoMap.get("url"));
+		System.out.println("-------------");
+		System.out.println("-------------");
+		System.out.println("-------------");
+		System.out.println("---JSON customer : " + payload);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
new file mode 100644
index 0000000..9454028
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/cxf-servlet.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ Copyright 2011-2012 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+         http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
+
+    <jaxrs:server id="repoSynchronizer" address="/notify">
+        <jaxrs:serviceBeans>
+            <ref bean="serviceBean"/>
+        </jaxrs:serviceBeans>
+    </jaxrs:server>
+
+    <bean id="serviceBean" class="org.apache.stratos.adc.mgt.reposync.service.RepositorySynchronizer"/>
+</beans>
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..696d5cc
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2011-2012 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
+         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+    <display-name>JAX-WS/JAX-RS Webapp</display-name>
+
+    <servlet>
+        <servlet-name>JAXServlet</servlet-name>
+        <display-name>JAX-WS/JAX-RS Servlet</display-name>
+        <description>JAX-WS/JAX-RS Endpoint</description>
+        <servlet-class>
+            org.apache.cxf.transport.servlet.CXFServlet
+        </servlet-class>
+        <init-param>
+            <param-name>service-list-stylesheet</param-name>
+            <param-value>servicelist.css</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>JAXServlet</servlet-name>
+        <url-pattern>/services/*</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <session-timeout>60</session-timeout>
+    </session-config>
+
+</web-app>
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
new file mode 100644
index 0000000..bbc4987
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.mgt.repository.synchronizer/2.1.1/src/main/webapp/servicelist.css
@@ -0,0 +1,117 @@
+@CHARSET "ISO-8859-1";
+
+/* http://meyerweb.com/eric/tools/css/reset/ 
+   v2.0 | 20110126
+   License: none (public domain)
+*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, 
+figure, figcaption, footer, header, hgroup, 
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+	margin: 0;
+	padding: 0;
+	border: 0;
+	font-size: 100%;
+	font: inherit;
+	vertical-align: baseline;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure, 
+footer, header, hgroup, menu, nav, section {
+	display: block;
+}
+
+html {
+	background: #efefef;
+}
+
+body {
+	line-height: 1;
+	width:960px;
+	margin:auto;
+	background:white;
+	padding:10px;
+	box-shadow:0px 0px 5px #CCC;
+	font-family:"Lucida Grande","Lucida Sans","Microsoft Sans Serif", "Lucida Sans Unicode","Verdana","Sans-serif","trebuchet ms" !important;
+	
+}
+ol, ul {
+	list-style: none;
+}
+blockquote, q {
+	quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+	content: '';
+	content: none;
+}
+table {
+	border-collapse: collapse;
+	border-spacing: 0;
+	width:960px;
+	border:solid 1px #ccc;
+}
+
+table a {
+	font-size:12px;
+	color:#1e90ff;
+	padding:7px;
+float:left;	
+;
+}
+
+.heading {
+	font-size: 18px;
+	margin-top: 20px;
+	float:left;
+	color:#0067B1;
+	margin-bottom:20px;
+	padding-top:20px;
+}
+
+.field {
+	font-weight: normal;
+	width:120px;
+	font-size:12px;
+	float:left;
+	padding:7px;
+	clear:left;
+}
+.value {
+	font-weight: bold;
+	font-size:12px;
+	float:left;
+	padding:7px;
+	clear:right;
+}
+.porttypename {
+	font-weight: bold;
+	font-size:14px;
+}
+UL {
+	margin-top: 0;
+}
+LI {
+	font-weight: normal;
+	font-size:12px;
+	margin-top:10px;
+}
+
+TD {
+	border:1px solid #ccc;
+	vertical-align: text-top;
+	padding: 5px;
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
new file mode 100644
index 0000000..0b6aa8f
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/pom.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~      http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.wso2.carbon</groupId>
+        <artifactId>adc-mgt</artifactId>
+        <version>2.1.0</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.wso2.carbon</groupId>
+    <artifactId>org.apache.stratos.adc.topology.mgt</artifactId>
+    <packaging>bundle</packaging>
+    <version>2.1.3</version>
+    <name>WSO2 Carbon - Topology Management</name>
+    <url>http://wso2.org</url>
+    
+    <dependencies>
+        <!-- <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.mediation.initializer</artifactId>
+            <version>${wso2carbon.version}</version>
+        </dependency> -->
+        <!-- <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.mediation.dependency.mgt</artifactId>
+            <version>${wso2carbon.version}</version>
+        </dependency> -->
+        <dependency>
+            <groupId>org.apache.synapse</groupId>
+            <artifactId>synapse-core</artifactId>
+        </dependency>
+         <!--dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+            <version>1.6.1.wso2v9</version>
+        </dependency-->
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>1.6.1-wso2v9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.utils</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.core</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.lb.common</artifactId>
+            <version>4.1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.ntask.core</artifactId>
+        </dependency>
+        <dependency>
+                <groupId>org.wso2.andes.wso2</groupId>
+                <artifactId>andes-client</artifactId>
+                <version>0.13.wso2v3</version>
+            </dependency>
+        <dependency>
+                <groupId>org.apache.geronimo.specs.wso2</groupId>
+                <artifactId>geronimo-jms_1.1_spec</artifactId>
+                <version>${orbit.version.geronimo-jms_1.1_spec}</version>
+            </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Name>${project.artifactId}</Bundle-Name>
+                        <!-- <Private-Package>
+                        	org.wso2.carbon.stratos.topology.mgt.service.impl.*
+                        </Private-Package> -->
+                        <Export-Package>
+                            org.apache.stratos.adc.topology.mgt.subscriber.*,
+                            org.apache.stratos.adc.topology.mgt.service.*,
+                            org.apache.stratos.adc.topology.mgt.group.mgt.*,
+							org.apache.stratos.adc.topology.mgt.serviceobjects.*
+                        </Export-Package>
+                        <Import-Package>
+                            org.wso2.carbon.lb.common.*; version=4.1.1,
+                            org.wso2.carbon.registry.core.service; version=1.0.1,
+                            *;resolution:=optional
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/builder/TopologySyncher.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/builder/TopologySyncher.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/builder/TopologySyncher.java
new file mode 100644
index 0000000..56713f8
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/builder/TopologySyncher.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.builder;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BlockingQueue;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.topology.mgt.group.mgt.GroupMgtAgentBuilder;
+import org.apache.stratos.adc.topology.mgt.util.ConfigHolder;
+import org.wso2.carbon.lb.common.conf.LoadBalancerConfiguration;
+import org.wso2.carbon.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration;
+import org.wso2.carbon.lb.common.conf.structure.Node;
+import org.wso2.carbon.lb.common.conf.structure.NodeBuilder;
+
+
+public class TopologySyncher implements Runnable {
+
+	@SuppressWarnings("rawtypes")
+    private BlockingQueue sharedQueue;
+	private static final Log log = LogFactory.getLog(TopologySyncher.class);
+	
+	public TopologySyncher(@SuppressWarnings("rawtypes") BlockingQueue queue){
+		
+		sharedQueue = queue;
+		
+	}
+	
+	public void run() {
+
+	    LoadBalancerConfiguration lbconfig = LoadBalancerConfiguration.getInstance();
+	    
+	    //FIXME Currently there has to be at least one dummy cluster defined in the loadbalancer conf
+	    // in order to proper initialization of TribesClusteringAgent.
+	    generateGroupMgtAgents(lbconfig);
+	    
+        while (true) {
+            try {
+
+                Object obj;
+                String msg = null;
+
+                obj = sharedQueue.take();
+                msg = (String) obj;
+
+                ConfigHolder data = ConfigHolder.getInstance();
+
+                Node topologyNode = NodeBuilder.buildNode(msg);
+
+                List<ServiceConfiguration> currentServiceConfigs = lbconfig.createServicesConfig(topologyNode);
+
+                data.setServiceConfigs(lbconfig.getServiceNameToServiceConfigurations());
+                generateGroupMgtAgents(lbconfig);
+                resetGroupMgtAgents(lbconfig, currentServiceConfigs);
+
+            } catch (InterruptedException ignore) {
+            }
+        }
+
+	}
+
+    /**
+     * @param lbconfig
+     */
+    private void generateGroupMgtAgents(LoadBalancerConfiguration lbconfig) {
+        for (List<ServiceConfiguration> serviceConfigsList : lbconfig.getServiceNameToServiceConfigurations()
+                                                                     .values()) {
+
+        	for (ServiceConfiguration serviceConfiguration : serviceConfigsList) {
+        		GroupMgtAgentBuilder.createGroupMgtAgent(serviceConfiguration.getDomain(),
+        		                                         serviceConfiguration.getSubDomain());
+        	}
+        }
+    }
+    
+    private void resetGroupMgtAgents(LoadBalancerConfiguration lbConfig,
+        List<ServiceConfiguration> currentServiceConfigs) {
+
+        for (Iterator<?> iterator = lbConfig.getServiceConfigurations().values().iterator(); iterator.hasNext();) {
+            @SuppressWarnings("unchecked")
+            Map<String, ServiceConfiguration> valuesMap = (Map<String, ServiceConfiguration>) iterator.next();
+
+            for (Iterator<ServiceConfiguration> iterator2 = valuesMap.values().iterator(); iterator2.hasNext();) {
+                ServiceConfiguration oldServiceConfig = (ServiceConfiguration) iterator2.next();
+
+                if (!currentServiceConfigs.contains(oldServiceConfig)) {
+                    // if the ServiceConfiguration is not there any more in the latest topology
+                    lbConfig.removeServiceConfiguration(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
+                    GroupMgtAgentBuilder.resetGroupMgtAgent(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
+                }
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/exception/TopologyMgtException.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/exception/TopologyMgtException.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/exception/TopologyMgtException.java
new file mode 100644
index 0000000..51faeb8
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/exception/TopologyMgtException.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.exception;
+
+public class TopologyMgtException extends RuntimeException {
+
+    private static final long serialVersionUID = -663839410798538370L;
+
+    public TopologyMgtException(String msg) {
+        super(msg);
+    }
+
+    public TopologyMgtException(String msg, Throwable cause) {
+        super(msg, cause);
+    }
+
+    public TopologyMgtException(Throwable cause) {
+        super(cause);
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/GroupMgtAgentBuilder.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/GroupMgtAgentBuilder.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/GroupMgtAgentBuilder.java
new file mode 100644
index 0000000..42a1b6f
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/GroupMgtAgentBuilder.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.group.mgt;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.axis2.clustering.ClusteringAgent;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.topology.mgt.util.ConfigHolder;
+import org.apache.synapse.SynapseException;
+import org.wso2.carbon.lb.common.conf.LoadBalancerConfiguration;
+import org.wso2.carbon.lb.common.conf.util.HostContext;
+import org.wso2.carbon.lb.common.conf.util.TenantDomainContext;
+
+public class GroupMgtAgentBuilder {
+
+	private static LoadBalancerConfiguration lbConfig;
+	/**
+     * Key - host name 
+     * Value - {@link HostContext}
+     */
+    private static Map<String, HostContext> hostContexts = new HashMap<String, HostContext>();
+    
+    private static final Log log = LogFactory.getLog(GroupMgtAgentBuilder.class);
+	
+	public static void createGroupMgtAgents() {
+		lbConfig = ConfigHolder.getInstance().getLbConfig();
+		hostContexts = lbConfig.getHostContextMap();
+		
+		ClusteringAgent clusteringAgent = ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
+        if (clusteringAgent == null) {
+            throw new SynapseException("Axis2 ClusteringAgent not defined in axis2.xml");
+        }
+
+        // Add the Axis2 GroupManagement agents
+        if (hostContexts != null) {
+            // iterate through each host context
+            for (HostContext hostCtxt : hostContexts.values()) {
+                // each host can has multiple Tenant Contexts, iterate through them
+                for (TenantDomainContext tenantCtxt : hostCtxt.getTenantDomainContexts()) {
+
+                    String domain = tenantCtxt.getDomain();
+                    String subDomain = tenantCtxt.getSubDomain();
+
+                    if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
+                        clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
+                            subDomain),
+                            domain, subDomain, -1);
+                        log.info("Group management agent added to cluster domain: " +
+                            domain + " and sub domain: " + subDomain);
+                    }
+                }
+            }
+        }
+    }
+	
+	public static void createGroupMgtAgent(String domain, String subDomain) {
+		
+		ClusteringAgent clusteringAgent = ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
+        if (clusteringAgent == null) {
+            throw new SynapseException("Axis2 ClusteringAgent not defined in axis2.xml");
+        }
+		
+        if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
+            clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(
+                subDomain),
+                domain, subDomain, -1);
+            log.info("Group management agent added to cluster domain: " +
+                domain + " and sub domain: " + subDomain);
+        }
+	}
+	
+	public static void resetGroupMgtAgent(String domain, String subDomain) {
+
+        ClusteringAgent clusteringAgent =
+            ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
+        
+        if (clusteringAgent == null) {
+            throw new SynapseException("Axis2 Clustering Agent not defined in axis2.xml");
+        }
+
+        // checks the existence. 
+        if (clusteringAgent.getGroupManagementAgent(domain, subDomain) != null) {
+            
+            clusteringAgent.resetGroupManagementAgent(domain, subDomain);
+            
+            log.info("Group management agent of cluster domain: " +
+                domain + " and sub domain: " + subDomain+" is removed.");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/SubDomainAwareGroupManagementAgent.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/SubDomainAwareGroupManagementAgent.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/SubDomainAwareGroupManagementAgent.java
new file mode 100644
index 0000000..d674c4c
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/group/mgt/SubDomainAwareGroupManagementAgent.java
@@ -0,0 +1,32 @@
+package org.apache.stratos.adc.topology.mgt.group.mgt;
+
+import org.apache.axis2.clustering.Member;
+import org.apache.axis2.clustering.management.DefaultGroupManagementAgent;
+
+/**
+ * This GroupManagementAgent can handle group membership based on cluster sub-domains
+ */
+public class SubDomainAwareGroupManagementAgent extends DefaultGroupManagementAgent {
+
+    private String subDomain;
+
+    public SubDomainAwareGroupManagementAgent(String subDomain) {
+        this.subDomain = subDomain;
+    }
+
+    @Override
+    public void applicationMemberAdded(Member member) {
+        String subDomain = member.getProperties().getProperty("subDomain");
+        if (subDomain == null || subDomain.equals(this.subDomain)) {
+            super.applicationMemberAdded(member);
+        }
+    }
+
+    @Override
+    public void applicationMemberRemoved(Member member) {
+        String subDomain = member.getProperties().getProperty("subDomain");
+        if (subDomain == null || subDomain.equals(this.subDomain)) {
+            super.applicationMemberRemoved(member);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/internal/TopologyMgtDSComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/internal/TopologyMgtDSComponent.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/internal/TopologyMgtDSComponent.java
new file mode 100644
index 0000000..aa0d400
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/internal/TopologyMgtDSComponent.java
@@ -0,0 +1,290 @@
+/*
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.internal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.topology.mgt.builder.TopologySyncher;
+import org.apache.stratos.adc.topology.mgt.service.TopologyManagementService;
+import org.apache.stratos.adc.topology.mgt.service.impl.TopologyManagementServiceImpl;
+import org.apache.stratos.adc.topology.mgt.subscriber.TopologySubscriber;
+import org.apache.stratos.adc.topology.mgt.util.ConfigHolder;
+import org.apache.stratos.adc.topology.mgt.util.TopologyConstants;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+import org.wso2.carbon.utils.ConfigurationContextService;
+import org.wso2.carbon.lb.common.service.LoadBalancerConfigurationService;
+import org.wso2.carbon.ntask.core.service.TaskService;
+
+//* @scr.reference name="synapse.config.service"
+//* interface="org.wso2.carbon.mediation.initializer.services.SynapseConfigurationService"
+//* cardinality="1..1" policy="dynamic" bind="setSynapseConfigurationService"
+//* unbind="unsetSynapseConfigurationService"
+//* @scr.reference name="registry.service"
+//* interface="org.wso2.carbon.registry.core.service.RegistryService"
+//* cardinality="1..1" policy="dynamic"
+//* bind="setRegistryService" unbind="unsetRegistryService"
+//* @scr.reference name="dependency.mgt.service"
+//* interface="org.wso2.carbon.mediation.dependency.mgt.services.DependencyManagementService"
+//* cardinality="0..1" policy="dynamic"
+//* bind="setDependencyManager" unbind="unsetDependencyManager"
+//* @scr.reference name="user.realmservice.default"
+//* interface="org.wso2.carbon.user.core.service.RealmService"
+//* cardinality="1..1" policy="dynamic" bind="setRealmService"
+//* unbind="unsetRealmService"
+
+/**
+ * @scr.component name="topology.mgt.service" immediate="true"
+ * @scr.reference name="configuration.context.service"
+ * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
+ * policy="dynamic" bind="setConfigurationContextService" unbind="unsetConfigurationContextService"
+ * @scr.reference name="org.wso2.carbon.lb.common"
+ * interface="org.wso2.carbon.lb.common.service.LoadBalancerConfigurationService"
+ * cardinality="1..1" policy="dynamic" bind="setLoadBalancerConfigurationService"
+ * unbind="unsetLoadBalancerConfigurationService"
+ * @scr.reference name="ntask.component" interface="org.wso2.carbon.ntask.core.service.TaskService"
+ * cardinality="1..1" policy="dynamic" bind="setTaskService" unbind="unsetTaskService"
+ */
+@SuppressWarnings({"UnusedDeclaration", "JavaDoc"})
+public class TopologyMgtDSComponent {
+
+    private static final Log log = LogFactory.getLog(TopologyMgtDSComponent.class);
+
+//    private boolean activated = false;
+
+    protected void activate(ComponentContext ctxt) {
+    	try {
+    		// start consumer
+    		// initialize TopologyBuilder Consumer
+            if (System.getProperty("mb.server.ip") != null) {
+                Thread topologyConsumer = new Thread(new TopologySyncher(ConfigHolder.getInstance().getSharedTopologyDiffQueue()));
+                // start consumer
+                topologyConsumer.start();
+
+                TopologySubscriber.subscribe(TopologyConstants.TOPIC_NAME);
+            }
+
+    		
+            BundleContext bundleContext = ctxt.getBundleContext();
+            bundleContext.registerService(TopologyManagementService.class.getName(),
+                                          new TopologyManagementServiceImpl(), null);
+
+            log.debug("******* Topology Mgt Service bundle is activated ******* ");
+        } catch (Throwable e) {
+            log.error("******* Topology Mgt Service Service bundle is failed to activate ****", e);
+        }
+//    	log.info("**************************************");
+//    	for (String str : ConfigHolder.getInstance().getLbConfig().getServiceDomains()) {
+//	        log.info(str);
+//        }
+//    	log.info("**************************************");
+    	
+//    	if(!activated){
+//    		GroupMgtAgentBuilder.createGroupMgtAgents();
+//    		activated = true;
+//    	}
+    	
+    	
+    	// topology synching task activation
+//    	TaskManager tm = null;
+//		try {
+//			// topology sync
+//			ConfigHolder.getInstance().getTaskService()
+//			          .registerTaskType(TopologyConstants.TOPOLOGY_SYNC_TASK_TYPE);
+//
+//			tm =
+//					ConfigHolder.getInstance().getTaskService()
+//			               .getTaskManager(TopologyConstants.TOPOLOGY_SYNC_TASK_TYPE);
+//
+//			TriggerInfo triggerInfo = new TriggerInfo(TopologyConstants.TOPOLOGY_SYNC_CRON);
+//			TaskInfo taskInfo =
+//			                    new TaskInfo(TopologyConstants.TOPOLOGY_SYNC_TASK_NAME,
+//			                                 TopologySubscriberTask.class.getName(),
+//			                                 new HashMap<String, String>(), triggerInfo);
+//			tm.registerTask(taskInfo);
+//
+//			// start consumer
+//			// initialize TopologyBuilder Consumer
+//	        Thread topologyConsumer = new Thread(new TopologyBuilder(ConfigHolder.getInstance().getSharedTopologyDiffQueue()));
+//	        // start consumer
+//	        topologyConsumer.start();
+//			
+//		} catch (Exception e) {
+//			String msg = "Error scheduling task: " + TopologyConstants.TOPOLOGY_SYNC_TASK_NAME;
+//			log.error(msg, e);
+//			if (tm != null) {
+//				try {
+//					tm.deleteTask(TopologyConstants.TOPOLOGY_SYNC_TASK_NAME);
+//				} catch (TaskException e1) {
+//					log.error(e1);
+//				}
+//			}
+//			throw new TopologyMgtException(msg, e);
+//		}
+    }
+
+    protected void deactivate(ComponentContext context) {}
+
+    protected void setConfigurationContextService(ConfigurationContextService cfgCtxService) {
+        ConfigHolder.getInstance().setAxisConfiguration(
+                cfgCtxService.getServerConfigContext().getAxisConfiguration());
+    }
+
+    protected void unsetConfigurationContextService(ConfigurationContextService cfgCtxService) {
+        ConfigHolder.getInstance().setAxisConfiguration(null);
+    }
+
+//    protected void setSynapseConfigurationService(
+//            SynapseConfigurationService synapseConfigurationService) {
+//
+//        ConfigHolder.getInstance().setSynapseConfiguration(
+//                synapseConfigurationService.getSynapseConfiguration());
+//    }
+//
+//    protected void unsetSynapseConfigurationService(
+//            SynapseConfigurationService synapseConfigurationService) {
+//
+//        ConfigHolder.getInstance().setSynapseConfiguration(null);
+//    }
+
+    /**
+     * Here we receive an event about the creation of a SynapseEnvironment. If this is
+     * SuperTenant we have to wait until all the other constraints are met and actual
+     * initialization is done in the activate method. Otherwise we have to do the activation here.
+     *
+     * @param synapseEnvironmentService SynapseEnvironmentService which contains information
+     *                                  about the new Synapse Instance
+     */
+//    protected void setSynapseEnvironmentService(
+//            SynapseEnvironmentService synapseEnvironmentService) {
+//        boolean alreadyCreated = ConfigHolder.getInstance().getSynapseEnvironmentServices().
+//                containsKey(synapseEnvironmentService.getTenantId());
+//
+//        ConfigHolder.getInstance().addSynapseEnvironmentService(
+//                synapseEnvironmentService.getTenantId(),
+//                synapseEnvironmentService);
+//        if (activated) {
+//            if (!alreadyCreated) {
+//                try {
+//                    registerDeployer(synapseEnvironmentService.getConfigurationContext().getAxisConfiguration(),
+//                            synapseEnvironmentService.getSynapseEnvironment());
+//                    if (log.isDebugEnabled()) {
+//                        log.debug("Endpoint Admin bundle is activated ");
+//                    }
+//                } catch (Throwable e) {
+//                    log.error("Failed to activate Endpoint Admin bundle ", e);
+//                }
+//            }
+//        }
+//    }
+
+//    /**
+//     * Here we receive an event about Destroying a SynapseEnvironment. This can be the super tenant
+//     * destruction or a tenant destruction.
+//     *
+//     * @param synapseEnvironmentService synapseEnvironment
+//     */
+//    protected void unsetSynapseEnvironmentService(
+//            SynapseEnvironmentService synapseEnvironmentService) {
+//        ConfigHolder.getInstance().removeSynapseEnvironmentService(
+//                synapseEnvironmentService.getTenantId());
+//    }
+//
+//    protected void setRegistryService(RegistryService regService) {
+//        if (log.isDebugEnabled()) {
+//            log.debug("RegistryService bound to the endpoint component");
+//        }
+//        try {
+//            ConfigHolder.getInstance().setConfigRegistry(regService.getConfigSystemRegistry());
+//            ConfigHolder.getInstance().setGovernanceRegistry(regService.getGovernanceSystemRegistry());
+//        } catch (RegistryException e) {
+//            log.error("Couldn't retrieve the registry from the registry service");
+//        }
+//    }
+//
+//    protected void unsetRegistryService(RegistryService regService) {
+//        if (log.isDebugEnabled()) {
+//            log.debug("RegistryService unbound from the endpoint component");
+//        }
+//        ConfigHolder.getInstance().setConfigRegistry(null);
+//    }
+//
+//    protected void setDependencyManager(DependencyManagementService dependencyMgr) {
+//        if (log.isDebugEnabled()) {
+//            log.debug("Dependency management service bound to the endpoint component");
+//        }
+//        ConfigHolder.getInstance().setDependencyManager(dependencyMgr);
+//    }
+//
+//    protected void unsetDependencyManager(DependencyManagementService dependencyMgr) {
+//        if (log.isDebugEnabled()) {
+//            log.debug("Dependency management service unbound from the endpoint component");
+//        }
+//        ConfigHolder.getInstance().setDependencyManager(null);
+//    }
+//
+//    protected void setSynapseRegistrationsService(
+//            SynapseRegistrationsService synapseRegistrationsService) {
+//
+//    }
+
+//    protected void unsetSynapseRegistrationsService(
+//            SynapseRegistrationsService synapseRegistrationsService) {
+//        int tenantId = synapseRegistrationsService.getTenantId();
+//        if (ConfigHolder.getInstance().getSynapseEnvironmentServices().containsKey(tenantId)) {
+//            SynapseEnvironment env = ConfigHolder.getInstance().
+//                    getSynapseEnvironmentService(tenantId).getSynapseEnvironment();
+//
+//            ConfigHolder.getInstance().removeSynapseEnvironmentService(
+//                    synapseRegistrationsService.getTenantId());
+//
+//            AxisConfiguration axisConfig = synapseRegistrationsService.getConfigurationContext().
+//                    getAxisConfiguration();
+//            if (axisConfig != null) {
+//                try {
+//                    unregisterDeployer(axisConfig, env);
+//                } catch (Exception e) {
+//                    log.warn("Couldn't remove the EndpointDeployer");
+//                }
+//            }
+//        }
+//    }
+
+//    protected void setRealmService(RealmService realmService) {
+//        ConfigHolder.getInstance().setRealmService(realmService);
+//    }
+//
+//    protected void unsetRealmService(RealmService realmService) {
+//        ConfigHolder.getInstance().setRealmService(null);
+//    }
+//    
+    protected void setLoadBalancerConfigurationService(LoadBalancerConfigurationService lbConfigSer){
+        ConfigHolder.getInstance().setLbConfigService(lbConfigSer);
+    }
+    
+    protected void unsetLoadBalancerConfigurationService(LoadBalancerConfigurationService lbConfigSer){
+        ConfigHolder.getInstance().setLbConfigService(null);
+    }
+    
+    protected void setTaskService(TaskService taskService) {
+        ConfigHolder.getInstance().setTaskService(taskService);
+    }
+
+    protected void unsetTaskService(TaskService taskService) {
+        ConfigHolder.getInstance().setTaskService(null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/TopologyManagementService.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/TopologyManagementService.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/TopologyManagementService.java
new file mode 100644
index 0000000..9b490e9
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/TopologyManagementService.java
@@ -0,0 +1,69 @@
+/*
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.service;
+
+import org.apache.stratos.adc.topology.mgt.serviceobjects.DomainContext;
+
+/**
+ * This exposes details regarding up-to-date topology
+ *
+ */
+public interface TopologyManagementService {
+
+	/**
+	 * Provide service cluster domains corresponds to the given information.
+	 * @param cartridgeType cartridge type
+	 * @param tenantId tenant id
+	 * @return String array of service cluster domains
+	 */
+	String[] getDomains(String cartridgeType, int tenantId);
+
+	/**
+	 * Provide service cluster sub domains corresponds to the given information.
+	 * @param cartridgeType cartridge type
+	 * @param tenantId tenant id
+	 * @return String array of service cluster sub domains
+	 */
+	String[] getSubDomains(String cartridgeType, int tenantId);
+
+//	/**
+//	 * Provide public IPs corresponds to the given information.
+//	 * @param cartridgeType cartridge type
+//	 * @param tenantId tenant id
+//	 * @return String array of public IPs
+//	 */
+//	String[] getActiveIPs(String cartridgeType, int tenantId);
+	
+	/**
+	 * Provide public IPs corresponds to the given information.
+	 * @param cartridgeType cartridge type
+	 * @param domain service cluster domain
+	 * @param subDomain service cluster sub domain
+	 * @return String array of public IPs
+	 */
+	String[] getActiveIPs(String cartridgeType, String domain, String subDomain);
+	
+	/**
+	 * Provide domains and the relevant subdomains corresponding to the given information
+	 * 
+	 * @param cartridgeType cartridge type
+	 * @param tenantId tenant id
+	 * @return DomainContext instances array of domains and sub domains 
+	 */
+	DomainContext[] getDomainsAndSubdomains (String cartridgeType, int tenantId);
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/impl/TopologyManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/impl/TopologyManagementServiceImpl.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/impl/TopologyManagementServiceImpl.java
new file mode 100644
index 0000000..96bfe60
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/service/impl/TopologyManagementServiceImpl.java
@@ -0,0 +1,127 @@
+/*
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.stratos.adc.topology.mgt.service.TopologyManagementService;
+import org.apache.stratos.adc.topology.mgt.serviceobjects.DomainContext;
+import org.apache.stratos.adc.topology.mgt.util.ConfigHolder;
+import org.wso2.carbon.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration;
+import org.wso2.carbon.lb.common.conf.util.LoadBalancerConfigUtil;
+
+public class TopologyManagementServiceImpl implements TopologyManagementService {
+	
+	ConfigHolder data = ConfigHolder.getInstance();
+
+	public String[] getDomains(String cartridgeType, int tenantId) {
+		List<String> domains = new ArrayList<String>();
+		if(data.getServiceConfigs() != null){
+			List<ServiceConfiguration> serviceConfigs = data.getServiceConfigs().get(cartridgeType);
+			if(serviceConfigs != null){
+				
+				for (ServiceConfiguration serviceConfiguration : serviceConfigs) {
+	                
+					List<Integer> tenantIds = LoadBalancerConfigUtil.getTenantIds(serviceConfiguration.getTenantRange());
+					if(!tenantIds.isEmpty() && (tenantIds.contains(tenantId) || tenantIds.contains(0))){
+						if (!domains.contains(serviceConfiguration.getDomain())) {
+							domains.add(serviceConfiguration.getDomain());
+						}
+					}
+                }
+			}
+		}
+		return domains.toArray(new String[domains.size()]);
+	}
+
+	public String[] getSubDomains(String cartridgeType, int tenantId) {
+		List<String> subDomains = new ArrayList<String>();
+		if(data.getServiceConfigs() != null){
+			List<ServiceConfiguration> serviceConfigs = data.getServiceConfigs().get(cartridgeType);
+			if(serviceConfigs != null){
+				
+				for (ServiceConfiguration serviceConfiguration : serviceConfigs) {
+	                
+					List<Integer> tenantIds = LoadBalancerConfigUtil.getTenantIds(serviceConfiguration.getTenantRange());
+					if(!tenantIds.isEmpty() && (tenantIds.contains(tenantId) || tenantIds.contains(0))){
+						if (!subDomains.contains(serviceConfiguration.getSubDomain())) {
+							subDomains.add(serviceConfiguration.getSubDomain());
+						}
+					}
+                }
+			}
+		}
+		return subDomains.toArray(new String[subDomains.size()]);
+	}
+
+    public String[] getActiveIPs(String cartridgeType, String domain, String subDomain) {
+		List<String> publicIps = new ArrayList<String>();
+		
+		if(domain == null || subDomain == null){
+			return new String[0];
+		}
+		
+		if(data.getServiceConfigs() != null){
+			List<ServiceConfiguration> serviceConfigs = data.getServiceConfigs().get(cartridgeType);
+			if(serviceConfigs != null){
+				
+				for (ServiceConfiguration serviceConfiguration : serviceConfigs) {
+	                
+					if(domain.equals(serviceConfiguration.getDomain()) && subDomain.equals(serviceConfiguration.getSubDomain())){
+						
+						String ipStr = serviceConfiguration.getPublicIp();
+						if(ipStr != null && !ipStr.isEmpty()){
+							for (String ip : ipStr.split(",")) {
+								if (!publicIps.contains(ip)) {
+									publicIps.add(ip);
+								}
+							}
+						}
+					}
+                }
+			}
+		}
+		return publicIps.toArray(new String[publicIps.size()]);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.wso2.carbon.stratos.topology.mgt.service.TopologyManagementService#getDomainsAndSubdomains(java.lang.String, int)
+	 */
+	public DomainContext[] getDomainsAndSubdomains(String cartridgeType, int tenantId) {
+		List<DomainContext> domainContexts = new ArrayList<DomainContext>();
+		
+		if(data.getServiceConfigs() != null){
+			List<ServiceConfiguration> serviceConfigs = data.getServiceConfigs().get(cartridgeType);
+			if(serviceConfigs != null){
+				
+				for (ServiceConfiguration serviceConfiguration : serviceConfigs) {
+	                
+					List<Integer> tenantIds = LoadBalancerConfigUtil.getTenantIds(serviceConfiguration.getTenantRange());
+					if(!tenantIds.isEmpty() && (tenantIds.contains(tenantId) || tenantIds.contains(0))){
+						DomainContext domainCtx = new DomainContext(serviceConfiguration.getDomain(), serviceConfiguration.getSubDomain());
+						if (!domainContexts.contains(domainCtx)) {
+							domainContexts.add(domainCtx);
+						}
+					}
+                }
+			}
+		}
+		return domainContexts.toArray(new DomainContext[domainContexts.size()]);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/serviceobjects/DomainContext.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/serviceobjects/DomainContext.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/serviceobjects/DomainContext.java
new file mode 100644
index 0000000..54357d2
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/serviceobjects/DomainContext.java
@@ -0,0 +1,90 @@
+/**
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.stratos.adc.topology.mgt.serviceobjects;
+
+/**
+ * Class to hold domain and subdomain details
+ *
+ */
+public class DomainContext {
+    
+    private String domain;
+    private String subDomain;
+    
+    /**
+     * Constructor
+     * 
+     * @param domain domain name
+     * @param subDomain subdomain name
+     */
+    public DomainContext (String domain, String subDomain) {
+        this.domain = domain;
+        this.subDomain = subDomain;
+    }
+
+    /**
+     * Returns the domain 
+     * 
+     * @return the domain
+     */
+    public String getDomain() {
+        return domain;
+    }
+
+    /**
+     * Returns the sub domain
+     * 
+     * @return the subDomain
+     */
+    public String getSubDomain() {
+        return subDomain;
+    }
+    
+    /**
+     * Overridden equals method
+     */
+    public boolean equals (Object object) {
+        if (object == null) 
+            return false;
+        if (object == this)  
+            return true;
+        if (!(object instanceof DomainContext))
+            return false;
+        
+        DomainContext domainCtx = (DomainContext)object;
+        if(this.getDomain().equals(domainCtx.getDomain()) &&
+                this.getSubDomain().equals(domainCtx.getSubDomain()))
+            return true;
+        else
+            return false;
+    }
+    
+    /**
+     * Overridden hashCode method
+     */
+    public int hashCode () {
+        int domainHash = 0;
+        int subDomainHash = 0;
+        
+        if(domain != null)
+            domainHash = domain.hashCode();
+        if(subDomain != null)
+            subDomainHash = subDomain.hashCode();
+        
+        return domainHash + subDomainHash;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopicHealthChecker.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopicHealthChecker.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopicHealthChecker.java
new file mode 100644
index 0000000..de8f9df
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopicHealthChecker.java
@@ -0,0 +1,67 @@
+/*
+*  Copyright (c) 2005-2011, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. licenses this file to you under the Apache License,
+*  Version 2.0 (the "License"); you may not use this file except
+*  in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.stratos.adc.topology.mgt.subscriber;
+
+import javax.jms.TopicSubscriber;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This health checker runs forever, and is responsible for re-establishing a connection
+ * between SC and CC.
+ */
+public class TopicHealthChecker implements Runnable{
+    
+    private static final Log log = LogFactory.getLog(TopicHealthChecker.class);
+    private String topicName;
+    private TopicSubscriber subscriber;
+
+    public TopicHealthChecker(String topicName, TopicSubscriber subscriber) {
+        this.topicName = topicName;
+        this.subscriber = subscriber;
+    }
+    
+    @Override
+    public void run() {
+        log.info("Topic Health Checker is running... ");
+
+        while (true) {
+            try {
+                subscriber.getTopic();
+                
+                // health checker runs in every 30s
+                Thread.sleep(30000);
+
+            } catch (Exception e) {
+                // implies connection is not established
+                // sleep for 5s and retry
+                try {
+                    log.info("Health checker failed and will retry to establish a connection after a 5s.");
+                    Thread.sleep(5000);
+                    break;
+                } catch (InterruptedException ignore) {
+                }
+            }
+
+        }
+
+        TopologySubscriber.subscribe(topicName);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologyListener.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologyListener.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologyListener.java
new file mode 100644
index 0000000..57289d7
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologyListener.java
@@ -0,0 +1,44 @@
+/*
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.subscriber;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.topology.mgt.util.ConfigHolder;
+
+public class TopologyListener implements MessageListener {
+
+    private static final Log log = LogFactory.getLog(TopologyListener.class);
+
+    @SuppressWarnings("unchecked")
+    public void onMessage(Message message) {
+        TextMessage receivedMessage = (TextMessage) message;
+        try {
+
+            ConfigHolder.getInstance().getSharedTopologyDiffQueue().add(receivedMessage.getText());
+
+        } catch (JMSException e) {
+            log.error(e.getMessage(), e);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriber.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriber.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriber.java
new file mode 100644
index 0000000..97bf94f
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriber.java
@@ -0,0 +1,92 @@
+/*
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.subscriber;
+
+import java.util.Properties;
+
+import javax.jms.*;
+import javax.naming.InitialContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.topology.mgt.util.TopologyConstants;
+
+public class TopologySubscriber {
+
+	private static final Log log = LogFactory.getLog(TopologySubscriber.class);
+	
+    public static void subscribe(String topicName) {
+        Properties initialContextProperties = new Properties();
+        TopicSubscriber topicSubscriber = null;
+        TopicSession topicSession = null;
+        TopicConnection topicConnection = null;
+        InitialContext initialContext = null;
+
+        initialContextProperties.put("java.naming.factory.initial",
+            "org.wso2.andes.jndi.PropertiesFileInitialContextFactory");
+
+        String mbServerIp =
+            System.getProperty(TopologyConstants.MB_SERVER_IP) == null
+                ? TopologyConstants.DEFAULT_MB_SERVER_IP
+                : System.getProperty(TopologyConstants.MB_SERVER_IP);
+
+        String connectionString =
+            "amqp://admin:admin@clientID/carbon?brokerlist='tcp://" +
+                mbServerIp + "'&reconnect='true'";
+        initialContextProperties.put("connectionfactory.qpidConnectionfactory", connectionString);
+
+        try {
+            initialContext = new InitialContext(initialContextProperties);
+            TopicConnectionFactory topicConnectionFactory =
+                (TopicConnectionFactory) initialContext.lookup("qpidConnectionfactory");
+            topicConnection = topicConnectionFactory.createTopicConnection();
+            topicConnection.start();
+            topicSession =
+                topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+
+            Topic topic = topicSession.createTopic(topicName);
+            topicSubscriber =
+                topicSession.createSubscriber(topic);
+
+            topicSubscriber.setMessageListener(new TopologyListener());
+
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+
+            try {
+                if (topicSubscriber != null) {
+                    topicSubscriber.close();
+                }
+
+                if (topicSession != null) {
+                    topicSession.close();
+                }
+
+                if (topicConnection != null) {
+                    topicConnection.close();
+                }
+            } catch (JMSException e1) {
+                // ignore
+            }
+
+        } finally {
+            // start the health checker
+            Thread healthChecker = new Thread(new TopicHealthChecker(topicName, topicSubscriber));
+            healthChecker.start();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriberTask.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriberTask.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriberTask.java
new file mode 100644
index 0000000..525de89
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/subscriber/TopologySubscriberTask.java
@@ -0,0 +1 @@
+package org.apache.stratos.adc.topology.mgt.subscriber;

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/ConfigHolder.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/ConfigHolder.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/ConfigHolder.java
new file mode 100644
index 0000000..b2a88ed
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/ConfigHolder.java
@@ -0,0 +1,197 @@
+/**
+ *  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.stratos.adc.topology.mgt.util;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.adc.topology.mgt.exception.TopologyMgtException;
+import org.apache.synapse.config.SynapseConfiguration;
+import org.wso2.carbon.lb.common.conf.LoadBalancerConfiguration;
+import org.wso2.carbon.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration;
+import org.wso2.carbon.lb.common.service.LoadBalancerConfigurationService;
+import org.wso2.carbon.ntask.core.service.TaskService;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.user.core.service.RealmService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+/**
+ *
+ */
+public class ConfigHolder {
+
+    private static ConfigHolder instance;
+    private static final Log log = LogFactory.getLog(ConfigHolder.class);
+
+    private SynapseConfiguration synapseConfiguration;
+    private ConfigurationContext configCtxt;
+    private AxisConfiguration axisConfiguration;
+    private UserRegistry configRegistry;
+    private UserRegistry governanceRegistry;
+    private TaskService taskService;
+    private BlockingQueue sharedTopologyDiffQueue = new LinkedBlockingQueue();
+    private String previousMessage;
+    private Map<String, List<ServiceConfiguration>> serviceNameToServiceConfigurations;
+//    private DependencyManagementService dependencyManager;
+    private LoadBalancerConfigurationService lbConfigService;
+    
+
+//    private Map<Integer, SynapseEnvironmentService> synapseEnvironmentServices =
+//            new HashMap<Integer, SynapseEnvironmentService>();
+
+    public RealmService getRealmService() {
+        return realmService;
+    }
+
+    public void setRealmService(RealmService realmService) {
+        this.realmService = realmService;
+    }
+
+    private RealmService realmService;
+
+    private ConfigHolder() {
+    }
+
+    public static ConfigHolder getInstance() {
+        if (instance == null) {
+            instance = new ConfigHolder();
+        }
+        return instance;
+    }
+
+    public SynapseConfiguration getSynapseConfiguration() throws TopologyMgtException{
+        assertNull("SynapseConfiguration", synapseConfiguration);
+        return synapseConfiguration;
+    }
+
+    public void setSynapseConfiguration(SynapseConfiguration synapseConfiguration) {
+        this.synapseConfiguration = synapseConfiguration;
+    }
+
+    public AxisConfiguration getAxisConfiguration() throws TopologyMgtException {
+        assertNull("AxisConfiguration", axisConfiguration);
+        return axisConfiguration;
+    }
+
+    public void setAxisConfiguration(AxisConfiguration axisConfiguration) {
+        this.axisConfiguration = axisConfiguration;
+    }
+
+    public UserRegistry getConfigRegistry() throws TopologyMgtException {
+        assertNull("Registry", configRegistry);
+        return configRegistry;
+    }
+
+    public void setConfigRegistry(UserRegistry configRegistry) {
+        this.configRegistry = configRegistry;
+    }
+
+////    public DependencyManagementService getDependencyManager() {
+////        return dependencyManager;
+////    }
+//
+//    public void setDependencyManager(DependencyManagementService dependencyManager) {
+//        this.dependencyManager = dependencyManager;
+//    }
+
+    private void assertNull(String name, Object object) throws TopologyMgtException {
+        if (object == null) {
+            String message = name + " reference in the proxy admin config holder is null";
+            log.error(message);
+            throw new TopologyMgtException(message);
+        }
+    }
+
+    public UserRegistry getGovernanceRegistry() {
+        return governanceRegistry;
+    }
+
+    public void setGovernanceRegistry(UserRegistry governanceRegistry) {
+        this.governanceRegistry = governanceRegistry;
+    }
+
+//    public SynapseEnvironmentService getSynapseEnvironmentService(int id) {
+//        return synapseEnvironmentServices.get(id);
+//    }
+//
+//    public void addSynapseEnvironmentService(int id,
+//                                             SynapseEnvironmentService synapseEnvironmentService) {
+//        synapseEnvironmentServices.put(id, synapseEnvironmentService);
+//    }
+//
+//    public void removeSynapseEnvironmentService(int id) {
+//        synapseEnvironmentServices.remove(id);
+//    }
+//
+//    public Map<Integer, SynapseEnvironmentService> getSynapseEnvironmentServices() {
+//        return synapseEnvironmentServices;
+//    }
+
+    public ConfigurationContext getConfigCtxt() {
+        return configCtxt;
+    }
+
+    public void setConfigCtxt(ConfigurationContext configCtxt) {
+        this.configCtxt = configCtxt;
+    }
+    
+    public void setLbConfigService(LoadBalancerConfigurationService lbConfigSer) {
+        this.lbConfigService = lbConfigSer;
+    }
+
+    public LoadBalancerConfiguration getLbConfig() {
+        return (LoadBalancerConfiguration) lbConfigService.getLoadBalancerConfig();
+    }
+    
+    public TaskService getTaskService() {
+        return taskService;
+    }
+
+    public void setTaskService(TaskService taskService) {
+        this.taskService = taskService;
+    }
+
+    public BlockingQueue getSharedTopologyDiffQueue() {
+	    return sharedTopologyDiffQueue;
+    }
+
+	public void setSharedTopologyDiffQueue(BlockingQueue sharedTopologyDiffQueue) {
+	    this.sharedTopologyDiffQueue = sharedTopologyDiffQueue;
+    }
+
+	public void setServiceConfigs(Map<String, List<ServiceConfiguration>> serviceNameToServiceConfigurations) {
+
+		this.serviceNameToServiceConfigurations = serviceNameToServiceConfigurations;
+    }
+	
+	public Map<String, List<ServiceConfiguration>> getServiceConfigs(){
+		return serviceNameToServiceConfigurations;
+	}
+
+	public String getPreviousMessage() {
+	    return previousMessage;
+    }
+
+	public void setPreviousMessage(String previousMessage) {
+	    this.previousMessage = previousMessage;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyConstants.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyConstants.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyConstants.java
new file mode 100644
index 0000000..984610d
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyConstants.java
@@ -0,0 +1,13 @@
+package org.apache.stratos.adc.topology.mgt.util;
+
+public class TopologyConstants {
+    
+    public static final String TOPIC_NAME = "cloud-controller-topology";
+    public static final String MB_SERVER_IP = "mb.server.ip";
+    public static final String DEFAULT_MB_SERVER_IP = "localhost:5673";
+    
+    public static final String TOPOLOGY_SYNC_CRON = "1 * * * * ? *";
+	public static final String TOPOLOGY_SYNC_TASK_NAME = "TopologySubscriberTaskOfADC";
+	public static final String TOPOLOGY_SYNC_TASK_TYPE = "TOPOLOGY_SUBSCRIBER_TASK";
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyMgtUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyMgtUtil.java b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyMgtUtil.java
new file mode 100644
index 0000000..01ff6db
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/java/org/apache/stratos/adc/topology/mgt/util/TopologyMgtUtil.java
@@ -0,0 +1,5 @@
+package org.apache.stratos.adc.topology.mgt.util;
+
+public class TopologyMgtUtil {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/72985a0f/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml
new file mode 100644
index 0000000..ef91287
--- /dev/null
+++ b/components/stratos/artifact-deployment-coordinator/org.apache.stratos.adc.topology.mgt/2.1.3/src/main/resources/META-INF/services.xml
@@ -0,0 +1,9 @@
+<serviceGroup>
+    <service name="TopologyMgtService" scope="application">
+        <parameter name="ServiceClass">org.apache.stratos.adc.topology.mgt.service.impl.TopologyManagementServiceImpl</parameter>
+        <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+    </messageReceivers>
+    </service>
+</serviceGroup>