You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2013/11/08 02:37:06 UTC
[1/2] git commit: Introduced method to add topology event listeners
to topology event processor chain
Updated Branches:
refs/heads/master 6fbefbf71 -> 9ac61e4eb
Introduced method to add topology event listeners to topology event processor chain
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/d558b478
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/d558b478
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/d558b478
Branch: refs/heads/master
Commit: d558b47818681057fdc57917b59120db91d4b85d
Parents: 6fbefbf
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Nov 8 06:59:28 2013 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Nov 8 06:59:28 2013 +0530
----------------------------------------------------------------------
components/org.apache.stratos.messaging/pom.xml | 21 -----
.../topology/TopologyEventProcessorChain.java | 81 +++++++++++++++++---
2 files changed, 72 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d558b478/components/org.apache.stratos.messaging/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/pom.xml b/components/org.apache.stratos.messaging/pom.xml
index f0ef23c..7530175 100644
--- a/components/org.apache.stratos.messaging/pom.xml
+++ b/components/org.apache.stratos.messaging/pom.xml
@@ -34,21 +34,6 @@
<url>http://apache.org</url>
<dependencies>
- <!--dependency>
- <groupId>org.wso2.carbon</groupId>
- <artifactId>org.wso2.carbon.core</artifactId>
- <version>${wso2carbon.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava.wso2</groupId>
- <artifactId>guava</artifactId>
- <version>${google.guava.wso2.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.synapse</groupId>
- <artifactId>synapse-core</artifactId>
- <version>${synapse.core.version}</version>
- </dependency-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -74,12 +59,6 @@
<artifactId>org.wso2.carbon.logging</artifactId>
<version>${wso2carbon.version}</version>
</dependency>
- <!--dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.6</version>
- </dependency-->
- <!-- This mysql dependency is required for tests-->
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d558b478/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyEventProcessorChain.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyEventProcessorChain.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyEventProcessorChain.java
index 917f7c9..d127438 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyEventProcessorChain.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/TopologyEventProcessorChain.java
@@ -21,6 +21,8 @@ package org.apache.stratos.messaging.message.processor.topology;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.EventListener;
+import org.apache.stratos.messaging.event.topology.*;
import org.apache.stratos.messaging.message.processor.MessageProcessorChain;
/**
@@ -29,19 +31,80 @@ import org.apache.stratos.messaging.message.processor.MessageProcessorChain;
public class TopologyEventProcessorChain extends MessageProcessorChain {
private static final Log log = LogFactory.getLog(TopologyEventProcessorChain.class);
+ private ServiceCreatedEventProcessor serviceCreatedEventProcessor;
+ private ServiceRemovedEventProcessor serviceRemovedEventProcessor;
+ private ClusterCreatedEventProcessor clusterCreatedEventProcessor;
+ private ClusterRemovedEventProcessor clusterRemovedEventProcessor;
+ private InstanceSpawnedEventProcessor instanceSpawnedEventProcessor;
+ private MemberStartedEventProcessor memberStartedEventProcessor;
+ private MemberActivatedEventProcessor memberActivatedEventProcessor;
+ private MemberSuspendedEventProcessor memberSuspendedEventProcessor;
+ private MemberTerminatedEventProcessor memberTerminatedEventProcessor;
+
public void initialize() {
// Add topology event processors
- add(new ServiceCreatedEventProcessor());
- add(new ServiceRemovedEventProcessor());
- add(new ClusterCreatedEventProcessor());
- add(new ClusterRemovedEventProcessor());
- add(new InstanceSpawnedEventProcessor());
- add(new MemberStartedEventProcessor());
- add(new MemberActivatedEventProcessor());
- add(new MemberSuspendedEventProcessor());
- add(new MemberTerminatedEventProcessor());
+ serviceCreatedEventProcessor = new ServiceCreatedEventProcessor();
+ add(serviceCreatedEventProcessor);
+
+ serviceRemovedEventProcessor = new ServiceRemovedEventProcessor();
+ add(serviceRemovedEventProcessor);
+
+ clusterCreatedEventProcessor = new ClusterCreatedEventProcessor();
+ add(clusterCreatedEventProcessor);
+
+ clusterRemovedEventProcessor = new ClusterRemovedEventProcessor();
+ add(clusterRemovedEventProcessor);
+
+ instanceSpawnedEventProcessor = new InstanceSpawnedEventProcessor();
+ add(instanceSpawnedEventProcessor);
+
+ memberStartedEventProcessor = new MemberStartedEventProcessor();
+ add(memberStartedEventProcessor);
+
+ memberActivatedEventProcessor = new MemberActivatedEventProcessor();
+ add(memberActivatedEventProcessor);
+
+ memberSuspendedEventProcessor = new MemberSuspendedEventProcessor();
+ add(memberSuspendedEventProcessor);
+
+ memberTerminatedEventProcessor = new MemberTerminatedEventProcessor();
+ add(memberTerminatedEventProcessor);
+
if(log.isDebugEnabled()) {
log.debug("Topology message processor chain initialized");
}
}
+
+ public void addEventListener(EventListener eventListener) {
+ if(eventListener instanceof ClusterCreatedEventListener) {
+ clusterCreatedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof ClusterRemovedEventListener) {
+ clusterRemovedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof InstanceSpawnedEventListener) {
+ instanceSpawnedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof MemberActivatedEventListener) {
+ memberActivatedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof MemberStartedEventListener) {
+ memberStartedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof MemberSuspendedEventListener) {
+ memberSuspendedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof MemberTerminatedEventListener) {
+ memberTerminatedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof ServiceCreatedEventListener) {
+ serviceCreatedEventProcessor.addEventListener(eventListener);
+ }
+ else if(eventListener instanceof ServiceRemovedEventListener) {
+ serviceRemovedEventProcessor.addEventListener(eventListener);
+ }
+ else {
+ throw new RuntimeException("Unknown event listener");
+ }
+ }
}
[2/2] git commit: Introduced new component
load.balancer.extension.api and fixed service component definitions
Posted by im...@apache.org.
Introduced new component load.balancer.extension.api and fixed service component definitions
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/9ac61e4e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/9ac61e4e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/9ac61e4e
Branch: refs/heads/master
Commit: 9ac61e4eb48a3cfe5d19cebb26fc0edb19c45fbd
Parents: d558b47
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Nov 8 07:06:47 2013 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Nov 8 07:06:47 2013 +0530
----------------------------------------------------------------------
.../LoadBalancerCommonServiceComponent.java | 4 +-
.../common/topology/TopologyReceiver.java | 70 ++++++++++++
.../pom.xml | 57 ++++++++++
.../balancer/extension/api/LoadBalancer.java | 50 ++++++++
.../extension/api/LoadBalancerExtension.java | 111 ++++++++++++++++++
...oadBalancerExtensionAPIServiceComponent.java | 43 +++++++
.../internal/LoadBalancerServiceComponent.java | 2 +-
components/pom.xml | 113 ++++++++++---------
8 files changed, 392 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/internal/LoadBalancerCommonServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/internal/LoadBalancerCommonServiceComponent.java b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/internal/LoadBalancerCommonServiceComponent.java
index a68ae4e..8aa811d 100644
--- a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/internal/LoadBalancerCommonServiceComponent.java
+++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/internal/LoadBalancerCommonServiceComponent.java
@@ -23,7 +23,9 @@ import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
/**
- *
+ * @scr.component name="org.apache.stratos.load.balancer.common.internal.LoadBalancerCommonServiceComponent" immediate="true"
+ * @scr.reference name="config.context.service"
+ * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
*/
public class LoadBalancerCommonServiceComponent {
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/topology/TopologyReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/topology/TopologyReceiver.java b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/topology/TopologyReceiver.java
new file mode 100644
index 0000000..88958b5
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer.common/src/main/java/org/apache/stratos/load/balancer/common/topology/TopologyReceiver.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.load.balancer.common.topology;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.broker.subscribe.TopicSubscriber;
+import org.apache.stratos.messaging.message.processor.MessageProcessorChain;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageReceiver;
+import org.apache.stratos.messaging.util.Constants;
+
+/**
+ * A thread for receiving topology information from message broker.
+ */
+public class TopologyReceiver implements Runnable {
+ private static final Log log = LogFactory.getLog(TopologyReceiver.class);
+ private TopologyEventMessageDelegator messageDelegator;
+
+ public TopologyReceiver() {
+ this.messageDelegator = new TopologyEventMessageDelegator();
+ }
+
+ public TopologyReceiver(TopologyEventMessageDelegator messageDelegator) {
+ this.messageDelegator = messageDelegator;
+ }
+
+ @Override
+ public void run() {
+ try {
+ // Start topic subscriber thread
+ TopicSubscriber topicSubscriber = new TopicSubscriber(Constants.TOPOLOGY_TOPIC);
+ topicSubscriber.setMessageListener(new TopologyEventMessageReceiver());
+ Thread subscriberThread = new Thread(topicSubscriber);
+ subscriberThread.start();
+ if (log.isDebugEnabled()) {
+ log.debug("Topology event message receiver thread started");
+ }
+
+ // Start topology message receiver thread
+ Thread receiverThread = new Thread(messageDelegator);
+ receiverThread.start();
+ if (log.isDebugEnabled()) {
+ log.debug("Topology message processor thread started");
+ }
+ }
+ catch (Exception e) {
+ if(log.isErrorEnabled()) {
+ log.error("Topology receiver failed", e);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer.extension.api/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.extension.api/pom.xml b/components/org.apache.stratos.load.balancer.extension.api/pom.xml
new file mode 100644
index 0000000..9ce6fd3
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer.extension.api/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.load.balancer.extension.api</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Apache Stratos - Load Balancer - Extension API</name>
+ <description>An extension API for integrating third party load balancers with Apache Stratos.</description>
+
+ <repositories>
+ <repository>
+ <id>wso2-nexus</id>
+ <name>WSO2 internal Repository</name>
+ <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ <checksumPolicy>ignore</checksumPolicy>
+ </releases>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.messaging</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stratos</groupId>
+ <artifactId>org.apache.stratos.load.balancer.common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancer.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancer.java b/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancer.java
new file mode 100644
index 0000000..9bd3881
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancer.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.load.balancer.extension.api;
+
+import org.apache.stratos.messaging.domain.topology.Topology;
+
+/**
+ * A generic load balancer life-cycle definition.
+ */
+public interface LoadBalancer {
+
+ /**
+ * Start a new load balancer instance.
+ */
+ void start();
+
+ /**
+ * Stop the running load balancer instance.
+ */
+ void stop();
+
+ /**
+ * Configure the load balancer using the given topology.
+ * @param topology
+ */
+ void configure(Topology topology);
+
+ /**
+ * Reload load balancer configuration using the given topology without interrupting the incoming requests.
+ * @param topology
+ */
+ void reload(Topology topology);
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancerExtension.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancerExtension.java b/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancerExtension.java
new file mode 100644
index 0000000..fd164b1
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/LoadBalancerExtension.java
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.load.balancer.extension.api;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.load.balancer.common.topology.TopologyReceiver;
+import org.apache.stratos.messaging.event.Event;
+import org.apache.stratos.messaging.event.topology.*;
+import org.apache.stratos.messaging.message.processor.MessageProcessorChain;
+import org.apache.stratos.messaging.message.processor.topology.TopologyEventProcessorChain;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyEventMessageDelegator;
+import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+
+/**
+ * Load balancer extension thread for executing load balancer life-cycle according to the topology updates
+ * received from the message broker.
+ */
+public class LoadBalancerExtension implements Runnable {
+ private static final Log log = LogFactory.getLog(LoadBalancerExtension.class);
+
+ private LoadBalancer loadBalancer;
+
+ public LoadBalancerExtension(LoadBalancer loadBalancer) {
+ this.loadBalancer = loadBalancer;
+ }
+
+ @Override
+ public void run() {
+ try {
+ // Start topology receiver
+ TopologyReceiver topologyReceiver = new TopologyReceiver(createMessageDelegator());
+ Thread thread = new Thread(topologyReceiver);
+ thread.start();
+ }
+ catch (Exception e){
+ if(log.isErrorEnabled()) {
+ log.error(e);
+ }
+ loadBalancer.stop();
+ }
+ }
+
+ private TopologyEventMessageDelegator createMessageDelegator() {
+ TopologyEventProcessorChain processorChain = createEventProcessorChain();
+ TopologyEventMessageDelegator messageDelegator = new TopologyEventMessageDelegator(processorChain);
+ messageDelegator.addCompleteTopologyEventListener(new CompleteTopologyEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ // Configure load balancer
+ loadBalancer.configure(TopologyManager.getTopology());
+
+ // Start load balancer
+ loadBalancer.start();
+ }
+ });
+ return messageDelegator;
+ }
+
+ private TopologyEventProcessorChain createEventProcessorChain() {
+ TopologyEventProcessorChain processorChain = new TopologyEventProcessorChain();
+ processorChain.addEventListener(new MemberActivatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ loadBalancer.reload(TopologyManager.getTopology());
+ }
+ });
+ processorChain.addEventListener(new MemberSuspendedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ loadBalancer.reload(TopologyManager.getTopology());
+ }
+ });
+ processorChain.addEventListener(new MemberTerminatedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ loadBalancer.reload(TopologyManager.getTopology());
+ }
+ });
+ processorChain.addEventListener(new ClusterRemovedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ loadBalancer.reload(TopologyManager.getTopology());
+ }
+ });
+ processorChain.addEventListener(new ServiceRemovedEventListener() {
+ @Override
+ protected void onEvent(Event event) {
+ loadBalancer.reload(TopologyManager.getTopology());
+ }
+ });
+ return processorChain;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/internal/LoadBalancerExtensionAPIServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/internal/LoadBalancerExtensionAPIServiceComponent.java b/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/internal/LoadBalancerExtensionAPIServiceComponent.java
new file mode 100644
index 0000000..424959a
--- /dev/null
+++ b/components/org.apache.stratos.load.balancer.extension.api/src/main/java/org/apache/stratos/load/balancer/extension/api/internal/LoadBalancerExtensionAPIServiceComponent.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.stratos.load.balancer.extension.api.internal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * @scr.component name="org.apache.stratos.load.balancer.extension.api.internal.LoadBalancerExtensionAPIServiceComponent" immediate="true"
+ * @scr.reference name="config.context.service"
+ * interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
+ */
+public class LoadBalancerExtensionAPIServiceComponent {
+
+ private static final Log log = LogFactory.getLog(LoadBalancerExtensionAPIServiceComponent.class);
+
+ protected void activate(ComponentContext context) {
+ try {
+ if(log.isDebugEnabled()) {
+ log.debug("Load Balancer Extension API Service bundle activated");
+ }
+ } catch (Exception e) {
+ log.error("Could not activate Load Balancer Extension API Service bundle", e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/internal/LoadBalancerServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/internal/LoadBalancerServiceComponent.java b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/internal/LoadBalancerServiceComponent.java
index afcc38a..440a6fb 100644
--- a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/internal/LoadBalancerServiceComponent.java
+++ b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/internal/LoadBalancerServiceComponent.java
@@ -53,7 +53,7 @@ import java.util.Map;
import java.util.Set;
/**
- * @scr.component name="org.apache.stratos.load.balancer.endpoint" immediate="true"
+ * @scr.component name="org.apache.stratos.load.balancer.internal.LoadBalancerServiceComponent" immediate="true"
* @scr.reference name="configuration.context.service"
* interface="org.wso2.carbon.utils.ConfigurationContextService"
* cardinality="1..1" policy="dynamic"
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9ac61e4e/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index bd1ce2f..b97402e 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -40,66 +40,67 @@
<module>org.apache.stratos.common</module>
<!-- Messaging -->
<module>org.apache.stratos.messaging</module>
- <!-- Autoscaler -->
+ <!-- Autoscaler -->
<module>org.apache.stratos.autoscaler</module>
- <!-- CC -->
- <module>org.apache.stratos.cloud.controller</module>
- <!-- ADC -->
- <module>org.apache.stratos.adc.topology.mgt</module>
- <module>org.apache.stratos.adc.mgt</module>
- <module>org.apache.stratos.deployment</module>
- <!-- CLI -->
- <module>org.apache.stratos.cli</module>
- <!-- ELB -->
+ <!-- CC -->
+ <module>org.apache.stratos.cloud.controller</module>
+ <!-- ADC -->
+ <module>org.apache.stratos.adc.topology.mgt</module>
+ <module>org.apache.stratos.adc.mgt</module>
+ <module>org.apache.stratos.deployment</module>
+ <!-- CLI -->
+ <module>org.apache.stratos.cli</module>
+ <!-- Load Balancer -->
<module>org.apache.stratos.load.balancer.common</module>
<module>org.apache.stratos.load.balancer</module>
- <!-- Tenant Mgt -->
- <module>org.apache.stratos.register.ui</module>
- <module>org.apache.stratos.tenant.mgt.core</module>
- <module>org.apache.stratos.tenant.mgt</module>
- <module>org.apache.stratos.tenant.mgt.ui</module>
- <module>org.apache.stratos.tenant.mgt.email.sender</module>
- <!-- Tenant Activity -->
- <module>org.apache.stratos.tenant.activity</module>
- <module>org.apache.stratos.tenant.activity.ui</module>
- <!-- Account Mgt -->
- <module>org.apache.stratos.account.mgt</module>
- <module>org.apache.stratos.account.mgt.ui</module>
- <module>org.apache.stratos.email.sender</module>
- <!-- Domain Validation -->
- <module>org.apache.stratos.validate.domain</module>
- <module>org.apache.stratos.validate.domain.ui</module>
- <!-- Throttling -->
- <module>org.apache.stratos.throttling.agent</module>
- <module>org.apache.stratos.throttling.manager</module>
- <module>org.apache.stratos.throttling.ui</module>
- <!-- Redirector -->
- <module>org.apache.stratos.sso.redirector.ui</module>
- <module>org.apache.stratos.redirector.servlet</module>
- <module>org.apache.stratos.redirector.servlet.ui</module>
- <!-- Status Monitor -->
- <module>org.apache.stratos.status.monitor.core</module>
- <module>org.apache.stratos.status.monitor</module>
- <module>org.apache.stratos.status.monitor.agent</module>
- <module>org.apache.stratos.status.monitor.ui</module>
- <!-- Usage -->
- <module>org.apache.stratos.usage.agent</module>
- <module>org.apache.stratos.usage</module>
- <module>org.apache.stratos.usage.summary.helper</module>
- <module>org.apache.stratos.usage.ui</module>
+ <module>org.apache.stratos.load.balancer.extension.api</module>
+ <!-- Tenant Mgt -->
+ <module>org.apache.stratos.register.ui</module>
+ <module>org.apache.stratos.tenant.mgt.core</module>
+ <module>org.apache.stratos.tenant.mgt</module>
+ <module>org.apache.stratos.tenant.mgt.ui</module>
+ <module>org.apache.stratos.tenant.mgt.email.sender</module>
+ <!-- Tenant Activity -->
+ <module>org.apache.stratos.tenant.activity</module>
+ <module>org.apache.stratos.tenant.activity.ui</module>
+ <!-- Account Mgt -->
+ <module>org.apache.stratos.account.mgt</module>
+ <module>org.apache.stratos.account.mgt.ui</module>
+ <module>org.apache.stratos.email.sender</module>
+ <!-- Domain Validation -->
+ <module>org.apache.stratos.validate.domain</module>
+ <module>org.apache.stratos.validate.domain.ui</module>
+ <!-- Throttling -->
+ <module>org.apache.stratos.throttling.agent</module>
+ <module>org.apache.stratos.throttling.manager</module>
+ <module>org.apache.stratos.throttling.ui</module>
+ <!-- Redirector -->
+ <module>org.apache.stratos.sso.redirector.ui</module>
+ <module>org.apache.stratos.redirector.servlet</module>
+ <module>org.apache.stratos.redirector.servlet.ui</module>
+ <!-- Status Monitor -->
+ <module>org.apache.stratos.status.monitor.core</module>
+ <module>org.apache.stratos.status.monitor</module>
+ <module>org.apache.stratos.status.monitor.agent</module>
+ <module>org.apache.stratos.status.monitor.ui</module>
+ <!-- Usage -->
+ <module>org.apache.stratos.usage.agent</module>
+ <module>org.apache.stratos.usage</module>
+ <module>org.apache.stratos.usage.summary.helper</module>
+ <module>org.apache.stratos.usage.ui</module>
- <module>org.apache.stratos.tenant.dispatcher</module>
- <module>org.apache.stratos.keystore.mgt</module>
- <module>org.apache.stratos.activation</module>
- <module>org.apache.stratos.cartridge.mgt.ui</module>
- <!-- Theme mgt -->
- <module>org.apache.stratos.theme.mgt.ui</module>
- <module>org.apache.stratos.theme.mgt</module>
- <!--Logging mgt-->
- <module>org.apache.stratos.logging.view.ui</module>
- <!-- RESTful admin services -->
- <module>org.apache.stratos.rest.endpoint</module>
- </modules>
+ <module>org.apache.stratos.tenant.dispatcher</module>
+ <module>org.apache.stratos.keystore.mgt</module>
+ <module>org.apache.stratos.activation</module>
+ <module>org.apache.stratos.cartridge.mgt.ui</module>
+ <!-- Theme mgt -->
+ <module>org.apache.stratos.theme.mgt.ui</module>
+ <module>org.apache.stratos.theme.mgt</module>
+ <!--Logging mgt-->
+ <module>org.apache.stratos.logging.view.ui</module>
+ <!-- RESTful admin services -->
+ <module>org.apache.stratos.rest.endpoint</module>
+ </modules>
<build>
<plugins>