qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1575547 - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/ broker-core/src/main/java/org/apache/qpid/server/logging/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/main/java/org/apache/qp...
Date Sat, 08 Mar 2014 14:36:07 GMT
Author: rgodfrey
Date: Sat Mar  8 14:36:06 2014
New Revision: 1575547

URL: http://svn.apache.org/r1575547
Log:
QPID-5611 : Fix other logging to always use the most current event logger held at the broker

Added:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/EventLoggerProvider.java
Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AbstractConfiguration.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/PlainConfiguration.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactory.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactoryTest.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporter.java
    qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporterTest.java
    qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
    qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporter.java
    qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporterTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/TransactionTimeoutHelper.java Sat Mar  8 14:36:06 2014
@@ -19,6 +19,7 @@
 package org.apache.qpid.server;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.logging.messages.ChannelMessages;
@@ -32,15 +33,15 @@ public class TransactionTimeoutHelper
     private final LogSubject _logSubject;
 
     private final CloseAction _closeAction;
-    private final EventLogger _eventLogger;
+    private final EventLoggerProvider _eventLoggerProvider;
 
     public TransactionTimeoutHelper(final LogSubject logSubject,
                                     final CloseAction closeAction,
-                                    final EventLogger eventLogger)
+                                    final EventLoggerProvider eventLoggerProvider)
     {
         _logSubject = logSubject;
         _closeAction = closeAction;
-        _eventLogger = eventLogger;
+        _eventLoggerProvider = eventLoggerProvider;
     }
 
     public void checkIdleOrOpenTimes(ServerTransaction transaction, long openWarn, long openClose, long idleWarn, long idleClose)
@@ -76,7 +77,7 @@ public class TransactionTimeoutHelper
     {
         if (isTimedOut(timeSoFar, warnTimeout))
         {
-            _eventLogger.message(_logSubject, warnMessage);
+            getEventLogger().message(_logSubject, warnMessage);
         }
 
         if(isTimedOut(timeSoFar, closeTimeout))
@@ -100,4 +101,9 @@ public class TransactionTimeoutHelper
         void doTimeoutAction(String reason);
     }
 
+    public EventLogger getEventLogger()
+    {
+        return _eventLoggerProvider.getEventLogger();
+    }
+
 }

Added: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/EventLoggerProvider.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/EventLoggerProvider.java?rev=1575547&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/EventLoggerProvider.java (added)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/EventLoggerProvider.java Sat Mar  8 14:36:06 2014
@@ -0,0 +1,26 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.logging;
+
+public interface EventLoggerProvider
+{
+    public EventLogger getEventLogger();
+}

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java Sat Mar  8 14:36:06 2014
@@ -24,6 +24,7 @@ import java.net.SocketAddress;
 import java.util.Collection;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.LogRecorder;
 import org.apache.qpid.server.logging.MessageLogger;
 import org.apache.qpid.server.configuration.updater.TaskExecutor;
@@ -32,7 +33,7 @@ import org.apache.qpid.server.security.S
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 
 @ManagedObject
-public interface Broker<X extends Broker<X>> extends ConfiguredObject<X>
+public interface Broker<X extends Broker<X>> extends ConfiguredObject<X>, EventLoggerProvider
 {
 
     String BUILD_VERSION = "buildVersion";

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AccessControlProviderFactory.java Sat Mar  8 14:36:06 2014
@@ -73,7 +73,7 @@ public class AccessControlProviderFactor
     {
         for (AccessControlFactory factory : _factories)
         {
-            AccessControl accessControl = factory.createInstance(attributes, broker.getEventLogger());
+            AccessControl accessControl = factory.createInstance(attributes, broker);
             if (accessControl != null)
             {
                 return new AccessControlProviderAdapter(id, broker,accessControl, attributes, factory.getAttributeNames());

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/AccessControlFactory.java Sat Mar  8 14:36:06 2014
@@ -22,6 +22,7 @@ import java.util.Collection;
 import java.util.Map;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.model.AccessControlProvider;
 import org.apache.qpid.server.security.AccessControl;
 
@@ -29,7 +30,7 @@ public interface AccessControlFactory ex
 {
     public static final String ATTRIBUTE_TYPE = AccessControlProvider.TYPE;
 
-    AccessControl createInstance(Map<String, Object> attributes, final EventLogger eventLogger);
+    AccessControl createInstance(Map<String, Object> attributes, final EventLoggerProvider eventLogger);
 
     /**
      * Returns the access control provider type

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/SecurityManager.java Sat Mar  8 14:36:06 2014
@@ -144,7 +144,7 @@ public class SecurityManager implements 
 
             for (AccessControlFactory provider : (new QpidServiceLoader<AccessControlFactory>()).instancesOf(AccessControlFactory.class))
             {
-                AccessControl accessControl = provider.createInstance(attributes, _broker.getEventLogger());
+                AccessControl accessControl = provider.createInstance(attributes, _broker);
                 accessControl.open();
                 if(accessControl != null)
                 {

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Sat Mar  8 14:36:06 2014
@@ -32,6 +32,7 @@ import org.apache.qpid.server.configurat
 import org.apache.qpid.server.connection.IConnectionRegistry;
 import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.plugin.ExchangeType;
@@ -43,7 +44,8 @@ import org.apache.qpid.server.store.Dura
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.txn.DtxRegistry;
 
-public interface VirtualHost extends DurableConfigurationStore.Source, Closeable, StatisticsGatherer
+public interface VirtualHost extends DurableConfigurationStore.Source, Closeable, StatisticsGatherer,
+                                     EventLoggerProvider
 {
     IConnectionRegistry getConnectionRegistry();
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/TransactionTimeoutHelperTest.java Sat Mar  8 14:36:06 2014
@@ -32,6 +32,7 @@ import static org.mockito.Mockito.when;
 
 import org.apache.qpid.server.TransactionTimeoutHelper.CloseAction;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.logging.MessageLogger;
@@ -155,8 +156,9 @@ public class TransactionTimeoutHelperTes
         when(_rootLogger.isEnabled()).thenReturn(true);
         when(_rootLogger.isMessageEnabled(anyString())).thenReturn(true);
         EventLogger eventLogger = new EventLogger(_rootLogger);
-
-        _transactionTimeoutHelper = new TransactionTimeoutHelper(_logSubject, _closeAction, eventLogger);
+        EventLoggerProvider eventLoggerProvider = mock(EventLoggerProvider.class);
+        when(eventLoggerProvider.getEventLogger()).thenReturn(eventLogger);
+        _transactionTimeoutHelper = new TransactionTimeoutHelper(_logSubject, _closeAction, eventLoggerProvider);
         _now = System.currentTimeMillis();
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AbstractConfiguration.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AbstractConfiguration.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AbstractConfiguration.java Sat Mar  8 14:36:06 2014
@@ -21,6 +21,7 @@
 package org.apache.qpid.server.security.access.config;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 
 import java.io.File;
 
@@ -28,9 +29,9 @@ public abstract class AbstractConfigurat
 {
     private File _file;
     private RuleSet _config;
-    private final EventLogger _eventLogger;
+    private final EventLoggerProvider _eventLogger;
 
-    public AbstractConfiguration(File file, final EventLogger eventLogger)
+    public AbstractConfiguration(File file, final EventLoggerProvider eventLogger)
     {
         _file = file;
         _eventLogger = eventLogger;

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/PlainConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/PlainConfiguration.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/PlainConfiguration.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/PlainConfiguration.java Sat Mar  8 14:36:06 2014
@@ -36,6 +36,7 @@ import org.apache.commons.lang.StringUti
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.security.access.ObjectType;
 import org.apache.qpid.server.security.access.Operation;
 import org.apache.qpid.server.security.access.Permission;
@@ -68,7 +69,7 @@ public class PlainConfiguration extends 
 
     private StreamTokenizer _st;
 
-    public PlainConfiguration(File file, final EventLogger eventLogger)
+    public PlainConfiguration(File file, final EventLoggerProvider eventLogger)
     {
         super(file, eventLogger);
     }

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/RuleSet.java Sat Mar  8 14:36:06 2014
@@ -39,6 +39,7 @@ import org.apache.commons.lang.BooleanUt
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.messages.AccessControlMessages;
 import org.apache.qpid.server.security.Result;
 import org.apache.qpid.server.security.access.ObjectProperties;
@@ -52,7 +53,7 @@ import org.apache.qpid.server.security.a
  * The access control rule definitions are loaded from an external configuration file, passed in as the
  * target to the {@link load(ConfigurationFile)} method. The file specified
  */
-public class RuleSet
+public class RuleSet implements EventLoggerProvider
 {
     private static final Logger _logger = Logger.getLogger(RuleSet.class);
 
@@ -70,9 +71,9 @@ public class RuleSet
     private final Map<Subject, Map<Operation, Map<ObjectType, List<Rule>>>> _cache =
                         new WeakHashMap<Subject, Map<Operation, Map<ObjectType, List<Rule>>>>();
     private final Map<String, Boolean> _config = new HashMap<String, Boolean>();
-    private final EventLogger _eventLogger;
+    private final EventLoggerProvider _eventLogger;
 
-    public RuleSet(EventLogger eventLogger)
+    public RuleSet(EventLoggerProvider eventLogger)
     {
         _eventLogger = eventLogger;
         // set some default configuration properties
@@ -323,14 +324,14 @@ public class RuleSet
                 switch (permission)
                 {
                     case ALLOW_LOG:
-                        _eventLogger.message(AccessControlMessages.ALLOWED(
+                        getEventLogger().message(AccessControlMessages.ALLOWED(
                                 action.getOperation().toString(),
                                 action.getObjectType().toString(),
                                 action.getProperties().toString()));
                     case ALLOW:
                         return Result.ALLOWED;
                     case DENY_LOG:
-                        _eventLogger.message(AccessControlMessages.DENIED(
+                        getEventLogger().message(AccessControlMessages.DENIED(
                                 action.getOperation().toString(),
                                 action.getObjectType().toString(),
                                 action.getProperties().toString()));
@@ -442,6 +443,6 @@ public class RuleSet
 
     public EventLogger getEventLogger()
     {
-        return _eventLogger;
+        return _eventLogger.getEventLogger();
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java Sat Mar  8 14:36:06 2014
@@ -35,6 +35,7 @@ import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.connection.ConnectionPrincipal;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.security.Result;
 import org.apache.qpid.server.security.AccessControl;
 import org.apache.qpid.server.security.access.ObjectProperties;
@@ -50,9 +51,9 @@ public class DefaultAccessControl implem
 
     private RuleSet _ruleSet;
     private File _aclFile;
-    private final EventLogger _eventLogger;
+    private final EventLoggerProvider _eventLogger;
 
-    public DefaultAccessControl(String fileName, final EventLogger eventLogger)
+    public DefaultAccessControl(String fileName, final EventLoggerProvider eventLogger)
     {
         _eventLogger = eventLogger;
         if (_logger.isDebugEnabled())
@@ -66,7 +67,7 @@ public class DefaultAccessControl implem
     DefaultAccessControl(RuleSet rs) throws ConfigurationException
     {
         _ruleSet = rs;
-        _eventLogger = rs.getEventLogger();
+        _eventLogger = rs;
     }
 
     public void open()

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactory.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactory.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactory.java Sat Mar  8 14:36:06 2014
@@ -31,6 +31,7 @@ import java.util.Map;
 
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.plugin.AccessControlFactory;
 import org.apache.qpid.server.security.AccessControl;
 import org.apache.qpid.server.util.ResourceBundleLoader;
@@ -44,7 +45,7 @@ public class DefaultAccessControlFactory
             PATH
             ));
 
-    public AccessControl createInstance(Map<String, Object> attributes, final EventLogger eventLogger)
+    public AccessControl createInstance(Map<String, Object> attributes, final EventLoggerProvider eventLogger)
     {
         if(attributes == null || !ACL_FILE_PROVIDER_TYPE.equals(attributes.get(ATTRIBUTE_TYPE)))
         {

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java Sat Mar  8 14:36:06 2014
@@ -28,6 +28,7 @@ import junit.framework.TestCase;
 
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.security.access.ObjectProperties;
 import org.apache.qpid.server.security.access.ObjectProperties.Property;
 import org.apache.qpid.server.security.access.ObjectType;
@@ -57,7 +58,7 @@ public class PlainConfigurationTest exte
         aclWriter.close();
 
         // Load ruleset
-        PlainConfiguration configFile = new PlainConfiguration(acl, new EventLogger());
+        PlainConfiguration configFile = new PlainConfiguration(acl, mock(EventLoggerProvider.class));
         configFile.load();
         return configFile;
     }
@@ -67,7 +68,7 @@ public class PlainConfigurationTest exte
         try
         {
             // Load ruleset
-            ConfigurationFile configFile = new PlainConfiguration(new File("doesnotexist"), new EventLogger());
+            ConfigurationFile configFile = new PlainConfiguration(new File("doesnotexist"), mock(EventLoggerProvider.class));
             configFile.load();
 
             fail("fail");

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactoryTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactoryTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlFactoryTest.java Sat Mar  8 14:36:06 2014
@@ -27,6 +27,7 @@ import java.util.regex.Pattern;
 
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.model.GroupProvider;
 import org.apache.qpid.server.security.AccessControl;
 import org.apache.qpid.server.security.access.FileAccessControlProviderConstants;
@@ -41,7 +42,7 @@ public class DefaultAccessControlFactory
     {
         DefaultAccessControlFactory factory = new DefaultAccessControlFactory();
         Map<String, Object> attributes = new HashMap<String, Object>();
-        AccessControl acl = factory.createInstance(attributes, new EventLogger());
+        AccessControl acl = factory.createInstance(attributes, mock(EventLoggerProvider.class));
         assertNull("ACL was created without a configuration file", acl);
     }
 
@@ -52,7 +53,7 @@ public class DefaultAccessControlFactory
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(GroupProvider.TYPE, FileAccessControlProviderConstants.ACL_FILE_PROVIDER_TYPE);
         attributes.put(FileAccessControlProviderConstants.PATH, aclFile.getAbsolutePath());
-        AccessControl acl = factory.createInstance(attributes, new EventLogger());
+        AccessControl acl = factory.createInstance(attributes, mock(EventLoggerProvider.class));
         acl.open();
 
         assertNotNull("ACL was not created from acl file: " + aclFile.getAbsolutePath(), acl);
@@ -68,7 +69,7 @@ public class DefaultAccessControlFactory
         attributes.put(FileAccessControlProviderConstants.PATH, aclFile.getAbsolutePath());
         try
         {
-            AccessControl control = factory.createInstance(attributes, new EventLogger());
+            AccessControl control = factory.createInstance(attributes, mock(EventLoggerProvider.class));
             control.open();
             fail("It should not be possible to create and initialise ACL with non existing file");
         }

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java Sat Mar  8 14:36:06 2014
@@ -34,6 +34,7 @@ import junit.framework.TestCase;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.connection.ConnectionPrincipal;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.UnitTestMessageLogger;
 import org.apache.qpid.server.protocol.AMQConnectionModel;
 import org.apache.qpid.server.security.Result;
@@ -79,7 +80,9 @@ public class DefaultAccessControlTest ex
 
     private RuleSet createGroupRuleSet()
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final EventLoggerProvider provider = mock(EventLoggerProvider.class);
+        when(provider.getEventLogger()).thenReturn(_eventLogger);
+        final RuleSet rs = new RuleSet(provider);
 
         // Rule expressed with username
         rs.grant(0, "user1", Permission.ALLOW, Operation.ACCESS, ObjectType.VIRTUALHOST, ObjectProperties.EMPTY);
@@ -176,7 +179,7 @@ public class DefaultAccessControlTest ex
      */
     public void testAuthoriseAccessMethodWhenAllAccessOperationsAllowedOnAllComponents() throws ConfigurationException
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class));
 
         // grant user4 access right on any method in any component
         rs.grant(1, "user4", Permission.ALLOW, Operation.ACCESS, ObjectType.METHOD, new ObjectProperties(ObjectProperties.STAR));
@@ -202,7 +205,7 @@ public class DefaultAccessControlTest ex
      */
     public void testAuthoriseAccessMethodWhenAllAccessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class));
 
         // grant user5 access right on any methods in "Test" component
         ObjectProperties ruleProperties = new ObjectProperties(ObjectProperties.STAR);
@@ -302,7 +305,7 @@ public class DefaultAccessControlTest ex
      */
     public void testAuthoriseAccessMethodWhenSpecifiedAccessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class));
 
         // grant user6 access right on "getAttribute" method in "Test" component
         ObjectProperties ruleProperties = new ObjectProperties("getAttribute");
@@ -339,7 +342,7 @@ public class DefaultAccessControlTest ex
      */
     public void testAuthoriseAccessUpdateMethodWhenAllRightsGrantedOnSpecifiedMethodForAllComponents() throws ConfigurationException
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class));
 
         // grant user8 all rights on method queryNames in all component
         rs.grant(1, "user8", Permission.ALLOW, Operation.ALL, ObjectType.METHOD, new ObjectProperties("queryNames"));
@@ -378,7 +381,7 @@ public class DefaultAccessControlTest ex
      */
     public void testAuthoriseAccessUpdateMethodWhenAllRightsGrantedOnAllMethodsInAllComponents() throws ConfigurationException
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class));
 
         // grant user9 all rights on any method in all component
         rs.grant(1, "user9", Permission.ALLOW, Operation.ALL, ObjectType.METHOD, new ObjectProperties());
@@ -416,7 +419,7 @@ public class DefaultAccessControlTest ex
      */
     public void testAuthoriseAccessMethodWhenMatchingAccessOperationsAllowedOnSpecifiedComponent() throws ConfigurationException
     {
-        final RuleSet rs = new RuleSet(_eventLogger);
+        final RuleSet rs = new RuleSet(mock(EventLoggerProvider.class));
 
         // grant user9 all rights on "getAttribute*" methods in Test component
         ObjectProperties ruleProperties = new ObjectProperties();

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/RuleSetTest.java Sat Mar  8 14:36:06 2014
@@ -26,6 +26,7 @@ import java.security.Principal;
 import javax.security.auth.Subject;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.security.Result;
 import org.apache.qpid.server.security.access.ObjectProperties;
 import org.apache.qpid.server.security.access.ObjectType;
@@ -65,7 +66,7 @@ public class RuleSetTest extends QpidTes
     {
         super.setUp();
 
-        _ruleSet = new RuleSet(new EventLogger());
+        _ruleSet = new RuleSet(mock(EventLoggerProvider.class));
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerConnection.java Sat Mar  8 14:36:06 2014
@@ -61,7 +61,8 @@ import static org.apache.qpid.server.log
 public class ServerConnection extends Connection implements AMQConnectionModel<ServerConnection, ServerSession>,
                                                             LogSubject, AuthorizationHolder
 {
-    private final EventLogger _eventLogger;
+
+    private final Broker _broker;
     private Runnable _onOpenTask;
     private AtomicBoolean _logClosed = new AtomicBoolean(false);
 
@@ -85,7 +86,7 @@ public class ServerConnection extends Co
     {
         _connectionId = connectionId;
         _authorizedSubject.getPrincipals().add(new ConnectionPrincipal(this));
-        _eventLogger = broker.getEventLogger();
+        _broker = broker;
     }
 
     public Object getReference()
@@ -101,7 +102,7 @@ public class ServerConnection extends Co
 
     EventLogger getEventLogger()
     {
-        return _virtualHost == null ? _eventLogger : _virtualHost.getEventLogger();
+        return _virtualHost == null ? _broker.getEventLogger() : _virtualHost.getEventLogger();
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSession.java Sat Mar  8 14:36:06 2014
@@ -156,7 +156,7 @@ public class ServerSession extends Sessi
             {
                 getConnectionModel().closeSession(ServerSession.this, AMQConstant.RESOURCE_ERROR, reason);
             }
-        }, getVirtualHost().getEventLogger());
+        }, getVirtualHost());
     }
 
     protected void setState(final State state)

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java Sat Mar  8 14:36:06 2014
@@ -208,7 +208,7 @@ public class AMQChannel<T extends AMQPro
                     throw new ConnectionScopedRuntimeException(e);
                 }
             }
-        }, getVirtualHost().getEventLogger());
+        }, getVirtualHost());
 
         Subject.doAs(_subject, new PrivilegedAction<Object>()
         {

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java Sat Mar  8 14:36:06 2014
@@ -92,7 +92,6 @@ public class AMQProtocolEngine implement
     private static final int CHANNEL_CACHE_SIZE = 0xff;
     private static final int REUSABLE_BYTE_BUFFER_CAPACITY = 65 * 1024;
     private final Port _port;
-    private EventLogger _eventLogger;
 
     private AMQShortString _contextKey;
 
@@ -178,7 +177,6 @@ public class AMQProtocolEngine implement
         _broker = broker;
         _port = port;
         _transport = transport;
-        _eventLogger = broker.getEventLogger();
         _maxNoOfChannels = (Integer)broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT);
         _receivedLock = new ReentrantLock();
         _stateManager = new AMQStateManager(broker, this);
@@ -1576,7 +1574,7 @@ public class AMQProtocolEngine implement
         }
         else
         {
-            return _eventLogger;
+            return _broker.getEventLogger();
         }
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagementUtil.java Sat Mar  8 14:36:06 2014
@@ -137,7 +137,7 @@ public class HttpManagementUtil
 
         // Cause the user logon to be logged.
         session.setAttribute(ATTR_LOGIN_LOGOUT_REPORTER,
-                             new LoginLogoutReporter(subject, getBroker(session.getServletContext()).getEventLogger()));
+                             new LoginLogoutReporter(subject, getBroker(session.getServletContext())));
     }
 
     public static Subject tryToAuthenticate(HttpServletRequest request, HttpManagementConfiguration managementConfig)

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporter.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporter.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporter.java Sat Mar  8 14:36:06 2014
@@ -29,6 +29,7 @@ import javax.servlet.http.HttpSessionBin
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.messages.ManagementConsoleMessages;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
 
@@ -42,14 +43,14 @@ public class LoginLogoutReporter impleme
     private static final Logger LOGGER = Logger.getLogger(LoginLogoutReporter.class);
     private final Subject _subject;
     private final Principal _principal;
-    private final EventLogger _eventLogger;
+    private final EventLoggerProvider _eventLoggerProvider;
 
-    public LoginLogoutReporter(Subject subject, EventLogger eventLogger)
+    public LoginLogoutReporter(Subject subject, EventLoggerProvider eventLoggerProvider)
     {
         super();
         _subject = subject;
         _principal = AuthenticatedPrincipal.getAuthenticatedPrincipalFromSubject(_subject);
-        _eventLogger = eventLogger;
+        _eventLoggerProvider = eventLoggerProvider;
     }
 
     @Override
@@ -76,7 +77,7 @@ public class LoginLogoutReporter impleme
             @Override
             public Void run()
             {
-                _eventLogger.message(ManagementConsoleMessages.OPEN(_principal.getName()));
+                getEventLogger().message(ManagementConsoleMessages.OPEN(_principal.getName()));
                 return null;
             }
         });
@@ -94,10 +95,14 @@ public class LoginLogoutReporter impleme
             @Override
             public Void run()
             {
-                _eventLogger.message(ManagementConsoleMessages.CLOSE(_principal.getName()));
+                getEventLogger().message(ManagementConsoleMessages.CLOSE(_principal.getName()));
                 return null;
             }
         });
     }
 
+    public EventLogger getEventLogger()
+    {
+        return _eventLoggerProvider.getEventLogger();
+    }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporterTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporterTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporterTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/session/LoginLogoutReporterTest.java Sat Mar  8 14:36:06 2014
@@ -29,6 +29,7 @@ import static org.mockito.Mockito.when;
 import javax.security.auth.Subject;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.MessageLogger;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
@@ -51,7 +52,9 @@ public class LoginLogoutReporterTest ext
         when(_logger.isEnabled()).thenReturn(true);
         when(_logger.isMessageEnabled(anyString())).thenReturn(true);
         EventLogger eventLogger = new EventLogger(_logger);
-        _loginLogoutReport = new LoginLogoutReporter(_subject, eventLogger);
+        EventLoggerProvider provider = mock(EventLoggerProvider.class);
+        when(provider.getEventLogger()).thenReturn(eventLogger);
+        _loginLogoutReport = new LoginLogoutReporter(_subject, provider);
     }
 
     public void testLoginLogged()

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java Sat Mar  8 14:36:06 2014
@@ -244,7 +244,7 @@ public class JMXManagedObjectRegistry im
         _cs.setMBeanServerForwarder(mbsf);
 
         // Install a ManagementLogonLogoffReporter so we can report as users logon/logoff
-        ManagementLogonLogoffReporter jmxManagementUserLogonLogoffReporter = new ManagementLogonLogoffReporter(_broker.getEventLogger(), usernameCachingRmiServer);
+        ManagementLogonLogoffReporter jmxManagementUserLogonLogoffReporter = new ManagementLogonLogoffReporter(_broker, usernameCachingRmiServer);
         _cs.addNotificationListener(jmxManagementUserLogonLogoffReporter, jmxManagementUserLogonLogoffReporter, null);
 
         // Install the usernameCachingRmiServer as a listener so it may cleanup as clients disconnect

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporter.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporter.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporter.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporter.java Sat Mar  8 14:36:06 2014
@@ -31,6 +31,7 @@ import javax.security.auth.Subject;
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.messages.ManagementConsoleMessages;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
 import org.apache.qpid.server.security.auth.jmx.JMXConnectionPrincipal;
@@ -42,12 +43,12 @@ import java.security.PrivilegedAction;
 public class ManagementLogonLogoffReporter implements  NotificationListener, NotificationFilter
 {
     private static final Logger LOGGER = Logger.getLogger(ManagementLogonLogoffReporter.class);
-    private final EventLogger _eventLogger;
+    private final EventLoggerProvider _eventLoggerProvider;
     private final UsernameAccessor _usernameAccessor;
 
-    public ManagementLogonLogoffReporter(EventLogger eventLogger, UsernameAccessor usernameAccessor)
+    public ManagementLogonLogoffReporter(EventLoggerProvider eventLoggerProvider, UsernameAccessor usernameAccessor)
     {
-        _eventLogger = eventLogger;
+        _eventLoggerProvider = eventLoggerProvider;
         _usernameAccessor = usernameAccessor;
     }
 
@@ -109,12 +110,12 @@ public class ManagementLogonLogoffReport
             {
                 if (JMXConnectionNotification.OPENED.equals(type))
                 {
-                    _eventLogger.message(ManagementConsoleMessages.OPEN(username));
+                    getEventLogger().message(ManagementConsoleMessages.OPEN(username));
                 }
                 else if (JMXConnectionNotification.CLOSED.equals(type) ||
                          JMXConnectionNotification.FAILED.equals(type))
                 {
-                    _eventLogger.message(ManagementConsoleMessages.CLOSE(username));
+                    getEventLogger().message(ManagementConsoleMessages.CLOSE(username));
                 }
                 return null;
             }
@@ -133,4 +134,8 @@ public class ManagementLogonLogoffReport
         return CLOSED.equals(type) || FAILED.equals(type) || OPENED.equals(type);
     }
 
+    public EventLogger getEventLogger()
+    {
+        return _eventLoggerProvider.getEventLogger();
+    }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporterTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporterTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporterTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/server/jmx/ManagementLogonLogoffReporterTest.java Sat Mar  8 14:36:06 2014
@@ -34,6 +34,7 @@ import javax.management.remote.JMXConnec
 import javax.security.auth.Subject;
 
 import org.apache.qpid.server.logging.EventLogger;
+import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.logging.LogMessage;
 import org.apache.qpid.server.logging.MessageLogger;
 
@@ -61,7 +62,9 @@ public class ManagementLogonLogoffReport
         // Enable messaging so we can valid the generated strings
         when(_messageLogger.isMessageEnabled(anyString())).thenReturn(true);
         EventLogger eventLogger = new EventLogger(_messageLogger);
-        _reporter = new ManagementLogonLogoffReporter(eventLogger, _usernameAccessor);
+        EventLoggerProvider provider = mock(EventLoggerProvider.class);
+        when(provider.getEventLogger()).thenReturn(eventLogger);
+        _reporter = new ManagementLogonLogoffReporter(provider, _usernameAccessor);
     }
 
     public void testOpenedNotification()

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java?rev=1575547&r1=1575546&r2=1575547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java Sat Mar  8 14:36:06 2014
@@ -69,7 +69,7 @@ public class VirtualHostLoggingTest exte
         {
             List<String> vhosts = Arrays.asList("test");
 
-            assertEquals("Each vhost did not create a store.", 2*vhosts.size(), results.size());
+            assertEquals("Each vhost did not create a store.", vhosts.size(), results.size());
 
             for (int index = 0; index < results.size(); index++)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message