summaryrefslogtreecommitdiff
path: root/java/broker-plugins
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2010-06-14 12:34:48 +0000
committerMartin Ritchie <ritchiem@apache.org>2010-06-14 12:34:48 +0000
commitc14e5d4b2a3bdcd45e4af44c3a641ad391873f4e (patch)
tree1b11f1fdee73bcbc241277e25b07cc4ef4a81e6c /java/broker-plugins
parentfa7068d1cb629de8cea4aa2743c9bc3f7d563a0f (diff)
downloadqpid-python-c14e5d4b2a3bdcd45e4af44c3a641ad391873f4e.tar.gz
Update LogMessage Generation to be based on a the existance of a _logmessages.property file.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@954431 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins')
-rw-r--r--java/broker-plugins/experimental/slowconsumerdetection/build.xml28
-rw-r--r--java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java6
-rw-r--r--java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/LogMessages.properties10
-rw-r--r--java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/SlowConsumerDetection_logmessages.properties4
-rw-r--r--java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/TopicDeletePolicy_logmessages.properties3
-rw-r--r--java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java4
6 files changed, 32 insertions, 23 deletions
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/build.xml b/java/broker-plugins/experimental/slowconsumerdetection/build.xml
index 4893de6886..340d749ecc 100644
--- a/java/broker-plugins/experimental/slowconsumerdetection/build.xml
+++ b/java/broker-plugins/experimental/slowconsumerdetection/build.xml
@@ -39,7 +39,7 @@ nn - or more contributor license agreements. See the NOTICE file
<property name="gentools.home" location="${project.root}/../gentools" />
<property name="generated.package" value="org/apache/qpid/server/virtualhost/plugin/logging" />
- <property name="generated.dir" location="${module.precompiled}/${generated.package}" />
+ <property name="generated.dir" location="${module.precompiled}" />
<property name="velocity.compile.dir" value="${build.scratch}/broker/velocity"/>
<property name="velocity.timestamp" location="${generated.dir}/velocity.timestamp" />
@@ -56,14 +56,26 @@ nn - or more contributor license agreements. See the NOTICE file
<target name="gen_logging" depends="check_velocity_deps" unless="velocity.notRequired">
<mkdir dir="${generated.dir}"/>
+
+ <path id="logmessages.path">
+ <fileset dir="${module.src}">
+ <include name="**/*_logmessages.properties"/>
+ </fileset>
+ </path>
+
+ <pathconvert property="logmessages"
+ refid="logmessages.path"
+ pathsep=" "/>
+
+ <echo message="logmessages is ${logmessages}"/>
+
<java classname="org.apache.qpid.server.logging.GenerateLogMessages" fork="true" dir="${gentools.home}/src" failonerror="true">
- <arg value="-j"/>
- <arg value="-o"/>
- <arg value="${generated.dir}"/>
- <arg value="-t"/>
- <arg value="${project.root}/broker/src/velocity/templates/org/apache/qpid/server/logging/messages"/>
- <arg value="-r"/>
- <arg value="org.apache.qpid.server.virtualhost.plugin.logging.LogMessages"/>
+ <arg line="-r ${logmessages}"/>
+ <arg value="-j"/>
+ <arg value="-o"/>
+ <arg value="${generated.dir}"/>
+ <arg value="-t"/>
+ <arg value="${project.root}/broker/src/velocity/templates/org/apache/qpid/server/logging/messages"/>
<classpath>
<pathelement path="${project.root}/broker-plugins/experimental/slowconsumerdetection/src/main/java"/>
<pathelement path="${velocity.compile.dir}" />
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java
index 71071d4d90..77819f8dbf 100644
--- a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java
+++ b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetection.java
@@ -66,11 +66,11 @@ class SlowConsumerDetection extends VirtualHostHouseKeepingPlugin
@Override
public void execute()
{
- SlowConsumerDetectionMessages.SCD_RUNNING();
+ SlowConsumerDetectionMessages.RUNNING();
for (AMQQueue q : _virtualhost.getQueueRegistry().getQueues())
{
- SlowConsumerDetectionMessages.SCD_CHECKING_QUEUE(q.getName());
+ SlowConsumerDetectionMessages.CHECKING_QUEUE(q.getName());
try
{
SlowConsumerDetectionQueueConfiguration config =
@@ -91,7 +91,7 @@ class SlowConsumerDetection extends VirtualHostHouseKeepingPlugin
}
}
- SlowConsumerDetectionMessages.SCD_COMPLETE();
+ SlowConsumerDetectionMessages.COMPLETE();
}
public long getDelay()
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/LogMessages.properties b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/LogMessages.properties
deleted file mode 100644
index 7243e144ad..0000000000
--- a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/LogMessages.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-#SlowConsumerDetection.logMessages
-SCD=SlowConsumerDetection
-SCD_RUNNING = SCD-1001 : Running
-SCD_COMPLETE = SCD-1002 : Complete
-SCD_CHECKING_QUEUE = SCD-1003 : Checking Status of Queue {0}
-
-#TopicDeletePolicy.logMessages
-TDP=TopicDeletePolicy
-TDP_DELETING_QUEUE = TDP-1001 : Deleting Queue
-TDP_DISCONNECTING = TDP-1002 : Disconnecting Session \ No newline at end of file
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/SlowConsumerDetection_logmessages.properties b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/SlowConsumerDetection_logmessages.properties
new file mode 100644
index 0000000000..2714935a71
--- /dev/null
+++ b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/SlowConsumerDetection_logmessages.properties
@@ -0,0 +1,4 @@
+#SlowConsumerDetection.logMessages
+RUNNING = SCD-1001 : Running
+COMPLETE = SCD-1002 : Complete
+CHECKING_QUEUE = SCD-1003 : Checking Status of Queue {0} \ No newline at end of file
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/TopicDeletePolicy_logmessages.properties b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/TopicDeletePolicy_logmessages.properties
new file mode 100644
index 0000000000..d0f5965c39
--- /dev/null
+++ b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/logging/TopicDeletePolicy_logmessages.properties
@@ -0,0 +1,3 @@
+#TopicDeletePolicy.logMessages
+DELETING_QUEUE = TDP-1001 : Deleting Queue
+DISCONNECTING = TDP-1002 : Disconnecting Session \ No newline at end of file
diff --git a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
index 577dced7d8..3c67f6e6d7 100644
--- a/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
+++ b/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
@@ -86,7 +86,7 @@ public class TopicDeletePolicy implements SlowConsumerPolicyPlugin
try
{
- CurrentActor.get().message(owner.getLogSubject(),TopicDeletePolicyMessages.TDP_DISCONNECTING());
+ CurrentActor.get().message(owner.getLogSubject(),TopicDeletePolicyMessages.DISCONNECTING());
// Close the consumer . this will cause autoDelete Queues to be purged
owner.getConnectionModel().
closeSession(owner, AMQConstant.RESOURCE_ERROR,
@@ -95,7 +95,7 @@ public class TopicDeletePolicy implements SlowConsumerPolicyPlugin
// Actively delete non autoDelete queues if deletePersistent is set
if (!q.isAutoDelete() && (_configuration != null && _configuration.deletePersistent()))
{
- CurrentActor.get().message(q.getLogSubject(), TopicDeletePolicyMessages.TDP_DELETING_QUEUE());
+ CurrentActor.get().message(q.getLogSubject(), TopicDeletePolicyMessages.DELETING_QUEUE());
q.delete();
}