You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2013/11/14 03:24:54 UTC

[1/2] git commit: supporting all kind of cartridges via the subscription(fixed the hard coded cartridges)

Updated Branches:
  refs/heads/master 9dc67d977 -> 43833f006


supporting all kind of cartridges via the subscription(fixed the hard coded cartridges)


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

Branch: refs/heads/master
Commit: f9fc4ec799abd6320cb8dae9a0a2116e6d16700f
Parents: 9dc67d9
Author: rekathiru <rt...@gmail.com>
Authored: Wed Nov 13 19:12:43 2013 -0700
Committer: rekathiru <rt...@gmail.com>
Committed: Wed Nov 13 19:12:43 2013 -0700

----------------------------------------------------------------------
 .../subscription/factory/CartridgeSubscriptionFactory.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f9fc4ec7/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/subscription/factory/CartridgeSubscriptionFactory.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/subscription/factory/CartridgeSubscriptionFactory.java b/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/subscription/factory/CartridgeSubscriptionFactory.java
index a6eb032..70be3ef 100644
--- a/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/subscription/factory/CartridgeSubscriptionFactory.java
+++ b/components/org.apache.stratos.adc.mgt/src/main/java/org/apache/stratos/adc/mgt/subscription/factory/CartridgeSubscriptionFactory.java
@@ -44,17 +44,16 @@ public class CartridgeSubscriptionFactory {
             cartridgeSubscription = new MultiTenantCartridgeSubscription(cartridgeInfo);
 
         } else {
-            if(cartridgeInfo.getType().equals(CartridgeConstants.MYSQL_CARTRIDGE_NAME)) {
+            if(cartridgeInfo.getProvider().equals(CartridgeConstants.DATA_CARTRIDGE_PROVIDER)) {
                 cartridgeSubscription = new DataCartridgeSubscription(cartridgeInfo);
             }
-            else if (cartridgeInfo.getType().equals(CartridgeConstants.PHP_CARTRIDGE_NAME)) {
-                cartridgeSubscription = new SingleTenantCartridgeSubscription(cartridgeInfo);
-            }
-            else if (cartridgeInfo.getType().equals(CartridgeConstants.TOMCAT_CARTRIDGE_NAME)) {
+            else {
                 cartridgeSubscription = new SingleTenantCartridgeSubscription(cartridgeInfo);
             }
         }
 
+
+
         if(cartridgeSubscription == null) {
             throw new ADCException("Unable to create a CartridgeSubscription subscription for "
                     + cartridgeInfo);


[2/2] git commit: fixing instance spawn event processor and adding partition to the member

Posted by re...@apache.org.
fixing instance spawn event processor and adding partition to the member


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

Branch: refs/heads/master
Commit: 43833f0060bcd5aed84a912805611fca2d7be421
Parents: f9fc4ec
Author: rekathiru <rt...@gmail.com>
Authored: Wed Nov 13 19:24:26 2013 -0700
Committer: rekathiru <rt...@gmail.com>
Committed: Wed Nov 13 19:24:26 2013 -0700

----------------------------------------------------------------------
 .../messaging/domain/topology/Member.java       |  9 +++++
 .../event/topology/InstanceSpawnedEvent.java    | 40 +++++---------------
 .../topology/InstanceSpawnedEventProcessor.java |  4 +-
 3 files changed, 22 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/43833f00/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
index 3e85da0..12374d4 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/domain/topology/Member.java
@@ -41,6 +41,7 @@ public class Member implements Serializable {
     private Map<String, Port> portMap;
     private Properties properties;
     private String iaasNodeId;
+    private Partition partition;
 
     public Member(String serviceName, String clusterId, String memberId) {
         this.serviceName = serviceName;
@@ -142,5 +143,13 @@ public class Member implements Serializable {
     public void setIaasNodeId(String iaasNodeId) {
         this.iaasNodeId = iaasNodeId;
     }
+
+    public Partition getPartition() {
+        return partition;
+    }
+
+    public void setPartition(Partition partition) {
+        this.partition = partition;
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/43833f00/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/InstanceSpawnedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/InstanceSpawnedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/InstanceSpawnedEvent.java
index d6765f5..a809624 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/InstanceSpawnedEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/InstanceSpawnedEvent.java
@@ -18,9 +18,7 @@
  */
 package org.apache.stratos.messaging.event.topology;
 
-import org.apache.stratos.messaging.domain.topology.Cloud;
-import org.apache.stratos.messaging.domain.topology.Region;
-import org.apache.stratos.messaging.domain.topology.Zone;
+import org.apache.stratos.messaging.domain.topology.Partition;
 
 import java.io.Serializable;
 
@@ -29,9 +27,7 @@ import java.io.Serializable;
  */
 public class InstanceSpawnedEvent extends TopologyEvent implements Serializable {
     private static final long serialVersionUID = 2672909702971355178L;
-    private Cloud cloud;
-    private Region region;
-    private Zone zone;
+    private Partition partition;
     private String serviceName;
     private String clusterId;
     private String memberId;
@@ -44,30 +40,6 @@ public class InstanceSpawnedEvent extends TopologyEvent implements Serializable
         this.iaasNodeId = iaasNodeId;
     }
 
-    public Cloud getCloud() {
-        return cloud;
-    }
-
-    public void setCloud(Cloud cloud) {
-        this.cloud = cloud;
-    }
-
-    public Region getRegion() {
-        return region;
-    }
-
-    public void setRegion(Region region) {
-        this.region = region;
-    }
-
-    public Zone getZone() {
-        return zone;
-    }
-
-    public void setZone(Zone zone) {
-        this.zone = zone;
-    }
-
     public String getServiceName() {
         return serviceName;
     }
@@ -87,4 +59,12 @@ public class InstanceSpawnedEvent extends TopologyEvent implements Serializable
     public void setIaasNodeId(String iaasNodeId) {
         this.iaasNodeId = iaasNodeId;
     }
+
+    public Partition getPartition() {
+        return partition;
+    }
+
+    public void setPartition(Partition partition) {
+        this.partition = partition;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/43833f00/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/InstanceSpawnedEventProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/InstanceSpawnedEventProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/InstanceSpawnedEventProcessor.java
index 5576d75..517174d 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/InstanceSpawnedEventProcessor.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/topology/InstanceSpawnedEventProcessor.java
@@ -21,6 +21,7 @@ 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.domain.topology.*;
+import org.apache.stratos.messaging.event.topology.InstanceSpawnedEvent;
 import org.apache.stratos.messaging.event.topology.MemberStartedEvent;
 import org.apache.stratos.messaging.message.processor.MessageProcessor;
 import org.apache.stratos.messaging.util.Util;
@@ -41,7 +42,7 @@ public class InstanceSpawnedEventProcessor extends MessageProcessor {
 
         if (MemberStartedEvent.class.getName().equals(type)) {
             // Parse complete message and build event
-            MemberStartedEvent event = (MemberStartedEvent) Util.jsonToObject(message, MemberStartedEvent.class);
+            InstanceSpawnedEvent event = (InstanceSpawnedEvent) Util.jsonToObject(message, InstanceSpawnedEvent.class);
 
             // Validate event against the existing topology
             Service service = topology.getService(event.getServiceName());
@@ -64,6 +65,7 @@ public class InstanceSpawnedEventProcessor extends MessageProcessor {
             // Apply changes to the topology
             Member member = new Member(event.getServiceName(), event.getClusterId(), event.getMemberId());
             member.setStatus(MemberStatus.Created);
+            member.setPartition(event.getPartition());
             cluster.addMember(member);
 
             if (log.isInfoEnabled()) {