qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r954432 [1/3] - in /qpid/trunk/qpid/java: ./ broker-plugins/experimental/slowconsumerdetection/ broker/ broker/src/main/java/org/apache/qpid/server/ broker/src/main/java/org/apache/qpid/server/binding/ broker/src/main/java/org/apache/qpid/s...
Date Mon, 14 Jun 2010 12:35:52 GMT
Author: ritchiem
Date: Mon Jun 14 12:35:51 2010
New Revision: 954432

URL: http://svn.apache.org/viewvc?rev=954432&view=rev
Log:
QPID-2625 : Moved Logging generation to moudule.xml to allow plugins to utilise the same functionality.
To enable generation for your plugin just add :
<target name="precompile" depends="gen_logging"/>
to your build.xml

Logging is now defined in a X_logmessage.properties file. Where X is used to make the XMessages.java class.

Also updated all existing usages to remove the 3 digit prefix that wasn't adding any info.
Updated ConfigStore and Transaction Log to use named properties rather than numeric values.

If we are going to continue with <3 alpha>-<4 numeric> ids for messages then we'll need to have some registry to prevent
clases. Perhaps it is simpler to relax this and require a plugin creator to provide a unique identifier for their messages.

Added:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ManagementConsole_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/MessageStore_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Subscription_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/TransactionLog_logmessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/VirtualHost_logmessages.properties
Removed:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages.properties
Modified:
    qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/build.xml
    qpid/trunk/qpid/java/broker/build.xml
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/BindingFactory.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngine.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMessageStore.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BindingMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/BrokerMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ChannelMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ConnectionMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ExchangeMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/ManagementConsoleMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/MessageStoreMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/QueueMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/SubscriptionMessagesTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/VirtualHostMessagesTest.java
    qpid/trunk/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
    qpid/trunk/qpid/java/module.xml
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java

Modified: qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/build.xml?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/build.xml (original)
+++ qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/build.xml Mon Jun 14 12:35:51 2010
@@ -29,64 +29,6 @@ nn - or more contributor license agreeme
 
     <target name="bundle" depends="bundle-tasks"/>
 
-
-
     <target name="precompile" depends="gen_logging"/>
 
-
-    <property name="velocity.properties.dir" value="src/main/java/org/apache/qpid/server/virtualhost/plugin/logging"/>
-
-    <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}" />
-    <property name="velocity.compile.dir" value="${build.scratch}/broker/velocity"/>
-    <property name="velocity.timestamp" location="${generated.dir}/velocity.timestamp" />
-
-
-    <target name="check_velocity_deps">
-      <uptodate property="velocity.notRequired" targetfile="${velocity.timestamp}">
-        <srcfiles dir="${velocity.properties.dir}" includes="LogMessages**" />
-        <srcfiles dir="${project.root}/broker/src/velocity/" includes="**/*.java **/*.vm" />
-      </uptodate>
-    </target>
-
-
-
-
-    <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 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}" />
-          <fileset dir="${project.root}/lib">
-            <include name="**/*.jar"/>
-          </fileset>
-          <pathelement path="${gentools.home}/lib/velocity-1.4.jar" />
-        </classpath>
-      </java>
-      <touch file="${velocity.timestamp}" />
-    </target>
-
-
 </project>

Modified: qpid/trunk/qpid/java/broker/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/build.xml?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/build.xml (original)
+++ qpid/trunk/qpid/java/broker/build.xml Mon Jun 14 12:35:51 2010
@@ -33,12 +33,6 @@
     <property name="qmf.output.dir" value="${module.precompiled}/org/apache/qpid/qmf/schema"/>
     <property name="qmf.output.file" value="BrokerSchema.java"/>
 
-    <property name="gentools.home" location="${project.root}/../gentools" />
-    <property name="generated.package" value="org/apache/qpid/server/logging/messages" />
-    <property name="generated.dir" location="${module.precompiled}/${generated.package}" />
-    <property name="velocity.compile.dir" value="${module.build}/velocity"/>
-    <property name="velocity.timestamp" location="${generated.dir}/velocity.timestamp" />
-
 
     <target name="precompile" depends="gen_logging,gen_qmf">
         <mkdir dir="${output.dir}"/>
@@ -48,50 +42,6 @@
                 javacchome="${project.root}/lib"/>
     </target>
 
-    <target name="compile_velocity" >
-        <mkdir dir="${velocity.compile.dir}" />	
-        <!-- Compile LogMessages Velocity Generator -->
-        <javac source="${java.source}" target="${java.target}"
-               destdir="${velocity.compile.dir}" debug="on" includeantruntime="false"
-               deprecation="${javac.deprecation}" 
-               srcdir="src/velocity/java" >
-          <classpath>
-            <pathelement path="${gentools.home}/lib/velocity-1.4.jar" />
-          </classpath>
-          <compilerarg line="${javac.compiler.args}"/>
-        </javac>
-    </target>
-
-  <property name="velocity.properties.dir" value="${project.root}/broker/src/main/java/org/apache/qpid/server/logging/messages"/>
-
-  <target name="check_velocity_deps">
-    <uptodate property="velocity.notRequired" targetfile="${velocity.timestamp}">
-      <srcfiles dir="${velocity.properties.dir}" includes="LogMessages**" />
-      <srcfiles dir="src/velocity/" includes="**/*.java **/*.vm" />
-    </uptodate>
-  </target>
-
-  <target name="gen_logging" depends="compile_velocity,check_velocity_deps" unless="velocity.notRequired">
-    <mkdir dir="${generated.dir}"/>
-    <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.logging.messages.LogMessages"/>
-      <classpath>
-        <pathelement path="${project.root}/broker/src/main/java"/>
-        <pathelement path="${velocity.compile.dir}" />
-        <fileset dir="${project.root}/lib">
-          <include name="**/*.jar"/>
-        </fileset> 
-        <pathelement path="${gentools.home}/lib/velocity-1.4.jar" />
-      </classpath>
-    </java>
-    <touch file="${velocity.timestamp}" />
-  </target>
 
   <target name="check_qmf_deps">
     <uptodate property="gen_qmf.notRequired" targetfile="${qmf.output.dir}/${qmf.output.file}">

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Mon Jun 14 12:35:51 2010
@@ -170,7 +170,7 @@ public class AMQChannel implements Sessi
         _actor = new AMQPChannelActor(this, session.getLogActor().getRootMessageLogger());
         _logSubject = new ChannelLogSubject(this);
         _id = getConfigStore().createId();
-        _actor.message(ChannelMessages.CHN_CREATE());
+        _actor.message(ChannelMessages.CREATE());
 
         getConfigStore().addConfiguredObject(this);
 
@@ -492,7 +492,7 @@ public class AMQChannel implements Sessi
             return;
         }
 
-        CurrentActor.get().message(_logSubject, ChannelMessages.CHN_CLOSE());
+        CurrentActor.get().message(_logSubject, ChannelMessages.CLOSE());
 
         unsubscribeAllConsumers();
         _transaction.rollback();
@@ -827,7 +827,7 @@ public class AMQChannel implements Sessi
             // Log Flow Started before we start the subscriptions
             if (!suspended)
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_FLOW("Started"));
+                _actor.message(_logSubject, ChannelMessages.FLOW("Started"));
             }
 
 
@@ -878,7 +878,7 @@ public class AMQChannel implements Sessi
             // stopped.
             if (suspended)
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_FLOW("Stopped"));
+                _actor.message(_logSubject, ChannelMessages.FLOW("Stopped"));
             }
 
         }
@@ -1001,7 +1001,7 @@ public class AMQChannel implements Sessi
 
     public void setCredit(final long prefetchSize, final int prefetchCount)
     {
-        _actor.message(ChannelMessages.CHN_PREFETCH_SIZE(prefetchSize, prefetchCount));
+        _actor.message(ChannelMessages.PREFETCH_SIZE(prefetchSize, prefetchCount));
         _creditManager.setCreditLimits(prefetchSize, prefetchCount);
     }
 
@@ -1306,7 +1306,7 @@ public class AMQChannel implements Sessi
 
             if(_blocking.compareAndSet(false,true))
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_FLOW_ENFORCED(queue.getNameShortString().toString()));
+                _actor.message(_logSubject, ChannelMessages.FLOW_ENFORCED(queue.getNameShortString().toString()));
                 flow(false);
             }
         }
@@ -1318,7 +1318,7 @@ public class AMQChannel implements Sessi
         {
             if(_blocking.compareAndSet(true,false))
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_FLOW_REMOVED());
+                _actor.message(_logSubject, ChannelMessages.FLOW_REMOVED());
 
                 flow(true);
             }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java Mon Jun 14 12:35:51 2010
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
-import java.util.Arrays;
 import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.List;
@@ -268,7 +267,7 @@ public class Main
         }
         else
         {
-            CurrentActor.get().message(BrokerMessages.BRK_CONFIG(configFile.getAbsolutePath()));
+            CurrentActor.get().message(BrokerMessages.CONFIG(configFile.getAbsolutePath()));
         }
 
         String logConfig = commandLine.getOptionValue("l");
@@ -427,7 +426,7 @@ public class Main
                                 serverConfig.getNetworkConfiguration(), null);
                     ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, port),
                                                                   new QpidAcceptor(driver,"TCP"));
-                    CurrentActor.get().message(BrokerMessages.BRK_LISTENING("TCP", port));
+                    CurrentActor.get().message(BrokerMessages.LISTENING("TCP", port));
 
                 }
 
@@ -441,14 +440,14 @@ public class Main
                             new AMQProtocolEngineFactory(), serverConfig.getNetworkConfiguration(), sslFactory);
                 ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, serverConfig.getSSLPort()),
                         new QpidAcceptor(driver,"TCP"));
-                CurrentActor.get().message(BrokerMessages.BRK_LISTENING("TCP/SSL", serverConfig.getSSLPort()));
+                CurrentActor.get().message(BrokerMessages.LISTENING("TCP/SSL", serverConfig.getSSLPort()));
             }
 
             //fixme  qpid.AMQP should be using qpidproperties to get value
             _brokerLogger.info("Qpid Broker Ready :" + QpidProperties.getReleaseVersion()
                     + " build: " + QpidProperties.getBuildVersion());
 
-            CurrentActor.get().message(BrokerMessages.BRK_READY());
+            CurrentActor.get().message(BrokerMessages.READY());
 
         }
         finally
@@ -568,7 +567,7 @@ public class Main
     {
         if (logConfigFile.exists() && logConfigFile.canRead())
         {
-            CurrentActor.get().message(BrokerMessages.BRK_LOG_CONFIG(logConfigFile.getAbsolutePath()));
+            CurrentActor.get().message(BrokerMessages.LOG_CONFIG(logConfigFile.getAbsolutePath()));
             System.out.println("Configuring logger using configuration file " + logConfigFile.getAbsolutePath());
             if (logWatchTime > 0)
             {

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/BindingFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/BindingFactory.java?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/BindingFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/binding/BindingFactory.java Mon Jun 14 12:35:51 2010
@@ -101,12 +101,12 @@ public class BindingFactory
 
         void logCreation()
         {
-            CurrentActor.get().message(_logSubject, BindingMessages.BND_CREATED(String.valueOf(getArguments()), getArguments() != null && !getArguments().isEmpty()));
+            CurrentActor.get().message(_logSubject, BindingMessages.CREATED(String.valueOf(getArguments()), getArguments() != null && !getArguments().isEmpty()));
         }
 
         void logDestruction()
         {
-            CurrentActor.get().message(_logSubject, BindingMessages.BND_DELETED());
+            CurrentActor.get().message(_logSubject, BindingMessages.DELETED());
         }
 
         public String getOrigin()

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java Mon Jun 14 12:35:51 2010
@@ -150,7 +150,7 @@ public abstract class AbstractExchange i
         _logSubject = new ExchangeLogSubject(this, this.getVirtualHost());
 
         // Log Exchange creation
-        CurrentActor.get().message(ExchangeMessages.EXH_CREATED(String.valueOf(getTypeShortString()), String.valueOf(name), durable));
+        CurrentActor.get().message(ExchangeMessages.CREATED(String.valueOf(getTypeShortString()), String.valueOf(name), durable));
     }
 
     public ConfigStore getConfigStore()
@@ -190,7 +190,7 @@ public abstract class AbstractExchange i
                 _alternateExchange.removeReference(this);
             }
 
-            CurrentActor.get().message(_logSubject, ExchangeMessages.EXH_DELETED());
+            CurrentActor.get().message(_logSubject, ExchangeMessages.DELETED());
 
             for(Task task : _closeTaskList)
             {

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java?rev=954432&r1=954431&r2=954432&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/SubscriptionActor.java Mon Jun 14 12:35:51 2010
@@ -21,15 +21,12 @@
 package org.apache.qpid.server.logging.actors;
 
 import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.subjects.QueueLogSubject;
 import org.apache.qpid.server.logging.subjects.SubscriptionLogSubject;
 import org.apache.qpid.server.subscription.Subscription;
 
-import java.text.MessageFormat;
-
 /**
  * The subscription actor provides formatted logging for actions that are
- * performed by the subsciption. Such as SUB_STATE changes.
+ * performed by the subsciption. Such as STATE changes.
  */
 public class SubscriptionActor extends AbstractActor
 {

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties?rev=954432&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties (added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Binding_logmessages.properties Mon Jun 14 12:35:51 2010
@@ -0,0 +1,213 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+# This file was derivied from LogMessages used within the Java Broker and
+# originally defined on the wiki:
+# http://cwiki.apache.org/confluence/display/qpid/Status+Update+Design#StatusUpdateDesign-InitialStatusMessages
+#
+# Technical Notes:
+#  This is a standard Java Properties file so white space is respected at the
+#  end of the lines. This file is processed in a number of ways.
+# 1) ResourceBundle
+#   This file is loaded as a ResourceBundle. The en_US
+#   addition to the file is the localisation. Additional localisations can be
+#   provided and will automatically be selected based on the <locale> value in
+#   the config.xml. The default is en_US.
+#
+# 2) MessasgeFormat
+#  Each entry is prepared with the Java Core MessageFormat methods. Therefore
+#  most functionality you can do via MessageFormat can be done here:
+#
+#  http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+#
+#  The cavet here is that only default String and number FormatTypes can be used.
+#  This is due to the processing described in 3 below. If support for date, time
+#  or choice is required then the GenerateLogMessages class should be updated to
+#  provide support.
+#
+#  Format Note:
+#   As mentioned earlier white space in this file is very important. One thing
+#  in particular to note is the way MessageFormat performs its replacements.
+#  The replacement text will totally replace the {xxx} section so there will be
+#  no addition of white space or removal e.g.
+#     MSG = Text----{0}----
+#  When given parameter 'Hello' result in text:
+#     Text----Hello----
+#
+#  For simple arguments this is expected however when using Style formats then
+#  it can be a little unexpected. In particular a common pattern is used for
+#  number replacements : {0,number,#}. This is used in the Broker to display an
+#  Integer simply as the Integer with no formatting. e.g new Integer(1234567)
+#  becomes the String "1234567" which is can be contrasted with the pattern
+#  without a style format field : {0,number} which becomes string "1,234,567".
+#
+#  What you may not expect is that {0,number, #} would produce the String " 1234567"
+#  note the space after the ','   here      /\   has resulted in a space  /\ in
+#  the output.
+#
+#  More details on the SubformatPattern can be found on the API link above.
+#
+# 3) GenerateLogMessage/Velocity Macro
+#  This is the only processing that this file goes through.
+#   1) Class Generation:
+#      The GenerateLogMessage processes this file and uses the velocity Macro
+#      to create classes with static methods to perform the logging and give us
+#      compile time validation.
+#
+#   2) Property Processing:
+#      During the class generation the message properties ({x}) are identified
+#      and used to create the method signature.
+#
+#   3) Option Processing:
+#      The Classes perform final formatting of the messages at runtime based on
+#      optional parameters that are defined within the message. Optional
+#      parameters are enclosed in square brackets e.g. [optional].
+#
+#  To provide fixed log messages as required by the Technical Specification:
+#  http://cwiki.apache.org/confluence/display/qpid/Operational+Logging+-+Status+Update+-+Technical+Specification#OperationalLogging-StatusUpdate-TechnicalSpecification-Howtoprovidefixedlogmessages
+#
+#  This file is processed by Velocity to create a number of classes that contain
+#  static methods that provide LogMessages in the code to provide compile time
+#  validation.
+#
+#  For details of what processing is done see GenerateLogMessages.
+#
+#  What a localiser or developer need know is the following:
+#
+#  The Property structure is important as it defines how the class and methods
+#  will be built.
+#
+#  Class Generation:
+#  =================
+#
+#  Each class of messages will be split in to their own <Class>Messages.java.
+#  Each logmessage file contains only one class of messages the <Class> name
+#  is derived from the name of the logmessages file e.g. <Class>_logmessages.properties.
+#
+#  Property Format
+#  ===============
+#   The property format MUST adhere to the follow format to make it easier to
+#   use the logging API as a developer but also so that operations staff can
+#   easily locate log messages in the output.
+#
+#   The property file should contain entries in the following format
+#
+#   <Log Identifier, developer focused> = <Log Identifier, Operate focus> : <Log Message>
+#
+#   eg:
+#    SHUTTING_DOWN = BRK-1003 : Shutting down : {0} port {1,number,#}
+#
+#   Note: the developer focused identifier will become a method name so only a
+#   valid method name should be used. Currently only '-' are converted to '_'.
+#
+#   That said properties generate the logging code at build time so any error
+#   can be easily identified.
+#
+#  The three character identifier show above in BRK-1003 should ideally be unique.
+#  This is the only requirement, limiting to 3 characters is not required.
+#  That said the current broker contains the following mappings.
+#
+#        Class              | Type
+#      ---------------------|--------
+#        Broker             |  BKR
+#        ManagementConsole  |  MNG
+#        VirtualHost        |  VHT
+#        MessageStore       |  MST
+#        ConfigStore        |  CFG
+#        TransactionLog     |  TXN
+#        Connection         |  CON
+#        Channel            |  CHN
+#        Queue              |  QUE
+#        Exchange           |  EXH
+#        Binding            |  BND
+#        Subscription       |  SUB
+#
+#
+#  Property Processing:
+#  ====================
+#
+#   Each property is then processed by the GenerateLogMessages class to identify
+#   The number and type of parameters, {x} entries. Parameters are defaulted to
+#   String types but the use of FormatType number (e.g.{0,number}) will result
+#   in a Number type being used. These parameters are then used to build the
+#   method parameter list. e.g:
+#   Property:
+#    SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+#   becomes Method:
+#    public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+#
+#   This improves our compile time validation of log message content and
+#   ensures that change in the message format does not accidentally cause
+#   erroneous messages.
+#
+#  Option Processing:
+#  ====================
+#
+#  Options are identified in the log message as being surrounded by square
+#  brackets ([ ]). These optional values can themselves contain parameters
+#  however nesting of options is not permitted. Identification is performed on
+#  first matching so given the message:
+#   Msg = Log Message [option1] [option2]
+#  Two options will be identified and enabled to select text 'option1' and
+#  'option2'.
+#
+#  The nesting of a options is not supported and will provide
+#  unexpected results. e.g. Using Message:
+#   Msg = Log Message [option1 [sub-option2]]
+#
+#  The options will be 'option1 [sub-option2' and 'sub-option2'. The first
+#  option includes the second option as the nesting is not detected.
+#
+#  The detected options are presented in the method signature as boolean options
+#  numerically identified by their position in the message. e.g.
+#   Property:
+#    CON-1001 = Open : Client ID {0} [: Protocol Version : {1}]
+#  becomes Method:
+#    public static LogMessage CON_1001(String param1, String param2, boolean opt1)
+#
+#  The value of 'opt1' will show/hide the option in the message. Note that
+#  'param2' is still required however a null value can be used if the optional
+#  section is not desired.
+#
+#  Again here the importance of white space needs to be highlighted.
+#  Looking at the QUE-1001 message as an example. The first thought on how this
+#  would look would be as follows:
+# QUE-1001 = Create : Owner: {0} [AutoDelete] [Durable] [Transient] [Priority: {1,number,#}]
+#  Each option is correctly defined so the text that is defined will appear when
+#  selected. e.g. 'AutoDelete'. However, what may not be immediately apparent is
+#  the white space. Using the above definition of QUE-1001 if we were to print
+#  the message with only the Priority option displayed it would appear as this:
+#  "Create : Owner: guest    Priority: 1"
+#  Note the spaces here   /\ This is because only the text between the brackets
+#  has been removed.
+#
+#  Each option needs to include white space to correctly format the message. So
+#  the correct definition of QUE-1001 is as follows:
+# QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+#  Note that white space is included with each option and there is no extra
+#  white space between the options. As a result the output with just Priority
+#  enabled is as follows:
+#  "Create : Owner: guest Priority: 1"
+#
+#
+# Default File used for all non-defined locales.
+
+CREATED = BND-1001 : Create[ : Arguments : {0}]
+DELETED = BND-1002 : Deleted

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties?rev=954432&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties (added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties Mon Jun 14 12:35:51 2010
@@ -0,0 +1,226 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+# This file was derivied from LogMessages used within the Java Broker and
+# originally defined on the wiki:
+# http://cwiki.apache.org/confluence/display/qpid/Status+Update+Design#StatusUpdateDesign-InitialStatusMessages
+#
+# Technical Notes:
+#  This is a standard Java Properties file so white space is respected at the
+#  end of the lines. This file is processed in a number of ways.
+# 1) ResourceBundle
+#   This file is loaded as a ResourceBundle. The en_US
+#   addition to the file is the localisation. Additional localisations can be
+#   provided and will automatically be selected based on the <locale> value in
+#   the config.xml. The default is en_US.
+#
+# 2) MessasgeFormat
+#  Each entry is prepared with the Java Core MessageFormat methods. Therefore
+#  most functionality you can do via MessageFormat can be done here:
+#
+#  http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+#
+#  The cavet here is that only default String and number FormatTypes can be used.
+#  This is due to the processing described in 3 below. If support for date, time
+#  or choice is required then the GenerateLogMessages class should be updated to
+#  provide support.
+#
+#  Format Note:
+#   As mentioned earlier white space in this file is very important. One thing
+#  in particular to note is the way MessageFormat performs its replacements.
+#  The replacement text will totally replace the {xxx} section so there will be
+#  no addition of white space or removal e.g.
+#     MSG = Text----{0}----
+#  When given parameter 'Hello' result in text:
+#     Text----Hello----
+#
+#  For simple arguments this is expected however when using Style formats then
+#  it can be a little unexpected. In particular a common pattern is used for
+#  number replacements : {0,number,#}. This is used in the Broker to display an
+#  Integer simply as the Integer with no formatting. e.g new Integer(1234567)
+#  becomes the String "1234567" which is can be contrasted with the pattern
+#  without a style format field : {0,number} which becomes string "1,234,567".
+#
+#  What you may not expect is that {0,number, #} would produce the String " 1234567"
+#  note the space after the ','   here      /\   has resulted in a space  /\ in
+#  the output.
+#
+#  More details on the SubformatPattern can be found on the API link above.
+#
+# 3) GenerateLogMessage/Velocity Macro
+#  This is the only processing that this file goes through.
+#   1) Class Generation:
+#      The GenerateLogMessage processes this file and uses the velocity Macro
+#      to create classes with static methods to perform the logging and give us
+#      compile time validation.
+#
+#   2) Property Processing:
+#      During the class generation the message properties ({x}) are identified
+#      and used to create the method signature.
+#
+#   3) Option Processing:
+#      The Classes perform final formatting of the messages at runtime based on
+#      optional parameters that are defined within the message. Optional
+#      parameters are enclosed in square brackets e.g. [optional].
+#
+#  To provide fixed log messages as required by the Technical Specification:
+#  http://cwiki.apache.org/confluence/display/qpid/Operational+Logging+-+Status+Update+-+Technical+Specification#OperationalLogging-StatusUpdate-TechnicalSpecification-Howtoprovidefixedlogmessages
+#
+#  This file is processed by Velocity to create a number of classes that contain
+#  static methods that provide LogMessages in the code to provide compile time
+#  validation.
+#
+#  For details of what processing is done see GenerateLogMessages.
+#
+#  What a localiser or developer need know is the following:
+#
+#  The Property structure is important as it defines how the class and methods
+#  will be built.
+#
+#  Class Generation:
+#  =================
+#
+#  Each class of messages will be split in to their own <Class>Messages.java.
+#  Each logmessage file contains only one class of messages the <Class> name
+#  is derived from the name of the logmessages file e.g. <Class>_logmessages.properties.
+#
+#  Property Format
+#  ===============
+#   The property format MUST adhere to the follow format to make it easier to
+#   use the logging API as a developer but also so that operations staff can
+#   easily locate log messages in the output.
+#
+#   The property file should contain entries in the following format
+#
+#   <Log Identifier, developer focused> = <Log Identifier, Operate focus> : <Log Message>
+#
+#   eg:
+#    SHUTTING_DOWN = BRK-1003 : Shutting down : {0} port {1,number,#}
+#
+#   Note: the developer focused identifier will become a method name so only a
+#   valid method name should be used. Currently only '-' are converted to '_'.
+#
+#   That said properties generate the logging code at build time so any error
+#   can be easily identified.
+#
+#  The three character identifier show above in BRK-1003 should ideally be unique.
+#  This is the only requirement, limiting to 3 characters is not required.
+#  That said the current broker contains the following mappings.
+#
+#        Class              | Type
+#      ---------------------|--------
+#        Broker             |  BKR
+#        ManagementConsole  |  MNG
+#        VirtualHost        |  VHT
+#        MessageStore       |  MST
+#        ConfigStore        |  CFG
+#        TransactionLog     |  TXN
+#        Connection         |  CON
+#        Channel            |  CHN
+#        Queue              |  QUE
+#        Exchange           |  EXH
+#        Binding            |  BND
+#        Subscription       |  SUB
+#
+#
+#  Property Processing:
+#  ====================
+#
+#   Each property is then processed by the GenerateLogMessages class to identify
+#   The number and type of parameters, {x} entries. Parameters are defaulted to
+#   String types but the use of FormatType number (e.g.{0,number}) will result
+#   in a Number type being used. These parameters are then used to build the
+#   method parameter list. e.g:
+#   Property:
+#    SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+#   becomes Method:
+#    public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+#
+#   This improves our compile time validation of log message content and
+#   ensures that change in the message format does not accidentally cause
+#   erroneous messages.
+#
+#  Option Processing:
+#  ====================
+#
+#  Options are identified in the log message as being surrounded by square
+#  brackets ([ ]). These optional values can themselves contain parameters
+#  however nesting of options is not permitted. Identification is performed on
+#  first matching so given the message:
+#   Msg = Log Message [option1] [option2]
+#  Two options will be identified and enabled to select text 'option1' and
+#  'option2'.
+#
+#  The nesting of a options is not supported and will provide
+#  unexpected results. e.g. Using Message:
+#   Msg = Log Message [option1 [sub-option2]]
+#
+#  The options will be 'option1 [sub-option2' and 'sub-option2'. The first
+#  option includes the second option as the nesting is not detected.
+#
+#  The detected options are presented in the method signature as boolean options
+#  numerically identified by their position in the message. e.g.
+#   Property:
+#    CON-1001 = Open : Client ID {0} [: Protocol Version : {1}]
+#  becomes Method:
+#    public static LogMessage CON_1001(String param1, String param2, boolean opt1)
+#
+#  The value of 'opt1' will show/hide the option in the message. Note that
+#  'param2' is still required however a null value can be used if the optional
+#  section is not desired.
+#
+#  Again here the importance of white space needs to be highlighted.
+#  Looking at the QUE-1001 message as an example. The first thought on how this
+#  would look would be as follows:
+# QUE-1001 = Create : Owner: {0} [AutoDelete] [Durable] [Transient] [Priority: {1,number,#}]
+#  Each option is correctly defined so the text that is defined will appear when
+#  selected. e.g. 'AutoDelete'. However, what may not be immediately apparent is
+#  the white space. Using the above definition of QUE-1001 if we were to print
+#  the message with only the Priority option displayed it would appear as this:
+#  "Create : Owner: guest    Priority: 1"
+#  Note the spaces here   /\ This is because only the text between the brackets
+#  has been removed.
+#
+#  Each option needs to include white space to correctly format the message. So
+#  the correct definition of QUE-1001 is as follows:
+# QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+#  Note that white space is included with each option and there is no extra
+#  white space between the options. As a result the output with just Priority
+#  enabled is as follows:
+#  "Create : Owner: guest Priority: 1"
+#
+#
+# Default File used for all non-defined locales.
+
+# 0 - Version
+# 1 = Build
+STARTUP = BRK-1001 : Startup : Version: {0} Build: {1}
+# 0 - Transport
+# 1 - Port
+LISTENING = BRK-1002 : Starting : Listening on {0} port {1,number,#}
+# 0 - Transport
+# 1 - Port
+SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+READY = BRK-1004 : Ready
+STOPPED = BRK-1005 : Stopped
+# 0 - path
+CONFIG = BRK-1006 : Using configuration : {0}
+# 0 - path
+LOG_CONFIG = BRK-1007 : Using logging configuration : {0}
\ No newline at end of file

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties?rev=954432&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties (added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Channel_logmessages.properties Mon Jun 14 12:35:51 2010
@@ -0,0 +1,221 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+# This file was derivied from LogMessages used within the Java Broker and
+# originally defined on the wiki:
+# http://cwiki.apache.org/confluence/display/qpid/Status+Update+Design#StatusUpdateDesign-InitialStatusMessages
+#
+# Technical Notes:
+#  This is a standard Java Properties file so white space is respected at the
+#  end of the lines. This file is processed in a number of ways.
+# 1) ResourceBundle
+#   This file is loaded as a ResourceBundle. The en_US
+#   addition to the file is the localisation. Additional localisations can be
+#   provided and will automatically be selected based on the <locale> value in
+#   the config.xml. The default is en_US.
+#
+# 2) MessasgeFormat
+#  Each entry is prepared with the Java Core MessageFormat methods. Therefore
+#  most functionality you can do via MessageFormat can be done here:
+#
+#  http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+#
+#  The cavet here is that only default String and number FormatTypes can be used.
+#  This is due to the processing described in 3 below. If support for date, time
+#  or choice is required then the GenerateLogMessages class should be updated to
+#  provide support.
+#
+#  Format Note:
+#   As mentioned earlier white space in this file is very important. One thing
+#  in particular to note is the way MessageFormat performs its replacements.
+#  The replacement text will totally replace the {xxx} section so there will be
+#  no addition of white space or removal e.g.
+#     MSG = Text----{0}----
+#  When given parameter 'Hello' result in text:
+#     Text----Hello----
+#
+#  For simple arguments this is expected however when using Style formats then
+#  it can be a little unexpected. In particular a common pattern is used for
+#  number replacements : {0,number,#}. This is used in the Broker to display an
+#  Integer simply as the Integer with no formatting. e.g new Integer(1234567)
+#  becomes the String "1234567" which is can be contrasted with the pattern
+#  without a style format field : {0,number} which becomes string "1,234,567".
+#
+#  What you may not expect is that {0,number, #} would produce the String " 1234567"
+#  note the space after the ','   here      /\   has resulted in a space  /\ in
+#  the output.
+#
+#  More details on the SubformatPattern can be found on the API link above.
+#
+# 3) GenerateLogMessage/Velocity Macro
+#  This is the only processing that this file goes through.
+#   1) Class Generation:
+#      The GenerateLogMessage processes this file and uses the velocity Macro
+#      to create classes with static methods to perform the logging and give us
+#      compile time validation.
+#
+#   2) Property Processing:
+#      During the class generation the message properties ({x}) are identified
+#      and used to create the method signature.
+#
+#   3) Option Processing:
+#      The Classes perform final formatting of the messages at runtime based on
+#      optional parameters that are defined within the message. Optional
+#      parameters are enclosed in square brackets e.g. [optional].
+#
+#  To provide fixed log messages as required by the Technical Specification:
+#  http://cwiki.apache.org/confluence/display/qpid/Operational+Logging+-+Status+Update+-+Technical+Specification#OperationalLogging-StatusUpdate-TechnicalSpecification-Howtoprovidefixedlogmessages
+#
+#  This file is processed by Velocity to create a number of classes that contain
+#  static methods that provide LogMessages in the code to provide compile time
+#  validation.
+#
+#  For details of what processing is done see GenerateLogMessages.
+#
+#  What a localiser or developer need know is the following:
+#
+#  The Property structure is important as it defines how the class and methods
+#  will be built.
+#
+#  Class Generation:
+#  =================
+#
+#  Each class of messages will be split in to their own <Class>Messages.java.
+#  Each logmessage file contains only one class of messages the <Class> name
+#  is derived from the name of the logmessages file e.g. <Class>_logmessages.properties.
+#
+#  Property Format
+#  ===============
+#   The property format MUST adhere to the follow format to make it easier to
+#   use the logging API as a developer but also so that operations staff can
+#   easily locate log messages in the output.
+#
+#   The property file should contain entries in the following format
+#
+#   <Log Identifier, developer focused> = <Log Identifier, Operate focus> : <Log Message>
+#
+#   eg:
+#    SHUTTING_DOWN = BRK-1003 : Shutting down : {0} port {1,number,#}
+#
+#   Note: the developer focused identifier will become a method name so only a
+#   valid method name should be used. Currently only '-' are converted to '_'.
+#
+#   That said properties generate the logging code at build time so any error
+#   can be easily identified.
+#
+#  The three character identifier show above in BRK-1003 should ideally be unique.
+#  This is the only requirement, limiting to 3 characters is not required.
+#  That said the current broker contains the following mappings.
+#
+#        Class              | Type
+#      ---------------------|--------
+#        Broker             |  BKR
+#        ManagementConsole  |  MNG
+#        VirtualHost        |  VHT
+#        MessageStore       |  MST
+#        ConfigStore        |  CFG
+#        TransactionLog     |  TXN
+#        Connection         |  CON
+#        Channel            |  CHN
+#        Queue              |  QUE
+#        Exchange           |  EXH
+#        Binding            |  BND
+#        Subscription       |  SUB
+#
+#
+#  Property Processing:
+#  ====================
+#
+#   Each property is then processed by the GenerateLogMessages class to identify
+#   The number and type of parameters, {x} entries. Parameters are defaulted to
+#   String types but the use of FormatType number (e.g.{0,number}) will result
+#   in a Number type being used. These parameters are then used to build the
+#   method parameter list. e.g:
+#   Property:
+#    SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+#   becomes Method:
+#    public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+#
+#   This improves our compile time validation of log message content and
+#   ensures that change in the message format does not accidentally cause
+#   erroneous messages.
+#
+#  Option Processing:
+#  ====================
+#
+#  Options are identified in the log message as being surrounded by square
+#  brackets ([ ]). These optional values can themselves contain parameters
+#  however nesting of options is not permitted. Identification is performed on
+#  first matching so given the message:
+#   Msg = Log Message [option1] [option2]
+#  Two options will be identified and enabled to select text 'option1' and
+#  'option2'.
+#
+#  The nesting of a options is not supported and will provide
+#  unexpected results. e.g. Using Message:
+#   Msg = Log Message [option1 [sub-option2]]
+#
+#  The options will be 'option1 [sub-option2' and 'sub-option2'. The first
+#  option includes the second option as the nesting is not detected.
+#
+#  The detected options are presented in the method signature as boolean options
+#  numerically identified by their position in the message. e.g.
+#   Property:
+#    CON-1001 = Open : Client ID {0} [: Protocol Version : {1}]
+#  becomes Method:
+#    public static LogMessage CON_1001(String param1, String param2, boolean opt1)
+#
+#  The value of 'opt1' will show/hide the option in the message. Note that
+#  'param2' is still required however a null value can be used if the optional
+#  section is not desired.
+#
+#  Again here the importance of white space needs to be highlighted.
+#  Looking at the QUE-1001 message as an example. The first thought on how this
+#  would look would be as follows:
+# QUE-1001 = Create : Owner: {0} [AutoDelete] [Durable] [Transient] [Priority: {1,number,#}]
+#  Each option is correctly defined so the text that is defined will appear when
+#  selected. e.g. 'AutoDelete'. However, what may not be immediately apparent is
+#  the white space. Using the above definition of QUE-1001 if we were to print
+#  the message with only the Priority option displayed it would appear as this:
+#  "Create : Owner: guest    Priority: 1"
+#  Note the spaces here   /\ This is because only the text between the brackets
+#  has been removed.
+#
+#  Each option needs to include white space to correctly format the message. So
+#  the correct definition of QUE-1001 is as follows:
+# QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+#  Note that white space is included with each option and there is no extra
+#  white space between the options. As a result the output with just Priority
+#  enabled is as follows:
+#  "Create : Owner: guest Priority: 1"
+#
+#
+# Default File used for all non-defined locales.
+
+CREATE = CHN-1001 : Create
+# 0 - flow
+FLOW = CHN-1002 : Flow {0}
+CLOSE = CHN-1003 : Close
+# 0 - bytes allowed in prefetch
+# 1 - number of messagse.
+PREFETCH_SIZE = CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}
+# 0 - queue causing flow control
+FLOW_ENFORCED = CHN-1005 : Flow Control Enforced (Queue {0})
+FLOW_REMOVED = CHN-1006 : Flow Control Removed

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties?rev=954432&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties (added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/ConfigStore_logmessages.properties Mon Jun 14 12:35:51 2010
@@ -0,0 +1,218 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+# This file was derivied from LogMessages used within the Java Broker and
+# originally defined on the wiki:
+# http://cwiki.apache.org/confluence/display/qpid/Status+Update+Design#StatusUpdateDesign-InitialStatusMessages
+#
+# Technical Notes:
+#  This is a standard Java Properties file so white space is respected at the
+#  end of the lines. This file is processed in a number of ways.
+# 1) ResourceBundle
+#   This file is loaded as a ResourceBundle. The en_US
+#   addition to the file is the localisation. Additional localisations can be
+#   provided and will automatically be selected based on the <locale> value in
+#   the config.xml. The default is en_US.
+#
+# 2) MessasgeFormat
+#  Each entry is prepared with the Java Core MessageFormat methods. Therefore
+#  most functionality you can do via MessageFormat can be done here:
+#
+#  http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+#
+#  The cavet here is that only default String and number FormatTypes can be used.
+#  This is due to the processing described in 3 below. If support for date, time
+#  or choice is required then the GenerateLogMessages class should be updated to
+#  provide support.
+#
+#  Format Note:
+#   As mentioned earlier white space in this file is very important. One thing
+#  in particular to note is the way MessageFormat performs its replacements.
+#  The replacement text will totally replace the {xxx} section so there will be
+#  no addition of white space or removal e.g.
+#     MSG = Text----{0}----
+#  When given parameter 'Hello' result in text:
+#     Text----Hello----
+#
+#  For simple arguments this is expected however when using Style formats then
+#  it can be a little unexpected. In particular a common pattern is used for
+#  number replacements : {0,number,#}. This is used in the Broker to display an
+#  Integer simply as the Integer with no formatting. e.g new Integer(1234567)
+#  becomes the String "1234567" which is can be contrasted with the pattern
+#  without a style format field : {0,number} which becomes string "1,234,567".
+#
+#  What you may not expect is that {0,number, #} would produce the String " 1234567"
+#  note the space after the ','   here      /\   has resulted in a space  /\ in
+#  the output.
+#
+#  More details on the SubformatPattern can be found on the API link above.
+#
+# 3) GenerateLogMessage/Velocity Macro
+#  This is the only processing that this file goes through.
+#   1) Class Generation:
+#      The GenerateLogMessage processes this file and uses the velocity Macro
+#      to create classes with static methods to perform the logging and give us
+#      compile time validation.
+#
+#   2) Property Processing:
+#      During the class generation the message properties ({x}) are identified
+#      and used to create the method signature.
+#
+#   3) Option Processing:
+#      The Classes perform final formatting of the messages at runtime based on
+#      optional parameters that are defined within the message. Optional
+#      parameters are enclosed in square brackets e.g. [optional].
+#
+#  To provide fixed log messages as required by the Technical Specification:
+#  http://cwiki.apache.org/confluence/display/qpid/Operational+Logging+-+Status+Update+-+Technical+Specification#OperationalLogging-StatusUpdate-TechnicalSpecification-Howtoprovidefixedlogmessages
+#
+#  This file is processed by Velocity to create a number of classes that contain
+#  static methods that provide LogMessages in the code to provide compile time
+#  validation.
+#
+#  For details of what processing is done see GenerateLogMessages.
+#
+#  What a localiser or developer need know is the following:
+#
+#  The Property structure is important as it defines how the class and methods
+#  will be built.
+#
+#  Class Generation:
+#  =================
+#
+#  Each class of messages will be split in to their own <Class>Messages.java.
+#  Each logmessage file contains only one class of messages the <Class> name
+#  is derived from the name of the logmessages file e.g. <Class>_logmessages.properties.
+#
+#  Property Format
+#  ===============
+#   The property format MUST adhere to the follow format to make it easier to
+#   use the logging API as a developer but also so that operations staff can
+#   easily locate log messages in the output.
+#
+#   The property file should contain entries in the following format
+#
+#   <Log Identifier, developer focused> = <Log Identifier, Operate focus> : <Log Message>
+#
+#   eg:
+#    SHUTTING_DOWN = BRK-1003 : Shutting down : {0} port {1,number,#}
+#
+#   Note: the developer focused identifier will become a method name so only a
+#   valid method name should be used. Currently only '-' are converted to '_'.
+#
+#   That said properties generate the logging code at build time so any error
+#   can be easily identified.
+#
+#  The three character identifier show above in BRK-1003 should ideally be unique.
+#  This is the only requirement, limiting to 3 characters is not required.
+#  That said the current broker contains the following mappings.
+#
+#        Class              | Type
+#      ---------------------|--------
+#        Broker             |  BKR
+#        ManagementConsole  |  MNG
+#        VirtualHost        |  VHT
+#        MessageStore       |  MST
+#        ConfigStore        |  CFG
+#        TransactionLog     |  TXN
+#        Connection         |  CON
+#        Channel            |  CHN
+#        Queue              |  QUE
+#        Exchange           |  EXH
+#        Binding            |  BND
+#        Subscription       |  SUB
+#
+#
+#  Property Processing:
+#  ====================
+#
+#   Each property is then processed by the GenerateLogMessages class to identify
+#   The number and type of parameters, {x} entries. Parameters are defaulted to
+#   String types but the use of FormatType number (e.g.{0,number}) will result
+#   in a Number type being used. These parameters are then used to build the
+#   method parameter list. e.g:
+#   Property:
+#    SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+#   becomes Method:
+#    public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+#
+#   This improves our compile time validation of log message content and
+#   ensures that change in the message format does not accidentally cause
+#   erroneous messages.
+#
+#  Option Processing:
+#  ====================
+#
+#  Options are identified in the log message as being surrounded by square
+#  brackets ([ ]). These optional values can themselves contain parameters
+#  however nesting of options is not permitted. Identification is performed on
+#  first matching so given the message:
+#   Msg = Log Message [option1] [option2]
+#  Two options will be identified and enabled to select text 'option1' and
+#  'option2'.
+#
+#  The nesting of a options is not supported and will provide
+#  unexpected results. e.g. Using Message:
+#   Msg = Log Message [option1 [sub-option2]]
+#
+#  The options will be 'option1 [sub-option2' and 'sub-option2'. The first
+#  option includes the second option as the nesting is not detected.
+#
+#  The detected options are presented in the method signature as boolean options
+#  numerically identified by their position in the message. e.g.
+#   Property:
+#    CON-1001 = Open : Client ID {0} [: Protocol Version : {1}]
+#  becomes Method:
+#    public static LogMessage CON_1001(String param1, String param2, boolean opt1)
+#
+#  The value of 'opt1' will show/hide the option in the message. Note that
+#  'param2' is still required however a null value can be used if the optional
+#  section is not desired.
+#
+#  Again here the importance of white space needs to be highlighted.
+#  Looking at the QUE-1001 message as an example. The first thought on how this
+#  would look would be as follows:
+# QUE-1001 = Create : Owner: {0} [AutoDelete] [Durable] [Transient] [Priority: {1,number,#}]
+#  Each option is correctly defined so the text that is defined will appear when
+#  selected. e.g. 'AutoDelete'. However, what may not be immediately apparent is
+#  the white space. Using the above definition of QUE-1001 if we were to print
+#  the message with only the Priority option displayed it would appear as this:
+#  "Create : Owner: guest    Priority: 1"
+#  Note the spaces here   /\ This is because only the text between the brackets
+#  has been removed.
+#
+#  Each option needs to include white space to correctly format the message. So
+#  the correct definition of QUE-1001 is as follows:
+# QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+#  Note that white space is included with each option and there is no extra
+#  white space between the options. As a result the output with just Priority
+#  enabled is as follows:
+#  "Create : Owner: guest Priority: 1"
+#
+#
+# Default File used for all non-defined locales.
+
+# 0 - name
+CREATED = CFG-1001 : Created : {0}
+# 0 - path
+STORE_LOCATION = CFG-1002 : Store location : {0}
+CLOSE = CFG-1003 : Closed
+RECOVERY_START = CFG-1004 : Recovery Start
+RECOVERY_COMPLETE = CFG-1005 : Recovery Complete

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties?rev=954432&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties (added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Connection_logmessages.properties Mon Jun 14 12:35:51 2010
@@ -0,0 +1,215 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+# This file was derivied from LogMessages used within the Java Broker and
+# originally defined on the wiki:
+# http://cwiki.apache.org/confluence/display/qpid/Status+Update+Design#StatusUpdateDesign-InitialStatusMessages
+#
+# Technical Notes:
+#  This is a standard Java Properties file so white space is respected at the
+#  end of the lines. This file is processed in a number of ways.
+# 1) ResourceBundle
+#   This file is loaded as a ResourceBundle. The en_US
+#   addition to the file is the localisation. Additional localisations can be
+#   provided and will automatically be selected based on the <locale> value in
+#   the config.xml. The default is en_US.
+#
+# 2) MessasgeFormat
+#  Each entry is prepared with the Java Core MessageFormat methods. Therefore
+#  most functionality you can do via MessageFormat can be done here:
+#
+#  http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+#
+#  The cavet here is that only default String and number FormatTypes can be used.
+#  This is due to the processing described in 3 below. If support for date, time
+#  or choice is required then the GenerateLogMessages class should be updated to
+#  provide support.
+#
+#  Format Note:
+#   As mentioned earlier white space in this file is very important. One thing
+#  in particular to note is the way MessageFormat performs its replacements.
+#  The replacement text will totally replace the {xxx} section so there will be
+#  no addition of white space or removal e.g.
+#     MSG = Text----{0}----
+#  When given parameter 'Hello' result in text:
+#     Text----Hello----
+#
+#  For simple arguments this is expected however when using Style formats then
+#  it can be a little unexpected. In particular a common pattern is used for
+#  number replacements : {0,number,#}. This is used in the Broker to display an
+#  Integer simply as the Integer with no formatting. e.g new Integer(1234567)
+#  becomes the String "1234567" which is can be contrasted with the pattern
+#  without a style format field : {0,number} which becomes string "1,234,567".
+#
+#  What you may not expect is that {0,number, #} would produce the String " 1234567"
+#  note the space after the ','   here      /\   has resulted in a space  /\ in
+#  the output.
+#
+#  More details on the SubformatPattern can be found on the API link above.
+#
+# 3) GenerateLogMessage/Velocity Macro
+#  This is the only processing that this file goes through.
+#   1) Class Generation:
+#      The GenerateLogMessage processes this file and uses the velocity Macro
+#      to create classes with static methods to perform the logging and give us
+#      compile time validation.
+#
+#   2) Property Processing:
+#      During the class generation the message properties ({x}) are identified
+#      and used to create the method signature.
+#
+#   3) Option Processing:
+#      The Classes perform final formatting of the messages at runtime based on
+#      optional parameters that are defined within the message. Optional
+#      parameters are enclosed in square brackets e.g. [optional].
+#
+#  To provide fixed log messages as required by the Technical Specification:
+#  http://cwiki.apache.org/confluence/display/qpid/Operational+Logging+-+Status+Update+-+Technical+Specification#OperationalLogging-StatusUpdate-TechnicalSpecification-Howtoprovidefixedlogmessages
+#
+#  This file is processed by Velocity to create a number of classes that contain
+#  static methods that provide LogMessages in the code to provide compile time
+#  validation.
+#
+#  For details of what processing is done see GenerateLogMessages.
+#
+#  What a localiser or developer need know is the following:
+#
+#  The Property structure is important as it defines how the class and methods
+#  will be built.
+#
+#  Class Generation:
+#  =================
+#
+#  Each class of messages will be split in to their own <Class>Messages.java.
+#  Each logmessage file contains only one class of messages the <Class> name
+#  is derived from the name of the logmessages file e.g. <Class>_logmessages.properties.
+#
+#  Property Format
+#  ===============
+#   The property format MUST adhere to the follow format to make it easier to
+#   use the logging API as a developer but also so that operations staff can
+#   easily locate log messages in the output.
+#
+#   The property file should contain entries in the following format
+#
+#   <Log Identifier, developer focused> = <Log Identifier, Operate focus> : <Log Message>
+#
+#   eg:
+#    SHUTTING_DOWN = BRK-1003 : Shutting down : {0} port {1,number,#}
+#
+#   Note: the developer focused identifier will become a method name so only a
+#   valid method name should be used. Currently only '-' are converted to '_'.
+#
+#   That said properties generate the logging code at build time so any error
+#   can be easily identified.
+#
+#  The three character identifier show above in BRK-1003 should ideally be unique.
+#  This is the only requirement, limiting to 3 characters is not required.
+#  That said the current broker contains the following mappings.
+#
+#        Class              | Type
+#      ---------------------|--------
+#        Broker             |  BKR
+#        ManagementConsole  |  MNG
+#        VirtualHost        |  VHT
+#        MessageStore       |  MST
+#        ConfigStore        |  CFG
+#        TransactionLog     |  TXN
+#        Connection         |  CON
+#        Channel            |  CHN
+#        Queue              |  QUE
+#        Exchange           |  EXH
+#        Binding            |  BND
+#        Subscription       |  SUB
+#
+#
+#  Property Processing:
+#  ====================
+#
+#   Each property is then processed by the GenerateLogMessages class to identify
+#   The number and type of parameters, {x} entries. Parameters are defaulted to
+#   String types but the use of FormatType number (e.g.{0,number}) will result
+#   in a Number type being used. These parameters are then used to build the
+#   method parameter list. e.g:
+#   Property:
+#    SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+#   becomes Method:
+#    public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+#
+#   This improves our compile time validation of log message content and
+#   ensures that change in the message format does not accidentally cause
+#   erroneous messages.
+#
+#  Option Processing:
+#  ====================
+#
+#  Options are identified in the log message as being surrounded by square
+#  brackets ([ ]). These optional values can themselves contain parameters
+#  however nesting of options is not permitted. Identification is performed on
+#  first matching so given the message:
+#   Msg = Log Message [option1] [option2]
+#  Two options will be identified and enabled to select text 'option1' and
+#  'option2'.
+#
+#  The nesting of a options is not supported and will provide
+#  unexpected results. e.g. Using Message:
+#   Msg = Log Message [option1 [sub-option2]]
+#
+#  The options will be 'option1 [sub-option2' and 'sub-option2'. The first
+#  option includes the second option as the nesting is not detected.
+#
+#  The detected options are presented in the method signature as boolean options
+#  numerically identified by their position in the message. e.g.
+#   Property:
+#    CON-1001 = Open : Client ID {0} [: Protocol Version : {1}]
+#  becomes Method:
+#    public static LogMessage CON_1001(String param1, String param2, boolean opt1)
+#
+#  The value of 'opt1' will show/hide the option in the message. Note that
+#  'param2' is still required however a null value can be used if the optional
+#  section is not desired.
+#
+#  Again here the importance of white space needs to be highlighted.
+#  Looking at the QUE-1001 message as an example. The first thought on how this
+#  would look would be as follows:
+# QUE-1001 = Create : Owner: {0} [AutoDelete] [Durable] [Transient] [Priority: {1,number,#}]
+#  Each option is correctly defined so the text that is defined will appear when
+#  selected. e.g. 'AutoDelete'. However, what may not be immediately apparent is
+#  the white space. Using the above definition of QUE-1001 if we were to print
+#  the message with only the Priority option displayed it would appear as this:
+#  "Create : Owner: guest    Priority: 1"
+#  Note the spaces here   /\ This is because only the text between the brackets
+#  has been removed.
+#
+#  Each option needs to include white space to correctly format the message. So
+#  the correct definition of QUE-1001 is as follows:
+# QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+#  Note that white space is included with each option and there is no extra
+#  white space between the options. As a result the output with just Priority
+#  enabled is as follows:
+#  "Create : Owner: guest Priority: 1"
+#
+#
+# Default File used for all non-defined locales.
+
+# 0 - Client id
+# 1 - Protocol Version
+OPEN = CON-1001 : Open[ : Client ID : {0}][ : Protocol Version : {1}]
+CLOSE = CON-1002 : Close
\ No newline at end of file

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties?rev=954432&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties (added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/Exchange_logmessages.properties Mon Jun 14 12:35:51 2010
@@ -0,0 +1,215 @@
+#
+#  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.
+#
+# Default File used for all non-defined locales.
+#
+# This file was derivied from LogMessages used within the Java Broker and
+# originally defined on the wiki:
+# http://cwiki.apache.org/confluence/display/qpid/Status+Update+Design#StatusUpdateDesign-InitialStatusMessages
+#
+# Technical Notes:
+#  This is a standard Java Properties file so white space is respected at the
+#  end of the lines. This file is processed in a number of ways.
+# 1) ResourceBundle
+#   This file is loaded as a ResourceBundle. The en_US
+#   addition to the file is the localisation. Additional localisations can be
+#   provided and will automatically be selected based on the <locale> value in
+#   the config.xml. The default is en_US.
+#
+# 2) MessasgeFormat
+#  Each entry is prepared with the Java Core MessageFormat methods. Therefore
+#  most functionality you can do via MessageFormat can be done here:
+#
+#  http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+#
+#  The cavet here is that only default String and number FormatTypes can be used.
+#  This is due to the processing described in 3 below. If support for date, time
+#  or choice is required then the GenerateLogMessages class should be updated to
+#  provide support.
+#
+#  Format Note:
+#   As mentioned earlier white space in this file is very important. One thing
+#  in particular to note is the way MessageFormat performs its replacements.
+#  The replacement text will totally replace the {xxx} section so there will be
+#  no addition of white space or removal e.g.
+#     MSG = Text----{0}----
+#  When given parameter 'Hello' result in text:
+#     Text----Hello----
+#
+#  For simple arguments this is expected however when using Style formats then
+#  it can be a little unexpected. In particular a common pattern is used for
+#  number replacements : {0,number,#}. This is used in the Broker to display an
+#  Integer simply as the Integer with no formatting. e.g new Integer(1234567)
+#  becomes the String "1234567" which is can be contrasted with the pattern
+#  without a style format field : {0,number} which becomes string "1,234,567".
+#
+#  What you may not expect is that {0,number, #} would produce the String " 1234567"
+#  note the space after the ','   here      /\   has resulted in a space  /\ in
+#  the output.
+#
+#  More details on the SubformatPattern can be found on the API link above.
+#
+# 3) GenerateLogMessage/Velocity Macro
+#  This is the only processing that this file goes through.
+#   1) Class Generation:
+#      The GenerateLogMessage processes this file and uses the velocity Macro
+#      to create classes with static methods to perform the logging and give us
+#      compile time validation.
+#
+#   2) Property Processing:
+#      During the class generation the message properties ({x}) are identified
+#      and used to create the method signature.
+#
+#   3) Option Processing:
+#      The Classes perform final formatting of the messages at runtime based on
+#      optional parameters that are defined within the message. Optional
+#      parameters are enclosed in square brackets e.g. [optional].
+#
+#  To provide fixed log messages as required by the Technical Specification:
+#  http://cwiki.apache.org/confluence/display/qpid/Operational+Logging+-+Status+Update+-+Technical+Specification#OperationalLogging-StatusUpdate-TechnicalSpecification-Howtoprovidefixedlogmessages
+#
+#  This file is processed by Velocity to create a number of classes that contain
+#  static methods that provide LogMessages in the code to provide compile time
+#  validation.
+#
+#  For details of what processing is done see GenerateLogMessages.
+#
+#  What a localiser or developer need know is the following:
+#
+#  The Property structure is important as it defines how the class and methods
+#  will be built.
+#
+#  Class Generation:
+#  =================
+#
+#  Each class of messages will be split in to their own <Class>Messages.java.
+#  Each logmessage file contains only one class of messages the <Class> name
+#  is derived from the name of the logmessages file e.g. <Class>_logmessages.properties.
+#
+#  Property Format
+#  ===============
+#   The property format MUST adhere to the follow format to make it easier to
+#   use the logging API as a developer but also so that operations staff can
+#   easily locate log messages in the output.
+#
+#   The property file should contain entries in the following format
+#
+#   <Log Identifier, developer focused> = <Log Identifier, Operate focus> : <Log Message>
+#
+#   eg:
+#    SHUTTING_DOWN = BRK-1003 : Shutting down : {0} port {1,number,#}
+#
+#   Note: the developer focused identifier will become a method name so only a
+#   valid method name should be used. Currently only '-' are converted to '_'.
+#
+#   That said properties generate the logging code at build time so any error
+#   can be easily identified.
+#
+#  The three character identifier show above in BRK-1003 should ideally be unique.
+#  This is the only requirement, limiting to 3 characters is not required.
+#  That said the current broker contains the following mappings.
+#
+#        Class              | Type
+#      ---------------------|--------
+#        Broker             |  BKR
+#        ManagementConsole  |  MNG
+#        VirtualHost        |  VHT
+#        MessageStore       |  MST
+#        ConfigStore        |  CFG
+#        TransactionLog     |  TXN
+#        Connection         |  CON
+#        Channel            |  CHN
+#        Queue              |  QUE
+#        Exchange           |  EXH
+#        Binding            |  BND
+#        Subscription       |  SUB
+#
+#
+#  Property Processing:
+#  ====================
+#
+#   Each property is then processed by the GenerateLogMessages class to identify
+#   The number and type of parameters, {x} entries. Parameters are defaulted to
+#   String types but the use of FormatType number (e.g.{0,number}) will result
+#   in a Number type being used. These parameters are then used to build the
+#   method parameter list. e.g:
+#   Property:
+#    SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+#   becomes Method:
+#    public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+#
+#   This improves our compile time validation of log message content and
+#   ensures that change in the message format does not accidentally cause
+#   erroneous messages.
+#
+#  Option Processing:
+#  ====================
+#
+#  Options are identified in the log message as being surrounded by square
+#  brackets ([ ]). These optional values can themselves contain parameters
+#  however nesting of options is not permitted. Identification is performed on
+#  first matching so given the message:
+#   Msg = Log Message [option1] [option2]
+#  Two options will be identified and enabled to select text 'option1' and
+#  'option2'.
+#
+#  The nesting of a options is not supported and will provide
+#  unexpected results. e.g. Using Message:
+#   Msg = Log Message [option1 [sub-option2]]
+#
+#  The options will be 'option1 [sub-option2' and 'sub-option2'. The first
+#  option includes the second option as the nesting is not detected.
+#
+#  The detected options are presented in the method signature as boolean options
+#  numerically identified by their position in the message. e.g.
+#   Property:
+#    CON-1001 = Open : Client ID {0} [: Protocol Version : {1}]
+#  becomes Method:
+#    public static LogMessage CON_1001(String param1, String param2, boolean opt1)
+#
+#  The value of 'opt1' will show/hide the option in the message. Note that
+#  'param2' is still required however a null value can be used if the optional
+#  section is not desired.
+#
+#  Again here the importance of white space needs to be highlighted.
+#  Looking at the QUE-1001 message as an example. The first thought on how this
+#  would look would be as follows:
+# QUE-1001 = Create : Owner: {0} [AutoDelete] [Durable] [Transient] [Priority: {1,number,#}]
+#  Each option is correctly defined so the text that is defined will appear when
+#  selected. e.g. 'AutoDelete'. However, what may not be immediately apparent is
+#  the white space. Using the above definition of QUE-1001 if we were to print
+#  the message with only the Priority option displayed it would appear as this:
+#  "Create : Owner: guest    Priority: 1"
+#  Note the spaces here   /\ This is because only the text between the brackets
+#  has been removed.
+#
+#  Each option needs to include white space to correctly format the message. So
+#  the correct definition of QUE-1001 is as follows:
+# QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+#  Note that white space is included with each option and there is no extra
+#  white space between the options. As a result the output with just Priority
+#  enabled is as follows:
+#  "Create : Owner: guest Priority: 1"
+#
+#
+# Default File used for all non-defined locales.
+
+# 0 - type
+# 1 - name
+CREATED = EXH-1001 : Create :[ Durable] Type: {0} Name: {1}
+DELETED = EXH-1002 : Deleted
\ No newline at end of file



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message