qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r886842 [1/2] - in /qpid/trunk/qpid/java: ./ broker/ broker/src/main/java/org/apache/qpid/server/ broker/src/main/java/org/apache/qpid/server/exchange/ broker/src/main/java/org/apache/qpid/server/logging/ broker/src/main/java/org/apache/qpi...
Date Thu, 03 Dec 2009 16:21:11 GMT
Author: ritchiem
Date: Thu Dec  3 16:19:14 2009
New Revision: 886842

URL: http://svn.apache.org/viewvc?rev=886842&view=rev
Log:
Merged r 886719:886722 from 0.5.x-dev.

Added:
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java
      - copied unchanged from r886722, qpid/branches/0.5.x-dev/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseActorTestCase.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java
      - copied unchanged from r886722, qpid/branches/0.5.x-dev/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/BaseConnectionActorTestCase.java
Removed:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_en_US.properties
Modified:
    qpid/trunk/qpid/java/   (props changed)
    qpid/trunk/qpid/java/broker/   (props changed)
    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/exchange/AbstractExchange.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.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/logging/messages/LogMessages.properties
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/   (props changed)
    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/   (props changed)
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.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/registry/ConfigurationFileApplicationRegistry.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/actors/AMQPChannelActorTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/ManagementActorTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/QueueActorTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/SubscriptionActorTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/TestLogActor.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.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/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/BindingLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ChannelLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ConnectionLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/ExchangeLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/QueueLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java
    qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/TestBlankSubject.java
    qpid/trunk/qpid/java/broker/src/velocity/java/org/apache/qpid/server/logging/GenerateLogMessages.java
    qpid/trunk/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java

Propchange: qpid/trunk/qpid/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  3 16:19:14 2009
@@ -1,3 +1,5 @@
+/qpid/branches/0.5.x-dev:886720-886722
+/qpid/branches/0.5.x-dev/qpid/java:886720-886722
 /qpid/branches/java-broker-0-10/qpid/java:795950-829653
 /qpid/branches/java-network-refactor/qpid/java:805429-821809
 /qpid/trunk/qpid:796646-796653

Propchange: qpid/trunk/qpid/java/broker/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  3 16:19:14 2009
@@ -1,3 +1,4 @@
+/qpid/branches/0.5.x-dev/qpid/java/broker:886720-886722
 /qpid/branches/java-broker-0-10/qpid/java/broker:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/broker:805429-821809
 /qpid/branches/jmx_mc_gsoc09/qpid/java/broker:787599

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=886842&r1=886841&r2=886842&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 Thu Dec  3 16:19:14 2009
@@ -133,7 +133,7 @@
         _actor = new AMQPChannelActor(this, session.getLogActor().getRootMessageLogger());
         _logSubject = new ChannelLogSubject(this);
 
-        _actor.message(ChannelMessages.CHN_1001());
+        _actor.message(ChannelMessages.CHN_CREATE());
 
         _messageStore = messageStore;
 
@@ -417,7 +417,7 @@
     {
         _closing = closing;
 
-        CurrentActor.get().message(_logSubject, ChannelMessages.CHN_1003());
+        CurrentActor.get().message(_logSubject, ChannelMessages.CHN_CLOSE());
     }
 
     private void unsubscribeAllConsumers() throws AMQException
@@ -737,7 +737,7 @@
             // Log Flow Started before we start the subscriptions
             if (!suspended)
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_1002("Started"));
+                _actor.message(_logSubject, ChannelMessages.CHN_FLOW("Started"));
             }
 
 
@@ -788,7 +788,7 @@
             // stopped.
             if (suspended)
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_1002("Stopped"));
+                _actor.message(_logSubject, ChannelMessages.CHN_FLOW("Stopped"));
             }
 
         }
@@ -904,7 +904,7 @@
 
     public void setCredit(final long prefetchSize, final int prefetchCount)
     {
-        _actor.message(ChannelMessages.CHN_1004(prefetchSize, prefetchCount));
+        _actor.message(ChannelMessages.CHN_PREFETCH_SIZE(prefetchSize, prefetchCount));
         _creditManager.setCreditLimits(prefetchSize, prefetchCount);
     }
 
@@ -1163,7 +1163,7 @@
 
             if(_blocking.compareAndSet(false,true))
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_1005(queue.getName().toString()));
+                _actor.message(_logSubject, ChannelMessages.CHN_FLOW_ENFORCED(queue.getName().toString()));
                 flow(false);
             }
         }
@@ -1175,7 +1175,7 @@
         {
             if(_blocking.compareAndSet(true,false))
             {
-                _actor.message(_logSubject, ChannelMessages.CHN_1006());
+                _actor.message(_logSubject, ChannelMessages.CHN_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=886842&r1=886841&r2=886842&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 Thu Dec  3 16:19:14 2009
@@ -266,7 +266,7 @@
         }
         else
         {
-            CurrentActor.get().message(BrokerMessages.BRK_1006(configFile.getAbsolutePath()));
+            CurrentActor.get().message(BrokerMessages.BRK_CONFIG(configFile.getAbsolutePath()));
         }
 
         String logConfig = commandLine.getOptionValue("l");
@@ -417,7 +417,7 @@
                                 serverConfig.getNetworkConfiguration(), null);
                     ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, port),
                                                                   new QpidAcceptor(driver,"TCP"));
-                    CurrentActor.get().message(BrokerMessages.BRK_1002("TCP", port));
+                    CurrentActor.get().message(BrokerMessages.BRK_LISTENING("TCP", port));
 
                 }
 
@@ -431,14 +431,14 @@
                             new AMQProtocolEngineFactory(), serverConfig.getNetworkConfiguration(), sslFactory);
                 ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, serverConfig.getSSLPort()),
                         new QpidAcceptor(driver,"TCP"));
-                CurrentActor.get().message(BrokerMessages.BRK_1002("TCP/SSL", serverConfig.getSSLPort()));
+                CurrentActor.get().message(BrokerMessages.BRK_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_1004());
+            CurrentActor.get().message(BrokerMessages.BRK_READY());
 
         }
         finally
@@ -558,7 +558,7 @@
     {
         if (logConfigFile.exists() && logConfigFile.canRead())
         {
-            CurrentActor.get().message(BrokerMessages.BRK_1007(logConfigFile.getAbsolutePath()));
+            CurrentActor.get().message(BrokerMessages.BRK_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/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=886842&r1=886841&r2=886842&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 Thu Dec  3 16:19:14 2009
@@ -185,7 +185,7 @@
         _logSubject = new ExchangeLogSubject(this, this.getVirtualHost());
 
         // Log Exchange creation
-        CurrentActor.get().message(ExchangeMessages.EXH_1001(String.valueOf(getType()), String.valueOf(name), durable));
+        CurrentActor.get().message(ExchangeMessages.EXH_CREATED(String.valueOf(getType()), String.valueOf(name), durable));
     }
 
     public abstract Logger getLogger();
@@ -216,7 +216,7 @@
             _alternateExchange.removeReference(this);
         }
 
-        CurrentActor.get().message(_logSubject, ExchangeMessages.EXH_1002());
+        CurrentActor.get().message(_logSubject, ExchangeMessages.EXH_DELETED());
     }
 
     public String toString()

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/LogActor.java Thu Dec  3 16:19:14 2009
@@ -57,4 +57,10 @@
      * @return the RootMessageLogger that is currently in use by this LogActor.
      */
     RootMessageLogger getRootMessageLogger();
+
+    /**
+     * 
+     * @return the String representing this LogActor
+     */
+    public String getLogMessage();
 }
\ No newline at end of file

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPChannelActor.java Thu Dec  3 16:19:14 2009
@@ -40,6 +40,7 @@
  */
 public class AMQPChannelActor extends AbstractActor
 {
+    private final String _logString;
 
     /**
      * Create a new ChannelActor
@@ -74,5 +75,10 @@
                                                channel.getChannelId())
                     + "] ";
     }
+
+    public String getLogMessage()
+    {
+        return _logString;
+    }
 }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AMQPConnectionActor.java Thu Dec  3 16:19:14 2009
@@ -54,6 +54,15 @@
      */
     public static final String USER_FORMAT = "con:{0}({1}@{2})";
 
+    // The log string prefix for each message
+    private String _logString;
+
+    // The Session this Actor is representing
+    private AMQProtocolSession _session;
+
+    // Used to stop re-creating the _logString when we reach our final format
+    private boolean _upToDate = false;
+
     public AMQPConnectionActor(AMQProtocolSession session, RootMessageLogger rootLogger)
     {
         super(rootLogger);
@@ -61,55 +70,66 @@
         _logString = "[" + MessageFormat.format(SOCKET_FORMAT,
                                                 session.getSessionID(),
                                                 session.getRemoteAddress())
-
                      + "] ";
+
+        _session = session;
     }
 
     /**
-     * Call when the connection has been authorized so that the logString
-     * can be updated with the new user identity.
+     * Update the LogString as the Connection process proceeds.
      *
-     * @param session the authorized session
+     * When the Session has an authorized ID add that to the string.
+     *
+     * When the Session then gains a Vhost add that to the string, at this point
+     * we can set upToDate = true as the _logString will not need to be updated
+     * from this point onwards.
      */
-    public void connectionAuthorized(AMQProtocolSession session)
+    private void updateLogString()
     {
-        _logString = "[" + MessageFormat.format(USER_FORMAT,
-                                                session.getSessionID(),
-                                                session.getPrincipal().getName(),
-                                                session.getRemoteAddress())
-                     + "] ";
-
+        if (!_upToDate)
+        {
+            if (_session.getPrincipal() != null)
+            {
+                if (_session.getVirtualHost() != null)
+                {
+                    /**
+                     * LOG FORMAT used by the AMQPConnectorActor follows
+                     * ConnectionLogSubject.CONNECTION_FORMAT :
+                     * con:{0}({1}@{2}/{3})
+                     *
+                     * Uses a MessageFormat call to insert the required values according to
+                     * these indices:
+                     *
+                     * 0 - Connection ID
+                     * 1 - User ID
+                     * 2 - IP
+                     * 3 - Virtualhost
+                     */
+                    _logString = "[" + MessageFormat.format(ConnectionLogSubject.CONNECTION_FORMAT,
+                                                            _session.getSessionID(),
+                                                            _session.getPrincipal().getName(),
+                                                            _session.getRemoteAddress(),
+                                                            _session.getVirtualHost().getName())
+                                 + "] ";
+                    _upToDate = true;
+                }
+                else
+                {
+                    _logString = "[" + MessageFormat.format(USER_FORMAT,
+                                                            _session.getSessionID(),
+                                                            _session.getPrincipal().getName(),
+                                                            _session.getRemoteAddress())
+                                 + "] ";
+
+                }
+            }
+        }
     }
 
-    /**
-     * Called once the user has been authenticated and they are now selecting
-     * the virtual host they wish to use.
-     *
-     * @param session the session that now has a virtualhost associated with it.
-     */
-    public void virtualHostSelected(AMQProtocolSession session)
+    public String getLogMessage()
     {
-
-        /**
-         * LOG FORMAT used by the AMQPConnectorActor follows
-         * ConnectionLogSubject.CONNECTION_FORMAT :
-         * con:{0}({1}@{2}/{3})
-         *
-         * Uses a MessageFormat call to insert the requried values according to
-         * these indicies:
-         *
-         * 0 - Connection ID
-         * 1 - User ID
-         * 2 - IP
-         * 3 - Virtualhost
-         */
-        _logString = "[" + MessageFormat.format(ConnectionLogSubject.CONNECTION_FORMAT,
-                                                session.getSessionID(),
-                                                session.getPrincipal().getName(),
-                                                session.getRemoteAddress(),
-                                                session.getVirtualHost().getName())
-                     + "] ";
-
+        updateLogString();
+        return _logString;
     }
 }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/AbstractActor.java Thu Dec  3 16:19:14 2009
@@ -27,7 +27,6 @@
 
 public abstract class AbstractActor implements LogActor
 {
-    protected String _logString;
     protected RootMessageLogger _rootLogger;
 
     public AbstractActor(RootMessageLogger rootLogger)
@@ -43,7 +42,7 @@
     {
         if (_rootLogger.isMessageEnabled(this, subject))
         {
-            _rootLogger.rawMessage(_logString + String.valueOf(subject) + message);
+            _rootLogger.rawMessage(getLogMessage() + String.valueOf(subject) + message);
         }
     }
 
@@ -51,7 +50,7 @@
     {
         if (_rootLogger.isMessageEnabled(this))
         {
-            _rootLogger.rawMessage(_logString + message);
+            _rootLogger.rawMessage(getLogMessage() + message);
         }
     }
 
@@ -62,7 +61,9 @@
 
     public String toString()
     {
-        return _logString;
+        return getLogMessage();
     }
 
+    abstract public String getLogMessage();
+
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/BrokerActor.java Thu Dec  3 16:19:14 2009
@@ -24,6 +24,7 @@
 
 public class BrokerActor extends AbstractActor
 {
+    private final String _logString;
 
     /**
      * Create a new BrokerActor
@@ -44,4 +45,9 @@
         _logString = "[Broker(" + name + ")] ";
     }
 
+    public String getLogMessage()
+    {
+        return _logString;
+    }    
+
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/ManagementActor.java Thu Dec  3 16:19:14 2009
@@ -53,11 +53,15 @@
      */
     public static final String MANAGEMENT_FORMAT = "mng:{0}({1})";
 
+    /**
+     * The logString to be used for logging
+     */
+    private String _logString;
+
     /** @param rootLogger The RootLogger to use for this Actor */
     public ManagementActor(RootMessageLogger rootLogger)
     {
         super(rootLogger);
-
     }
 
     private void updateLogString()
@@ -101,18 +105,10 @@
         }
     }
 
-    @Override
-    public void message(LogSubject subject, LogMessage message)
-    {
-        updateLogString();
-        super.message(subject, message);
-    }
-
-    @Override
-    public void message(LogMessage message)
+    public String getLogMessage()
     {
         updateLogString();
-        super.message(message);
+        return _logString;
     }
 
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/actors/QueueActor.java Thu Dec  3 16:19:14 2009
@@ -32,6 +32,7 @@
  */
 public class QueueActor extends AbstractActor
 {
+    private final String _logString;
 
     /**
      * Create an QueueLogSubject that Logs in the following format.
@@ -46,7 +47,11 @@
         _logString = "[" + MessageFormat.format(QueueLogSubject.LOG_FORMAT,
                                                 queue.getVirtualHost().getName(),
                                                 queue.getName()) + "] ";
+    }
 
+    public String getLogMessage()
+    {
+        return _logString;
     }
 }
     
\ No newline at end of file

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=886842&r1=886841&r2=886842&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 Thu Dec  3 16:19:14 2009
@@ -21,6 +21,8 @@
 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;
@@ -28,15 +30,21 @@
 public class SubscriptionActor extends AbstractActor
 {
     public static String SUBSCRIBER_FORMAT = "sub:{0}(vh({1})/qu({2}))";
+    private final String _logString;
 
     public SubscriptionActor(RootMessageLogger logger, Subscription subscription)
     {
         super(logger);
 
-        _logString = "[" + MessageFormat.format(SUBSCRIBER_FORMAT,
+        _logString = "[" + MessageFormat.format(SubscriptionLogSubject.SUBSCRIPTION_FORMAT,
                                                 subscription.getSubscriptionID(),
                                                 subscription.getQueue().getVirtualHost().getName(),
                                                 subscription.getQueue().getName())
                      + "] ";
     }
+
+    public String getLogMessage()
+    {
+        return _logString;
+    }
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages.properties?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages.properties (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages.properties Thu Dec  3 16:19:14 2009
@@ -17,116 +17,307 @@
 #  under the License.
 #
 # Default File used for all non-defined locales.
+#
+# LogMessages used within the Java Broker as 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 through a ResourceBundle named LogMessages. 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 requried 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 peforms its replacements. 	 
+#  The replacement text will totally replace the {xxx} section so there will be 	 
+#  no addtion 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 unexepcted. 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 formating. 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 first and final stage of 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 	 
+#      paramters 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 is 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 	 
+#  Currently the following classes are created and are populated with the 	 
+#  messages that bear their 3-digit type identifier: 	 
+# 	 
+#        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 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:
+#    BRK_SHUTTING_DOWN = BRK-1003 : Shuting 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.
+#
+#  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: 	 
+#    BRK_SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#} 	 
+#   becomes Method: 	 
+#    public static LogMessage BRK_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 paramters 	 
+#  however nesting of options is not permitted. Identification is performed on 	 
+#  first matchings so give the message: 	 
+#   Msg = Log Message [option1] [option2] 	 
+#  Two options will be identifed 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" 	 
+# 	 
+#  The final processing that is done in the generation is the conversion of the 	 
+#  property name. As a '-' is an illegal character in the method name it is 	 
+#  converted to '_' This processing gives the final method signature as follows: 	 
+#   <Class>Message.<Type>_<Number>(<parmaters>,<options>) 	 
+#
+#
+# Default File used for all non-defined locales.
 #Broker
 # 0 - Version
 # 1 = Build
-BRK-1001 = Startup : Version: {0} Build: {1}
+BRK_STARTUP = BRK-1001 : Startup : Version: {0} Build: {1}
 # 0 - Transport
 # 1 - Port
-BRK-1002 = Starting : Listening on {0} port {1,number,#}
+BRK_LISTENING = BRK-1002 : Starting : Listening on {0} port {1,number,#}
 # 0 - Transport
 # 1 - Port
-BRK-1003 = Shuting down : {0} port {1,number,#}
-BRK-1004 = Ready
-BRK-1005 = Stopped
+BRK_SHUTTING_DOWN = BRK-1003 : Shuting down : {0} port {1,number,#}
+BRK_READY = BRK-1004 : Ready
+BRK_STOPPED = BRK-1005 : Stopped
 # 0 - path
-BRK-1006 = Using configuration : {0}
+BRK_CONFIG = BRK-1006 : Using configuration : {0}
 # 0 - path
-BRK-1007 = Using logging configuration : {0}
+BRK_LOG_CONFIG = BRK-1007 : Using logging configuration : {0}
 
 #ManagementConsole
-MNG-1001 = Startup
+MNG_STARTUP = MNG-1001 : Startup
 # 0 - Service
 # 1 - Port
-MNG-1002 = Starting : {0} : Listening on port {1,number,#}
+MNG_LISTENING = MNG-1002 : Starting : {0} : Listening on port {1,number,#}
 # 0 - Service
 # 1 - Port
-MNG-1003 = Shuting down : {0} : port {1,number,#}
-MNG-1004 = Ready
-MNG-1005 = Stopped
+MNG_SHUTTING_DOWN = MNG-1003 : Shuting down : {0} : port {1,number,#}
+MNG_READY = MNG-1004 : Ready
+MNG_STOPPED = MNG-1005 : Stopped
 # 0 - Path
-MNG-1006 = Using SSL Keystore : {0}
-MNG-1007 = Open : User {0}
-MNG-1008 = Close
+MNG_SSL_KEYSTORE = MNG-1006 : Using SSL Keystore : {0}
+MNG_OPEN = MNG-1007 : Open : User {0}
+MNG_CLOSE = MNG-1008 : Close
 
 
 #VirtualHost
 # 0 - name
-VHT-1001 = Created : {0}
-VHT-1002 = Closed
+VHT_CREATED = VHT-1001 : Created : {0}
+VHT_CLOSED = VHT-1002 : Closed
 
 #MessageStore
 # 0 - name
-MST-1001 = Created : {0}
+MST_CREATED = MST-1001 : Created : {0}
 # 0 - path
-MST-1002 = Store location : {0}
-MST-1003 = Closed
-MST-1004 = Recovery Start
-MST-1005 = Recovered {0,number} messages
-MST-1006 = Recovery Complete
+MST_STORE_LOCATION = MST-1002 : Store location : {0}
+MST_CLOSED = MST-1003 : Closed
+MST_RECOVERY_START = MST-1004 : Recovery Start
+MST_RECOVERED = MST-1005 : Recovered {0,number} messages
+MST_RECOVERY_COMPLETE = MST-1006 : Recovery Complete
 
 #ConfigStore
 # 0 - name
-CFG-1001 = Created : {0}
+CFG-1001 = CFG-1001 : Created : {0}
 # 0 - path
-CFG-1002 = Store location : {0}
-CFG-1003 = Closed
-CFG-1004 = Recovery Start
-CFG-1005 = Recovery Complete
+CFG-1002 = CFG-1002 : Store location : {0}
+CFG-1003 = CFG-1003 : Closed
+CFG-1004 = CFG-1004 : Recovery Start
+CFG-1005 = CFG-1005 : Recovery Complete
 
 #TransactionLog
 # 0 - name
-TXN-1001 = Created : {0}
+TXN-1001 = TXN-1001 : Created : {0}
 # 0 - path
-TXN-1002 = Store location : {0}
-TXN-1003 = Closed
+TXN-1002 = TXN-1002 : Store location : {0}
+TXN-1003 = TXN-1003 : Closed
 # 0 - queue name
-TXN-1004 = Recovery Start[ : {0}]
+TXN-1004 = TXN-1004 : Recovery Start[ : {0}]
 # 0 - count
 # 1 - queue count
-TXN-1005 = Recovered {0,number} messages for queue {1}
+TXN-1005 = TXN-1005 : Recovered {0,number} messages for queue {1}
 # 0 - queue name
-TXN-1006 = Recovery Complete[ : {0}]
+TXN-1006 = TXN-1006 : Recovery Complete[ : {0}]
 
 #Connection
 # 0 - Client id
 # 1 - Protocol Version
-CON-1001 = Open[ : Client ID : {0}][ : Protocol Version : {1}]
-CON-1002 = Close
+CON_OPEN = CON-1001 : Open[ : Client ID : {0}][ : Protocol Version : {1}]
+CON_CLOSE = CON-1002 : Close
 
 #Channel
-CHN-1001 = Create
+CHN_CREATE = CHN-1001 : Create
 # 0 - flow
-CHN-1002 = Flow {0}
-CHN-1003 = Close
+CHN_FLOW = CHN-1002 : Flow {0}
+CHN_CLOSE = CHN-1003 : Close
 # 0 - bytes allowed in prefetch
 # 1 - number of messagse.
-CHN-1004 = Prefetch Size (bytes) {0,number} : Count {1,number}
+CHN_PREFETCH_SIZE = CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}
 # 0 - queue causing flow control
-CHN-1005 = Flow Control Enforced (Queue {0})
-CHN-1006 = Flow Control Removed
+CHN_FLOW_ENFORCED = CHN-1005 : Flow Control Enforced (Queue {0})
+CHN_FLOW_REMOVED = CHN-1006 : Flow Control Removed
 
 #Queue
 # 0 - owner
 # 1 - priority
-QUE-1001 = Create :[ Owner: {0}][ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
-QUE-1002 = Deleted
-QUE-1003 = Overfull : Size : {0,number} bytes, Capacity : {1,number}
-QUE-1004 = Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}
+QUE_CREATED = QUE-1001 : Create :[ Owner: {0}][ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+QUE_DELETED = QUE-1002 : Deleted
+QUE_OVERFULL = QUE-1003 : Overfull : Size : {0,number} bytes, Capacity : {1,number}
+QUE_UNDERFULL = QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity : {1,number}
 
 
 #Exchange
 # 0 - type
 # 1 - name
-EXH-1001 = Create :[ Durable] Type: {0} Name: {1}
-EXH-1002 = Deleted
+EXH_CREATED = EXH-1001 : Create :[ Durable] Type: {0} Name: {1}
+EXH_DELETED = EXH-1002 : Deleted
 
 #Binding
-BND-1001 = Create[ : Arguments : {0}]
-BND-1002 = Deleted
+BND_CREATED = BND-1001 : Create[ : Arguments : {0}]
+BND_DELETED = BND-1002 : Deleted
 
 #Subscription
-SUB-1001 = Create[ : Durable][ : Arguments : {0}]
-SUB-1002 = Close
+SUB_CREATE = SUB-1001 : Create[ : Durable][ : Arguments : {0}]
+SUB_CLOSE = SUB-1002 : Close
 # 0 - The current subscription state
-SUB-1003 = State : {0}
+SUB_STATE = SUB-1003 : State : {0}
+

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubject.java Thu Dec  3 16:19:14 2009
@@ -33,7 +33,7 @@
      * 0 - Subscription ID
      * 1 - queue name
      */
-    protected static String BINDING_FORMAT = "sub:{0}(qu({1}))";
+    public static String SUBSCRIPTION_FORMAT = "sub:{0}(vh(/{1})/qu({2}))";
 
     /**
      * Create an QueueLogSubject that Logs in the following format.
@@ -42,8 +42,8 @@
      */
     public SubscriptionLogSubject(Subscription subscription)
     {
-
-        setLogStringWithFormat(BINDING_FORMAT, subscription.getSubscriptionID(),
+        setLogStringWithFormat(SUBSCRIPTION_FORMAT, subscription.getSubscriptionID(),
+                               subscription.getQueue().getVirtualHost().getName(),
                                subscription.getQueue().getName());
     }
 }

Propchange: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  3 16:19:14 2009
@@ -1,4 +1,5 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management:757268
+/qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/management:886720-886722
 /qpid/branches/java-broker-0-10/qpid/java/broker/src/main/java/org/apache/qpid/server/management:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/management:805429-821809
 /qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/management:787599

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java Thu Dec  3 16:19:14 2009
@@ -100,7 +100,7 @@
     public void start() throws IOException, ConfigurationException
     {
 
-        CurrentActor.get().message(ManagementConsoleMessages.MNG_1001());
+        CurrentActor.get().message(ManagementConsoleMessages.MNG_STARTUP());
         
         //check if system properties are set to use the JVM's out-of-the-box JMXAgent
         if (areOutOfTheBoxJMXOptionsSet())
@@ -171,7 +171,7 @@
                 _log.info("JMX ConnectorServer using SSL keystore file " + ksf.getAbsolutePath());
                 _startupLog.info("JMX ConnectorServer using SSL keystore file " + ksf.getAbsolutePath());
 
-                CurrentActor.get().message(ManagementConsoleMessages.MNG_1006(ksf.getAbsolutePath()));
+                CurrentActor.get().message(ManagementConsoleMessages.MNG_SSL_KEYSTORE(ksf.getAbsolutePath()));
             }
 
             //check the key store password is set
@@ -199,8 +199,8 @@
             _startupLog.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" + 
                      (port +PORT_EXPORT_OFFSET) + ") with SSL");
 
-            CurrentActor.get().message(ManagementConsoleMessages.MNG_1002("SSL RMI Registry", port));
-            CurrentActor.get().message(ManagementConsoleMessages.MNG_1002("SSL RMI ConnectorServer", port + PORT_EXPORT_OFFSET));
+            CurrentActor.get().message(ManagementConsoleMessages.MNG_LISTENING("SSL RMI Registry", port));
+            CurrentActor.get().message(ManagementConsoleMessages.MNG_LISTENING("SSL RMI ConnectorServer", port + PORT_EXPORT_OFFSET));
 
         }
         else
@@ -211,8 +211,8 @@
 
             _log.warn("Starting JMX ConnectorServer on port '" + port + "' (+" + (port +PORT_EXPORT_OFFSET) + ")");
             _startupLog.warn("Starting JMX ConnectorServer on port '" + port + "' (+" + (port +PORT_EXPORT_OFFSET) + ")");
-            CurrentActor.get().message(ManagementConsoleMessages.MNG_1002("RMI Registry", port));
-            CurrentActor.get().message(ManagementConsoleMessages.MNG_1002("RMI ConnectorServer", port + PORT_EXPORT_OFFSET));
+            CurrentActor.get().message(ManagementConsoleMessages.MNG_LISTENING("RMI Registry", port));
+            CurrentActor.get().message(ManagementConsoleMessages.MNG_LISTENING("RMI ConnectorServer", port + PORT_EXPORT_OFFSET));
         }
 
         //add a JMXAuthenticator implementation the env map to authenticate the RMI based JMX connector server
@@ -301,7 +301,7 @@
         _cs.start();
 
 
-        CurrentActor.get().message(ManagementConsoleMessages.MNG_1004());
+        CurrentActor.get().message(ManagementConsoleMessages.MNG_READY());
     }
 
     /*
@@ -389,8 +389,8 @@
             try
             {
                 _cs.stop();
-                CurrentActor.get().message(ManagementConsoleMessages.MNG_1003("RMI Registry", _cs.getAddress().getPort() - PORT_EXPORT_OFFSET));
-                CurrentActor.get().message(ManagementConsoleMessages.MNG_1003("RMI ConnectorServer", _cs.getAddress().getPort()));
+                CurrentActor.get().message(ManagementConsoleMessages.MNG_SHUTTING_DOWN("RMI Registry", _cs.getAddress().getPort() - PORT_EXPORT_OFFSET));
+                CurrentActor.get().message(ManagementConsoleMessages.MNG_SHUTTING_DOWN("RMI ConnectorServer", _cs.getAddress().getPort()));
             }
             catch (IOException e)
             {
@@ -421,7 +421,7 @@
             }
         }
 
-        CurrentActor.get().message(ManagementConsoleMessages.MNG_1005());        
+        CurrentActor.get().message(ManagementConsoleMessages.MNG_STOPPED());
     }
 
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java Thu Dec  3 16:19:14 2009
@@ -26,8 +26,6 @@
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.actors.ManagementActor;
 import org.apache.qpid.server.logging.messages.ManagementConsoleMessages;
-import org.apache.qpid.server.logging.messages.ConnectionMessages;
-import org.apache.qpid.server.logging.LogActor;
 import org.apache.log4j.Logger;
 
 import javax.management.remote.MBeanServerForwarder;
@@ -47,7 +45,6 @@
 import java.security.AccessController;
 import java.security.Principal;
 import java.security.AccessControlContext;
-import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.Properties;
@@ -276,12 +273,12 @@
 
         if (notification.getType().equals(JMXConnectionNotification.OPENED))
         {
-            _logActor.message(ManagementConsoleMessages.MNG_1007(user));
+            _logActor.message(ManagementConsoleMessages.MNG_OPEN(user));
         }
         else if (notification.getType().equals(JMXConnectionNotification.CLOSED) ||
                  notification.getType().equals(JMXConnectionNotification.FAILED))
         {
-            _logActor.message(ManagementConsoleMessages.MNG_1008());
+            _logActor.message(ManagementConsoleMessages.MNG_CLOSE());
         }
     }
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngine.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngine.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolEngine.java Thu Dec  3 16:19:14 2009
@@ -178,7 +178,7 @@
         _writeJob = new Job(_poolReference, Job.MAX_JOB_EVENTS, false);
 
         _actor = new AMQPConnectionActor(this, virtualHostRegistry.getApplicationRegistry().getRootMessageLogger());
-        _actor.message(ConnectionMessages.CON_1001(null, null, false, false));
+        _actor.message(ConnectionMessages.CON_OPEN(null, null, false, false));
 
     }
 
@@ -329,7 +329,7 @@
         try
         {
             // Log incomming protocol negotiation request
-            _actor.message(ConnectionMessages.CON_1001(null, pi._protocolMajor + "-" + pi._protocolMinor, false, true));
+            _actor.message(ConnectionMessages.CON_OPEN(null, pi._protocolMajor + "-" + pi._protocolMinor, false, true));
 
             ProtocolVersion pv = pi.checkVersion(); // Fails if not correct
 
@@ -720,7 +720,7 @@
                     notifyAll();
                 }
                 _poolReference.releaseExecutorService();
-                CurrentActor.get().message(_logSubject, ConnectionMessages.CON_1002());
+                CurrentActor.get().message(_logSubject, ConnectionMessages.CON_CLOSE());
             }
         }
         else
@@ -840,7 +840,7 @@
                 setContextKey(new AMQShortString(clientID));
 
                 // Log the Opening of the connection for this client
-                _actor.message(ConnectionMessages.CON_1001(clientID, _protocolVersion.toString(), true, true));
+                _actor.message(ConnectionMessages.CON_OPEN(clientID, _protocolVersion.toString(), true, true));
             }
 
             if (_clientProperties.getString(ClientProperties.version.toString()) != null)
@@ -898,7 +898,6 @@
     {
         _virtualHost = virtualHost;
 
-        _actor.virtualHostSelected(this);
         _logSubject = new ConnectionLogSubject(this);
 
         _virtualHost.getConnectionRegistry().registerConnection(this);
@@ -932,9 +931,6 @@
     public void setAuthorizedID(Principal authorizedID)
     {
         _authorizedID = authorizedID;
-
-        // Let the actor know that this connection is now Authorized
-        _actor.connectionAuthorized(this);
     }
 
     public Principal getAuthorizedID()

Propchange: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec  3 16:19:14 2009
@@ -1,4 +1,5 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue:757257
+/qpid/branches/0.5.x-dev/qpid/java/broker/src/main/java/org/apache/qpid/server/queue:886720-886722
 /qpid/branches/java-broker-0-10/qpid/java/broker/src/main/java/org/apache/qpid/server/queue:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/broker/src/main/java/org/apache/qpid/server/queue:805429-821809
 /qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/queue:787599

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java Thu Dec  3 16:19:14 2009
@@ -45,7 +45,7 @@
         _arguments = arguments == null ? EMPTY_ARGUMENTS : arguments;
         _logSubject = new BindingLogSubject(routingKey,exchange,queue);
 
-        CurrentActor.get().message(_logSubject, BindingMessages.BND_1001(String.valueOf(_arguments), arguments != null));
+        CurrentActor.get().message(_logSubject, BindingMessages.BND_CREATED(String.valueOf(_arguments), arguments != null));
     }
 
 
@@ -54,7 +54,7 @@
     {
         _exchange.deregisterQueue(_routingKey, queue, _arguments);
 
-        CurrentActor.get().message(_logSubject, BindingMessages.BND_1002());
+        CurrentActor.get().message(_logSubject, BindingMessages.BND_DELETED());
     }
 
     public Exchange getExchange()

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java Thu Dec  3 16:19:14 2009
@@ -200,7 +200,7 @@
         // Log the creation of this Queue.
         // The priorities display is toggled on if we set priorities > 0
         CurrentActor.get().message(_logSubject,
-                                   QueueMessages.QUE_1001(String.valueOf(_owner),
+                                   QueueMessages.QUE_CREATED(String.valueOf(_owner),
                                                           priorities,
                                                           _owner != null,
                                                           autoDelete,
@@ -1297,7 +1297,7 @@
             stop();
 
             //Log Queue Deletion
-            CurrentActor.get().message(_logSubject, QueueMessages.QUE_1002());
+            CurrentActor.get().message(_logSubject, QueueMessages.QUE_DELETED());
 
         }
         return getMessageCount();
@@ -1320,7 +1320,7 @@
             {
                 _overfull.set(true);
                 //Overfull log message
-                _logActor.message(_logSubject, QueueMessages.QUE_1003(_atomicQueueSize.get(), _capacity));
+                _logActor.message(_logSubject, QueueMessages.QUE_OVERFULL(_atomicQueueSize.get(), _capacity));
 
                 if(_blockedChannels.putIfAbsent(channel, Boolean.TRUE)==null)
                 {
@@ -1331,7 +1331,7 @@
                 {
 
                     //Underfull log message
-                    _logActor.message(_logSubject, QueueMessages.QUE_1004(_atomicQueueSize.get(), _flowResumeCapacity));
+                    _logActor.message(_logSubject, QueueMessages.QUE_UNDERFULL(_atomicQueueSize.get(), _flowResumeCapacity));
 
                    channel.unblock(this);
                    _blockedChannels.remove(channel);
@@ -1353,7 +1353,7 @@
             {
                 if(_overfull.compareAndSet(true,false))
                 {//Underfull log message
-                    _logActor.message(_logSubject, QueueMessages.QUE_1004(_atomicQueueSize.get(), _flowResumeCapacity));
+                    _logActor.message(_logSubject, QueueMessages.QUE_UNDERFULL(_atomicQueueSize.get(), _flowResumeCapacity));
                 }
 
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java Thu Dec  3 16:19:14 2009
@@ -248,7 +248,7 @@
 
 //        _pluginManager.close();
 
-        CurrentActor.get().message(BrokerMessages.BRK_1005());        
+        CurrentActor.get().message(BrokerMessages.BRK_STOPPED());
     }
 
     private void unbind()
@@ -259,7 +259,7 @@
             {
                 QpidAcceptor acceptor = _acceptors.get(bindAddress);
                 acceptor.getNetworkDriver().close();
-                CurrentActor.get().message(BrokerMessages.BRK_1003(acceptor.toString(), bindAddress.getPort()));
+                CurrentActor.get().message(BrokerMessages.BRK_SHUTTING_DOWN(acceptor.toString(), bindAddress.getPort()));
             }
         }
     }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java Thu Dec  3 16:19:14 2009
@@ -59,7 +59,7 @@
         // Set the Actor for current log messages
         CurrentActor.set(new BrokerActor(_registryName, _rootMessageLogger));
 
-        CurrentActor.get().message(BrokerMessages.BRK_1001(QpidProperties.getReleaseVersion(),QpidProperties.getBuildVersion()));
+        CurrentActor.get().message(BrokerMessages.BRK_STARTUP(QpidProperties.getReleaseVersion(),QpidProperties.getBuildVersion()));
 
         initialiseManagedObjectRegistry();
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMessageStore.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/AbstractMessageStore.java Thu Dec  3 16:19:14 2009
@@ -34,11 +34,11 @@
     public void configure(VirtualHost virtualHost) throws Exception
     {
         _logSubject = new MessageStoreLogSubject(virtualHost, this);
-        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_1001(this.getClass().getName()));
+        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_CREATED(this.getClass().getName()));
     }
 
     public void close() throws Exception
     {
-        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_1003());
+        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_CLOSED());
     }
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java Thu Dec  3 16:19:14 2009
@@ -173,7 +173,7 @@
                           Configuration storeConfiguration,
                           LogSubject logSubject) throws Exception
     {
-        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_1001(this.getClass().getName()));
+        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_CREATED(this.getClass().getName()));
 
         if(!_configured)
         {
@@ -231,7 +231,7 @@
             }
         }
 
-        CurrentActor.get().message(logSubject, MessageStoreMessages.MST_1002(environmentPath.getAbsolutePath()));
+        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_STORE_LOCATION(environmentPath.getAbsolutePath()));
 
         createOrOpenDatabase(name, databasePath);
     }
@@ -369,6 +369,7 @@
     {
         stateTransition(State.CONFIGURING, State.RECOVERING);
 
+        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_RECOVERY_START());
 
         try
         {
@@ -380,8 +381,6 @@
             ConfigurationRecoveryHandler.BindingRecoveryHandler brh = erh.completeExchangeRecovery();
             recoverBindings(brh, exchanges);
             brh.completeBindingRecovery();
-
-
         }
         catch (SQLException e)
         {
@@ -408,9 +407,6 @@
             qrh.queue(queueName, owner, null);
 
             queues.add(queueName);
-
-
-
         }
         return queues;
     }
@@ -505,7 +501,7 @@
 
     public void close() throws Exception
     {
-        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_1003());
+        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_CLOSED());
         _closed.getAndSet(true);
     }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java Thu Dec  3 16:19:14 2009
@@ -102,13 +102,13 @@
         }
         int hashtableCapacity = config.getInt(name + "." + HASHTABLE_CAPACITY_CONFIG, DEFAULT_HASHTABLE_CAPACITY);
         _log.info("Using capacity " + hashtableCapacity + " for hash tables");
-        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_1001(this.getClass().getName()));
+        CurrentActor.get().message(_logSubject, MessageStoreMessages.MST_CREATED(this.getClass().getName()));
     }
 
     public void close() throws Exception
     {
         _closed.getAndSet(true);
-        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_1003());
+        CurrentActor.get().message(_logSubject,MessageStoreMessages.MST_CLOSED());
 
     }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java Thu Dec  3 16:19:14 2009
@@ -365,7 +365,7 @@
 
             CurrentActor.get().
                     message(_logSubject,
-                            SubscriptionMessages.SUB_1001(filterLogString,
+                            SubscriptionMessages.SUB_CREATE(filterLogString,
                                                           queue.isDurable() && exclusive,
                                                           filterLogString != null));
         }
@@ -508,7 +508,7 @@
 
 
         //Log Subscription closed
-        CurrentActor.get().message(_logSubject, SubscriptionMessages.SUB_1002());
+        CurrentActor.get().message(_logSubject, SubscriptionMessages.SUB_CLOSE());
     }
 
     public boolean isClosed()
@@ -596,7 +596,7 @@
                 _stateListener.stateChange(this, State.ACTIVE, State.SUSPENDED);
             }
         }
-        CurrentActor.get().message(_logSubject,SubscriptionMessages.SUB_1003(_state.get().toString()));
+        CurrentActor.get().message(_logSubject,SubscriptionMessages.SUB_STATE(_state.get().toString()));
     }
 
     public State getState()

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java Thu Dec  3 16:19:14 2009
@@ -34,6 +34,7 @@
 import org.apache.qpid.server.logging.subjects.MessageStoreLogSubject;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.messages.TransactionLogMessages;
+import org.apache.qpid.server.logging.messages.MessageStoreMessages;
 import org.apache.qpid.server.message.AMQMessage;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.message.MessageTransferMessage;

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java Thu Dec  3 16:19:14 2009
@@ -158,7 +158,7 @@
         _configuration = hostConfig;
         _name = hostConfig.getName();
 
-        CurrentActor.get().message(VirtualHostMessages.VHT_1001(_name));
+        CurrentActor.get().message(VirtualHostMessages.VHT_CREATED(_name));
 
         if (_name == null || _name.length() == 0)
         {
@@ -482,7 +482,7 @@
             _messageStore.close();
         }
 
-        CurrentActor.get().message(VirtualHostMessages.VHT_1002());
+        CurrentActor.get().message(VirtualHostMessages.VHT_CLOSED());
     }
 
     public ManagedObject getBrokerMBean()

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/LogMessageTest.java Thu Dec  3 16:19:14 2009
@@ -29,9 +29,11 @@
 {
 
     /**
-     * Test that the US local is loadable. 
+     * Test that the US local has a loadable bundle.
+     * No longer have a specific en_US bundle so cannot verify that that version
+     * is loaded.
      */
-    public void testUSLocale()
+    public void testBundle()
     {
         Locale usLocal = Locale.US;
         Locale.setDefault(usLocal);
@@ -39,8 +41,6 @@
                                                             usLocal);
 
         assertNotNull("Unable to load ResourceBundle", _messages);
-
-        assertEquals("Loaded bundle has incorrect locale.", usLocal, _messages.getLocale());
     }
 
     /**

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java Thu Dec  3 16:19:14 2009
@@ -20,83 +20,40 @@
  */
 package org.apache.qpid.server.logging.actors;
 
-import junit.framework.TestCase;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.configuration.ServerConfiguration;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.RootMessageLoggerImpl;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.logging.LogMessage;
-import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.AMQChannel;
 
 import java.util.List;
 
 /**
- * Test : AMQPConnectionActorTest
- * Validate the AMQPConnectionActor class.
+ * Test : AMQPChannelActorTest
+ * Validate the AMQPChannelActor class.
  *
  * The test creates a new AMQPActor and then logs a message using it.
  *
  * The test then verifies that the logged message was the only one created and
  * that the message contains the required message.
  */
-public class AMQPChannelActorTest extends TestCase
+public class AMQPChannelActorTest extends BaseConnectionActorTestCase
 {
 
-    LogActor _amqpActor;
-    UnitTestMessageLogger _rawLogger;
-    AMQProtocolSession _session;
     AMQChannel _channel;
 
-    public void setUp() throws Exception, AMQException
+    @Override
+    protected void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException
     {
-        super.setUp();
-        //Highlight that this test will cause a new AR to be created
-        ApplicationRegistry.getInstance();
-
-        Configuration config = new PropertiesConfiguration();
-        ServerConfiguration serverConfig = new ServerConfiguration(config);
-
-        serverConfig.getConfig().setProperty(ServerConfiguration.STATUS_UPDATES, "on");        
-
-        setUpWithConfig(serverConfig);
-    }
-
-    private void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException
-    {
-        _rawLogger = new UnitTestMessageLogger();
-        RootMessageLogger rootLogger =
-                new RootMessageLoggerImpl(serverConfig, _rawLogger);
-
-        VirtualHost virtualHost = ApplicationRegistry.getInstance().
-                    getVirtualHostRegistry().getVirtualHosts().iterator().next();
-
-        // Create a single session for this test.
-        _session = new InternalTestProtocolSession(virtualHost);
-
+        super.setUpWithConfig(serverConfig);
 
         _channel = new AMQChannel(_session, 1, _session.getVirtualHost().getMessageStore());
 
-        _amqpActor = new AMQPChannelActor(_channel, rootLogger);
-
-    }
-
-    public void tearDown() throws Exception
-    {
-        _rawLogger.clearLogMessages();
-        // Correctly Close the AR we created
-        ApplicationRegistry.remove();
-
-        super.tearDown();
+        _amqpActor = new AMQPChannelActor(_channel, _rootLogger);
     }
 
     /**

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java Thu Dec  3 16:19:14 2009
@@ -20,22 +20,13 @@
  */
 package org.apache.qpid.server.logging.actors;
 
-import junit.framework.TestCase;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.configuration.ServerConfiguration;
-import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
-import org.apache.qpid.server.logging.RootMessageLogger;
-import org.apache.qpid.server.logging.RootMessageLoggerImpl;
-import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
 
 import java.util.List;
 
@@ -48,51 +39,8 @@
  * The test then verifies that the logged message was the only one created and
  * that the message contains the required message.
  */
-public class AMQPConnectionActorTest extends TestCase
+public class AMQPConnectionActorTest extends BaseConnectionActorTestCase
 {
-
-    LogActor _amqpActor;
-    UnitTestMessageLogger _rawLogger;
-
-    public void setUp() throws Exception, AMQException
-    {
-        super.setUp();
-        //Highlight that this test will cause a new AR to be created
-        ApplicationRegistry.getInstance();
-
-        Configuration config = new PropertiesConfiguration();
-        ServerConfiguration serverConfig = new ServerConfiguration(config);
-
-        serverConfig.getConfig().setProperty(ServerConfiguration.STATUS_UPDATES, "on");
-
-        setUpWithConfig(serverConfig);
-    }
-
-    public void tearDown() throws Exception
-    {
-        _rawLogger.clearLogMessages();
-
-        // Correctly Close the AR we created
-        ApplicationRegistry.remove();
-
-        super.tearDown();
-    }
-
-    private void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException
-    {
-        _rawLogger = new UnitTestMessageLogger();
-        RootMessageLogger rootLogger =
-                new RootMessageLoggerImpl(serverConfig, _rawLogger);
-
-        VirtualHost virtualHost = ApplicationRegistry.getInstance().
-                getVirtualHostRegistry().getVirtualHosts().iterator().next();
-
-        // Create a single session for this test.
-        AMQProtocolSession session = new InternalTestProtocolSession(virtualHost);
-
-        _amqpActor = new AMQPConnectionActor(session, rootLogger);
-    }
-
     /**
      * Test the AMQPActor logging as a Connection level.
      *
@@ -114,7 +62,7 @@
                    logs.get(0).toString().contains(message));
 
         // Verify that the message has the correct type
-        assertTrue("Message contains the [con: prefix",
+        assertTrue("Message does not contain the [con: prefix",
                    logs.get(0).toString().contains("[con:"));
 
         // Verify that all the values were presented to the MessageFormatter

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java?rev=886842&r1=886841&r2=886842&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java Thu Dec  3 16:19:14 2009
@@ -20,15 +20,11 @@
  */
 package org.apache.qpid.server.logging.actors;
 
-import junit.framework.TestCase;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.AMQChannel;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
 import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
 
 /**
  * Test : CurrentActorTest
@@ -51,38 +47,28 @@
  * is called before one or more threads call get(). This way we can ensure that
  * the remove does not affect more than the Thread it was called in.
  */
-public class CurrentActorTest extends TestCase
+public class CurrentActorTest extends BaseConnectionActorTestCase
 {
     //Set this to be a reasonably large number
     int THREADS = 10;
 
     // Record any exceptions that are thrown by the threads
-    final Exception[] _errors = new Exception[THREADS];
-
-    // Create a single session for this test.
-    AMQProtocolSession _session;
-
-    public void setUp() throws Exception
-    {
-        super.setUp();
-        // Create a single session for this test.
-        VirtualHost virtualHost = ApplicationRegistry.getInstance().
-                getVirtualHostRegistry().getVirtualHosts().iterator().next();
-
-        // Create a single session for this test.
-        _session = new InternalTestProtocolSession(virtualHost);
-    }
-
-
-    @Override
-    public void tearDown() throws Exception
-    {
-        // Correctly Close the AR we created
-        ApplicationRegistry.remove();
-        super.tearDown();
-    }
-
+    Exception[] _errors = new Exception[THREADS];
 
+    /**
+     * Test that CurrentActor behaves as LIFO queue.
+     *
+     * Test creates two Actors Connection and Channel and then sets the
+     * CurrentActor.
+     *
+     * The test validates that CurrentActor remembers the Connection actor
+     * after the Channel actor has been removed.
+     *
+     * And then finally validates that removing the Connection actor results
+     * in there being no actors set.
+     *
+     * @throws AMQException
+     */
     public void testLIFO() throws AMQException
     {
         // Create a new actor using retrieving the rootMessageLogger from
@@ -92,6 +78,12 @@
                                                                       ApplicationRegistry.getInstance().
                                                                               getRootMessageLogger());
 
+        /*
+         * Push the actor on to the stack:
+         *
+         *  CurrentActor -> Connection
+         *       Stack   -> null
+         */
         CurrentActor.set(connectionActor);
 
         //Use the Actor to send a simple message
@@ -115,8 +107,12 @@
                      connectionActor, CurrentActor.get());
 
         /**
-         * Set the actor to nwo be the Channel actor so testing the ability
-         * to push the actor on to the stack
+         * Set the actor to now be the Channel actor so testing the ability
+         * to push the actor on to the stack:
+         *
+         *  CurrentActor -> Channel
+         *       Stack   -> Connection, null
+         *
          */
 
         AMQChannel channel = new AMQChannel(_session, 1, _session.getVirtualHost().getMessageStore());
@@ -149,6 +145,13 @@
 
         // Remove the ChannelActor from the stack
         CurrentActor.remove();
+        /*
+         * Pop the actor on to the stack:
+         *
+         *  CurrentActor -> Connection
+         *       Stack   -> null
+         */
+
 
         // Verify we now have the same connection actor as we set earlier
         assertEquals("Retrieved actor is not as expected ",
@@ -157,18 +160,44 @@
         // Verify that removing the our last actor it returns us to the test
         // default that the ApplicationRegistry sets.
         CurrentActor.remove();
+        /*
+         * Pop the actor on to the stack:
+         *
+         *  CurrentActor -> null
+         */
+
 
         assertEquals("CurrentActor not the Test default", TestLogActor.class ,CurrentActor.get().getClass());
     }
 
+    /**
+     * Test the setting CurrentActor is done correctly as a ThreadLocal.
+     *
+     * The test starts 'THREADS' threads that all set the CurrentActor log
+     * a message then remove the actor.
+     *
+     * Checks are done to ensure that there is no set actor after the remove.
+     *
+     * If the ThreadLoacl was not working then having concurrent actor sets
+     * would result in more than one actor and so the remove will not result
+     * in the clearing of the CurrentActor
+     *
+     */
     public void testThreadLocal()
     {
 
+        new Runnable(){
+            public void run()
+            {
+                System.out.println(_errors[0]);
+            }
+        };
+
         // Setup the threads
         Thread[] threads = new Thread[THREADS];
         for (int count = 0; count < THREADS; count++)
         {
-            Runnable test = new Test(count);
+            Runnable test = new LogMessagesWithAConnectionActor(count);
             threads[count] = new Thread(test);
         }
 
@@ -202,11 +231,15 @@
         }
     }
 
-    public class Test implements Runnable
+    /**
+     * Creates a new ConnectionActor and logs the given number of messages
+     * before removing the actor and validating that there is no set actor.
+     */
+    public class LogMessagesWithAConnectionActor implements Runnable
     {
         int count;
 
-        Test(int count)
+        LogMessagesWithAConnectionActor(int count)
         {
             this.count = count;
         }



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


Mime
View raw message