You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2009/10/05 13:11:14 UTC

svn commit: r821755 [2/3] - in /qpid/branches/java-broker-0-10/qpid/java: ./ broker/ broker/bin/ broker/etc/ 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/...

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription_0_10.java Mon Oct  5 11:11:05 2009
@@ -29,6 +29,12 @@
 import org.apache.qpid.server.flow.WindowCreditManager;
 import org.apache.qpid.server.flow.FlowCreditManager_0_10;
 import org.apache.qpid.server.filter.FilterManager;
+import org.apache.qpid.server.logging.actors.CurrentActor;
+import org.apache.qpid.server.logging.actors.SubscriptionActor;
+import org.apache.qpid.server.logging.messages.SubscriptionMessages;
+import org.apache.qpid.server.logging.subjects.SubscriptionLogSubject;
+import org.apache.qpid.server.logging.LogSubject;
+import org.apache.qpid.server.logging.LogActor;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.message.MessageTransferMessage;
 import org.apache.qpid.server.transport.ServerSession;
@@ -83,6 +89,9 @@
     private ConcurrentHashMap<Integer, QueueEntry> _sentMap = new ConcurrentHashMap<Integer, QueueEntry>();
     private static final Struct[] EMPTY_STRUCT_ARRAY = new Struct[0];
 
+    private LogSubject _logSubject;
+    private LogActor _logActor;
+
 
     public Subscription_0_10(ServerSession session, String destination, MessageAcceptMode acceptMode,
                              MessageAcquireMode acquireMode,
@@ -100,6 +109,9 @@
         _creditManager.addStateListener(this);
         _state.set(_creditManager.hasCredit() ? State.ACTIVE : State.SUSPENDED);
 
+        _logSubject = new SubscriptionLogSubject(this);
+        _logActor = new SubscriptionActor(CurrentActor.get().getRootMessageLogger(), this);
+
     }
 
     public AMQQueue getQueue()
@@ -112,7 +124,7 @@
         return _owningState;
     }
 
-    public void setQueue(AMQQueue queue)
+    public void setQueue(AMQQueue queue, boolean exclusive)
     {
         if(getQueue() != null)
         {
@@ -581,4 +593,10 @@
         return _subscriptionID;
     }
 
+    public LogActor getLogActor()
+    {
+        return _logActor;
+    }
+
+
 }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java Mon Oct  5 11:11:05 2009
@@ -33,6 +33,7 @@
 {
     private QueueRegistry _queueRegistry;
     private ExchangeRegistry _exchangeRegistry;
+    private VirtualHost _vHost;
 
     public void testExchangeOperations() throws Exception
     {
@@ -44,9 +45,8 @@
         assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange2)) == null);
         assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange3)) == null);
 
-        VirtualHost vHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
 
-        ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) vHost.getManagedObject());
+        ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) _vHost.getManagedObject());
         mbean.createNewExchange(exchange1, "direct", false);
         mbean.createNewExchange(exchange2, "topic", false);
         mbean.createNewExchange(exchange3, "headers", false);
@@ -67,9 +67,8 @@
     public void testQueueOperations() throws Exception
     {
         String queueName = "testQueue_" + System.currentTimeMillis();
-        VirtualHost vHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
 
-        ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) vHost.getManagedObject());
+        ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) _vHost.getManagedObject());
 
         assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) == null);
 
@@ -85,7 +84,15 @@
     {
         super.setUp();
         IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-        _queueRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getQueueRegistry();
-        _exchangeRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getExchangeRegistry();
+        _vHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test");
+        _queueRegistry = _vHost.getQueueRegistry();
+        _exchangeRegistry = _vHost.getExchangeRegistry();
+    }
+
+    @Override
+    protected void tearDown() throws Exception
+    {
+        //Ensure we close the opened Registry
+        ApplicationRegistry.remove();
     }
 }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java Mon Oct  5 11:11:05 2009
@@ -62,7 +62,7 @@
 
     UnacknowledgedMessageMapImpl _unacknowledgedMessageMap;
     private static final int INITIAL_MSG_COUNT = 10;
-    private AMQQueue _queue = new MockAMQQueue();
+    private AMQQueue _queue = new MockAMQQueue(getName());
     private LinkedList<QueueEntry> _referenceList = new LinkedList<QueueEntry>();
 
     @Override

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java Mon Oct  5 11:11:05 2009
@@ -28,6 +28,7 @@
 import org.apache.qpid.framing.ContentHeaderBody;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.RequiredDeliveryException;
+import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.queue.AMQMessage;
@@ -53,6 +54,10 @@
     {
         super.setUp();
 
+
+        // Highlight that this test will cause the creation of an AR
+        ApplicationRegistry.getInstance();
+
         //ack only 5th msg
         individual = new Scenario(10, Arrays.asList(5l), Arrays.asList(1l, 2l, 3l, 4l, 6l, 7l, 8l, 9l, 10l));
         individual.update(5, false);
@@ -77,6 +82,10 @@
     	individual.stop();
     	multiple.stop();
     	combined.stop();
+
+        // Ensure we close the AR we created
+        ApplicationRegistry.remove();
+        super.tearDown();
     }
 
     public void testPrepare() throws AMQException
@@ -121,10 +130,8 @@
                                                                           new LinkedList<RequiredDeliveryException>()
             );
 
-            PropertiesConfiguration env = new PropertiesConfiguration();
-            env.setProperty("name", "test");
-            VirtualHost virtualHost = new VirtualHost(new VirtualHostConfiguration("test", env), null);
-            
+            VirtualHost virtualHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts().iterator().next();
+
             _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false,
                     virtualHost, null);
 

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java Mon Oct  5 11:11:05 2009
@@ -49,13 +49,17 @@
     @Override
     public void setUp()
     {
+        //Highlight that this test will cause a new AR to be created
+        ApplicationRegistry.getInstance();
+
         _config = new XMLConfiguration();
     }
     
     @Override
-    public void tearDown()
+    public void tearDown() throws Exception
     {
-        ApplicationRegistry.removeAll();
+        //Correctly Close the AR we created
+        ApplicationRegistry.remove();
     }
 
     public void testSetJMXManagementPort() throws ConfigurationException

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java Mon Oct  5 11:11:05 2009
@@ -21,7 +21,6 @@
 
 
 import junit.framework.TestCase;
-
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.qpid.AMQException;
@@ -39,12 +38,23 @@
 
     @Override
     protected void setUp() throws Exception
-    {   
+    {
+        super.setUp();
+        //Highlight that this test will cause a new AR to be created
+        ApplicationRegistry.getInstance();
         // Fill config file with stuff
         configXml = new XMLConfiguration();
         configXml.setRootElementName("virtualhosts");
         configXml.addProperty("virtualhost(-1).name", "test");
     }
+
+    public void tearDown() throws Exception
+    {
+        //Correctly close the AR we created
+        ApplicationRegistry.remove();
+
+        super.tearDown();
+    }
     
     public void testQueuePriority() throws Exception
     {

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java Mon Oct  5 11:11:05 2009
@@ -62,7 +62,7 @@
 
     public void tearDown()
     {
-        ApplicationRegistry.remove(1); 
+        ApplicationRegistry.remove(); 
     }
 
 

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java Mon Oct  5 11:11:05 2009
@@ -131,7 +131,7 @@
     {
         super.setUp();
 
-        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance(1);
+        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
         _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
         _queueRegistry = _virtualHost.getQueueRegistry();
         _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue"), false, new AMQShortString("ExchangeMBeanTest"), false, _virtualHost,
@@ -141,7 +141,8 @@
 
     protected void tearDown()
     {
-        ApplicationRegistry.remove(1);
+        // Correctly Close the AR that we created above
+        ApplicationRegistry.remove();
     }
 
 }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java Mon Oct  5 11:11:05 2009
@@ -22,7 +22,6 @@
 
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.util.NullApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.protocol.InternalTestProtocolSession;
 import org.apache.qpid.server.protocol.AMQProtocolSession;
@@ -34,15 +33,16 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        ApplicationRegistry.initialise(new NullApplicationRegistry(), 1);
+        // AR will use the NullAR by default
         // Just use the first vhost.
-        VirtualHost virtualHost = ApplicationRegistry.getInstance(1).getVirtualHostRegistry().getVirtualHosts().iterator().next();
+        VirtualHost virtualHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts().iterator().next();
         _protocolSession = new InternalTestProtocolSession(virtualHost);
     }
 
     protected void tearDown()
     {
-        ApplicationRegistry.remove(1);
+        // Correctly Close the AR that we created above
+        ApplicationRegistry.remove();
     }
 
     public void testSimple() throws AMQException

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPChannelActorTest.java Mon Oct  5 11:11:05 2009
@@ -57,8 +57,12 @@
     AMQProtocolSession _session;
     AMQChannel _channel;
 
-    public void setUp() throws ConfigurationException, AMQException
+    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);
 
@@ -84,9 +88,13 @@
 
     }
 
-    public void tearDown()
+    public void tearDown() throws Exception
     {
         _rawLogger.clearLogMessages();
+        // Correctly Close the AR we created
+        ApplicationRegistry.remove();
+
+        super.tearDown();
     }
 
     /**

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/AMQPConnectionActorTest.java Mon Oct  5 11:11:05 2009
@@ -54,17 +54,26 @@
     LogActor _amqpActor;
     UnitTestMessageLogger _rawLogger;
 
-    public void setUp() throws ConfigurationException, AMQException
+    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);
 
         setUpWithConfig(serverConfig);
     }
 
-    public void tearDown()
+    public void tearDown() throws Exception
     {
         _rawLogger.clearLogMessages();
+
+        // Correctly Close the AR we created
+        ApplicationRegistry.remove();
+
+        super.tearDown();        
     }
 
     private void setUpWithConfig(ServerConfiguration serverConfig) throws AMQException

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/actors/CurrentActorTest.java Mon Oct  5 11:11:05 2009
@@ -62,8 +62,9 @@
     // Create a single session for this test.
     AMQProtocolSession _session;
 
-    public void setUp() throws AMQException
+    public void setUp() throws Exception
     {
+        super.setUp();
         // Create a single session for this test.
         VirtualHost virtualHost = ApplicationRegistry.getInstance().
                 getVirtualHostRegistry().getVirtualHosts().iterator().next();
@@ -72,7 +73,17 @@
         _session = new InternalTestProtocolSession(virtualHost);
     }
 
-    public void testFIFO() throws AMQException
+
+    @Override
+    public void tearDown() throws Exception
+    {
+        // Correctly Close the AR we created
+        ApplicationRegistry.remove();
+        super.tearDown();
+    }
+
+
+    public void testLIFO() throws AMQException
     {
         // Create a new actor using retrieving the rootMessageLogger from
         // the default ApplicationRegistry.
@@ -143,11 +154,11 @@
         assertEquals("Retrieved actor is not as expected ",
                      connectionActor, CurrentActor.get());
 
-        // Verify that removing the last actor returns us to a null value.
+        // Verify that removing the our last actor it returns us to the test
+        // default that the ApplicationRegistry sets.
         CurrentActor.remove();
 
-        assertNull("CurrentActor should be null", CurrentActor.get());
-
+        assertEquals("CurrentActor not the Test default", TestLogActor.class ,CurrentActor.get().getClass());
     }
 
     public void testThreadLocal()

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java Mon Oct  5 11:11:05 2009
@@ -30,9 +30,10 @@
 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.actors.TestBlankActor;
+import org.apache.qpid.server.logging.actors.TestLogActor;
 import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
 import org.apache.qpid.server.logging.subjects.TestBlankSubject;
+import org.apache.qpid.server.registry.ApplicationRegistry;
 
 import java.util.List;
 
@@ -44,15 +45,26 @@
     protected UnitTestMessageLogger _logger;
     protected LogSubject _logSubject = new TestBlankSubject();
 
-    public void setUp() throws ConfigurationException
+    public void setUp() throws Exception
     {
+        super.setUp();
+        // Highlight that we create a new AR here
+        ApplicationRegistry.getInstance();
+
         ServerConfiguration serverConfig = new ServerConfiguration(_config);
 
         _logger = new UnitTestMessageLogger();
         RootMessageLogger rootLogger =
                 new RootMessageLoggerImpl(serverConfig, _logger);
 
-        _actor = new TestBlankActor(rootLogger);
+        _actor = new TestLogActor(rootLogger);
+    }
+
+    public void tearDown() throws Exception
+    {
+        // Correctly Close the AR that we created above
+        ApplicationRegistry.remove();
+        super.tearDown();
     }
 
     protected List<Object> performLog()

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/AbstractTestLogSubject.java Mon Oct  5 11:11:05 2009
@@ -32,7 +32,7 @@
 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.actors.TestBlankActor;
+import org.apache.qpid.server.logging.actors.TestLogActor;
 import org.apache.qpid.server.logging.rawloggers.UnitTestMessageLogger;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -60,6 +60,14 @@
         _session = new InternalTestProtocolSession(virtualHost);
     }
 
+    public void tearDown() throws Exception
+    {
+        // Correctly Close the AR that we created above
+        ApplicationRegistry.remove();
+
+        super.tearDown();
+    }
+
     protected List<Object> performLog() throws ConfigurationException
     {
         if (_subject == null)
@@ -73,7 +81,7 @@
         RootMessageLogger rootLogger =
                 new RootMessageLoggerImpl(serverConfig, logger);
 
-        LogActor actor = new TestBlankActor(rootLogger);
+        LogActor actor = new TestLogActor(rootLogger);
 
         actor.message(_subject, new LogMessage()
         {

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubjectTest.java Mon Oct  5 11:11:05 2009
@@ -34,7 +34,7 @@
         _testVhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().
                 getVirtualHost("test");
 
-        _subject = new MessagesStoreLogSubject(_testVhost, _testVhost.getMessageStore());
+        _subject = new MessageStoreLogSubject(_testVhost, _testVhost.getMessageStore());
     }
 
     /**

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/logging/subjects/SubscriptionLogSubjectTest.java Mon Oct  5 11:11:05 2009
@@ -63,7 +63,7 @@
                                                    _acks, _filters, _noLocal,
                                                    new LimitlessCreditManager());
 
-        _subscription.setQueue(_queue);
+        _subscription.setQueue(_queue, false);
 
         _subject = new SubscriptionLogSubject(_subscription);
     }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java Mon Oct  5 11:11:05 2009
@@ -26,6 +26,7 @@
 import org.apache.qpid.codec.AMQCodecFactory;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.server.registry.ApplicationRegistry;
@@ -109,20 +110,17 @@
     {
         super.setUp();
 
-        IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-        _protocolSession =
-                new AMQMinaProtocolSession(new TestIoSession(), appRegistry.getVirtualHostRegistry(), new AMQCodecFactory(true));
-        // Need to authenticate session for it to work, (well for logging to work)
-        _protocolSession.setAuthorizedID(new Principal()
-        {
-            public String getName()
-            {
-                return "AMQProtocolSessionMBeanTestUser";
-            }
-        });
-        _protocolSession.setVirtualHost(appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
+        VirtualHost vhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
+        _protocolSession = new InternalTestProtocolSession(vhost);
+
         _channel = new AMQChannel(_protocolSession, 1, _messageStore);
         _protocolSession.addChannel(_channel);
         _mbean = (AMQProtocolSessionMBean) _protocolSession.getManagedObject();
     }
+
+    @Override
+    protected void tearDown()
+    {
+        ApplicationRegistry.remove();
+    }
 }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/MaxChannelsTest.java Mon Oct  5 11:11:05 2009
@@ -25,6 +25,7 @@
 import org.apache.qpid.codec.AMQCodecFactory;
 import org.apache.qpid.protocol.AMQConstant;
 import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.IApplicationRegistry;
@@ -36,27 +37,12 @@
 /** Test class to test MBean operations for AMQMinaProtocolSession. */
 public class MaxChannelsTest extends TestCase
 {
-	private IApplicationRegistry _appRegistry;
 	private AMQMinaProtocolSession _session;
 
     public void testChannels() throws Exception
     {
-        _session = new AMQMinaProtocolSession(new TestIoSession(), _appRegistry
-				.getVirtualHostRegistry(), new AMQCodecFactory(true));
-
-        // Set the current Actor for these tests
-        CurrentActor.set(_session.getLogActor());
-
-        // Need to authenticate session for it to work, (well for logging to work)
-        _session.setAuthorizedID(new Principal()
-        {
-            public String getName()
-            {
-                return "AMQProtocolSessionMBeanTestUser";
-            }
-        });
-
-        _session.setVirtualHost(_appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
+        VirtualHost vhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
+        _session = new InternalTestProtocolSession(vhost);
 
         // check the channel count is correct
         int channelCount = _session.getChannels().size();
@@ -84,11 +70,12 @@
     @Override
     public void setUp()
     {
-        _appRegistry = ApplicationRegistry.getInstance(1);
+        //Highlight that this test will cause a new AR to be created
+        ApplicationRegistry.getInstance();
     }
     
     @Override
-    public void tearDown()
+    public void tearDown() throws Exception
     {
     	try {
 			_session.closeSession();
@@ -98,10 +85,9 @@
 		}
         finally
         {
-            //Remove the actor set during the test
-            CurrentActor.remove();
-        }
-    	ApplicationRegistry.remove(1);
+            // Correctly Close the AR we created
+            ApplicationRegistry.remove();
+        }        
     }
 
 }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java Mon Oct  5 11:11:05 2009
@@ -294,7 +294,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance(1);
+        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
         _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
         _protocolSession = new InternalTestProtocolSession(_virtualHost);
         CurrentActor.set(_protocolSession.getLogActor());
@@ -302,8 +302,9 @@
 
     protected void tearDown()
     {
+        // Remove the Protocol Session Actor set above
         CurrentActor.remove();
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
     }
 
 

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java Mon Oct  5 11:11:05 2009
@@ -46,7 +46,7 @@
     public void tearDown()
     {
         assertEquals("Queue was not registered in virtualhost", 1, _queueRegistry.getQueues().size());
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
     }
 
 

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java Mon Oct  5 11:11:05 2009
@@ -360,7 +360,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance(1);
+        IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
         _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
         _messageStore = _virtualHost.getMessageStore();
 
@@ -378,7 +378,7 @@
 
     public void tearDown()
     {
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
     }
 
     private void sendMessages(int messageCount, boolean persistent) throws AMQException

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AckTest.java Mon Oct  5 11:11:05 2009
@@ -74,8 +74,8 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        ApplicationRegistry.initialise(new NullApplicationRegistry(), 1);
-
+        // The NullApplicationRegistry will be created by default when
+        // calling AR.getInstance
         _virtualHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
         _messageStore = new TestMemoryMessageStore();
         _protocolSession = new InternalTestProtocolSession(_virtualHost);
@@ -89,7 +89,7 @@
 
     protected void tearDown()
     {
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
     }
 
     private void publishMessages(int count) throws AMQException

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java Mon Oct  5 11:11:05 2009
@@ -55,11 +55,6 @@
        _name = new AMQShortString(name);
     }
 
-    public MockAMQQueue()
-    {
-       
-    }
-
     public AMQShortString getName()
     {
         return _name;

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java Mon Oct  5 11:11:05 2009
@@ -94,7 +94,7 @@
     {
         super.setUp();
         //Create Application Registry for test
-        ApplicationRegistry applicationRegistry = (ApplicationRegistry)ApplicationRegistry.getInstance(1);
+        ApplicationRegistry applicationRegistry = (ApplicationRegistry)ApplicationRegistry.getInstance();
 
         PropertiesConfiguration env = new PropertiesConfiguration();
         _virtualHost = new VirtualHost(new VirtualHostConfiguration(getClass().getName(), env), _store);
@@ -107,7 +107,7 @@
     protected void tearDown()
     {
         _queue.stop();
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
     }
 
     public void testCreateQueue() throws AMQException

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java Mon Oct  5 11:11:05 2009
@@ -36,7 +36,7 @@
     public void test() throws AMQException
     {
         int initialCount = ReferenceCountingExecutorService.getInstance().getReferenceCount();
-        VirtualHost test = ApplicationRegistry.getInstance(1).getVirtualHostRegistry().getVirtualHost("test");
+        VirtualHost test = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
 
         try
         {
@@ -54,7 +54,7 @@
         }
         finally
         {
-            ApplicationRegistry.remove(1);
+            ApplicationRegistry.remove();
         }       
     }
 }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java Mon Oct  5 11:11:05 2009
@@ -22,6 +22,7 @@
 
 import junit.framework.TestCase;
 import org.apache.qpid.server.util.TestApplicationRegistry;
+import org.apache.qpid.AMQException;
 
 import java.security.Security;
 import java.security.Provider;
@@ -37,13 +38,24 @@
 public class ApplicationRegistryShutdownTest extends TestCase
 {
 
-    ApplicationRegistry _registry;
+    IApplicationRegistry _registry;
 
     public void setUp() throws Exception
     {
+        //Highlight that this test will cause a new AR to be created
+        // This must used TestAppRegistry but during the test getInstance()
+        // will be called so we must ensure to do the remove()
         _registry = new TestApplicationRegistry();
     }
 
+    @Override
+    public void tearDown() throws Exception
+    {
+        // Correctly Close the AR we created        
+    	ApplicationRegistry.remove();
+    }
+
+
     /**
      * QPID-1399 : Ensure that the Authentiction manager unregisters any SASL providers created during
      * ApplicationRegistry initialisation.

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java Mon Oct  5 11:11:05 2009
@@ -72,6 +72,14 @@
         // 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();
+    }    
     
     public void testACLManagerConfigurationPluginManager() throws Exception
     {

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java Mon Oct  5 11:11:05 2009
@@ -36,6 +36,7 @@
 import org.apache.qpid.server.security.access.ACLPlugin.AuthzResult;
 import org.apache.qpid.server.store.SkeletonMessageStore;
 import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.registry.ApplicationRegistry;
 
 public class PrincipalPermissionsTest extends TestCase
 {
@@ -65,6 +66,9 @@
     @Override
     public void setUp()
     {
+        //Highlight that this test will cause a new AR to be created
+        ApplicationRegistry.getInstance();        
+
         _perms = new PrincipalPermissions(_user);
         try 
         {
@@ -78,7 +82,15 @@
             fail(e.getMessage());
         }
     }
-    
+
+    @Override
+    protected void tearDown() throws Exception
+    {
+        //Ensure we close the opened Registry
+        ApplicationRegistry.remove();
+    }
+
+
     public void testPrincipalPermissions()
     {
         assertNotNull(_perms);

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java Mon Oct  5 11:11:05 2009
@@ -89,6 +89,7 @@
     @Override
     public void setUp() throws Exception
     {
+        super.setUp();
         _store = new TestableMemoryMessageStore();
         TestIoSession iosession = new TestIoSession();
         iosession.setAddress("127.0.0.1");
@@ -100,7 +101,14 @@
         AMQCodecFactory codecFactory = new AMQCodecFactory(true);
         _session = new AMQMinaProtocolSession(iosession, virtualHostRegistry, codecFactory);        
     }
-    
+
+    public void tearDown() throws Exception
+    {
+        // Correctly Close the AR that we created above
+        ApplicationRegistry.remove();
+        super.tearDown();
+    }
+
     private FirewallPlugin initialisePlugin(String defaultAction, RuleInfo[] rules) throws IOException, ConfigurationException
     {
         // Create sample config file

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java Mon Oct  5 11:11:05 2009
@@ -136,12 +136,12 @@
 
     protected void setUp()
     {
-        ApplicationRegistry.getInstance(1);
+        ApplicationRegistry.getInstance();
     }
 
     protected void tearDown()
     {
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
     }
 
     protected void runTestWithStore(Configuration configuration)

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java Mon Oct  5 11:11:05 2009
@@ -24,6 +24,8 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.logging.LogActor;
+import org.apache.qpid.server.filter.FilterManager;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.QueueEntry;
 import org.apache.qpid.server.queue.QueueEntry.SubscriptionAcquiredState;
@@ -89,6 +91,11 @@
         return new QueueEntry.SubscriptionAcquiredState(this);
     }
 
+    public LogActor getLogActor()
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
     public AMQQueue getQueue()
     {
         return queue;
@@ -176,7 +183,7 @@
         _queueContext = queueContext;
     }
 
-    public void setQueue(AMQQueue queue)
+    public void setQueue(AMQQueue queue, boolean exclusive)
     {
         this.queue = queue;
     }

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java Mon Oct  5 11:11:05 2009
@@ -91,7 +91,7 @@
     public void tearDown() throws Exception
     {
         CurrentActor.remove();
-        ApplicationRegistry.remove(1);
+        ApplicationRegistry.remove();
         super.tearDown();
     }
 

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java Mon Oct  5 11:11:05 2009
@@ -40,6 +40,8 @@
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 import org.apache.qpid.server.logging.RootMessageLoggerImpl;
+import org.apache.qpid.server.logging.actors.CurrentActor;
+import org.apache.qpid.server.logging.actors.TestLogActor;
 import org.apache.qpid.server.logging.rawloggers.Log4jMessageLogger;
 
 import java.util.Collection;
@@ -77,7 +79,11 @@
     {
         _rootMessageLogger = new RootMessageLoggerImpl(_configuration,
                                                        new Log4jMessageLogger());
-        
+
+        //Add a Test Actor as a lot of our System Tests reach in to the broker
+        // and manipulate it so the CurrentActor is not set.
+        CurrentActor.set(new TestLogActor(_rootMessageLogger));
+
         Properties users = new Properties();
 
         users.put("guest", "guest");
@@ -137,6 +143,19 @@
         return _messageStore;
     }
 
+    @Override
+    public void close() throws Exception
+    {
+        try
+        {
+            super.close();
+        }
+        finally
+        {
+            CurrentActor.remove();
+        }
+    }
+    
 }
 
 

Modified: qpid/branches/java-broker-0-10/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm (original)
+++ qpid/branches/java-broker-0-10/qpid/java/broker/src/velocity/templates/org/apache/qpid/server/logging/messages/LogMessages.vm Mon Oct  5 11:11:05 2009
@@ -45,7 +45,21 @@
 
     static
     {
-        Locale currentLocale = ApplicationRegistry.getInstance().getConfiguration().getLocale();
+        reload();
+    }
+
+    public static void reload()
+    {
+        Locale currentLocale;
+             
+        if (ApplicationRegistry.isConfigured())
+        {
+            currentLocale = ApplicationRegistry.getInstance().getConfiguration().getLocale();
+        }
+        else
+        {
+            currentLocale = Locale.getDefault();
+        }
 
         _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.LogMessages",
                                                            currentLocale);
@@ -54,6 +68,7 @@
         _formatter.setLocale(currentLocale);
     }
 
+
 ##
 ## The list stored under key 'list' in the 'type' HashMap contains all the
 ## log messages that this class should contain. So for each entry in the list
@@ -106,27 +121,11 @@
     public static LogMessage ${message.methodName}(#foreach($parameter in ${message.parameters})${parameter.type} ${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end
 #end#if(${message.parameters.size()} > 0 && ${message.options.size()} > 0), #end#foreach($option in ${message.options})boolean ${option.name}#if (${velocityCount} != ${message.options.size()} ), #end#end)
     {
-##
-## If we don't have any parameters then we don't need the overhead of using the
-## message formatter so we can just set our return message to the retreived
-## fixed string.
-## So we don't need to update the _formatter with the new pattern.
-##
-## Here we setup rawMessage to be the formatted message ready for direct return
-## with the message.name or further processing to remove options.
-##
-#if(${message.parameters.size()} > 0)
-        final Object[] messageArguments = {#foreach($parameter in ${message.parameters})${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end#end};
-        _formatter.applyPattern(_messages.getString("${message.name}"));
-        String rawMessage = _formatter.format(messageArguments);
-#else
-        String rawMessage = _messages.getString("${message.name}");
-#end
-
+        String rawMessage = "${message.name} : " + _messages.getString("${message.name}");
 ## If we have some options then we need to build the message based
 ## on those values so only provide that logic if we need it.
 #if(${message.options.size()} > 0)
-        StringBuffer msg =new StringBuffer("${message.name} : ");
+        StringBuffer msg = new StringBuffer();
 
         // Split the formatted message up on the option values so we can
         // rebuild the message based on the configured options.     
@@ -152,10 +151,26 @@
 #end
         }
 
-        final String message = msg.toString();
+        rawMessage = msg.toString();
+#end
+
+##
+## If we don't have any parameters then we don't need the overhead of using the
+## message formatter so we can just set our return message to the retreived
+## fixed string.
+## So we don't need to update the _formatter with the new pattern.
+##
+## Here we setup rawMessage to be the formatted message ready for direct return
+## with the message.name or further processing to remove options.
+##
+#if(${message.parameters.size()} > 0)
+        final Object[] messageArguments = {#foreach($parameter in ${message.parameters})${parameter.name}#if (${velocityCount} != ${message.parameters.size()} ), #end#end};
+        _formatter.applyPattern(rawMessage);
+
+        final String message = _formatter.format(messageArguments);
 #else
-## If we have no options then we can just format and set the log
-        final String message = "${message.name} : " + rawMessage;            
+## If we have no parameters then we can skip the formatter and set the log
+        final String message = rawMessage;
 #end
 
         return new LogMessage()

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,2 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/management/ConfigurationManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ConfigurationManagement.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,2 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/management/LoggingManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/LoggingManagement.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedBroker.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,2 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedConnection.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,2 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedExchange.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java:757257
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java:753219-753220,753253,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,2 +1,2 @@
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java:742626,743015,743028-743029,743304,743306,743311,743357,744113,747363,747367,747369-747370,747376,747783,747868-747870,747875,748561,748591,748641,748680,748686,749149,749282,749285,749315,749340,749572,753219-753220,753253,754934,754958,755256,757258,757270,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/UserManagement.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanAttribute.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanConstructor.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanDescription.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperation.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,3 +1,3 @@
 /qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java:757268
 /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java:753219-753220,753253,758730,759097,760919,761721,762365,762992,763959,764026,764109,764140,764790
-/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:796196-800440
+/qpid/trunk/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/annotations/MBeanOperationParameter.java:796196-802129

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/build.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/build.xml?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/build.xml (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/build.xml Mon Oct  5 11:11:05 2009
@@ -21,6 +21,7 @@
 <project name="Eclipse Plugin" default="build">
 
     <property name="module.depends" value="broker common management/common"/>
+    <property name="module.test.depends" value="broker/test" />
 
     <import file="../../module.xml"/>
 

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
Binary files - no diff available.

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/icons/refresh.gif
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/icons/refresh.gif?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
Binary files - no diff available.

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/plugin.xml?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/plugin.xml (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/plugin.xml Mon Oct  5 11:11:05 2009
@@ -150,6 +150,7 @@
            <toolbar id="qpidMC">
                <separator name="qpidActionsGroup" visible="false"/>
                <separator name="refresh" visible="true"/>
+               <separator name="refresh2" visible="false"/>
                <separator name="additions" visible="false"/>
            </toolbar>
        </menuContribution>
@@ -179,8 +180,8 @@
                label="Refresh"
                menubarPath="qpidmanager/additions"
                style="push"
-               toolbarPath="qpidMC/qpidActionsGroup"
-               tooltip="Refresh"/>
+               toolbarPath="qpidMC/refresh2"
+               tooltip="Refresh Now"/>
          <action
                class="org.apache.qpid.management.ui.actions.RemoveServer"
                definitionId="org.apache.qpid.management.ui.actions.cmd_remove"

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1,2 +1,2 @@
 /qpid/branches/jmx_mc_gsoc09/qpid/java/management/eclipse-plugin/src:788755
-/qpid/trunk/qpid/java/management/eclipse-plugin/src:796196-800440
+/qpid/trunk/qpid/java/management/eclipse-plugin/src:796196-802129

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java Mon Oct  5 11:11:05 2009
@@ -64,6 +64,16 @@
                 PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT));
         imageRegistry.put(Constants.NOTIFICATION_IMAGE,
                 org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/notifications.gif"));
+        imageRegistry.put(Constants.LOGGING_MANAGEMENT_IMAGE,
+                org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/logging_management.gif"));
+        imageRegistry.put(Constants.USER_MANAGEMENT_IMAGE,
+                org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/user_management.gif"));
+        imageRegistry.put(Constants.CONFIGURATION_MANAGEMENT_IMAGE,
+                org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/configuration_management.gif"));
+        imageRegistry.put(Constants.SERVER_INFO_IMAGE,
+                org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/server_information.gif"));
+        imageRegistry.put(Constants.VHOST_MANAGER_IMAGE,
+                org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/virtualhost_manager.gif"));
     }
     
     static

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java Mon Oct  5 11:11:05 2009
@@ -104,6 +104,11 @@
     public final static String OPEN_FOLDER_IMAGE = "OpenFolderImage";
     public final static String MBEAN_IMAGE = "MBeanImage";
     public final static String NOTIFICATION_IMAGE = "NotificationImage";
+    public final static String LOGGING_MANAGEMENT_IMAGE = "LoggingManagementImage";
+    public final static String USER_MANAGEMENT_IMAGE = "UserManagementImage";
+    public final static String CONFIGURATION_MANAGEMENT_IMAGE = "ConfigurationManagementImage";
+    public final static String SERVER_INFO_IMAGE = "ServerInfoImage";
+    public final static String VHOST_MANAGER_IMAGE = "VhostManagerImage";
     
     public final static String FONT_BUTTON = "ButtonFont";
     public final static String FONT_BOLD = "BoldFont";

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java Mon Oct  5 11:11:05 2009
@@ -36,6 +36,7 @@
 import org.apache.qpid.management.ui.ApiVersion;
 import org.apache.qpid.management.ui.ApplicationRegistry;
 import org.apache.qpid.management.ui.ManagedBean;
+import org.apache.qpid.management.ui.ManagedObject;
 import org.apache.qpid.management.ui.ManagedServer;
 import org.apache.qpid.management.ui.ServerRegistry;
 import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
@@ -1151,7 +1152,42 @@
             }
             else
             {
-                return ApplicationRegistry.getImage(MBEAN_IMAGE);
+                ManagedObject obj = node.getManagedObject();
+                if(obj instanceof ManagedBean)
+                {
+                    ManagedBean mbean = (ManagedBean) obj;
+                    String mbeanType = mbean.getType();
+
+                    if(mbeanType.equals(LoggingManagement.TYPE))
+                    {
+                        return ApplicationRegistry.getImage(LOGGING_MANAGEMENT_IMAGE);
+                    }
+                    else if(mbeanType.equals(UserManagement.TYPE))
+                    {
+                        return ApplicationRegistry.getImage(USER_MANAGEMENT_IMAGE);
+                    }
+                    else if(mbeanType.equals(ConfigurationManagement.TYPE))
+                    {
+                        return ApplicationRegistry.getImage(CONFIGURATION_MANAGEMENT_IMAGE);
+                    }
+                    else if(mbeanType.equals(ServerInformation.TYPE))
+                    {
+                        return ApplicationRegistry.getImage(SERVER_INFO_IMAGE);
+                    }
+                    else if(mbeanType.equals("VirtualHost.VirtualHostManager"))
+                    {
+                        return ApplicationRegistry.getImage(VHOST_MANAGER_IMAGE);
+                    }
+                    else
+                    {
+                        return ApplicationRegistry.getImage(MBEAN_IMAGE);
+                    }
+                    
+                }
+                else
+                {
+                    return ApplicationRegistry.getImage(MBEAN_IMAGE);
+                }
             }
         }
 

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java Mon Oct  5 11:11:05 2009
@@ -186,10 +186,21 @@
                 IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection();
                 if(!ss.isEmpty())
                 {
+                    //clear selected Notifications
                     serverRegistry.clearNotifications(_mbean, ss.toList());
                 }
                 else if(_notifications != null)
                 {
+                    //clear all the notifications, if there are any
+                    
+                    //check the user is certain of this clear-all operation
+                    int response = ViewUtility.popupOkCancelConfirmationMessage(
+                            "Clear Notifications", "Clear all Notifications for this MBean?");
+                    if(response != SWT.OK)
+                    {
+                        return;
+                    }
+                    
                     synchronized(this)
                     {
                         List<NotificationObject> newList = new ArrayList<NotificationObject>();

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java Mon Oct  5 11:11:05 2009
@@ -136,10 +136,21 @@
                 IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection();
                 if(!ss.isEmpty())
                 {
+                    //clear selected Notifications
                     serverRegistry.clearNotifications(null, ss.toList());
                 }
                 else if(_notifications != null)
                 {
+                    //clear all the notifications, if there are any
+                    
+                    //check the user is certain of this clear-all operation
+                    int response = ViewUtility.popupOkCancelConfirmationMessage(
+                            "Clear Notifications", "Clear all Notifications for this VirtualHost?");
+                    if(response != SWT.OK)
+                    {
+                        return;
+                    }
+                    
                     synchronized(this)
                     {
                         serverRegistry.clearNotifications(null, _notifications);

Modified: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java?rev=821755&r1=821754&r2=821755&view=diff
==============================================================================
--- qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java (original)
+++ qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/queue/QueueOperationsTabControl.java Mon Oct  5 11:11:05 2009
@@ -93,15 +93,17 @@
     
     private Text _fromMsgText;
     private Text _toMsgText;
+    private static final String FROM_DEFAULT = "1";
+    private static final String TO_DEFAULT = "50";
+    private long _interval = 50; //(to-from)+1
     private Long _fromMsg = new Long(FROM_DEFAULT);
     private Long _toMsg = new Long(TO_DEFAULT);
     
     private TabularDataSupport _messages = null;
     private ManagedQueue _qmb;
     
-    private static final String FROM_DEFAULT = "1";
-    private static final String TO_DEFAULT = "50";
-    private long INTERVAL = 50;
+    private Button _previousButton;
+    private Button _nextButton;
     
     private static final String MSG_AMQ_ID = ManagedQueue.VIEW_MSGS_COMPOSITE_ITEM_NAMES[0];
     private static final String MSG_HEADER = ManagedQueue.VIEW_MSGS_COMPOSITE_ITEM_NAMES[1];
@@ -252,9 +254,9 @@
         
         _toolkit.createLabel(viewMessageRangeComposite, "     "); //spacer
         
-        final Button previousButton = _toolkit.createButton(viewMessageRangeComposite, "< Prev " + INTERVAL, SWT.PUSH);
-        previousButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
-        previousButton.addSelectionListener(new SelectionAdapter()
+        _previousButton = _toolkit.createButton(viewMessageRangeComposite, "< Prev " + _interval, SWT.PUSH);
+        _previousButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
+        _previousButton.addSelectionListener(new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
             {
@@ -266,16 +268,16 @@
                 }
                 
                 //make 'from' be 'from - INTERVAL', or make it 1 if that would make it 0 or less 
-                _fromMsg = (_fromMsg - INTERVAL < 1) ? 1 : _fromMsg - INTERVAL;
+                _fromMsg = (_fromMsg - _interval < 1) ? 1 : _fromMsg - _interval;
                 _fromMsgText.setText(_fromMsg.toString());
                 
                 refresh(_mbean);
             }
         });
         
-        final Button nextButton = _toolkit.createButton(viewMessageRangeComposite, "Next " + INTERVAL + " >", SWT.PUSH);
-        nextButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
-        nextButton.addSelectionListener(new SelectionAdapter()
+        _nextButton = _toolkit.createButton(viewMessageRangeComposite, "Next " + _interval + " >", SWT.PUSH);
+        _nextButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
+        _nextButton.addSelectionListener(new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
             {
@@ -287,7 +289,7 @@
                 }
                 
                 //make 'to' be 'to + INTERVAL', or make it Long.MAX_VALUE if that would too large
-                _toMsg = (Long.MAX_VALUE - _toMsg > INTERVAL) ? _toMsg + INTERVAL : Long.MAX_VALUE;
+                _toMsg = (Long.MAX_VALUE - _toMsg > _interval) ? _toMsg + _interval : Long.MAX_VALUE;
                 _toMsgText.setText(_toMsg.toString());
                 
                 refresh(_mbean);
@@ -718,6 +720,10 @@
         _fromMsg = from;
         _toMsg = to;
         
+        _interval = (to - from) + 1;
+        _previousButton.setText("< Prev " + _interval);
+        _nextButton.setText("Next " + _interval + " >");
+        
         refresh(_mbean);
     }
     

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1 +1 @@
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:796196-800440
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ConnectionTypeTabControl.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1 +1 @@
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:796196-800440
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/ExchangeTypeTabControl.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1 +1 @@
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:796196-800440
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/MBeanTypeTabControl.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1 +1 @@
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:796196-800440
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/type/QueueTypeTabControl.java:796196-802129

Propchange: qpid/branches/java-broker-0-10/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct  5 11:11:05 2009
@@ -1 +1 @@
-/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:796196-800440
+/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Contents/MacOS/qpidmc:796196-802129



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