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 2014/12/05 14:40:29 UTC
[3/5] stratos git commit: adding instance prefix to events, ,
processor and listener
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceActivatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceActivatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceActivatedEvent.java
new file mode 100644
index 0000000..34b304f
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceActivatedEvent.java
@@ -0,0 +1,63 @@
+/*
+ * 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.messaging.event.topology;
+
+import org.apache.stratos.messaging.domain.topology.ClusterStatus;
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Cluster activated event will be sent by Autoscaler
+ */
+public class ClusterInstanceActivatedEvent extends Event {
+
+ private final String serviceName;
+ private final String clusterId;
+ private String appId;
+ private String instanceId;
+
+ public ClusterInstanceActivatedEvent(String appId, String serviceName, String clusterId, String instanceId) {
+ this.serviceName = serviceName;
+ this.clusterId = clusterId;
+ this.appId = appId;
+ this.instanceId = instanceId;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
+ "]";
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceInactivateEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceInactivateEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceInactivateEvent.java
new file mode 100644
index 0000000..e84be18
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceInactivateEvent.java
@@ -0,0 +1,63 @@
+/*
+ * 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.messaging.event.topology;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Cluster activated event will be sent by Autoscaler
+ */
+public class ClusterInstanceInactivateEvent extends Event {
+
+ private final String serviceName;
+ private final String clusterId;
+ private String appId;
+ private String instanceId;
+
+
+ public ClusterInstanceInactivateEvent(String appId, String serviceName, String clusterId, String instanceId) {
+ this.serviceName = serviceName;
+ this.clusterId = clusterId;
+ this.appId = appId;
+ this.instanceId = instanceId;
+
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
+ "]";
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatedEvent.java
new file mode 100644
index 0000000..8c51234
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatedEvent.java
@@ -0,0 +1,63 @@
+/*
+ * 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.messaging.event.topology;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Cluster activated event will be sent by Autoscaler
+ */
+public class ClusterInstanceTerminatedEvent extends Event {
+
+ private final String serviceName;
+ private final String clusterId;
+ private String appId;
+ private String instanceId;
+
+
+ public ClusterInstanceTerminatedEvent(String appId, String serviceName, String clusterId, String instanceId) {
+ this.serviceName = serviceName;
+ this.clusterId = clusterId;
+ this.appId = appId;
+ this.instanceId = instanceId;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
+ "]";
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatingEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatingEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatingEvent.java
new file mode 100644
index 0000000..c1458be
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterInstanceTerminatingEvent.java
@@ -0,0 +1,61 @@
+/*
+ * 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.messaging.event.topology;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Cluster activated event will be sent by Autoscaler
+ */
+public class ClusterInstanceTerminatingEvent extends Event {
+
+ private final String serviceName;
+ private final String clusterId;
+ private String appId;
+ private String instanceId;
+
+ public ClusterInstanceTerminatingEvent(String appId, String serviceName, String clusterId, String instanceId) {
+ this.serviceName = serviceName;
+ this.clusterId = clusterId;
+ this.appId = appId;
+ this.instanceId = instanceId;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ @Override
+ public String toString() {
+ return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
+ "]";
+ }
+
+ public String getClusterId() {
+ return clusterId;
+ }
+
+ public String getAppId() {
+ return appId;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatedEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatedEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatedEvent.java
deleted file mode 100644
index 1013292..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatedEvent.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.event.topology;
-
-import org.apache.stratos.messaging.event.Event;
-
-/**
- * Cluster activated event will be sent by Autoscaler
- */
-public class ClusterTerminatedEvent extends Event {
-
- private final String serviceName;
- private final String clusterId;
- private String appId;
- private String instanceId;
-
-
- public ClusterTerminatedEvent(String appId, String serviceName, String clusterId, String instanceId) {
- this.serviceName = serviceName;
- this.clusterId = clusterId;
- this.appId = appId;
- this.instanceId = instanceId;
- }
-
- public String getServiceName() {
- return serviceName;
- }
-
- @Override
- public String toString() {
- return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
- "]";
- }
-
- public String getClusterId() {
- return clusterId;
- }
-
- public String getAppId() {
- return appId;
- }
-
- public String getInstanceId() {
- return instanceId;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatingEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatingEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatingEvent.java
deleted file mode 100644
index 86b15e4..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/topology/ClusterTerminatingEvent.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.event.topology;
-
-import org.apache.stratos.messaging.event.Event;
-
-/**
- * Cluster activated event will be sent by Autoscaler
- */
-public class ClusterTerminatingEvent extends Event {
-
- private final String serviceName;
- private final String clusterId;
- private String appId;
- private String instanceId;
-
- public ClusterTerminatingEvent(String appId, String serviceName, String clusterId, String instanceId) {
- this.serviceName = serviceName;
- this.clusterId = clusterId;
- this.appId = appId;
- this.instanceId = instanceId;
- }
-
- public String getServiceName() {
- return serviceName;
- }
-
- @Override
- public String toString() {
- return "ClusterActivatedEvent [serviceName=" + serviceName + ", clusterStatus=" +
- "]";
- }
-
- public String getClusterId() {
- return clusterId;
- }
-
- public String getAppId() {
- return appId;
- }
-
- public String getInstanceId() {
- return instanceId;
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationActivatedEventListener.java
deleted file mode 100644
index e244ae9..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationActivatedEventListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-/**
- * This listener will get triggered upon the application activated event.
- */
-public abstract class ApplicationActivatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInactivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInactivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInactivatedEventListener.java
deleted file mode 100644
index d0593fb..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInactivatedEventListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-/**
- * This listener will get triggered upon the application inactivated event.
- */
-public abstract class ApplicationInactivatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceActivatedEventListener.java
new file mode 100644
index 0000000..086efbc
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceActivatedEventListener.java
@@ -0,0 +1,27 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * This listener will get triggered upon the application activated event.
+ */
+public abstract class ApplicationInstanceActivatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceInactivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceInactivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceInactivatedEventListener.java
new file mode 100644
index 0000000..2fbfbf9
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceInactivatedEventListener.java
@@ -0,0 +1,27 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * This listener will get triggered upon the application inactivated event.
+ */
+public abstract class ApplicationInstanceInactivatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatedEventListener.java
new file mode 100644
index 0000000..e7c31f8
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatedEventListener.java
@@ -0,0 +1,27 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * This listener will get triggered upon the application terminated event.
+ */
+public abstract class ApplicationInstanceTerminatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatingEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatingEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatingEventListener.java
new file mode 100644
index 0000000..ef2ff49
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationInstanceTerminatingEventListener.java
@@ -0,0 +1,27 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+/**
+ * This listener will get triggered upon the application terminating event.
+ */
+public abstract class ApplicationInstanceTerminatingEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatedEventListener.java
deleted file mode 100644
index 064465c..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatedEventListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-/**
- * This listener will get triggered upon the application terminated event.
- */
-public abstract class ApplicationTerminatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatingEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatingEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatingEventListener.java
deleted file mode 100644
index 3be2ad2..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/ApplicationTerminatingEventListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-/**
- * This listener will get triggered upon the application terminating event.
- */
-public abstract class ApplicationTerminatingEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupActivatedEventListener.java
deleted file mode 100644
index 51455ae..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupActivatedEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class GroupActivatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInactivateEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInactivateEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInactivateEventListener.java
deleted file mode 100644
index aeb58da..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInactivateEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class GroupInactivateEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceActivatedEventListener.java
new file mode 100644
index 0000000..3c102cb
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceActivatedEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class GroupInstanceActivatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceCreatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceCreatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceCreatedEventListener.java
new file mode 100644
index 0000000..22de3c1
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceCreatedEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class GroupInstanceCreatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceInactivateEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceInactivateEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceInactivateEventListener.java
new file mode 100644
index 0000000..e402bd1
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceInactivateEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class GroupInstanceInactivateEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatedEventListener.java
new file mode 100644
index 0000000..7d396c0
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatedEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class GroupInstanceTerminatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatingEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatingEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatingEventListener.java
new file mode 100644
index 0000000..b85cbc0
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupInstanceTerminatingEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.applications;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class GroupInstanceTerminatingEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupResetEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupResetEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupResetEventListener.java
deleted file mode 100644
index b4b67ed..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupResetEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class GroupResetEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatedEventListener.java
deleted file mode 100644
index ed4bb3a..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatedEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class GroupTerminatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatingEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatingEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatingEventListener.java
deleted file mode 100644
index 5168f77..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/applications/GroupTerminatingEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.applications;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class GroupTerminatingEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterActivatedEventListener.java
deleted file mode 100644
index 00efcfd..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterActivatedEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.topology;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class ClusterActivatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInActivateEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInActivateEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInActivateEventListener.java
deleted file mode 100644
index 551f1b8..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInActivateEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.topology;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class ClusterInActivateEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceActivatedEventListener.java
new file mode 100644
index 0000000..c35c759
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceActivatedEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.topology;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class ClusterInstanceActivatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceInActivateEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceInActivateEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceInActivateEventListener.java
new file mode 100644
index 0000000..888892d
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceInActivateEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.topology;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class ClusterInstanceInActivateEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatedEventListener.java
new file mode 100644
index 0000000..17c1b77
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatedEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.topology;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class ClusterInstanceTerminatedEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatingEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatingEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatingEventListener.java
new file mode 100644
index 0000000..30ae39b
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterInstanceTerminatingEventListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.messaging.listener.topology;
+
+import org.apache.stratos.messaging.listener.EventListener;
+
+public abstract class ClusterInstanceTerminatingEventListener extends EventListener {
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatedEventListener.java
deleted file mode 100644
index 33d050d..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatedEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.topology;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class ClusterTerminatedEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatingEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatingEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatingEventListener.java
deleted file mode 100644
index 5c08203..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterTerminatingEventListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.listener.topology;
-
-import org.apache.stratos.messaging.listener.EventListener;
-
-public abstract class ClusterTerminatingEventListener extends EventListener {
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationActivatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationActivatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationActivatedMessageProcessor.java
deleted file mode 100644
index 401e206..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationActivatedMessageProcessor.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.message.processor.applications;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.messaging.domain.applications.Application;
-import org.apache.stratos.messaging.domain.applications.ApplicationStatus;
-import org.apache.stratos.messaging.domain.applications.Applications;
-import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
-import org.apache.stratos.messaging.event.applications.ApplicationActivatedEvent;
-import org.apache.stratos.messaging.message.processor.MessageProcessor;
-import org.apache.stratos.messaging.message.processor.applications.updater.ApplicationsUpdater;
-import org.apache.stratos.messaging.util.Util;
-
-/**
- * This processor responsible to process the application activation even and update the Topology.
- */
-public class ApplicationActivatedMessageProcessor extends MessageProcessor {
- private static final Log log =
- LogFactory.getLog(ApplicationActivatedMessageProcessor.class);
-
-
- private MessageProcessor nextProcessor;
-
- @Override
- public void setNext(MessageProcessor nextProcessor) {
- this.nextProcessor = nextProcessor;
- }
-
-
- @Override
- public boolean process(String type, String message, Object object) {
- Applications applications = (Applications) object;
-
- if (ApplicationActivatedEvent.class.getName().equals(type)) {
- // Return if applications has not been initialized
- if (!applications.isInitialized())
- return false;
-
- // Parse complete message and build event
- ApplicationActivatedEvent event = (ApplicationActivatedEvent) Util.
- jsonToObject(message, ApplicationActivatedEvent.class);
-
- ApplicationsUpdater.acquireWriteLockForApplication(event.getAppId());
-
- try {
- return doProcess(event, applications);
-
- } finally {
- ApplicationsUpdater.releaseWriteLockForApplication(event.getAppId());
- }
-
- } else {
- if (nextProcessor != null) {
- // ask the next processor to take care of the message.
- return nextProcessor.process(type, message, applications);
- } else {
- throw new RuntimeException(String.format("Failed to process message using available message processors: [type] %s [body] %s", type, message));
- }
- }
- }
-
- private boolean doProcess(ApplicationActivatedEvent event, Applications applications) {
-
- // Validate event against the existing applications
- Application application = applications.getApplication(event.getAppId());
- if (application == null) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("Application does not exist: [service] %s",
- event.getAppId()));
- }
- return false;
- } else {
- // Apply changes to the applications
- ApplicationInstance context = application.getInstanceContexts(event.getInstanceId());
- if(context == null) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("Application Instance not exists in Group: [AppId] %s" +
- "[instanceId] %s", event.getAppId(), event.getInstanceId()));
- return false;
- }
- }
- ApplicationStatus status = ApplicationStatus.Active;
- if (!context.isStateTransitionValid(status)) {
- log.error("Invalid State transfer from [ " + context.getStatus() +
- " ] to [ " + status + " ]");
- }
- context.setStatus(status);
-
- }
-
- // Notify event listeners
- notifyEventListeners(event);
- return true;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInactivatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInactivatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInactivatedMessageProcessor.java
deleted file mode 100644
index 5a3ef91..0000000
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInactivatedMessageProcessor.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.messaging.message.processor.applications;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.messaging.domain.applications.Application;
-import org.apache.stratos.messaging.domain.applications.ApplicationStatus;
-import org.apache.stratos.messaging.domain.applications.Applications;
-import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
-import org.apache.stratos.messaging.event.applications.ApplicationInstanceInactivatedEvent;
-import org.apache.stratos.messaging.message.processor.MessageProcessor;
-import org.apache.stratos.messaging.message.processor.applications.updater.ApplicationsUpdater;
-import org.apache.stratos.messaging.util.Util;
-
-/**
- * This processor responsible to process the application Inactivation even and update the Topology.
- */
-public class ApplicationInactivatedMessageProcessor extends MessageProcessor {
- private static final Log log =
- LogFactory.getLog(ApplicationInactivatedMessageProcessor.class);
-
-
- private MessageProcessor nextProcessor;
-
- @Override
- public void setNext(MessageProcessor nextProcessor) {
- this.nextProcessor = nextProcessor;
- }
-
-
- @Override
- public boolean process(String type, String message, Object object) {
- Applications applications = (Applications) object;
-
- if (ApplicationInstanceInactivatedEvent.class.getName().equals(type)) {
- // Return if applications has not been initialized
- if (!applications.isInitialized())
- return false;
-
- // Parse complete message and build event
- ApplicationInstanceInactivatedEvent event = (ApplicationInstanceInactivatedEvent) Util.
- jsonToObject(message, ApplicationInstanceInactivatedEvent.class);
-
- ApplicationsUpdater.acquireWriteLockForApplication(event.getAppId());
-
- try {
- return doProcess(event, applications);
-
- } finally {
- ApplicationsUpdater.releaseWriteLockForApplication(event.getAppId());
- }
-
- } else {
- if (nextProcessor != null) {
- // ask the next processor to take care of the message.
- return nextProcessor.process(type, message, applications);
- } else {
- throw new RuntimeException(String.format("Failed to process message using available message processors: [type] %s [body] %s", type, message));
- }
- }
- }
-
- private boolean doProcess(ApplicationInstanceInactivatedEvent event, Applications applications) {
-
- // Validate event against the existing applications
- Application application = applications.getApplication(event.getAppId());
- if (application == null) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("Application does not exist: [service] %s",
- event.getAppId()));
- }
- return false;
- } else {
- // Apply changes to the applications
- ApplicationInstance context = application.getInstanceContexts(event.getInstanceId());
- if(context == null) {
- if (log.isWarnEnabled()) {
- log.warn(String.format("Application Instance not exists in Group: [AppId] %s" +
- "[instanceId] %s", event.getAppId(), event.getInstanceId()));
- return false;
- }
- }
- ApplicationStatus status = ApplicationStatus.Inactive;
- if (!context.isStateTransitionValid(status)) {
- log.error("Invalid State transfer from [ " + context.getStatus() +
- " ] to [ " + status + " ]");
- }
- context.setStatus(status);
-
- }
-
- // Notify event listeners
- notifyEventListeners(event);
- return true;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceActivatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceActivatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceActivatedMessageProcessor.java
new file mode 100644
index 0000000..bd83e10
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceActivatedMessageProcessor.java
@@ -0,0 +1,114 @@
+/*
+ * 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.messaging.message.processor.applications;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.domain.applications.Application;
+import org.apache.stratos.messaging.domain.applications.ApplicationStatus;
+import org.apache.stratos.messaging.domain.applications.Applications;
+import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
+import org.apache.stratos.messaging.event.applications.ApplicationInstanceActivatedEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.message.processor.applications.updater.ApplicationsUpdater;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * This processor responsible to process the application activation even and update the Topology.
+ */
+public class ApplicationInstanceActivatedMessageProcessor extends MessageProcessor {
+ private static final Log log =
+ LogFactory.getLog(ApplicationInstanceActivatedMessageProcessor.class);
+
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ Applications applications = (Applications) object;
+
+ if (ApplicationInstanceActivatedEvent.class.getName().equals(type)) {
+ // Return if applications has not been initialized
+ if (!applications.isInitialized())
+ return false;
+
+ // Parse complete message and build event
+ ApplicationInstanceActivatedEvent event = (ApplicationInstanceActivatedEvent) Util.
+ jsonToObject(message, ApplicationInstanceActivatedEvent.class);
+
+ ApplicationsUpdater.acquireWriteLockForApplication(event.getAppId());
+
+ try {
+ return doProcess(event, applications);
+
+ } finally {
+ ApplicationsUpdater.releaseWriteLockForApplication(event.getAppId());
+ }
+
+ } else {
+ if (nextProcessor != null) {
+ // ask the next processor to take care of the message.
+ return nextProcessor.process(type, message, applications);
+ } else {
+ throw new RuntimeException(String.format("Failed to process message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+
+ private boolean doProcess(ApplicationInstanceActivatedEvent event, Applications applications) {
+
+ // Validate event against the existing applications
+ Application application = applications.getApplication(event.getAppId());
+ if (application == null) {
+ if (log.isWarnEnabled()) {
+ log.warn(String.format("Application does not exist: [service] %s",
+ event.getAppId()));
+ }
+ return false;
+ } else {
+ // Apply changes to the applications
+ ApplicationInstance context = application.getInstanceContexts(event.getInstanceId());
+ if(context == null) {
+ if (log.isWarnEnabled()) {
+ log.warn(String.format("Application Instance not exists in Group: [AppId] %s" +
+ "[instanceId] %s", event.getAppId(), event.getInstanceId()));
+ return false;
+ }
+ }
+ ApplicationStatus status = ApplicationStatus.Active;
+ if (!context.isStateTransitionValid(status)) {
+ log.error("Invalid State transfer from [ " + context.getStatus() +
+ " ] to [ " + status + " ]");
+ }
+ context.setStatus(status);
+
+ }
+
+ // Notify event listeners
+ notifyEventListeners(event);
+ return true;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/cf1b3727/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceInactivatedMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceInactivatedMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceInactivatedMessageProcessor.java
new file mode 100644
index 0000000..e41905b
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/applications/ApplicationInstanceInactivatedMessageProcessor.java
@@ -0,0 +1,114 @@
+/*
+ * 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.messaging.message.processor.applications;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.domain.applications.Application;
+import org.apache.stratos.messaging.domain.applications.ApplicationStatus;
+import org.apache.stratos.messaging.domain.applications.Applications;
+import org.apache.stratos.messaging.domain.instance.ApplicationInstance;
+import org.apache.stratos.messaging.event.applications.ApplicationInstanceInactivatedEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.message.processor.applications.updater.ApplicationsUpdater;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * This processor responsible to process the application Inactivation even and update the Topology.
+ */
+public class ApplicationInstanceInactivatedMessageProcessor extends MessageProcessor {
+ private static final Log log =
+ LogFactory.getLog(ApplicationInstanceInactivatedMessageProcessor.class);
+
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ Applications applications = (Applications) object;
+
+ if (ApplicationInstanceInactivatedEvent.class.getName().equals(type)) {
+ // Return if applications has not been initialized
+ if (!applications.isInitialized())
+ return false;
+
+ // Parse complete message and build event
+ ApplicationInstanceInactivatedEvent event = (ApplicationInstanceInactivatedEvent) Util.
+ jsonToObject(message, ApplicationInstanceInactivatedEvent.class);
+
+ ApplicationsUpdater.acquireWriteLockForApplication(event.getAppId());
+
+ try {
+ return doProcess(event, applications);
+
+ } finally {
+ ApplicationsUpdater.releaseWriteLockForApplication(event.getAppId());
+ }
+
+ } else {
+ if (nextProcessor != null) {
+ // ask the next processor to take care of the message.
+ return nextProcessor.process(type, message, applications);
+ } else {
+ throw new RuntimeException(String.format("Failed to process message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+
+ private boolean doProcess(ApplicationInstanceInactivatedEvent event, Applications applications) {
+
+ // Validate event against the existing applications
+ Application application = applications.getApplication(event.getAppId());
+ if (application == null) {
+ if (log.isWarnEnabled()) {
+ log.warn(String.format("Application does not exist: [service] %s",
+ event.getAppId()));
+ }
+ return false;
+ } else {
+ // Apply changes to the applications
+ ApplicationInstance context = application.getInstanceContexts(event.getInstanceId());
+ if(context == null) {
+ if (log.isWarnEnabled()) {
+ log.warn(String.format("Application Instance not exists in Group: [AppId] %s" +
+ "[instanceId] %s", event.getAppId(), event.getInstanceId()));
+ return false;
+ }
+ }
+ ApplicationStatus status = ApplicationStatus.Inactive;
+ if (!context.isStateTransitionValid(status)) {
+ log.error("Invalid State transfer from [ " + context.getStatus() +
+ " ] to [ " + status + " ]");
+ }
+ context.setStatus(status);
+
+ }
+
+ // Notify event listeners
+ notifyEventListeners(event);
+ return true;
+
+ }
+}