You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ud...@apache.org on 2013/12/20 16:15:16 UTC
[01/19] git commit: Updated string.format place holders in cartridge
agent
Updated Branches:
refs/heads/master ce67fc1f9 -> 8c6a58c97
Updated string.format place holders in cartridge agent
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/93f71b74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/93f71b74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/93f71b74
Branch: refs/heads/master
Commit: 93f71b747d4e05071431cce86e31b950871a50f0
Parents: 419b38c
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 14:52:25 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:36 2013 -0500
----------------------------------------------------------------------
.../agent/statistics/publisher/HealthStatisticsNotifier.java | 4 ++--
.../agent/statistics/publisher/HealthStatisticsPublisher.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/93f71b74/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
index 4beeee9..9d54a87 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
@@ -70,7 +70,7 @@ public class HealthStatisticsNotifier implements Runnable {
double memoryConsumption = HealthStatisticsReader.getMemoryConsumption();
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing memory consumption: %d", memoryConsumption));
+ log.info(String.format("Publishing memory consumption: %f", memoryConsumption));
}
statsPublisher.publish(
CartridgeAgentConfiguration.getInstance().getClusterId(),
@@ -83,7 +83,7 @@ public class HealthStatisticsNotifier implements Runnable {
double loadAverage = HealthStatisticsReader.getLoadAverage();
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing load average: %d", loadAverage));
+ log.info(String.format("Publishing load average: %f", loadAverage));
}
statsPublisher.publish(
CartridgeAgentConfiguration.getInstance().getClusterId(),
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/93f71b74/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
index cf3f1b7..e4f0ae8 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
@@ -74,7 +74,7 @@ public class HealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
*/
public void publish(String clusterId, String networkPartitionId, String memberId, String partitionId, String health, double value) {
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %d",
+ log.info(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %f",
clusterId, networkPartitionId, partitionId, memberId, health, value));
}
List<Object> payload = new ArrayList<Object>();
[08/19] git commit: removing a unnecessray section
Posted by ud...@apache.org.
removing a unnecessray section
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/70a41329
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/70a41329
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/70a41329
Branch: refs/heads/master
Commit: 70a4132978276a49e76d33cd88bf72eb7b64d3c3
Parents: 93f71b7
Author: Isuru <is...@wso2.com>
Authored: Fri Dec 20 14:59:51 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../modules/scripts/ec2/cartridge-agent.sh | 10 ----------
1 file changed, 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/70a41329/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
index 5769f92..2f31da6 100755
--- a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
+++ b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
@@ -59,16 +59,6 @@ source ${instance_path}/launch.params
# Starting cartridge agent executable
#------------------------------------
pushd $ca_exec_path
-echo "Configuring cartridge agent executable..." | tee -a $LOG
-cp -f templates/cartridge-agent.sh.template bin/cartridge-agent.sh.tmp
-cat bin/cartridge-agent.sh.tmp | sed -e "s@MB-IP@$MB_IP@g" > bin/cartridge-agent.sh
-cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
-cat bin/cartridge-agent.sh.tmp | sed -e "s@MB-PORT@$MB_PORT@g" > bin/cartridge-agent.sh
-cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
-cat bin/cartridge-agent.sh.tmp | sed -e "s@CEP-IP@$CEP_IP@g" > bin/cartridge-agent.sh
-cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
-cat bin/cartridge-agent.sh.tmp | sed -e "s@CEP-PORT@$CEP_PORT@g" > bin/cartridge-agent.sh
-rm -f bin/cartridge-agent.sh.tmp
echo "Starting cartridge agent..." | tee -a $LOG
sh bin/cartridge-agent.sh
popd
[07/19] git commit: Changed info log to debug in cartridge agent
Posted by ud...@apache.org.
Changed info log to debug in cartridge agent
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/7588e61e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/7588e61e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/7588e61e
Branch: refs/heads/master
Commit: 7588e61e77da17cd07d91a1476cf96e6303f0ada
Parents: 8807206
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 15:53:32 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../agent/statistics/publisher/HealthStatisticsPublisher.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7588e61e/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
index 4972a30..0e9da7c 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
@@ -72,8 +72,8 @@ public class HealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
* @param value
*/
public void publish(String clusterId, String networkPartitionId, String memberId, String partitionId, String health, double value) {
- if(log.isInfoEnabled()) {
- log.info(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %f",
+ if(log.isDebugEnabled()) {
+ log.debug(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %f",
clusterId, networkPartitionId, partitionId, memberId, health, value));
}
List<Object> payload = new ArrayList<Object>();
[19/19] git commit: adding the serializability to the partition
context and network partiton context
Posted by ud...@apache.org.
adding the serializability to the partition context and network partiton context
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/8c6a58c9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/8c6a58c9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/8c6a58c9
Branch: refs/heads/master
Commit: 8c6a58c97ead7dd8b8284b1962729d028227b5cb
Parents: b302284
Author: Udara Liyanage <ud...@wso2.com>
Authored: Fri Dec 20 20:44:26 2013 -0500
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:44:26 2013 -0500
----------------------------------------------------------------------
.../org/apache/stratos/autoscaler/NetworkPartitionContext.java | 5 +++--
.../java/org/apache/stratos/autoscaler/PartitionContext.java | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8c6a58c9/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
index e902fff..61b2351 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/NetworkPartitionContext.java
@@ -30,9 +30,10 @@ import java.util.Map;
* Holds runtime data of a network partition.
*
*/
-public class NetworkPartitionContext{
+public class NetworkPartitionContext implements Serializable{
- private static final Log log = LogFactory.getLog(NetworkPartitionContext.class);
+ private static final long serialVersionUID = -8851073480764734511L;
+ private static final Log log = LogFactory.getLog(NetworkPartitionContext.class);
private String id;
private String defaultLbClusterId;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8c6a58c9/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java
index e60d855..51150e0 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/PartitionContext.java
@@ -40,9 +40,10 @@ import java.util.concurrent.CopyOnWriteArrayList;
*
*/
-public class PartitionContext{
+public class PartitionContext implements Serializable{
- private static final Log log = LogFactory.getLog(PartitionContext.class);
+ private static final long serialVersionUID = -2920388667345980487L;
+ private static final Log log = LogFactory.getLog(PartitionContext.class);
private String partitionId;
private String serviceName;
private String networkPartitionId;
[05/19] git commit: Updated cartridge agent main class to initialize
config
Posted by ud...@apache.org.
Updated cartridge agent main class to initialize config
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/2011cd20
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/2011cd20
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/2011cd20
Branch: refs/heads/master
Commit: 2011cd20e2de670fd6d9297d6fd2bfa5d6842902
Parents: 3bb2e47
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 13:56:34 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:36 2013 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/stratos/cartridge/agent/Main.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2011cd20/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/Main.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/Main.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/Main.java
index 873868b..744b258 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/Main.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/Main.java
@@ -44,6 +44,9 @@ public class Main {
// Generate jndi.properties file
JndiConfigurator.configure();
+ // Initialize cartridge agent configuration
+ CartridgeAgentConfiguration.getInstance();
+
cartridgeAgent = new CartridgeAgent();
Thread thread = new Thread(cartridgeAgent);
thread.start();
[16/19] git commit: committing cartridge-agent.sh with support for
single cartridge agent pack
Posted by ud...@apache.org.
committing cartridge-agent.sh with support for single cartridge agent pack
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6e62121d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6e62121d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6e62121d
Branch: refs/heads/master
Commit: 6e62121d1ff13ff41e09491587061e34d87c1d7d
Parents: 2f8a008
Author: Isuru <is...@wso2.com>
Authored: Fri Dec 20 16:33:32 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../modules/scripts/ec2/cartridge-agent.sh | 36 +++++++++++++++++---
1 file changed, 31 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6e62121d/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
index 2f774e0..b8c3d3a 100755
--- a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
+++ b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
@@ -24,14 +24,19 @@
# instance is spawned. It will initiate all the tasks that needs to
# be run to bring the cartridge instance to operational state.
+source /etc/environment
+
set -e # Terminate on any error
export LOG=/var/log/apache-stratos/cartridge-agent-sh.log
instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
ca_exec_path=${instance_path}/cartridge-agent # Cartridge agent executable home
+temp_payload_path=/tmp/payload/launch-params
+puppet_payload_path=/tmp/puppet-payload
+cartridge_agent_script=cartridge-agent.sh
-#-----
+#---------------------------------------------
# Unzip cartridge agent pack
-#-----
+#---------------------------------------------
pushd ${instance_path}
unzip apache-stratos-cartridge-agent-4.0.0-SNAPSHOT-bin.zip
mv apache-stratos-cartridge-agent-4.0.0-SNAPSHOT cartridge-agent
@@ -45,8 +50,14 @@ if [ ! -d ${instance_path}/payload ]; then
echo "creating payload directory... " | tee -a $LOG
mkdir ${instance_path}/payload
echo "payload directory created" | tee -a $LOG
- wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/payload.txt
- echo "payload copied" | tee -a $LOG
+ #wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/launch-params -- payload already downloaded
+ #echo "payload copied" | tee -a $LOG
+
+ # Concat puppet payload and instance payload into ${instance_path}/payload/launch-params
+ #Read puppet configs
+ puppet_config=`cat /tmp/puppet-payload`
+ echo "puppet_config"
+ sed "s|$|${puppet_config}|" ${temp_payload_path} > ${instance_path}/payload/launch-params
for i in `/usr/bin/ruby ${instance_path}/get-launch-params.rb`
do
@@ -59,11 +70,26 @@ if [ ! -d ${instance_path}/payload ]; then
fi
echo "writing to launch.params ${value}" | tee -a $LOG
echo "export" ${value} >> ${instance_path}/launch.params
- done
+ done
+
fi
source ${instance_path}/launch.params
+pushd $ca_exec_path
+echo "Configuring cartridge agent executable..." | tee -a $LOG
+cp -f bin/$cartridge_agent_script bin/$cartridge_agent_script.tmp
+cat bin/$cartridge_agent_script.tmp | sed -e "s@MB-IP@$MB_IP@g" > bin/$cartridge_agent_script
+cp -f bin/$cartridge_agent_script bin/$cartridge_agent_script.tmp
+cat bin/$cartridge_agent_script.tmp | sed -e "s@MB-PORT@$MB_PORT@g" > bin/$cartridge_agent_script
+cp -f bin/$cartridge_agent_script bin/$cartridge_agent_script.tmp
+cat bin/$cartridge_agent_script.tmp | sed -e "s@CEP-IP@$CEP_IP@g" > bin/$cartridge_agent_script
+cp -f bin/$cartridge_agent_script bin/$cartridge_agent_script.tmp
+cat bin/$cartridge_agent_script.tmp | sed -e "s@CEP-PORT@$CEP_PORT@g" > bin/$cartridge_agent_script
+rm -f bin/$cartridge_agent_script.tmp
+popd
+
+
#------------------------------------
# Starting cartridge agent executable
#------------------------------------
[17/19] git commit: Adding message processors and adding super class
for events
Posted by ud...@apache.org.
Adding message processors and adding super class for events
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/4e772d16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/4e772d16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/4e772d16
Branch: refs/heads/master
Commit: 4e772d162700bb68385a297380bf398aea593fd8
Parents: 62f852f
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Fri Dec 20 15:22:37 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../health/stat/AverageLoadAverageEvent.java | 6 +-
.../stat/AverageMemoryConsumptionEvent.java | 6 +-
.../stat/AverageRequestsInFlightEvent.java | 6 +-
.../health/stat/GradientOfLoadAverageEvent.java | 6 +-
.../stat/GradientOfMemoryConsumptionEvent.java | 6 +-
.../stat/GradientOfRequestsInFlightEvent.java | 6 +-
.../event/health/stat/HealthStatEvent.java | 32 ++++++++++
.../stat/MemberAverageLoadAverageEvent.java | 6 +-
.../MemberAverageMemoryConsumptionEvent.java | 6 +-
.../event/health/stat/MemberFaultEvent.java | 6 +-
.../stat/MemberGradientOfLoadAverageEvent.java | 6 +-
.../MemberGradientOfMemoryConsumptionEvent.java | 6 +-
...emberSecondDerivativeOfLoadAverageEvent.java | 6 +-
...econdDerivativeOfMemoryConsumptionEvent.java | 6 +-
.../SecondDerivativeOfLoadAverageEvent.java | 5 +-
...econdDerivativeOfMemoryConsumptionEvent.java | 6 +-
...SecondDerivativeOfRequestsInFlightEvent.java | 6 +-
.../AverageLoadAverageMessageProcessor.java | 66 +++++++++++++++++++
...verageMemoryConsumptionMessageProcessor.java | 66 +++++++++++++++++++
...AverageRequestsInFlightMessageProcessor.java | 66 +++++++++++++++++++
.../GradientOfLoadAverageMessageProcessor.java | 66 +++++++++++++++++++
...ientOfMemoryConsumptionMessageProcessor.java | 65 +++++++++++++++++++
...dientOfRequestsInFlightMessageProcessor.java | 66 +++++++++++++++++++
...emberAverageLoadAverageMessageProcessor.java | 66 +++++++++++++++++++
...verageMemoryConsumptionMessageProcessor.java | 66 +++++++++++++++++++
.../stat/MemberFaultMessageProcessor.java | 66 +++++++++++++++++++
...erGradientOfLoadAverageMessageProcessor.java | 66 +++++++++++++++++++
...ientOfMemoryConsumptionMessageProcessor.java | 67 ++++++++++++++++++++
...DerivativeOfLoadAverageMessageProcessor.java | 66 +++++++++++++++++++
...tiveOfMemoryConsumptionMessageProcessor.java | 66 +++++++++++++++++++
...DerivativeOfLoadAverageMessageProcessor.java | 66 +++++++++++++++++++
...tiveOfMemoryConsumptionMessageProcessor.java | 66 +++++++++++++++++++
...ativeOfRequestsInFlightMessageProcessor.java | 66 +++++++++++++++++++
33 files changed, 1120 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
index 6694fd0..ef28e4b 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send average of Load average
*/
-public class AverageLoadAverageEvent implements Serializable {
- private static final long serialVersionUID = 1917296044923546781L;
-
+public class AverageLoadAverageEvent extends Event {
private String networkPartitionId;
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
index feb0837..b5c569a 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send average of memory consumption
*/
-public class AverageMemoryConsumptionEvent implements Serializable {
- private static final long serialVersionUID = -2381956370716318004L;
-
+public class AverageMemoryConsumptionEvent extends Event {
private String networkPartitionId;
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
index e7f9f46..0135d8f 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send average of requests in flight
*/
-public class AverageRequestsInFlightEvent implements Serializable {
- private static final long serialVersionUID = 6191065740806547472L;
-
+public class AverageRequestsInFlightEvent extends Event {
private String networkPartitionId;
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
index 6688d50..5596c42 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send gradient of Load average
*/
-public class GradientOfLoadAverageEvent implements Serializable {
- private static final long serialVersionUID = 1196101093883889564L;
-
+public class GradientOfLoadAverageEvent extends Event {
private String networkPartitionId;
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
index d322ebf..7598b76 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send gradient of memory consumption
*/
-public class GradientOfMemoryConsumptionEvent implements Serializable {
- private static final long serialVersionUID = 1295261800754126413L;
-
+public class GradientOfMemoryConsumptionEvent extends Event {
private String networkPartitionId;
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
index b53fa0f..fa52577 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send gradient of requests in flight
*/
-public class GradientOfRequestsInFlightEvent implements Serializable {
- private static final long serialVersionUID = 1981538866459526611L;
-
+public class GradientOfRequestsInFlightEvent extends Event {
private String networkPartitionId;
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/HealthStatEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/HealthStatEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/HealthStatEvent.java
new file mode 100644
index 0000000..49ab5b8
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/HealthStatEvent.java
@@ -0,0 +1,32 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+import java.io.Serializable;
+
+/**
+ * Represents all topology events.
+ */
+public abstract class HealthStatEvent extends Event implements Serializable {
+
+ private static final long serialVersionUID = 878645729335256359L;
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
index cd7eb83..bacdbf0 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send average of Load average
*/
-public class MemberAverageLoadAverageEvent implements Serializable {
- private static final long serialVersionUID = 506284597552753304L;
-
+public class MemberAverageLoadAverageEvent extends Event {
private String memberId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
index c61a67d..2a647e7 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send average of memory consumption
*/
-public class MemberAverageMemoryConsumptionEvent implements Serializable {
- private static final long serialVersionUID = -1707034855948914488L;
-
+public class MemberAverageMemoryConsumptionEvent extends Event {
private String memberId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
index 3061e23..baa6ba4 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send member fault event
*/
-public class MemberFaultEvent implements Serializable {
-
- private static final long serialVersionUID = 5364415023905395683L;
+public class MemberFaultEvent extends Event {
private String clusterId;
private String memberId;
private String partitionId;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
index 0f8cfb5..3f6a8e8 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send gradient of Load average
*/
-public class MemberGradientOfLoadAverageEvent implements Serializable {
-
- private static final long serialVersionUID = -3175864652586282657L;
+public class MemberGradientOfLoadAverageEvent extends Event {
private String memberId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
index 1fffcbb..c244669 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send gradient of memory consumption
*/
-public class MemberGradientOfMemoryConsumptionEvent implements Serializable {
-
- private static final long serialVersionUID = 2001384053411577107L;
+public class MemberGradientOfMemoryConsumptionEvent extends Event {
private String memberId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
index 377becf..6879b27 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send second derivative of Load average
*/
-public class MemberSecondDerivativeOfLoadAverageEvent implements Serializable {
-
- private static final long serialVersionUID = 4746324304909298087L;
+public class MemberSecondDerivativeOfLoadAverageEvent extends Event {
private String memberId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
index 91809b7..1c2ae0d 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send second derivative of memory consumption
*/
-public class MemberSecondDerivativeOfMemoryConsumptionEvent implements Serializable {
-
- private static final long serialVersionUID = -8348401633474144696L;
+public class MemberSecondDerivativeOfMemoryConsumptionEvent extends Event {
private String memberId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
index 3d69f03..da12c41 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
@@ -19,13 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send second derivative of Load average
*/
-public class SecondDerivativeOfLoadAverageEvent implements Serializable {
- private static final long serialVersionUID = -908665632193275589L;
+public class SecondDerivativeOfLoadAverageEvent extends Event {
private String networkPartitionId;
private String clusterId;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
index 59bd12c..7abba9b 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send second derivative of memory consumption
*/
-public class SecondDerivativeOfMemoryConsumptionEvent implements Serializable {
-
- private static final long serialVersionUID = 8546005128088790015L;
+public class SecondDerivativeOfMemoryConsumptionEvent extends Event {
private String clusterId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
index 839b256..f659a47 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
@@ -19,14 +19,12 @@
package org.apache.stratos.messaging.event.health.stat;
-import java.io.Serializable;
+import org.apache.stratos.messaging.event.Event;
/**
* This event is fired by Event processing engine to send second derivative of requests in flight
*/
-public class SecondDerivativeOfRequestsInFlightEvent implements Serializable {
-
- private static final long serialVersionUID = -3085209649653431205L;
+public class SecondDerivativeOfRequestsInFlightEvent extends Event {
private String clusterId;
private String networkPartitionId;
private float value;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageLoadAverageMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageLoadAverageMessageProcessor.java
new file mode 100644
index 0000000..779e0e3
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageLoadAverageMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.AverageLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send average of Load average
+ */
+public class AverageLoadAverageMessageProcessor extends MessageProcessor {
+
+ private static final Log log = LogFactory.getLog(AverageLoadAverageMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (AverageLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ AverageLoadAverageEvent event = (AverageLoadAverageEvent) Util.jsonToObject(message, AverageLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageMemoryConsumptionMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000..88b09a1
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.AverageMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send average of memory consumption
+ */
+public class AverageMemoryConsumptionMessageProcessor extends MessageProcessor {
+
+ private static final Log log = LogFactory.getLog(AverageMemoryConsumptionMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (AverageMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ AverageMemoryConsumptionEvent event = (AverageMemoryConsumptionEvent) Util.jsonToObject(message, AverageMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageRequestsInFlightMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageRequestsInFlightMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageRequestsInFlightMessageProcessor.java
new file mode 100644
index 0000000..e5c470a
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/AverageRequestsInFlightMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send average of requests in flight
+ */
+public class AverageRequestsInFlightMessageProcessor extends MessageProcessor {
+
+ private static final Log log = LogFactory.getLog(AverageRequestsInFlightMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (AverageRequestsInFlightEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ AverageRequestsInFlightEvent event = (AverageRequestsInFlightEvent) Util.jsonToObject(message, AverageRequestsInFlightEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfLoadAverageMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfLoadAverageMessageProcessor.java
new file mode 100644
index 0000000..c55f119
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfLoadAverageMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.AverageRequestsInFlightEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send gradient of Load average
+ */
+public class GradientOfLoadAverageMessageProcessor extends MessageProcessor {
+
+ private static final Log log = LogFactory.getLog(GradientOfLoadAverageMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (AverageRequestsInFlightEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ AverageRequestsInFlightEvent event = (AverageRequestsInFlightEvent) Util.jsonToObject(message, AverageRequestsInFlightEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfMemoryConsumptionMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000..e03cc5a
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,65 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.GradientOfMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send gradient of memory consumption
+ */
+public class GradientOfMemoryConsumptionMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(GradientOfMemoryConsumptionMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (GradientOfMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ GradientOfMemoryConsumptionEvent event = (GradientOfMemoryConsumptionEvent) Util.jsonToObject(message, GradientOfMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfRequestsInFlightMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfRequestsInFlightMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfRequestsInFlightMessageProcessor.java
new file mode 100644
index 0000000..784bd78
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/GradientOfRequestsInFlightMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.GradientOfRequestsInFlightEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send gradient of requests in flight
+ */
+public class GradientOfRequestsInFlightMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(GradientOfRequestsInFlightMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (GradientOfRequestsInFlightEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ GradientOfRequestsInFlightEvent event = (GradientOfRequestsInFlightEvent) Util.jsonToObject
+ (message, GradientOfRequestsInFlightEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageLoadAverageMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageLoadAverageMessageProcessor.java
new file mode 100644
index 0000000..d757da0
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageLoadAverageMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberAverageLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send average of Load average
+ */
+public class MemberAverageLoadAverageMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(MemberAverageLoadAverageMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberAverageLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberAverageLoadAverageEvent event = (MemberAverageLoadAverageEvent) Util.jsonToObject
+ (message, MemberAverageLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageMemoryConsumptionMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000..fd61cbb
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberAverageMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberAverageMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send average of memory consumption
+ */
+public class MemberAverageMemoryConsumptionMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(MemberAverageMemoryConsumptionMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberAverageMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberAverageMemoryConsumptionEvent event = (MemberAverageMemoryConsumptionEvent) Util.jsonToObject
+ (message, MemberAverageMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberFaultMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberFaultMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberFaultMessageProcessor.java
new file mode 100644
index 0000000..fe04cca
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberFaultMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberFaultEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send member fault event
+ */
+public class MemberFaultMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(MemberFaultMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberFaultEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberFaultEvent event = (MemberFaultEvent) Util.jsonToObject
+ (message, MemberFaultEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfLoadAverageMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfLoadAverageMessageProcessor.java
new file mode 100644
index 0000000..0c1b4df
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfLoadAverageMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberGradientOfLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send gradient of Load average
+ */
+public class MemberGradientOfLoadAverageMessageProcessor extends MessageProcessor{
+ private static final Log log = LogFactory.getLog(MemberGradientOfLoadAverageMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberGradientOfLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberGradientOfLoadAverageEvent event = (MemberGradientOfLoadAverageEvent) Util.jsonToObject
+ (message, MemberGradientOfLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfMemoryConsumptionMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000..e554a88
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberGradientOfMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,67 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberGradientOfMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send gradient of memory consumption
+ */
+public class MemberGradientOfMemoryConsumptionMessageProcessor extends MessageProcessor {
+
+ private static final Log log = LogFactory.getLog(MemberGradientOfMemoryConsumptionMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberGradientOfMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberGradientOfMemoryConsumptionEvent event = (MemberGradientOfMemoryConsumptionEvent) Util.jsonToObject
+ (message, MemberGradientOfMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfLoadAverageMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfLoadAverageMessageProcessor.java
new file mode 100644
index 0000000..a45ca44
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfLoadAverageMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send second derivative of Load average
+ */
+public class MemberSecondDerivativeOfLoadAverageMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(MemberSecondDerivativeOfLoadAverageMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberSecondDerivativeOfLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberSecondDerivativeOfLoadAverageEvent event = (MemberSecondDerivativeOfLoadAverageEvent) Util.jsonToObject
+ (message, MemberSecondDerivativeOfLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfMemoryConsumptionMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000..4eddf68
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/MemberSecondDerivativeOfMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.MemberSecondDerivativeOfMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send second derivative of memory consumption
+ */
+public class MemberSecondDerivativeOfMemoryConsumptionMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(MemberSecondDerivativeOfMemoryConsumptionMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (MemberSecondDerivativeOfMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ MemberSecondDerivativeOfMemoryConsumptionEvent event = (MemberSecondDerivativeOfMemoryConsumptionEvent) Util.jsonToObject
+ (message, MemberSecondDerivativeOfMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfLoadAverageMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfLoadAverageMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfLoadAverageMessageProcessor.java
new file mode 100644
index 0000000..d2100a4
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfLoadAverageMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfLoadAverageEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send second derivative of Load average
+ */
+public class SecondDerivativeOfLoadAverageMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(SecondDerivativeOfLoadAverageMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (SecondDerivativeOfLoadAverageEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ SecondDerivativeOfLoadAverageEvent event = (SecondDerivativeOfLoadAverageEvent) Util.jsonToObject
+ (message, SecondDerivativeOfLoadAverageEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfMemoryConsumptionMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfMemoryConsumptionMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfMemoryConsumptionMessageProcessor.java
new file mode 100644
index 0000000..59190ed
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfMemoryConsumptionMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfMemoryConsumptionEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send second derivative of memory consumption
+ */
+public class SecondDerivativeOfMemoryConsumptionMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(SecondDerivativeOfMemoryConsumptionMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (SecondDerivativeOfMemoryConsumptionEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ SecondDerivativeOfMemoryConsumptionEvent event = (SecondDerivativeOfMemoryConsumptionEvent) Util.jsonToObject
+ (message, SecondDerivativeOfMemoryConsumptionEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/4e772d16/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfRequestsInFlightMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfRequestsInFlightMessageProcessor.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfRequestsInFlightMessageProcessor.java
new file mode 100644
index 0000000..6fa80ca
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/message/processor/health/stat/SecondDerivativeOfRequestsInFlightMessageProcessor.java
@@ -0,0 +1,66 @@
+/*
+ * 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.health.stat;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.event.health.stat.SecondDerivativeOfRequestsInFlightEvent;
+import org.apache.stratos.messaging.message.processor.MessageProcessor;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Processes event that is fired by Event processing engine to send second derivative of requests in flight
+ */
+public class SecondDerivativeOfRequestsInFlightMessageProcessor extends MessageProcessor {
+ private static final Log log = LogFactory.getLog(SecondDerivativeOfRequestsInFlightMessageProcessor.class);
+
+ private MessageProcessor nextProcessor;
+
+ @Override
+ public void setNext(MessageProcessor nextProcessor) {
+ this.nextProcessor = nextProcessor;
+ }
+
+ @Override
+ public boolean process(String type, String message, Object object) {
+ if (SecondDerivativeOfRequestsInFlightEvent.class.getName().equals(type)) {
+
+ // Parse complete message and build event
+ SecondDerivativeOfRequestsInFlightEvent event = (SecondDerivativeOfRequestsInFlightEvent) Util.jsonToObject
+ (message, SecondDerivativeOfRequestsInFlightEvent.class);
+
+ // Notify event listeners
+ notifyEventListeners(event);
+
+ if(log.isDebugEnabled()){
+ log.debug(String.format("%s event processor notified listeners ... " , type));
+ }
+ return true;
+ }
+ else {
+ if(nextProcessor != null) {
+ return nextProcessor.process(type, message, object);
+ }
+ else {
+ throw new RuntimeException(String.format("Failed to process health stat message using available message processors: [type] %s [body] %s", type, message));
+ }
+ }
+ }
+}
[02/19] git commit: Updated log entry in cartridge agent
Posted by ud...@apache.org.
Updated log entry in cartridge agent
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/419b38c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/419b38c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/419b38c2
Branch: refs/heads/master
Commit: 419b38c2f203ada1bd67cc86c1386e83d86a73b7
Parents: 18057e2
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 14:47:15 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:36 2013 -0500
----------------------------------------------------------------------
.../agent/statistics/publisher/HealthStatisticsPublisher.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/419b38c2/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
index 094e6fc..cf3f1b7 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
@@ -74,7 +74,7 @@ public class HealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
*/
public void publish(String clusterId, String networkPartitionId, String memberId, String partitionId, String health, double value) {
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %s",
+ log.info(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %d",
clusterId, networkPartitionId, partitionId, memberId, health, value));
}
List<Object> payload = new ArrayList<Object>();
[09/19] git commit: Handle exceptions in CLI
Posted by ud...@apache.org.
Handle exceptions in CLI
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/88072066
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/88072066
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/88072066
Branch: refs/heads/master
Commit: 88072066bf2e828151e3809a6fd23d31f87a0061
Parents: 6475c06
Author: Manula Thantriwatte <ma...@apache.org>
Authored: Fri Dec 20 15:39:58 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../java/org/apache/stratos/cli/RestClient.java | 52 ++---------------
.../stratos/cli/RestCommandLineService.java | 60 +++++++++++---------
2 files changed, 39 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/88072066/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
index f5f855b..d5de9a9 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java
@@ -48,6 +48,8 @@ public class RestClient implements GenericRestClient{
/**
* Handle http post request. Return String
*
+ * @param httpClient
+ * This should be httpClient which used to connect to rest endpoint
* @param resourcePath
* This should be REST endpoint
* @param jsonParamString
@@ -60,11 +62,9 @@ public class RestClient implements GenericRestClient{
* @throws org.apache.http.client.ClientProtocolException and IOException
* if any errors occur when executing the request
*/
- public HttpResponse doPost(DefaultHttpClient httpClient, String resourcePath, String jsonParamString, String userName, String passWord) throws Exception{
+ public HttpResponse doPost(DefaultHttpClient httpClient, String resourcePath, String jsonParamString, String userName,
+ String passWord) throws Exception{
try {
-
- //DefaultHttpClient httpClient = new DefaultHttpClient();
-
HttpPost postRequest = new HttpPost(resourcePath);
StringEntity input = new StringEntity(jsonParamString);
@@ -83,32 +83,7 @@ public class RestClient implements GenericRestClient{
HttpResponse response = httpClient.execute(postRequest);
- /*
- int responseCode = response.getStatusLine().getStatusCode();
-
- if (responseCode == CliConstants.RESPONSE_AUTHORIZATION_FAIL) {
- return "" + CliConstants.RESPONSE_AUTHORIZATION_FAIL;
- } else if (responseCode == CliConstants.RESPONSE_NO_CONTENT) {
- return "" + CliConstants.RESPONSE_NO_CONTENT;
- } else if (responseCode == CliConstants.RESPONSE_INTERNAL_SERVER_ERROR) {
- return "" + CliConstants.RESPONSE_INTERNAL_SERVER_ERROR;
- } else if (response.getStatusLine().getStatusCode() != 200) {
- throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
- }
-
- BufferedReader br = new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
-
- String output;
- String result = "";
- while ((output = br.readLine()) != null) {
- result += output;
- }
- */
-
- //httpClient.getConnectionManager().shutdown();
- //return result;
return response;
-
} catch (ClientProtocolException e) {
throw new ClientProtocolException();
} catch (ConnectException e) {
@@ -123,6 +98,8 @@ public class RestClient implements GenericRestClient{
/**
* Handle http get request. Return String
*
+ * @param httpClient
+ * This should be httpClient which used to connect to rest endpoint
* @param resourcePath
* This should be REST endpoint
* @param userName
@@ -135,7 +112,6 @@ public class RestClient implements GenericRestClient{
*/
public HttpResponse doGet(DefaultHttpClient httpClient, String resourcePath, String userName, String passWord) {
try {
- //DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getRequest = new HttpGet(resourcePath);
getRequest.addHeader("Content-Type", "application/json");
@@ -151,23 +127,7 @@ public class RestClient implements GenericRestClient{
HttpResponse response = httpClient.execute(getRequest);
- /*
- if (response.getStatusLine().getStatusCode() != 200) {
- throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
- }
-
- BufferedReader br = new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
-
- String output;
- String result = "";
- while ((output = br.readLine()) != null) {
- result += output;
- }
- */
-
- //httpClient.getConnectionManager().shutdown();
return response;
-
} catch (ClientProtocolException e) {
e.printStackTrace();
return null;
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/88072066/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index a35cb8e..cfc37b9 100644
--- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -259,7 +259,7 @@ public class RestCommandLineService {
System.out.println();
}
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in listing available cartridges", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -336,7 +336,7 @@ public class RestCommandLineService {
CommandLineUtils.printTable(cartridges, cartridgeMapper, headers.toArray(new String[headers.size()]));
System.out.println();
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in listing subscribe cartridges", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -351,7 +351,6 @@ public class RestCommandLineService {
CartridgeInfoBean cartridgeInfoBean = new CartridgeInfoBean();
cartridgeInfoBean.setCartridgeType(null);
cartridgeInfoBean.setAlias(null);
- //cartridgeInfoBean.setPolicy(null);
cartridgeInfoBean.setRepoURL(null);
cartridgeInfoBean.setPrivateRepo(false);
cartridgeInfoBean.setRepoUsername(null);
@@ -379,9 +378,6 @@ public class RestCommandLineService {
if (responseCode.equals(CliConstants.RESPONSE_AUTHORIZATION_FAIL)) {
System.out.println("Invalid operation. Authorization failed");
return;
- //} else if (responseCode.equals(CliConstants.RESPONSE_NO_CONTENT)) {
- // System.out.println("Duplicate alias. Please choose different alias");
- // return;
} else if ( ! responseCode.equals(CliConstants.RESPONSE_OK)) {
System.out.println("Error occured while subscribing cartridge");
return;
@@ -402,7 +398,7 @@ public class RestCommandLineService {
System.out.format("%nSubscribing to %s cartridge and connecting with %s data cartridge.%n", alias,
dataCartridgeAlias);
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in subscribing to data cartridge", e);
}
finally {
httpClient.getConnectionManager().shutdown();
@@ -416,7 +412,6 @@ public class RestCommandLineService {
try {
cartridgeInfoBean.setCartridgeType(cartridgeType);
cartridgeInfoBean.setAlias(alias);
- //cartridgeInfoBean.setPolicy(policy);
cartridgeInfoBean.setRepoURL(externalRepoURL);
cartridgeInfoBean.setPrivateRepo(privateRepo);
cartridgeInfoBean.setRepoUsername(username);
@@ -436,9 +431,6 @@ public class RestCommandLineService {
if (responseCode.equals(CliConstants.RESPONSE_AUTHORIZATION_FAIL)) {
System.out.println("Invalid operation. Authorization failed");
return;
- //} else if (responseCode.equals(CliConstants.RESPONSE_NO_CONTENT)) {
- // System.out.println("Duplicate alias. Please choose different alias");
- // return;
} else if ( ! responseCode.equals(CliConstants.RESPONSE_OK)) {
System.out.println("Error occured while subscribing cartridge");
return;
@@ -485,14 +477,15 @@ public class RestCommandLineService {
System.out.format("Please map the %s \"%s\" to LB IP%n", hostnamesLabel, hostnames);
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in subscribing to cartridge", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
}
// This method helps to create the new tenant
- public void addTenant(String admin, String firstName, String lastaName, String password, String domain, String email){
+ public void addTenant(String admin, String firstName, String lastaName, String password, String domain, String email)
+ throws CommandException{
DefaultHttpClient httpClient = new DefaultHttpClient();
try {
TenantInfoBean tenantInfo = new TenantInfoBean();
@@ -502,7 +495,6 @@ public class RestCommandLineService {
tenantInfo.setAdminPassword(password);
tenantInfo.setTenantDomain(domain);
tenantInfo.setEmail(email);
- //tenantInfo.setActive(active);
GsonBuilder gsonBuilder = new GsonBuilder();
Gson gson = gsonBuilder.create();
@@ -514,6 +506,7 @@ public class RestCommandLineService {
completeJsonString, restClientService.getUsername(), restClientService.getPassword());
String responseCode = "" + response.getStatusLine().getStatusCode();
+
if (responseCode.equals(CliConstants.RESPONSE_AUTHORIZATION_FAIL)) {
System.out.println("Invalid operation. Authorization failed");
return;
@@ -529,7 +522,7 @@ public class RestCommandLineService {
}
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in creating tenant", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -543,14 +536,14 @@ public class RestCommandLineService {
restClientService.getUsername(), restClientService.getPassword());
System.out.println("You have successfully unsubscribed " + alias);
} catch ( Exception e) {
- e.printStackTrace();
+ handleException("Exception in un-subscribing cartridge", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
}
// This method helps to deploy cartridge definitions
- public void deployCartridgeDefinition (String cartridgeDefinition) {
+ public void deployCartridgeDefinition (String cartridgeDefinition) throws CommandException{
DefaultHttpClient httpClient = new DefaultHttpClient();
try {
HttpResponse response = restClientService.doPost(httpClient, restClientService.getUrl() + cartridgeDeploymentEndPoint,
@@ -569,14 +562,14 @@ public class RestCommandLineService {
return;
}
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in deploy cartridge definition", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
}
// This method helps to deploy partitions
- public void deployPartition (String partitionDefinition) {
+ public void deployPartition (String partitionDefinition) throws CommandException{
DefaultHttpClient httpClient = new DefaultHttpClient();
try {
HttpResponse response = restClientService.doPost(httpClient, restClientService.getUrl() + partitionDeploymentEndPoint,
@@ -600,14 +593,14 @@ public class RestCommandLineService {
}
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in deploying partitions", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
}
// This method helps to deploy autoscalling polices
- public void deployAutoscalingPolicy (String autoScalingPolicy) {
+ public void deployAutoscalingPolicy (String autoScalingPolicy) throws CommandException{
DefaultHttpClient httpClient= new DefaultHttpClient();
try {
HttpResponse response = restClientService.doPost(httpClient, restClientService.getUrl() + autoscalingPolicyDeploymentEndPoint,
@@ -630,14 +623,14 @@ public class RestCommandLineService {
}
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in deploying autoscale police", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
}
// This method helps to deploy deployment polices
- public void deployDeploymentPolicy (String deploymentPolicy) {
+ public void deployDeploymentPolicy (String deploymentPolicy) throws CommandException{
DefaultHttpClient httpClient = new DefaultHttpClient();
try {
HttpResponse response = restClientService.doPost(httpClient, restClientService.getUrl() + deploymentPolicyDeploymentEndPoint,
@@ -660,7 +653,7 @@ public class RestCommandLineService {
}
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in deploying deployment policy", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -718,7 +711,7 @@ public class RestCommandLineService {
System.out.println();
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in listing partitions", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -775,7 +768,7 @@ public class RestCommandLineService {
System.out.println();
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in listing autoscale policies", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -829,7 +822,7 @@ public class RestCommandLineService {
System.out.println();
} catch (Exception e) {
- e.printStackTrace();
+ handleException("Exception in listing deployment polices", e);
} finally {
httpClient.getConnectionManager().shutdown();
}
@@ -944,4 +937,17 @@ public class RestCommandLineService {
return null;
}
}
+
+ // This is for handle exception
+ private void handleException(String key, Exception e, Object... args) throws CommandException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Displaying message for {}. Exception thrown is {}", key, e.getClass());
+ }
+ String message = CommandLineUtils.getMessage(key, args);
+ if (logger.isErrorEnabled()) {
+ logger.error(message);
+ }
+ System.out.println(message);
+ throw new CommandException(message, e);
+ }
}
[11/19] git commit: adding unzip pack section
Posted by ud...@apache.org.
adding unzip pack section
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/2f8a008a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/2f8a008a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/2f8a008a
Branch: refs/heads/master
Commit: 2f8a008a2e655dd02eaecfcd190c005bcdf36c5a
Parents: 21d9aec
Author: Isuru <is...@wso2.com>
Authored: Fri Dec 20 15:17:14 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../cartridge-agent/modules/scripts/ec2/cartridge-agent.sh | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/2f8a008a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
index 2f31da6..2f774e0 100755
--- a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
+++ b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
@@ -29,6 +29,15 @@ export LOG=/var/log/apache-stratos/cartridge-agent-sh.log
instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
ca_exec_path=${instance_path}/cartridge-agent # Cartridge agent executable home
+#-----
+# Unzip cartridge agent pack
+#-----
+pushd ${instance_path}
+unzip apache-stratos-cartridge-agent-4.0.0-SNAPSHOT-bin.zip
+mv apache-stratos-cartridge-agent-4.0.0-SNAPSHOT cartridge-agent
+popd
+
+
# ---------------------------------------------
# Download payload
# ---------------------------------------------
[14/19] git commit: Adding health stat message listeners
Posted by ud...@apache.org.
Adding health stat message listeners
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/b4df4706
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/b4df4706
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/b4df4706
Branch: refs/heads/master
Commit: b4df4706284802c3045f8b4d41077832177eaddf
Parents: a22a867
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Fri Dec 20 17:03:11 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../stat/AverageLoadAverageEventListener.java | 28 ++++++++++++
.../AverageMemoryConsumptionEventListener.java | 28 ++++++++++++
.../AverageRequestsInFlightEventListener.java | 28 ++++++++++++
.../GradientOfLoadAverageEventListener.java | 28 ++++++++++++
...radientOfMemoryConsumptionEventListener.java | 28 ++++++++++++
...GradientOfRequestsInFlightEventListener.java | 28 ++++++++++++
.../MemberAverageLoadAverageEventListener.java | 29 ++++++++++++
...erAverageMemoryConsumptionEventListener.java | 28 ++++++++++++
.../health/stat/MemberFaultEventListener.java | 28 ++++++++++++
...emberGradientOfLoadAverageEventListener.java | 48 ++++++++++++++++++++
...radientOfMemoryConsumptionEventListener.java | 28 ++++++++++++
...ondDerivativeOfLoadAverageEventListener.java | 28 ++++++++++++
...ivativeOfMemoryConsumptionEventListener.java | 28 ++++++++++++
...ondDerivativeOfLoadAverageEventListener.java | 28 ++++++++++++
...ivativeOfMemoryConsumptionEventListener.java | 28 ++++++++++++
...rivativeOfRequestsInFlightEventListener.java | 28 ++++++++++++
16 files changed, 469 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageLoadAverageEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageLoadAverageEventListener.java
new file mode 100644
index 0000000..c65ee0b
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageLoadAverageEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Average of Load average event listener
+ */
+public class AverageLoadAverageEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageMemoryConsumptionEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageMemoryConsumptionEventListener.java
new file mode 100644
index 0000000..b5d904e
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageMemoryConsumptionEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Memory consumption event listener
+ */
+public class AverageMemoryConsumptionEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageRequestsInFlightEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageRequestsInFlightEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageRequestsInFlightEventListener.java
new file mode 100644
index 0000000..e707d70
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/AverageRequestsInFlightEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Average of requests in flight event listener
+ */
+public class AverageRequestsInFlightEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfLoadAverageEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfLoadAverageEventListener.java
new file mode 100644
index 0000000..de21abd
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfLoadAverageEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Gradient of Load average event listener
+ */
+public class GradientOfLoadAverageEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfMemoryConsumptionEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfMemoryConsumptionEventListener.java
new file mode 100644
index 0000000..9bc0305
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfMemoryConsumptionEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Memory consumption event listener
+ */
+public class GradientOfMemoryConsumptionEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfRequestsInFlightEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfRequestsInFlightEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfRequestsInFlightEventListener.java
new file mode 100644
index 0000000..c4824a5
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/GradientOfRequestsInFlightEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Gradient of requests in flight event listener
+ */
+public class GradientOfRequestsInFlightEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageLoadAverageEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageLoadAverageEventListener.java
new file mode 100644
index 0000000..8f10aa5
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageLoadAverageEventListener.java
@@ -0,0 +1,29 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Average of Load average event listener
+ */
+public class MemberAverageLoadAverageEventListener extends Event {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageMemoryConsumptionEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageMemoryConsumptionEventListener.java
new file mode 100644
index 0000000..68580c3
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberAverageMemoryConsumptionEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Average of memory consumption event listener
+ */
+public class MemberAverageMemoryConsumptionEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberFaultEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberFaultEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberFaultEventListener.java
new file mode 100644
index 0000000..d8fc9f4
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberFaultEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Member fault event listener
+ */
+public class MemberFaultEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfLoadAverageEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfLoadAverageEventListener.java
new file mode 100644
index 0000000..46b8891
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfLoadAverageEventListener.java
@@ -0,0 +1,48 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Gradient of Load average event listener
+ */
+public class MemberGradientOfLoadAverageEventListener extends Event {
+
+ private String memberId;
+ private float value;
+
+
+ public String getMemberId() {
+ return memberId;
+ }
+
+ public void setMemberId(String memberId) {
+ this.memberId = memberId;
+ }
+
+ public float getValue() {
+ return value;
+ }
+
+ public void setValue(float value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfMemoryConsumptionEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfMemoryConsumptionEventListener.java
new file mode 100644
index 0000000..7d67fe7
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberGradientOfMemoryConsumptionEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Gradient of memory consumption event listener
+ */
+public class MemberGradientOfMemoryConsumptionEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfLoadAverageEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfLoadAverageEventListener.java
new file mode 100644
index 0000000..ec2b4b7
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfLoadAverageEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Second derivative of Load average event listener
+ */
+public class MemberSecondDerivativeOfLoadAverageEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfMemoryConsumptionEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfMemoryConsumptionEventListener.java
new file mode 100644
index 0000000..d854e52
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/MemberSecondDerivativeOfMemoryConsumptionEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Second derivative of memory consumption event listener
+ */
+public class MemberSecondDerivativeOfMemoryConsumptionEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfLoadAverageEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfLoadAverageEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfLoadAverageEventListener.java
new file mode 100644
index 0000000..a7a5817
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfLoadAverageEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Second derivative of Load average event listener
+ */
+public class SecondDerivativeOfLoadAverageEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfMemoryConsumptionEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfMemoryConsumptionEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfMemoryConsumptionEventListener.java
new file mode 100644
index 0000000..1266cb0
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfMemoryConsumptionEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Second derivative of memory consumption event listener event listener
+ */
+public class SecondDerivativeOfMemoryConsumptionEventListener extends Event {
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/b4df4706/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfRequestsInFlightEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfRequestsInFlightEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfRequestsInFlightEventListener.java
new file mode 100644
index 0000000..6518bf5
--- /dev/null
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/health/stat/SecondDerivativeOfRequestsInFlightEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * 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.health.stat;
+
+import org.apache.stratos.messaging.event.Event;
+
+/**
+ * Second derivative of requests in flight event listener
+ */
+public class SecondDerivativeOfRequestsInFlightEventListener extends Event {
+}
[10/19] git commit: Formatted code in health statistics publisher
Posted by ud...@apache.org.
Formatted code in health statistics publisher
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/21d9aec7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/21d9aec7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/21d9aec7
Branch: refs/heads/master
Commit: 21d9aec72510577aac8331d6811fbaf7d5326361
Parents: 70a4132
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 14:54:24 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../agent/statistics/publisher/HealthStatisticsPublisher.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/21d9aec7/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
index e4f0ae8..4972a30 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
@@ -43,15 +43,14 @@ public class HealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION);
streamDefinition.setNickName("agent health stats");
streamDefinition.setDescription("agent health stats");
+ // Payload definition
List<Attribute> payloadData = new ArrayList<Attribute>();
-
payloadData.add(new Attribute("cluster_id", AttributeType.STRING));
payloadData.add(new Attribute("network_partition_id", AttributeType.STRING));
payloadData.add(new Attribute("member_id", AttributeType.STRING));
payloadData.add(new Attribute("partition_id", AttributeType.STRING));
payloadData.add(new Attribute("health_description", AttributeType.STRING));
payloadData.add(new Attribute("value", AttributeType.DOUBLE));
-
streamDefinition.setPayloadData(payloadData);
return streamDefinition;
} catch (Exception e) {
[13/19] git commit: Fixed cep stats publisher enabled flag
Posted by ud...@apache.org.
Fixed cep stats publisher enabled flag
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6475c063
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6475c063
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6475c063
Branch: refs/heads/master
Commit: 6475c063e4e8ed996d4add3ea4c37e5899035328
Parents: 4e772d1
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 15:46:53 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../statistics/publisher/WSO2CEPStatisticsPublisher.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6475c063/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
index 0899f1a..5db61cd 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
@@ -51,12 +51,10 @@ public class WSO2CEPStatisticsPublisher implements StatisticsPublisher {
this.port = System.getProperty("thrift.receiver.port");
this.username = "admin";
this.password = "admin";
- String enabledStr = System.getProperty("cep.stats.publisher.enabled");
- if (StringUtils.isNotBlank(enabledStr)) {
- enabled = Boolean.getBoolean(enabledStr);
- if (enabled) {
- init();
- }
+
+ enabled = Boolean.getBoolean("cep.stats.publisher.enabled");
+ if (enabled) {
+ init();
}
}
[03/19] git commit: Changed member health stat value type to double
in cartridge agent
Posted by ud...@apache.org.
Changed member health stat value type to double in cartridge agent
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/18057e24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/18057e24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/18057e24
Branch: refs/heads/master
Commit: 18057e2448d795c7715f841e16788c17c59ef14c
Parents: f4e605c
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 14:46:13 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:36 2013 -0500
----------------------------------------------------------------------
.../statistics/publisher/HealthStatisticsNotifier.java | 10 +++++-----
.../statistics/publisher/HealthStatisticsPublisher.java | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/18057e24/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
index 9412e28..4beeee9 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsNotifier.java
@@ -64,13 +64,13 @@ public class HealthStatisticsNotifier implements Runnable {
CartridgeAgentConfiguration.getInstance().getMemberId(),
CartridgeAgentConfiguration.getInstance().getPartitionId(),
CartridgeAgentConstants.PORTS_NOT_OPEN,
- "1"
+ 1
);
}
- String memoryConsumption = String.valueOf(HealthStatisticsReader.getMemoryConsumption());
+ double memoryConsumption = HealthStatisticsReader.getMemoryConsumption();
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing memory consumption: %s", memoryConsumption));
+ log.info(String.format("Publishing memory consumption: %d", memoryConsumption));
}
statsPublisher.publish(
CartridgeAgentConfiguration.getInstance().getClusterId(),
@@ -81,9 +81,9 @@ public class HealthStatisticsNotifier implements Runnable {
memoryConsumption
);
- String loadAverage = String.valueOf(HealthStatisticsReader.getLoadAverage());
+ double loadAverage = HealthStatisticsReader.getLoadAverage();
if(log.isInfoEnabled()) {
- log.info(String.format("Publishing load average: %s", loadAverage));
+ log.info(String.format("Publishing load average: %d", loadAverage));
}
statsPublisher.publish(
CartridgeAgentConfiguration.getInstance().getClusterId(),
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/18057e24/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
index 1c23cb9..094e6fc 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/statistics/publisher/HealthStatisticsPublisher.java
@@ -50,7 +50,7 @@ public class HealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
payloadData.add(new Attribute("member_id", AttributeType.STRING));
payloadData.add(new Attribute("partition_id", AttributeType.STRING));
payloadData.add(new Attribute("health_description", AttributeType.STRING));
- payloadData.add(new Attribute("value", AttributeType.STRING));
+ payloadData.add(new Attribute("value", AttributeType.DOUBLE));
streamDefinition.setPayloadData(payloadData);
return streamDefinition;
@@ -72,7 +72,7 @@ public class HealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
* @param health
* @param value
*/
- public void publish(String clusterId, String networkPartitionId, String memberId, String partitionId, String health, String value) {
+ public void publish(String clusterId, String networkPartitionId, String memberId, String partitionId, String health, double value) {
if(log.isInfoEnabled()) {
log.info(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %s",
clusterId, networkPartitionId, partitionId, memberId, health, value));
[04/19] git commit: Checking in new cartridge agent scripts
Posted by ud...@apache.org.
Checking in new cartridge agent scripts
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f4e605c9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f4e605c9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f4e605c9
Branch: refs/heads/master
Commit: f4e605c90a8cce4e4d2a12199e00303751748b56
Parents: 2011cd2
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 14:09:16 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:36 2013 -0500
----------------------------------------------------------------------
.../modules/scripts/ec2/cartridge-agent.sh | 75 ++++++
.../modules/scripts/ec2/clean.sh | 20 ++
.../modules/scripts/ec2/get-launch-params.rb | 54 +++++
.../ec2/load-balancer/cartridge-agent.sh | 51 ++---
.../scripts/ec2/mysql/cartridge-agent.sh | 142 ------------
.../modules/scripts/ec2/mysql/clean.sh | 33 ---
.../scripts/ec2/mysql/get-launch-params.rb | 54 -----
.../modules/scripts/ec2/mysql/healthcheck.sh | 33 ---
.../modules/scripts/ec2/php/cartridge-agent.sh | 86 -------
.../modules/scripts/ec2/php/clean.sh | 39 ----
.../scripts/ec2/php/get-launch-params.rb | 54 -----
.../modules/scripts/ec2/php/healthcheck.sh | 33 ---
.../scripts/ec2/tomcat/cartridge-agent.sh | 227 -------------------
.../modules/scripts/ec2/tomcat/clean.sh | 39 ----
.../scripts/ec2/tomcat/get-launch-params.rb | 54 -----
.../modules/scripts/ec2/tomcat/healthcheck.sh | 33 ---
16 files changed, 171 insertions(+), 856 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
new file mode 100755
index 0000000..5769f92
--- /dev/null
+++ b/products/cartridge-agent/modules/scripts/ec2/cartridge-agent.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+
+# This script will be called from /etc/rc.local when the cartridge
+# instance is spawned. It will initiate all the tasks that needs to
+# be run to bring the cartridge instance to operational state.
+
+set -e # Terminate on any error
+export LOG=/var/log/apache-stratos/cartridge-agent-sh.log
+instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
+ca_exec_path=${instance_path}/cartridge-agent # Cartridge agent executable home
+
+# ---------------------------------------------
+# Download payload
+# ---------------------------------------------
+if [ ! -d ${instance_path}/payload ]; then
+ echo "creating payload directory... " | tee -a $LOG
+ mkdir ${instance_path}/payload
+ echo "payload directory created" | tee -a $LOG
+ wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/payload.txt
+ echo "payload copied" | tee -a $LOG
+
+ for i in `/usr/bin/ruby ${instance_path}/get-launch-params.rb`
+ do
+ # Add double quotes on both sides of the value
+ value=`echo "${i}" | sed -e s@=@=\"@g`
+ value=${value}"\""
+ if [[ ${value} == PORTS* ]]; then
+ # Replace port separator | with ,
+ value=`echo ${value} | sed -e s@'|'@,@g`
+ fi
+ echo "writing to launch.params ${value}" | tee -a $LOG
+ echo "export" ${value} >> ${instance_path}/launch.params
+ done
+fi
+
+source ${instance_path}/launch.params
+
+#------------------------------------
+# Starting cartridge agent executable
+#------------------------------------
+pushd $ca_exec_path
+echo "Configuring cartridge agent executable..." | tee -a $LOG
+cp -f templates/cartridge-agent.sh.template bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@MB-IP@$MB_IP@g" > bin/cartridge-agent.sh
+cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@MB-PORT@$MB_PORT@g" > bin/cartridge-agent.sh
+cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@CEP-IP@$CEP_IP@g" > bin/cartridge-agent.sh
+cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@CEP-PORT@$CEP_PORT@g" > bin/cartridge-agent.sh
+rm -f bin/cartridge-agent.sh.tmp
+echo "Starting cartridge agent..." | tee -a $LOG
+sh bin/cartridge-agent.sh
+popd
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/clean.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/clean.sh b/products/cartridge-agent/modules/scripts/ec2/clean.sh
new file mode 100755
index 0000000..b088281
--- /dev/null
+++ b/products/cartridge-agent/modules/scripts/ec2/clean.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+read -p "Please confirm that you want to clean this instance [y/n] " answer
+if [[ $answer != y ]] ; then
+ exit 1
+fi
+
+echo 'Stopping all java processes'
+killall java
+echo "Removing payload directory"
+rm -rf payload/
+echo "Removing launch.params"
+rm -f launch.params
+echo "Removing content copied to the web server"
+rm -rf /var/www/* /var/www/.git
+echo "Removing cartridge agent logs"
+rm -f /var/log/apache-stratos/*
+echo "Removing load balancer logs"
+rm load-balancer/nohup.out
+echo "Cleaning completed"
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/get-launch-params.rb
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/get-launch-params.rb b/products/cartridge-agent/modules/scripts/ec2/get-launch-params.rb
new file mode 100644
index 0000000..8e62d35
--- /dev/null
+++ b/products/cartridge-agent/modules/scripts/ec2/get-launch-params.rb
@@ -0,0 +1,54 @@
+#! /usr/bin/ruby
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+
+### get-launch-params.rb
+
+# The following script obtains the launch parameters from
+# the file /tmp/payload/launch-params, then parses out the
+# parameters for this instance by using the launch index
+# of this particular EC2 instance.
+#
+# Pass the command the -e flag to output the instance
+# parameters as exports of shell variables. Any other
+# arguments are ignored.
+
+def get_launch_params(launch_params_file)
+ IO.readlines launch_params_file
+end
+
+export_stmt = ""
+
+launch_params = get_launch_params(
+ "/opt/apache-stratos-cartridge-agent/payload/payload.txt")
+
+if launch_params.length > 0
+ instance_params_str = launch_params[0]
+
+ instance_params = instance_params_str.split(',')
+
+ export_stmt = "export " if ARGV.length > 0 && ARGV.include?("-e")
+
+ instance_params.each { |param|
+ puts export_stmt + param
+ }
+
+end
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/load-balancer/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/load-balancer/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/load-balancer/cartridge-agent.sh
index e463a69..b65888f 100644
--- a/products/cartridge-agent/modules/scripts/ec2/load-balancer/cartridge-agent.sh
+++ b/products/cartridge-agent/modules/scripts/ec2/load-balancer/cartridge-agent.sh
@@ -21,15 +21,13 @@
# --------------------------------------------------------------
# This script will be called from /etc/rc.local when the cartridge
-# instance is spawned. It will initiate all the tasks that needs to
+# instance is spawned. It will initiate all the tasks that needs to
# be run to bring the cartridge instance to operational state.
set -e # Terminate on any error
-export LOG=/var/log/apache-stratos/cartridge-agent.log
+export LOG=/var/log/apache-stratos/cartridge-agent-sh.log
instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
-event_publisher_path=/opt/apache-stratos-cartridge-agent/event-publisher # Event publisher home
-event_subscriber_path=/opt/apache-stratos-cartridge-agent/event-subscriber # Event subscriber home
-health_publisher_path=/opt/apache-stratos-cartridge-agent/health-publisher # Health publisher home
+ca_exec_path=${instance_path}/cartridge-agent # Cartridge agent executable home
# ---------------------------------------------
# Download payload
@@ -38,7 +36,7 @@ if [ ! -d ${instance_path}/payload ]; then
echo "creating payload directory... " | tee -a $LOG
mkdir ${instance_path}/payload
echo "payload directory created" | tee -a $LOG
- wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/launch-params
+ wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/payload.txt
echo "payload copied" | tee -a $LOG
for i in `/usr/bin/ruby ${instance_path}/get-launch-params.rb`
@@ -52,7 +50,7 @@ if [ ! -d ${instance_path}/payload ]; then
fi
echo "writing to launch.params ${value}" | tee -a $LOG
echo "export" ${value} >> ${instance_path}/launch.params
- done
+ done
fi
source ${instance_path}/launch.params
@@ -61,29 +59,24 @@ source ${instance_path}/launch.params
# Starting load balancer
#---------------------------
pushd $instance_path/load-balancer/
-sh start-load-balancer.sh $MB_IP $MB_PORT $CEP_IP $CEP_PORT $LB_CLUSTER_ID $NETWORK_PARTITION_ID &
+sh "start-load-balancer.sh" $MB_IP $MB_PORT $CEP_IP $CEP_PORT $CLUSTER_ID $NETWORK_PARTITION_ID &
popd
-#---------------------------
-# Starting topic subscriber
-#---------------------------
-# change mb ip port in conf/jndi.properties
-pushd $event_subscriber_path
-cp -f templates/jndi.properties.template conf/jndi.properties.tmp
-cat conf/jndi.properties.tmp | sed -e "s@MB-IP@$MB_IP@g" > conf/jndi.properties
-cp -f conf/jndi.properties conf/jndi.properties.tmp
-cat conf/jndi.properties.tmp | sed -e "s@MB-PORT@$MB_PORT@g" > conf/jndi.properties
-rm -f conf/jndi.properties.tmp
+#------------------------------------
+# Starting cartridge agent executable
+#------------------------------------
+pushd $ca_exec_path
+echo "Configuring cartridge agent executable..." | tee -a $LOG
+cp -f templates/cartridge-agent.sh.template bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@MB-IP@$MB_IP@g" > bin/cartridge-agent.sh
+cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@MB-PORT@$MB_PORT@g" > bin/cartridge-agent.sh
+cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@CEP-IP@$CEP_IP@g" > bin/cartridge-agent.sh
+cp -f bin/cartridge-agent.sh bin/cartridge-agent.sh.tmp
+cat bin/cartridge-agent.sh.tmp | sed -e "s@CEP-PORT@$CEP_PORT@g" > bin/cartridge-agent.sh
+rm -f bin/cartridge-agent.sh.tmp
+echo "Starting cartridge agent..." | tee -a $LOG
+sh bin/cartridge-agent.sh
popd
-pushd $event_subscriber_path/bin
-echo "Executing: event-subscriber.sh "
-sh event-subscriber.sh &
-echo "Event subscribed" | tee -a $LOG
-popd
-
-pushd $health_publisher_path/bin
-echo "Executing: health-publisher.sh"
-sh health-publisher.sh $MEMBER_ID $CEP_IP $CEP_PORT $PORTS $CLUSTER_ID $NETWORK_PARTITION_ID
-echo "Health stat published" | tee -a $LOG
-popd
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/mysql/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/mysql/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/mysql/cartridge-agent.sh
deleted file mode 100755
index 5a2f370..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/mysql/cartridge-agent.sh
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-# This script will be called from /etc/rc.local when the cartridge
-# instance is spawned. It will initiate all the tasks that needs to
-# be run to bring the cartridge instance to operational state.
-
-set -e # Terminate on any error
-export LOG=/var/log/apache-stratos/cartridge-agent.log
-instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
-event_publisher_path=/opt/apache-stratos-cartridge-agent/event-publisher # Event publisher home
-
-# ---------------------------------------------
-# Download payload.zip
-# ---------------------------------------------
-if [ ! -d ${instance_path}/payload ]; then
- echo "creating payload directory... " | tee -a $LOG
- mkdir ${instance_path}/payload
- echo "payload directory created" | tee -a $LOG
- wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/payload.zip
- echo "payload copied" | tee -a $LOG
- unzip -d ${instance_path}/payload ${instance_path}/payload/payload.zip
- echo "unzipped" | tee -a $LOG
-
- for i in `/usr/bin/ruby ${instance_path}/get-launch-params.rb`
- do
- # Add double quotes on both sides of the value
- value=`echo "${i}" | sed -e s@=@=\"@g`
- value=${value}"\""
- if [[ ${value} == PORTS* ]]; then
- # Replace port separator | with ,
- value=`echo ${value} | sed -e s@'|'@,@g`
- fi
- echo "writing to launch.params ${value}" | tee -a $LOG
- echo "export" ${value} >> ${instance_path}/launch.params
- done
-fi
-
-source ${instance_path}/launch.params
-
-# ---------------------------------------------
-# Publish member-started-event
-# ---------------------------------------------
-echo "Generating member-started-event.json..." | tee -a $LOG
-cp -f $event_publisher_path/templates/member-started-event.json.template member-started-event.json.tmp
-cat member-started-event.json.tmp | sed -e "s@SERVICE_NAME@$SERVICE_NAME@g" > member-started-event.json
-cp -f member-started-event.json member-started-event.json.tmp
-cat member-started-event.json.tmp | sed -e "s@CLUSTER_ID@$CLUSTER_ID@g" > member-started-event.json
-cp -f member-started-event.json member-started-event.json.tmp
-cat member-started-event.json.tmp | sed -e "s@MEMBER_ID@$MEMBER_ID@g" > member-started-event.json
-rm -f member-started-event.json.tmp
-echo "member-started-event.json generated" | tee -a $LOG
-
-echo "Publishing member started event..." | tee -a $LOG
-event_class_name=org.apache.stratos.messaging.event.instance.status.MemberStartedEvent
-event_json_path=`pwd`/member-started-event.json
-
-pushd $event_publisher_path/bin
-echo "Executing: event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path"
-sh event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path
-popd
-echo "Event published" | tee -a $LOG
-
-
-# -----------------------------------------------------
-# Set MySQL root password
-# -----------------------------------------------------
-echo "Setting MySQL root password" >> $LOG
-if [[ (-n ${MYSQL_PASSWORD} ) ]]; then
- mysqladmin -uroot -pmysql password "${MYSQL_PASSWORD}"
- mysql -uroot -p${MYSQL_PASSWORD} -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}' WITH GRANT OPTION; flush privileges;"
- echo "MySQL root password set" >> $LOG
-fi
-
-
-# -----------------------------------------------------
-# Publish member-activated-event
-# -----------------------------------------------------
-while true
-do
-var=`nc -z localhost 3306; echo $?`;
-if [ $var -eq 0 ]
- then
- echo "port 3306 is available" | tee -a $LOG
- break
- else
- echo "port 3306 is not available" | tee -a $LOG
- fi
- sleep 1
-done
-
-while true
-do
-var=`nc -z localhost 80; echo $?`;
-if [ $var -eq 0 ]
- then
- echo "port 80 is available" | tee -a $LOG
- break
- else
- echo "port 80 is not available" | tee -a $LOG
- fi
- sleep 1
-done
-
-echo "Generating member-activated-event.json..." | tee -a $LOG
-cp -f $event_publisher_path/templates/member-activated-event.json.template member-activated-event.json.tmp
-cat member-activated-event.json.tmp | sed -e "s@SERVICE_NAME@$SERVICE_NAME@g" > member-activated-event.json
-cp -f member-activated-event.json member-activated-event.json.tmp
-cat member-activated-event.json.tmp | sed -e "s@CLUSTER_ID@$CLUSTER_ID@g" > member-activated-event.json
-cp -f member-activated-event.json member-activated-event.json.tmp
-cat member-activated-event.json.tmp | sed -e "s@MEMBER_ID@$MEMBER_ID@g" > member-activated-event.json
-rm -f member-activated-event.json.tmp
-echo "member-activated-event.json generated" | tee -a $LOG
-
-echo "Publishing member activated event..." | tee -a $LOG
-event_class_name=org.apache.stratos.messaging.event.instance.status.MemberActivatedEvent
-event_json_path=`pwd`/member-activated-event.json
-
-pushd $event_publisher_path/bin
-echo "Executing: event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path"
-sh event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path
-popd
-echo "Event published" | tee -a $LOG
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/mysql/clean.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/mysql/clean.sh b/products/cartridge-agent/modules/scripts/ec2/mysql/clean.sh
deleted file mode 100755
index 4e5f96a..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/mysql/clean.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-echo "Removing json files created"
-rm -f *.json
-echo "Removing payload directory"
-rm -rf payload/
-echo "Removing repo info soap request"
-rm -f repoinforequest.xml
-echo "Removing launch.params"
-rm -f launch.params
-echo "Removing cartridge agent logs"
-rm -f /var/log/apache-stratos/*
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/mysql/get-launch-params.rb
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/mysql/get-launch-params.rb b/products/cartridge-agent/modules/scripts/ec2/mysql/get-launch-params.rb
deleted file mode 100644
index 0631b2b..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/mysql/get-launch-params.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#! /usr/bin/ruby
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-### get-launch-params.rb
-
-# The following script obtains the launch parameters from
-# the file /tmp/payload/launch-params, then parses out the
-# parameters for this instance by using the launch index
-# of this particular EC2 instance.
-#
-# Pass the command the -e flag to output the instance
-# parameters as exports of shell variables. Any other
-# arguments are ignored.
-
-def get_launch_params(launch_params_file)
- IO.readlines launch_params_file
-end
-
-export_stmt = ""
-
-launch_params = get_launch_params(
- "/opt/apache-stratos-cartridge-agent/payload/launch-params")
-
-if launch_params.length > 0
- instance_params_str = launch_params[0]
-
- instance_params = instance_params_str.split(',')
-
- export_stmt = "export " if ARGV.length > 0 && ARGV.include?("-e")
-
- instance_params.each { |param|
- puts export_stmt + param
- }
-
-end
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/mysql/healthcheck.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/mysql/healthcheck.sh b/products/cartridge-agent/modules/scripts/ec2/mysql/healthcheck.sh
deleted file mode 100644
index 04a96d1..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/mysql/healthcheck.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-
-var=`nc -z localhost 80; echo $?`;
-if [ $var -eq 0 ]
-then
- echo "port 80 is available" > /dev/null 2>&1
-else
- echo "port 80 is not available" > /dev/null 2>&1
- /etc/init.d/apache2 restart
-fi
-
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/php/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/php/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/php/cartridge-agent.sh
deleted file mode 100755
index 7064af8..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/php/cartridge-agent.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-# This script will be called from /etc/rc.local when the cartridge
-# instance is spawned. It will initiate all the tasks that needs to
-# be run to bring the cartridge instance to operational state.
-
-set -e # Terminate on any error
-export LOG=/var/log/apache-stratos/cartridge-agent.log
-instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
-event_publisher_path=/opt/apache-stratos-cartridge-agent/event-publisher # Event publisher home
-event_subscriber_path=/opt/apache-stratos-cartridge-agent/event-subscriber # Event subscriber home
-health_publisher_path=/opt/apache-stratos-cartridge-agent/health-publisher # Health publisher home
-
-# ---------------------------------------------
-# Download payload.zip
-# ---------------------------------------------
-if [ ! -d ${instance_path}/payload ]; then
- echo "creating payload directory... " | tee -a $LOG
- mkdir ${instance_path}/payload
- echo "payload directory created" | tee -a $LOG
- wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/launch-params
- echo "payload copied" | tee -a $LOG
-
- for i in `/usr/bin/ruby ${instance_path}/get-launch-params.rb`
- do
- # Add double quotes on both sides of the value
- value=`echo "${i}" | sed -e s@=@=\"@g`
- value=${value}"\""
- if [[ ${value} == PORTS* ]]; then
- # Replace port separator | with ,
- value=`echo ${value} | sed -e s@'|'@,@g`
- fi
- echo "writing to launch.params ${value}" | tee -a $LOG
- echo "export" ${value} >> ${instance_path}/launch.params
- done
-fi
-
-source ${instance_path}/launch.params
-
-
-
-#---------------------------
-# Starting Topic Subscriber
-#---------------------------
-# change mb ip port in conf/jndi.properties
-pushd $event_subscriber_path/conf
-cp -rf jndi.properties jndi.properties.tmp
-cat jndi.properties.tmp | sed -e "s@MB-PORT@$MB_PORT@g" > jndi.properties
-cp -rf jndi.properties jndi.properties.tmp
-cat jndi.properties.tmp | sed -e "s@MB-IP-ADDRESS@$MB_IP@g" > jndi.properties
-rm -f jndi.properties.tmp
-popd
-
-pushd $event_subscriber_path/bin
-echo "Executing: event-subscriber.sh "
-sh event-subscriber.sh &
-echo "Event subscribed" | tee -a $LOG
-popd
-
-#Health publisher is started inside event subscriber
-#pushd $health_publisher_path/bin
-#echo "Executing: health-publisher.sh"
-#sh health-publisher.sh $MEMBER_ID $CEP_IP $CEP_PORT $PORTS $CLUSTER_ID $NETWORK_PARTITION_ID
-#echo "Health stat published" | tee -a $LOG
-#popd
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/php/clean.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/php/clean.sh b/products/cartridge-agent/modules/scripts/ec2/php/clean.sh
deleted file mode 100755
index 9720568..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/php/clean.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-echo "Removing json files created"
-rm -f *.json
-echo "Removing payload directory"
-rm -rf payload/
-echo "Removing repo info soap request"
-rm -f repoinforequest.xml
-echo "Removing launch.params"
-rm -f launch.params
-echo "Removing git.sh"
-rm -f git.sh
-echo "Removing temporary git directory"
-rm -rf /opt/temp_git
-echo "Removing content copied to the web server"
-rm -rf /var/www/* /var/www/.git
-echo "Removing cartridge agent logs"
-rm -f /var/log/apache-stratos/*
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/php/get-launch-params.rb
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/php/get-launch-params.rb b/products/cartridge-agent/modules/scripts/ec2/php/get-launch-params.rb
deleted file mode 100644
index 0631b2b..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/php/get-launch-params.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#! /usr/bin/ruby
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-### get-launch-params.rb
-
-# The following script obtains the launch parameters from
-# the file /tmp/payload/launch-params, then parses out the
-# parameters for this instance by using the launch index
-# of this particular EC2 instance.
-#
-# Pass the command the -e flag to output the instance
-# parameters as exports of shell variables. Any other
-# arguments are ignored.
-
-def get_launch_params(launch_params_file)
- IO.readlines launch_params_file
-end
-
-export_stmt = ""
-
-launch_params = get_launch_params(
- "/opt/apache-stratos-cartridge-agent/payload/launch-params")
-
-if launch_params.length > 0
- instance_params_str = launch_params[0]
-
- instance_params = instance_params_str.split(',')
-
- export_stmt = "export " if ARGV.length > 0 && ARGV.include?("-e")
-
- instance_params.each { |param|
- puts export_stmt + param
- }
-
-end
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/php/healthcheck.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/php/healthcheck.sh b/products/cartridge-agent/modules/scripts/ec2/php/healthcheck.sh
deleted file mode 100644
index 04a96d1..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/php/healthcheck.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-
-var=`nc -z localhost 80; echo $?`;
-if [ $var -eq 0 ]
-then
- echo "port 80 is available" > /dev/null 2>&1
-else
- echo "port 80 is not available" > /dev/null 2>&1
- /etc/init.d/apache2 restart
-fi
-
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/tomcat/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/tomcat/cartridge-agent.sh b/products/cartridge-agent/modules/scripts/ec2/tomcat/cartridge-agent.sh
deleted file mode 100755
index 4f640fd..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/tomcat/cartridge-agent.sh
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-# This script will be called from /etc/rc.local when the cartridge
-# instance is spawned. It will initiate all the tasks that needs to
-# be run to bring the cartridge instance to operational state.
-
-set -e # Terminate on any error
-export LOG=/var/log/apache-stratos/cartridge-agent.log
-instance_path=/opt/apache-stratos-cartridge-agent # Cartridge agent home
-event_publisher_path=/opt/apache-stratos-cartridge-agent/event-publisher # Event publisher home
-
-# ---------------------------------------------
-# Download payload.zip
-# ---------------------------------------------
-if [ ! -d ${instance_path}/payload ]; then
- echo "creating payload directory... " | tee -a $LOG
- mkdir ${instance_path}/payload
- echo "payload directory created" | tee -a $LOG
- wget http://169.254.169.254/latest/user-data -O ${instance_path}/payload/launch-params
- echo "payload copied" | tee -a $LOG
-
- for i in `/usr/bin/ruby ${instance_path}/get-launch-params.rb`
- do
- # Add double quotes on both sides of the value
- value=`echo "${i}" | sed -e s@=@=\"@g`
- value=${value}"\""
- if [[ ${value} == PORTS* ]]; then
- # Replace port separator | with ,
- value=`echo ${value} | sed -e s@'|'@,@g`
- fi
- echo "writing to launch.params ${value}" | tee -a $LOG
- echo "export" ${value} >> ${instance_path}/launch.params
- done
-fi
-
-source ${instance_path}/launch.params
-
-# ---------------------------------------------
-# Publish member-started-event
-# ---------------------------------------------
-echo "Generating member-started-event.json..." | tee -a $LOG
-cp -f $event_publisher_path/templates/member-started-event.json.template member-started-event.json.tmp
-cat member-started-event.json.tmp | sed -e "s@SERVICE_NAME@$SERVICE_NAME@g" > member-started-event.json
-cp -f member-started-event.json member-started-event.json.tmp
-cat member-started-event.json.tmp | sed -e "s@CLUSTER_ID@$CLUSTER_ID@g" > member-started-event.json
-cp -f member-started-event.json member-started-event.json.tmp
-cat member-started-event.json.tmp | sed -e "s@MEMBER_ID@$MEMBER_ID@g" > member-started-event.json
-rm -f member-started-event.json.tmp
-echo "member-started-event.json generated" | tee -a $LOG
-
-echo "Publishing member started event..." | tee -a $LOG
-event_class_name=org.apache.stratos.messaging.event.instance.status.MemberStartedEvent
-event_json_path=`pwd`/member-started-event.json
-
-pushd $event_publisher_path/bin
-echo "Executing: event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path"
-sh event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path
-echo "Event published" | tee -a $LOG
-popd
-
-
-# -----------------------------------------------------
-# Generate git.sh
-# -----------------------------------------------------
-echo "Creating repoinfo request " | tee -a $LOG
-echo "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://org.apache.axis2/xsd\">
- <soapenv:Header/>
- <soapenv:Body>
- <xsd:getRepositoryCredentials>
- <xsd:tenantId>${TENANT_ID}</xsd:tenantId>
- <xsd:cartridgeType>${SERVICE_NAME}</xsd:cartridgeType>
- <xsd:alias>${CARTRIDGE_ALIAS}</xsd:alias>
- </xsd:getRepositoryCredentials>
- </soapenv:Body>
-</soapenv:Envelope>" > ${instance_path}/repoinforequest.xml
-
-echo "Repoinfo request created " | tee -a $LOG
-
-
-echo "Generating git.sh..." | tee -a $LOG
-# If repo is available do a git pull, else clone
-echo "#!/bin/bash
-set -e
-GIT_SH_LOG=/var/log/apache-stratos/git-sh.log
-if [ -d \"${APP_PATH}/.git\" ]; then
- cd ${APP_PATH}
- echo \"Invoking repo info service...\" | tee -a \$GIT_SH_LOG
- curl -X POST -H \"Content-Type: text/xml\" -H \"SOAPAction: urn:getRepositoryCredentials\" -d @${instance_path}/repoinforequest.xml --silent \"${REPO_INFO_EPR}\" --insecure > /tmp/git.xml
- echo \"Processing repo info service response...\" | tee -a \$GIT_SH_LOG
- sed '1,5d' /tmp/git.xml > /tmp/git1.xml
- sed '2d' /tmp/git1.xml > /tmp/git.xml
- username=\`xml_grep 'ax29:userName' /tmp/git.xml --text_only\`
- password=\`xml_grep 'ax29:password' /tmp/git.xml --text_only\`
- repo=\`xml_grep 'ax29:url' /tmp/git.xml --text_only\`
- echo \"username=\$username repo=\${repo}\" | tee -a \$GIT_SH_LOG
- rm /tmp/git1.xml
- rm /tmp/git.xml
- echo \"Preparing .netrc...\" | tee -a \$GIT_SH_LOG
- url=\`echo \$repo |sed 's/http.*\/\///g' |sed 's/\:.*//g' |sed 's/\/.*//g'\`
- echo \"machine \${url} login \${username} password \${password}\" > ~/.netrc
- sudo echo \"machine \${url} login \${username} password \${password}\" > /root/.netrc
- chmod 600 ~/.netrc
- sudo chmod 600 /root/.netrc
- echo \"Setting git http.sslVerify false\" | tee -a \$GIT_SH_LOG
- git config --global --bool --add http.sslVerify false
- echo \"Running git pull...\" | tee -a \$GIT_SH_LOG
- sudo git pull
- if [ -f ~/.netrc ]; then
- echo \"Removing ~/.netrc...\" | tee -a \$GIT_SH_LOG
- rm ~/.netrc
- fi
- if [ -f /root/.netrc ]; then
- echo \"Removing /root/.netrc...\" | tee -a \$GIT_SH_LOG
- sudo rm /root/.netrc
- fi
-
-else
- echo \"Removing index.html from application path...\" | tee -a \$GIT_SH_LOG
- sudo rm -f ${APP_PATH}/index.html
- echo \"Invoking repo info service...\" | tee -a \$GIT_SH_LOG
- curl -X POST -H \"Content-Type: text/xml\" -H \"SOAPAction: urn:getRepositoryCredentials\" -d @${instance_path}/repoinforequest.xml --silent \"${REPO_INFO_EPR}\" --insecure > /tmp/git.xml
- echo \"Processing repo info service response...\" | tee -a \$GIT_SH_LOG
- sed '1,5d' /tmp/git.xml > /tmp/git1.xml
- sed '2d' /tmp/git1.xml > /tmp/git.xml
- username=\`xml_grep 'ax29:userName' /tmp/git.xml --text_only\`
- password=\`xml_grep 'ax29:password' /tmp/git.xml --text_only\`
- repo=\`xml_grep 'ax29:url' /tmp/git.xml --text_only\`
- echo \"username=\$username repo=\${repo}\" | tee -a \$GIT_SH_LOG
- rm /tmp/git1.xml
- rm /tmp/git.xml
- echo \"Preparing .netrc...\" | tee -a \$GIT_SH_LOG
- url=\`echo \$repo |sed 's/http.*\/\///g' |sed 's/\:.*//g' |sed 's/\/.*//g'\`
- echo \"machine \${url} login \${username} password \${password}\" > ~/.netrc
- sudo echo \"machine \${url} login \${username} password \${password}\" > /root/.netrc
- chmod 600 ~/.netrc
- sudo chmod 600 /root/.netrc
- echo \"Setting git http.sslVerify false\" | tee -a \$GIT_SH_LOG
- git config --global --bool --add http.sslVerify false
- echo \"Creating temporary git folder...\" | tee -a \$GIT_SH_LOG
- sudo mkdir ${instance_path}/temp_git
- echo \"Running git clone...\" | tee -a \$GIT_SH_LOG
- git clone \${repo} ${instance_path}/temp_git
- sudo cp -r ${instance_path}/temp_git/* $APP_PATH/
- sudo cp -r ${instance_path}/temp_git/.git $APP_PATH/
- sudo rm -rf ${instance_path}/temp_git
-
- if [ -f ~/.netrc ]; then
- echo \"Removing ~/.netrc...\" | tee -a \$GIT_SH_LOG
- rm ~/.netrc
- fi
- if [ -f /root/.netrc ]; then
- echo \"Removing /root/.netrc...\" | tee -a \$GIT_SH_LOG
- sudo rm /root/.netrc
- fi
-
-
-fi
-echo \"git.sh done\" | tee -a \$LOG" > ${instance_path}/git.sh
-echo "git.sh generated" | tee -a $LOG
-chmod 755 ${instance_path}/git.sh
-
-
-# -----------------------------------------------------
-# Git clone
-# -----------------------------------------------------
-pushd ${instance_path}
-echo "Running git.sh..." | tee -a $LOG
-sudo sh ${instance_path}/git.sh
-echo "Git clone done" | tee -a $LOG
-
-
-# -----------------------------------------------------
-# Publish member-activated-event
-# -----------------------------------------------------
-while true
-do
-var=`nc -z localhost 8080; echo $?`;
-if [ $var -eq 0 ]
- then
- echo "Port 8080 is available" | tee -a $LOG
- break
- else
- echo "Port 8080 is not available" | tee -a $LOG
- fi
- sleep 1
-done
-
-echo "Generating member-activated-event.json..." | tee -a $LOG
-cp -f $event_publisher_path/templates/member-activated-event.json.template member-activated-event.json.tmp
-cat member-activated-event.json.tmp | sed -e "s@SERVICE_NAME@$SERVICE_NAME@g" > member-activated-event.json
-cp -f member-activated-event.json member-activated-event.json.tmp
-cat member-activated-event.json.tmp | sed -e "s@CLUSTER_ID@$CLUSTER_ID@g" > member-activated-event.json
-cp -f member-activated-event.json member-activated-event.json.tmp
-cat member-activated-event.json.tmp | sed -e "s@MEMBER_ID@$MEMBER_ID@g" > member-activated-event.json
-rm -f member-activated-event.json.tmp
-echo "member-activated-event.json generated" | tee -a $LOG
-
-echo "Publishing member activated event..." | tee -a $LOG
-event_class_name=org.apache.stratos.messaging.event.instance.status.MemberActivatedEvent
-event_json_path=`pwd`/member-activated-event.json
-
-pushd $event_publisher_path/bin
-echo "Executing: event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path"
-sh event-publisher.sh $MB_IP $MB_PORT $event_class_name $event_json_path
-echo "Event published" | tee -a $LOG
-popd
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/tomcat/clean.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/tomcat/clean.sh b/products/cartridge-agent/modules/scripts/ec2/tomcat/clean.sh
deleted file mode 100755
index 9720568..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/tomcat/clean.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-echo "Removing json files created"
-rm -f *.json
-echo "Removing payload directory"
-rm -rf payload/
-echo "Removing repo info soap request"
-rm -f repoinforequest.xml
-echo "Removing launch.params"
-rm -f launch.params
-echo "Removing git.sh"
-rm -f git.sh
-echo "Removing temporary git directory"
-rm -rf /opt/temp_git
-echo "Removing content copied to the web server"
-rm -rf /var/www/* /var/www/.git
-echo "Removing cartridge agent logs"
-rm -f /var/log/apache-stratos/*
-
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/tomcat/get-launch-params.rb
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/tomcat/get-launch-params.rb b/products/cartridge-agent/modules/scripts/ec2/tomcat/get-launch-params.rb
deleted file mode 100644
index 0631b2b..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/tomcat/get-launch-params.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#! /usr/bin/ruby
-# --------------------------------------------------------------
-#
-# 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.
-#
-# --------------------------------------------------------------
-
-### get-launch-params.rb
-
-# The following script obtains the launch parameters from
-# the file /tmp/payload/launch-params, then parses out the
-# parameters for this instance by using the launch index
-# of this particular EC2 instance.
-#
-# Pass the command the -e flag to output the instance
-# parameters as exports of shell variables. Any other
-# arguments are ignored.
-
-def get_launch_params(launch_params_file)
- IO.readlines launch_params_file
-end
-
-export_stmt = ""
-
-launch_params = get_launch_params(
- "/opt/apache-stratos-cartridge-agent/payload/launch-params")
-
-if launch_params.length > 0
- instance_params_str = launch_params[0]
-
- instance_params = instance_params_str.split(',')
-
- export_stmt = "export " if ARGV.length > 0 && ARGV.include?("-e")
-
- instance_params.each { |param|
- puts export_stmt + param
- }
-
-end
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f4e605c9/products/cartridge-agent/modules/scripts/ec2/tomcat/healthcheck.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/scripts/ec2/tomcat/healthcheck.sh b/products/cartridge-agent/modules/scripts/ec2/tomcat/healthcheck.sh
deleted file mode 100644
index d536e1c..0000000
--- a/products/cartridge-agent/modules/scripts/ec2/tomcat/healthcheck.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# --------------------------------------------------------------
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# --------------------------------------------------------------
-
-
-var=`nc -z localhost 80; echo $?`;
-if [ $var -eq 0 ]
-then
- echo "port 8080 is available" > /dev/null 2>&1
-else
- echo "port 8080 is not available" > /dev/null 2>&1
- /etc/init.d/apache2 restart
-fi
-
-
[12/19] git commit: Enabled health statistics notifier in cartridge
agent
Posted by ud...@apache.org.
Enabled health statistics notifier in cartridge agent
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/62f852f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/62f852f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/62f852f1
Branch: refs/heads/master
Commit: 62f852f1eb71aa4f2ac8d2a67b660e9de2baade9
Parents: 6e62121
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 15:34:38 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../publisher/CartridgeAgentEventPublisher.java | 78 +++++++++++++-------
.../publisher/WSO2CEPStatisticsPublisher.java | 2 +-
.../conf/configurator/CEPConfigurator.java | 2 +-
.../src/main/bin/haproxy-extension.sh | 2 +-
.../src/main/bin/cartridge-agent.sh | 3 +-
5 files changed, 57 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62f852f1/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/event/publisher/CartridgeAgentEventPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/event/publisher/CartridgeAgentEventPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/event/publisher/CartridgeAgentEventPublisher.java
index a576a3a..9e6372d 100644
--- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/event/publisher/CartridgeAgentEventPublisher.java
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/event/publisher/CartridgeAgentEventPublisher.java
@@ -3,6 +3,7 @@ package org.apache.stratos.cartridge.agent.event.publisher;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.stratos.cartridge.agent.config.CartridgeAgentConfiguration;
+import org.apache.stratos.cartridge.agent.statistics.publisher.HealthStatisticsNotifier;
import org.apache.stratos.messaging.broker.publish.EventPublisher;
import org.apache.stratos.messaging.event.instance.status.InstanceActivatedEvent;
import org.apache.stratos.messaging.event.instance.status.InstanceStartedEvent;
@@ -13,40 +14,65 @@ import org.apache.stratos.messaging.util.Constants;
*/
public class CartridgeAgentEventPublisher {
private static final Log log = LogFactory.getLog(CartridgeAgentEventPublisher.class);
+ private static boolean started;
+ private static boolean activated;
public static void publishInstanceStartedEvent() {
- if(log.isInfoEnabled()) {
- log.info("Publishing instance started event");
- }
- InstanceStartedEvent event = new InstanceStartedEvent(
- CartridgeAgentConfiguration.getInstance().getServiceName(),
- CartridgeAgentConfiguration.getInstance().getClusterId(),
- CartridgeAgentConfiguration.getInstance().getNetworkPartitionId(),
- CartridgeAgentConfiguration.getInstance().getPartitionId(),
- CartridgeAgentConfiguration.getInstance().getMemberId());
+ if (!started) {
+ if (log.isInfoEnabled()) {
+ log.info("Publishing instance started event");
+ }
+ InstanceStartedEvent event = new InstanceStartedEvent(
+ CartridgeAgentConfiguration.getInstance().getServiceName(),
+ CartridgeAgentConfiguration.getInstance().getClusterId(),
+ CartridgeAgentConfiguration.getInstance().getNetworkPartitionId(),
+ CartridgeAgentConfiguration.getInstance().getPartitionId(),
+ CartridgeAgentConfiguration.getInstance().getMemberId());
- EventPublisher eventPublisher = new EventPublisher(Constants.INSTANCE_STATUS_TOPIC);
- eventPublisher.publish(event);
- if(log.isInfoEnabled()) {
- log.info("Instance started event published");
+ EventPublisher eventPublisher = new EventPublisher(Constants.INSTANCE_STATUS_TOPIC);
+ eventPublisher.publish(event);
+ started = true;
+ if (log.isInfoEnabled()) {
+ log.info("Instance started event published");
+ }
+ } else {
+ if (log.isWarnEnabled()) {
+ log.warn("Instance already started");
+ }
}
}
public static void publishInstanceActivatedEvent() {
- if(log.isInfoEnabled()) {
- log.info("Publishing instance activated event");
- }
- InstanceActivatedEvent event = new InstanceActivatedEvent(
- CartridgeAgentConfiguration.getInstance().getServiceName(),
- CartridgeAgentConfiguration.getInstance().getClusterId(),
- CartridgeAgentConfiguration.getInstance().getNetworkPartitionId(),
- CartridgeAgentConfiguration.getInstance().getPartitionId(),
- CartridgeAgentConfiguration.getInstance().getMemberId());
+ if (!activated) {
+ if (log.isInfoEnabled()) {
+ log.info("Publishing instance activated event");
+ }
+ InstanceActivatedEvent event = new InstanceActivatedEvent(
+ CartridgeAgentConfiguration.getInstance().getServiceName(),
+ CartridgeAgentConfiguration.getInstance().getClusterId(),
+ CartridgeAgentConfiguration.getInstance().getNetworkPartitionId(),
+ CartridgeAgentConfiguration.getInstance().getPartitionId(),
+ CartridgeAgentConfiguration.getInstance().getMemberId());
+
+ EventPublisher eventPublisher = new EventPublisher(Constants.INSTANCE_STATUS_TOPIC);
+ eventPublisher.publish(event);
+ if (log.isInfoEnabled()) {
+ log.info("Instance activated event published");
+ }
- EventPublisher eventPublisher = new EventPublisher(Constants.INSTANCE_STATUS_TOPIC);
- eventPublisher.publish(event);
- if(log.isInfoEnabled()) {
- log.info("Instance activated event published");
+ if (log.isInfoEnabled()) {
+ log.info("Starting health statistics notifier");
+ }
+ Thread thread = new Thread(new HealthStatisticsNotifier());
+ thread.start();
+ activated = true;
+ if (log.isInfoEnabled()) {
+ log.info("Health statistics notifier started");
+ }
+ } else {
+ if (log.isWarnEnabled()) {
+ log.warn("Instance already activated");
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62f852f1/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
index 153c511..0899f1a 100644
--- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
+++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/statistics/publisher/WSO2CEPStatisticsPublisher.java
@@ -51,7 +51,7 @@ public class WSO2CEPStatisticsPublisher implements StatisticsPublisher {
this.port = System.getProperty("thrift.receiver.port");
this.username = "admin";
this.password = "admin";
- String enabledStr = System.getProperty("load.balancer.cep.stats.publisher.enabled");
+ String enabledStr = System.getProperty("cep.stats.publisher.enabled");
if (StringUtils.isNotBlank(enabledStr)) {
enabled = Boolean.getBoolean(enabledStr);
if (enabled) {
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62f852f1/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/configurator/CEPConfigurator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/configurator/CEPConfigurator.java b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/configurator/CEPConfigurator.java
index 9d9d492..7d76766 100644
--- a/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/configurator/CEPConfigurator.java
+++ b/components/org.apache.stratos.load.balancer/src/main/java/org/apache/stratos/load/balancer/conf/configurator/CEPConfigurator.java
@@ -28,7 +28,7 @@ public class CEPConfigurator {
public static void configure(LoadBalancerConfiguration configuration) {
// Set system properties
- System.setProperty("load.balancer.cep.stats.publisher.enabled", String.valueOf(configuration.isCepStatsPublisherEnabled()));
+ System.setProperty("cep.stats.publisher.enabled", String.valueOf(configuration.isCepStatsPublisherEnabled()));
System.setProperty("thrift.receiver.ip", configuration.getCepIp());
System.setProperty("thrift.receiver.port", String.valueOf(configuration.getCepPort()));
System.setProperty("network.partition.id", configuration.getNetworkPartitionId());
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62f852f1/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
----------------------------------------------------------------------
diff --git a/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh b/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
index 2254f09..43b7428 100755
--- a/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
+++ b/extensions/load-balancer/haproxy-extension/src/main/bin/haproxy-extension.sh
@@ -38,7 +38,7 @@ properties="-Djndi.properties.dir=${script_path}/../conf
-Dthrift.receiver.port=7615
-Dnetwork.partition.id=
-Dstratos.messaging.topology.service.filter=
- -Dload.balancer.cep.stats.publisher.enabled=true"
+ -Dcep.stats.publisher.enabled=true"
# Uncomment below line to enable remote debugging
#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/62f852f1/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh b/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
index c03bad3..830a78a 100644
--- a/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
+++ b/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
@@ -30,8 +30,9 @@ properties="-Dmb.ip=localhost
-Dthrift.receiver.port=7615
-Djndi.properties.template.file.path=${script_path}/../conf/templates/jndi.properties.template
-Djndi.properties.dir=${script_path}/../conf
- -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties"
+ -Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties
-Dparam.file.path=/opt/apache-stratos-cartridge-agent/payload/launch.params
+ -Dcep.stats.publisher.enabled=true"
# Uncomment below line to enable remote debugging
#debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
[18/19] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-stratos
Posted by ud...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-stratos
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/b302284d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/b302284d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/b302284d
Branch: refs/heads/master
Commit: b302284d6497b10e0ae8be9a2ef6d302f1070d99
Parents: 25df5a9 ce67fc1
Author: Udara Liyanage <ud...@wso2.com>
Authored: Fri Dec 20 20:25:50 2013 -0500
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:50 2013 -0500
----------------------------------------------------------------------
.../autoscaler/client/cloud/controller/CloudControllerClient.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
[06/19] git commit: improving events adding constructors and topology
listeners by removing abstract
Posted by ud...@apache.org.
improving events adding constructors and topology listeners by removing abstract
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/25df5a90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/25df5a90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/25df5a90
Branch: refs/heads/master
Commit: 25df5a9032b500ae5f4a1d4ddf92e4824e644085
Parents: b4df470
Author: Lahiru Sandaruwan <la...@apache.org>
Authored: Fri Dec 20 17:04:34 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../topology/AutoscalerTopologyReceiver.java | 8 ++---
.../health/stat/AverageLoadAverageEvent.java | 25 +++++++---------
.../stat/AverageMemoryConsumptionEvent.java | 25 +++++++---------
.../stat/AverageRequestsInFlightEvent.java | 24 ++++++---------
.../health/stat/GradientOfLoadAverageEvent.java | 24 ++++++---------
.../stat/GradientOfMemoryConsumptionEvent.java | 24 ++++++---------
.../stat/GradientOfRequestsInFlightEvent.java | 24 ++++++---------
.../stat/MemberAverageLoadAverageEvent.java | 17 +++++------
.../MemberAverageMemoryConsumptionEvent.java | 16 +++++-----
.../event/health/stat/MemberFaultEvent.java | 31 +++++++-------------
.../stat/MemberGradientOfLoadAverageEvent.java | 17 +++++------
.../MemberGradientOfMemoryConsumptionEvent.java | 17 +++++------
...emberSecondDerivativeOfLoadAverageEvent.java | 17 +++++------
...econdDerivativeOfMemoryConsumptionEvent.java | 17 +++++------
.../SecondDerivativeOfLoadAverageEvent.java | 24 ++++++---------
...econdDerivativeOfMemoryConsumptionEvent.java | 17 +++++------
...SecondDerivativeOfRequestsInFlightEvent.java | 24 ++++++---------
.../tenant/TenantRemovedEventListener.java | 7 ++++-
.../topology/ClusterCreatedEventListener.java | 6 +---
.../topology/ClusterRemovedEventListener.java | 6 +---
.../topology/CompleteTopologyEventListener.java | 6 +---
.../topology/InstanceSpawnedEventListener.java | 6 +---
.../topology/MemberActivatedEventListener.java | 6 +---
.../topology/MemberStartedEventListener.java | 6 +---
.../topology/MemberSuspendedEventListener.java | 7 +----
.../topology/MemberTerminatedEventListener.java | 6 +---
.../topology/ServiceCreatedEventListener.java | 6 +---
.../topology/ServiceRemovedEventListener.java | 6 +---
28 files changed, 154 insertions(+), 265 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/topology/AutoscalerTopologyReceiver.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/topology/AutoscalerTopologyReceiver.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/topology/AutoscalerTopologyReceiver.java
index 5ecfad9..b216df1 100644
--- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/topology/AutoscalerTopologyReceiver.java
+++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/topology/AutoscalerTopologyReceiver.java
@@ -218,7 +218,7 @@ public class AutoscalerTopologyReceiver implements Runnable {
try {
TopologyManager.acquireReadLock();
-
+
MemberActivatedEvent e = (MemberActivatedEvent)event;
String memberId = e.getMemberId();
String partitionId = e.getPartitionId();
@@ -228,10 +228,10 @@ public class AutoscalerTopologyReceiver implements Runnable {
PartitionContext partitionContext;
String clusterId = e.getClusterId();
AbstractMonitor monitor;
-
+
if(AutoscalerContext.getInstance().moniterExist(clusterId)) {
monitor = AutoscalerContext.getInstance().getMonitor(clusterId);
- partitionContext = monitor.getNetworkPartitionCtxt(networkPartitionId).getPartitionCtxt(partitionId);
+ partitionContext = monitor.getNetworkPartitionCtxt(networkPartitionId).getPartitionCtxt(partitionId);
} else {
monitor = AutoscalerContext.getInstance().getLBMonitor(clusterId);
partitionContext = monitor.getNetworkPartitionCtxt(networkPartitionId).getPartitionCtxt(partitionId);
@@ -244,7 +244,7 @@ public class AutoscalerTopologyReceiver implements Runnable {
// .getPartitionCtxt(partitionId);
partitionContext.incrementCurrentMemberCount(1);
partitionContext.removePendingMember(memberId);
-
+
}
finally{
TopologyManager.releaseReadLock();
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
index ef28e4b..ba5abb3 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageLoadAverageEvent.java
@@ -25,32 +25,27 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send average of Load average
*/
public class AverageLoadAverageEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+ public AverageLoadAverageEvent(String networkPartitionId, String clusterId, float value, String networkPartitionId1, String clusterId1, float value1){
- public String getClusterId() {
- return clusterId;
+ this.networkPartitionId = networkPartitionId1;
+ this.clusterId = clusterId1;
+ this.value = value1;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
+
+ public String getClusterId() {
+ return clusterId;
}
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
index b5c569a..2f13b09 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageMemoryConsumptionEvent.java
@@ -25,32 +25,27 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send average of memory consumption
*/
public class AverageMemoryConsumptionEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+ public AverageMemoryConsumptionEvent(String networkPartitionId, String clusterId, float value){
- public String getClusterId() {
- return clusterId;
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.value = value;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
+
+ public String getClusterId() {
+ return clusterId;
}
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
index 0135d8f..143ae03 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/AverageRequestsInFlightEvent.java
@@ -25,32 +25,26 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send average of requests in flight
*/
public class AverageRequestsInFlightEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+
+ public AverageRequestsInFlightEvent(String networkPartitionId, String clusterId, float value) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
index 5596c42..e12b35b 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfLoadAverageEvent.java
@@ -25,32 +25,26 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send gradient of Load average
*/
public class GradientOfLoadAverageEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+
+ public GradientOfLoadAverageEvent(String networkPartitionId, String clusterId, float value) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
index 7598b76..56e43b6 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfMemoryConsumptionEvent.java
@@ -25,32 +25,26 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send gradient of memory consumption
*/
public class GradientOfMemoryConsumptionEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+
+ public GradientOfMemoryConsumptionEvent(String networkPartitionId, String clusterId, float value) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
index fa52577..b92a985 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/GradientOfRequestsInFlightEvent.java
@@ -25,32 +25,26 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send gradient of requests in flight
*/
public class GradientOfRequestsInFlightEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+
+ public GradientOfRequestsInFlightEvent(String networkPartitionId, String clusterId, float value) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
index bacdbf0..5ad0211 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageLoadAverageEvent.java
@@ -25,24 +25,21 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send average of Load average
*/
public class MemberAverageLoadAverageEvent extends Event {
- private String memberId;
- private float value;
+ private final String memberId;
+ private final float value;
+
+ public MemberAverageLoadAverageEvent(String memberId, float value) {
+ this.memberId = memberId;
+ this.value = value;
+ }
public String getMemberId() {
return memberId;
}
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
index 2a647e7..85025c5 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberAverageMemoryConsumptionEvent.java
@@ -25,23 +25,21 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send average of memory consumption
*/
public class MemberAverageMemoryConsumptionEvent extends Event {
- private String memberId;
- private float value;
+ private final String memberId;
+ private final float value;
+
+ public MemberAverageMemoryConsumptionEvent(String memberId, float value) {
+ this.memberId = memberId;
+ this.value = value;
+ }
public String getMemberId() {
return memberId;
}
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
index baa6ba4..e96a4b5 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberFaultEvent.java
@@ -25,42 +25,33 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send member fault event
*/
public class MemberFaultEvent extends Event {
- private String clusterId;
- private String memberId;
- private String partitionId;
+ private final String clusterId;
+ private final String memberId;
+ private final String partitionId;
- private float value;
+ private final float value;
+
+ public MemberFaultEvent(String clusterId, String memberId, String partitionId, float value) {
+ this.clusterId = clusterId;
+ this.memberId = memberId;
+ this.partitionId = partitionId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getPartitionId() {
return partitionId;
}
- public void setPartitionId(String partitionId) {
- this.partitionId = partitionId;
- }
-
public String getMemberId() {
return memberId;
}
-
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
index 3f6a8e8..d0f8ae5 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfLoadAverageEvent.java
@@ -26,23 +26,20 @@ import org.apache.stratos.messaging.event.Event;
*/
public class MemberGradientOfLoadAverageEvent extends Event {
- private String memberId;
- private float value;
+ private final String memberId;
+ private final float value;
+
+ public MemberGradientOfLoadAverageEvent(String memberId, float value) {
+ this.memberId = memberId;
+ this.value = value;
+ }
public String getMemberId() {
return memberId;
}
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
public float getValue() {
return value;
}
-
- public void setValue(float value) {
- this.value = value;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
index c244669..b94f5ef 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberGradientOfMemoryConsumptionEvent.java
@@ -26,23 +26,20 @@ import org.apache.stratos.messaging.event.Event;
*/
public class MemberGradientOfMemoryConsumptionEvent extends Event {
- private String memberId;
- private float value;
+ private final String memberId;
+ private final float value;
+
+ public MemberGradientOfMemoryConsumptionEvent(String memberId, float value) {
+ this.memberId = memberId;
+ this.value = value;
+ }
public String getMemberId() {
return memberId;
}
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
public float getValue() {
return value;
}
-
- public void setValue(float value) {
- this.value = value;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
index 6879b27..650043f 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfLoadAverageEvent.java
@@ -26,23 +26,20 @@ import org.apache.stratos.messaging.event.Event;
*/
public class MemberSecondDerivativeOfLoadAverageEvent extends Event {
- private String memberId;
- private float value;
+ private final String memberId;
+ private final float value;
+
+ public MemberSecondDerivativeOfLoadAverageEvent(String memberId, float value) {
+ this.memberId = memberId;
+ this.value = value;
+ }
public String getMemberId() {
return memberId;
}
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
public float getValue() {
return value;
}
-
- public void setValue(float value) {
- this.value = value;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
index 1c2ae0d..532c6dd 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/MemberSecondDerivativeOfMemoryConsumptionEvent.java
@@ -26,23 +26,20 @@ import org.apache.stratos.messaging.event.Event;
*/
public class MemberSecondDerivativeOfMemoryConsumptionEvent extends Event {
- private String memberId;
- private float value;
+ private final String memberId;
+ private final float value;
+
+ public MemberSecondDerivativeOfMemoryConsumptionEvent(String memberId, float value) {
+ this.memberId = memberId;
+ this.value = value;
+ }
public String getMemberId() {
return memberId;
}
- public void setMemberId(String memberId) {
- this.memberId = memberId;
- }
-
public float getValue() {
return value;
}
-
- public void setValue(float value) {
- this.value = value;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
index da12c41..efc54ed 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfLoadAverageEvent.java
@@ -26,32 +26,26 @@ import org.apache.stratos.messaging.event.Event;
*/
public class SecondDerivativeOfLoadAverageEvent extends Event {
- private String networkPartitionId;
- private String clusterId;
- private float value;
+ private final String networkPartitionId;
+ private final String clusterId;
+ private final float value;
+
+ public SecondDerivativeOfLoadAverageEvent(String networkPartitionId, String clusterId, float value) {
+ this.networkPartitionId = networkPartitionId;
+ this.clusterId = clusterId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
index 7abba9b..5d9e9af 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfMemoryConsumptionEvent.java
@@ -25,23 +25,20 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send second derivative of memory consumption
*/
public class SecondDerivativeOfMemoryConsumptionEvent extends Event {
- private String clusterId;
- private float value;
+ private final String clusterId;
+ private final float value;
+
+ public SecondDerivativeOfMemoryConsumptionEvent(String clusterId, float value) {
+ this.clusterId = clusterId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
-
- public void setValue(float value) {
- this.value = value;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
index f659a47..cd6fe6c 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/event/health/stat/SecondDerivativeOfRequestsInFlightEvent.java
@@ -25,32 +25,26 @@ import org.apache.stratos.messaging.event.Event;
* This event is fired by Event processing engine to send second derivative of requests in flight
*/
public class SecondDerivativeOfRequestsInFlightEvent extends Event {
- private String clusterId;
- private String networkPartitionId;
- private float value;
+ private final String clusterId;
+ private final String networkPartitionId;
+ private final float value;
+
+ public SecondDerivativeOfRequestsInFlightEvent(String clusterId, String networkPartitionId, float value) {
+ this.clusterId = clusterId;
+ this.networkPartitionId = networkPartitionId;
+ this.value = value;
+ }
public String getClusterId() {
return clusterId;
}
- public void setClusterId(String clusterId) {
- this.clusterId = clusterId;
- }
-
public float getValue() {
return value;
}
- public void setValue(float value) {
- this.value = value;
- }
-
public String getNetworkPartitionId() {
return networkPartitionId;
}
-
- public void setNetworkPartitionId(String networkPartitionId) {
- this.networkPartitionId = networkPartitionId;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/tenant/TenantRemovedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/tenant/TenantRemovedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/tenant/TenantRemovedEventListener.java
index f94305f..ba75f9b 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/tenant/TenantRemovedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/tenant/TenantRemovedEventListener.java
@@ -19,10 +19,15 @@
package org.apache.stratos.messaging.listener.tenant;
+import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
/**
* Tenant removed event listener.
*/
-public abstract class TenantRemovedEventListener extends EventListener {
+public class TenantRemovedEventListener extends EventListener {
+ @Override
+ protected void onEvent(Event event) {
+
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterCreatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterCreatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterCreatedEventListener.java
index 7e916e6..e1d3766 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterCreatedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterCreatedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class ClusterCreatedEventListener extends EventListener {
+public abstract class ClusterCreatedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterRemovedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterRemovedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterRemovedEventListener.java
index 5c088db..ef99ccf 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterRemovedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ClusterRemovedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class ClusterRemovedEventListener extends EventListener {
+public abstract class ClusterRemovedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/CompleteTopologyEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/CompleteTopologyEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/CompleteTopologyEventListener.java
index f7b9ef4..c067b72 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/CompleteTopologyEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/CompleteTopologyEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class CompleteTopologyEventListener extends EventListener {
+public abstract class CompleteTopologyEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/InstanceSpawnedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/InstanceSpawnedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/InstanceSpawnedEventListener.java
index 75713bd..adc16a0 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/InstanceSpawnedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/InstanceSpawnedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class InstanceSpawnedEventListener extends EventListener {
+public abstract class InstanceSpawnedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberActivatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberActivatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberActivatedEventListener.java
index 951fdbf..a1b39fe 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberActivatedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberActivatedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class MemberActivatedEventListener extends EventListener {
+public abstract class MemberActivatedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberStartedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberStartedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberStartedEventListener.java
index 5286c01..1e3bae0 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberStartedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberStartedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class MemberStartedEventListener extends EventListener {
+public abstract class MemberStartedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberSuspendedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberSuspendedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberSuspendedEventListener.java
index 23fdd8d..8076772 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberSuspendedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberSuspendedEventListener.java
@@ -19,12 +19,7 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class MemberSuspendedEventListener extends EventListener {
-
- @Override
- protected void onEvent(Event event) {
- }
+public abstract class MemberSuspendedEventListener extends EventListener {
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberTerminatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberTerminatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberTerminatedEventListener.java
index 202fce0..7da4cf2 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberTerminatedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/MemberTerminatedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class MemberTerminatedEventListener extends EventListener {
+public abstract class MemberTerminatedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceCreatedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceCreatedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceCreatedEventListener.java
index b1d4399..e2accac 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceCreatedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceCreatedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class ServiceCreatedEventListener extends EventListener {
+public abstract class ServiceCreatedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/25df5a90/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceRemovedEventListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceRemovedEventListener.java b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceRemovedEventListener.java
index f9c0e58..70fc5d1 100644
--- a/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceRemovedEventListener.java
+++ b/components/org.apache.stratos.messaging/src/main/java/org/apache/stratos/messaging/listener/topology/ServiceRemovedEventListener.java
@@ -19,12 +19,8 @@
package org.apache.stratos.messaging.listener.topology;
-import org.apache.stratos.messaging.event.Event;
import org.apache.stratos.messaging.listener.EventListener;
-public class ServiceRemovedEventListener extends EventListener {
+public abstract class ServiceRemovedEventListener extends EventListener {
- @Override
- protected void onEvent(Event event) {
- }
}
[15/19] git commit: Added place holders to cartridge-agent.sh
Posted by ud...@apache.org.
Added place holders to cartridge-agent.sh
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/a22a8676
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/a22a8676
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/a22a8676
Branch: refs/heads/master
Commit: a22a86769147deb46095cd682171e74d2bc8816b
Parents: 7588e61
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Dec 20 16:02:15 2013 +0530
Committer: Udara Liyanage <ud...@wso2.com>
Committed: Fri Dec 20 20:25:37 2013 -0500
----------------------------------------------------------------------
.../modules/distribution/src/main/bin/cartridge-agent.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a22a8676/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
----------------------------------------------------------------------
diff --git a/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh b/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
index 830a78a..b24d1bf 100644
--- a/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
+++ b/products/cartridge-agent/modules/distribution/src/main/bin/cartridge-agent.sh
@@ -24,10 +24,10 @@ echo "Starting cartridge agent..."
script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
lib_path=${script_path}/../lib/
class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
-properties="-Dmb.ip=localhost
- -Dmb.port=5677
- -Dthrift.receiver.ip=localhost
- -Dthrift.receiver.port=7615
+properties="-Dmb.ip=MB-IP
+ -Dmb.port=MB-PORT
+ -Dthrift.receiver.ip=CEP-IP
+ -Dthrift.receiver.port=CEP-PORT
-Djndi.properties.template.file.path=${script_path}/../conf/templates/jndi.properties.template
-Djndi.properties.dir=${script_path}/../conf
-Dlog4j.properties.file.path=${script_path}/../conf/log4j.properties