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

svn commit: r752300 [5/12] - in /qpid/branches/qpid-1673/qpid: cpp/ cpp/examples/ cpp/examples/direct/ cpp/examples/failover/ cpp/examples/fanout/ cpp/examples/pub-sub/ cpp/examples/qmf-console/ cpp/examples/request-response/ cpp/examples/tradedemo/ cp...

Modified: qpid/branches/qpid-1673/qpid/cpp/xml/cluster.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/cpp/xml/cluster.xml?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/cpp/xml/cluster.xml (original)
+++ qpid/branches/qpid-1673/qpid/cpp/xml/cluster.xml Tue Mar 10 23:10:57 2009
@@ -125,13 +125,13 @@
       <field name="member-id" type="uint64"/>
       <field name="connection-id" type="uint64"/>
       <field name="user-name" type="str8"/>
+      <field name="fragment" type="str32"/>
     </control>
 
     <!-- Complete a cluster state update. -->
     <control name="membership" code="0x21" label="Cluster membership details.">
       <field name="joiners" type="map"/> <!-- member-id -> URL -->
       <field name="members" type="map"/> <!-- member-id -> state -->
-      <field name="frame-id" type="uint64"/>> <!-- Frame id counter value -->
     </control>
 
     <!-- Set the position of a replicated queue. -->
@@ -139,11 +139,12 @@
       <field name="queue" type="str8"/>
       <field name="position" type="sequence-no"/>
     </control>
-    
+
     <!-- Replicate encoded exchanges/queues. -->
     <control name="exchange" code="0x31"><field name="encoded" type="str32"/></control>
     <control name="queue" code="0x32"><field name="encoded" type="str32"/></control>
-    
 
+    <!-- Set expiry-id for subsequent messages. -->
+    <control name="expiry-id" code="0x33"><field name="expiry-id" type="uint64"/></control>
   </class>
 </amqp>

Modified: qpid/branches/qpid-1673/qpid/java/08ExcludeList
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/08ExcludeList?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/08ExcludeList (original)
+++ qpid/branches/qpid-1673/qpid/java/08ExcludeList Tue Mar 10 23:10:57 2009
@@ -6,3 +6,4 @@
 org.apache.qpid.test.client.failover.FailoverTest#test4MinuteFailover
 // Those tests are written against the 0.10 path
 org.apache.qpid.test.unit.message.UTF8Test#*
+org.apache.qpid.client.MessageListenerTest#testSynchronousRecieveNoWait

Modified: qpid/branches/qpid-1673/qpid/java/08ExcludeList-nonvm
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/08ExcludeList-nonvm?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/08ExcludeList-nonvm (original)
+++ qpid/branches/qpid-1673/qpid/java/08ExcludeList-nonvm Tue Mar 10 23:10:57 2009
@@ -27,3 +27,4 @@
 
 // Those tests are written against the 0.10 path
 org.apache.qpid.test.unit.message.UTF8Test#*
+org.apache.qpid.client.MessageListenerTest#testSynchronousRecieveNoWait

Modified: qpid/branches/qpid-1673/qpid/java/ExcludeList
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/ExcludeList?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/ExcludeList (original)
+++ qpid/branches/qpid-1673/qpid/java/ExcludeList Tue Mar 10 23:10:57 2009
@@ -1,8 +1,6 @@
 org.apache.qpid.client.MultipleJCAProviderRegistrationTest#test
-// QPID-1451 : testBrowsingWithSelector test is not correct.
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testBrowsingWithSelector
+// QPID-1715, QPID-1715 : Client Error Handling on close is still broken
+org.apache.qpid.server.queue.QueueCreateTest#testCreatePriorityString
+org.apache.qpid.server.queue.QueueCreateTest#testCreateFlowToDiskValidNoSize
+org.apache.qpid.server.queue.QueueCreateTest#testCreateFlowToDiskInvalid
+org.apache.qpid.server.queue.QueueCreateTest#testCreateFlowToDiskInvalidSize

Modified: qpid/branches/qpid-1673/qpid/java/broker/etc/config.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/etc/config.xml?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/etc/config.xml (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/etc/config.xml Tue Mar 10 23:10:57 2009
@@ -45,7 +45,6 @@
     <management>
         <enabled>true</enabled>
         <jmxport>8999</jmxport>
-        <security-enabled>false</security-enabled>
         <ssl>
             <enabled>true</enabled>
             <!-- Update below path to your keystore location, eg ${conf}/qpid.keystore  -->

Modified: qpid/branches/qpid-1673/qpid/java/broker/etc/debug.log4j.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/etc/debug.log4j.xml?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/etc/debug.log4j.xml (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/etc/debug.log4j.xml Tue Mar 10 23:10:57 2009
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  -
  - Licensed to the Apache Software Foundation (ASF) under one
@@ -18,10 +18,10 @@
  - specific language governing permissions and limitations
  - under the License.
  -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-    <appender name="ArchivingFileAppender" class="org.apache.log4j.QpidCompositeRollingAppender">
+ --><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="null" threshold="null">
+    <appender class="org.apache.log4j.QpidCompositeRollingAppender" name="ArchivingFileAppender">
         <!-- Ensure that logs allways have the dateFormat set-->
         <param name="StaticLogFileName" value="false"/>
         <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
@@ -48,7 +48,7 @@
         </layout>
     </appender>
 
-    <appender name="FileAppender" class="org.apache.log4j.FileAppender">
+    <appender class="org.apache.log4j.FileAppender" name="FileAppender">
         <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
         <param name="Append" value="false"/>
 
@@ -57,7 +57,7 @@
         </layout>
     </appender>
 
-    <appender name="AlertFile" class="org.apache.log4j.FileAppender">
+    <appender class="org.apache.log4j.FileAppender" name="AlertFile">
         <param name="File" value="${QPID_WORK}/log/alert.log"/>
         <param name="Append" value="false"/>
 
@@ -66,28 +66,28 @@
         </layout>
     </appender>
 
-    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
+    <appender class="org.apache.log4j.ConsoleAppender" name="STDOUT">
 
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
         </layout>
     </appender>
 
-    <category name="Qpid.Broker">
+    <category additivity="true" name="Qpid.Broker">
         <priority value="debug"/>
         <appender-ref ref="AlertFile"/>
         <!--appender-ref ref="STDOUT"/-->        
     </category>
 
 
-    <category name="org.apache.qpid.server.queue.AMQQueueMBean">
+    <category additivity="true" name="org.apache.qpid.server.queue.AMQQueueMBean">
         <priority value="info"/>
         <appender-ref ref="AlertFile"/>
     </category>
 
 
     <!-- Provide warnings to standard output -->
-    <!--category name="org.apache.qpid">
+    <!--category additivity="true" name="org.apache.qpid">
         <priority value="warn"/>
         <appender-ref ref="STDOUT"/>
     </category-->
@@ -96,11 +96,11 @@
     <!-- Additional level settings for debugging -->
     <!-- Each class in the Broker is a category that can have its logging level adjusted. -->
     <!-- This will provide more details if available about that classes processing. -->
-    <!--category name="org.apache.qpid.server.txn">
+    <!--category additivity="true" name="org.apache.qpid.server.txn">
         <priority value="debug"/>
     </category>-->
 
-    <!--<category name="org.apache.qpid.server.store">
+    <!--<category additivity="true" name="org.apache.qpid.server.store">
         <priority value="debug"/>
     </category-->
 

Modified: qpid/branches/qpid-1673/qpid/java/broker/etc/log4j.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/etc/log4j.xml?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/etc/log4j.xml (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/etc/log4j.xml Tue Mar 10 23:10:57 2009
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
  -
  - Licensed to the Apache Software Foundation (ASF) under one
@@ -18,10 +18,10 @@
  - specific language governing permissions and limitations
  - under the License.
  -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-    <appender name="ArchivingFileAppender" class="org.apache.log4j.QpidCompositeRollingAppender">
+ --><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="null" threshold="null">
+    <appender class="org.apache.log4j.QpidCompositeRollingAppender" name="ArchivingFileAppender">
         <!-- Ensure that logs allways have the dateFormat set-->
         <param name="StaticLogFileName" value="false"/>
         <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
@@ -48,7 +48,7 @@
         </layout>
     </appender>
 
-    <appender name="FileAppender" class="org.apache.log4j.FileAppender">
+    <appender class="org.apache.log4j.FileAppender" name="FileAppender">
         <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
         <param name="Append" value="false"/>
 
@@ -57,25 +57,25 @@
         </layout>
     </appender>
 
-    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
+    <appender class="org.apache.log4j.ConsoleAppender" name="STDOUT">
 
         <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
         </layout>
     </appender>
 
-    <!-- Qpid.Broker log is a special log category used to only useful broker startup details -->
-    <category name="Qpid.Broker">
+    <!-- Qpid.Broker log is a special log category used to log only useful broker startup details -->
+    <category additivity="true" name="Qpid.Broker">
         <priority value="debug"/>
         <appender-ref ref="STDOUT"/>
     </category>
 
-    <category name="org.apache.qpid.server.queue.AMQQueueMBean">
+    <category additivity="true" name="org.apache.qpid.server.queue.AMQQueueMBean">
         <priority value="info"/>
     </category>
 
     <!-- Provide warnings to standard output -->
-    <category name="org.apache.qpid">
+    <category additivity="true" name="org.apache.qpid">
         <priority value="warn"/>
     </category>
 
@@ -83,7 +83,7 @@
     <!-- Examples of additional logging settings -->
     <!-- Used to generate extra debug. See debug.log4j.xml -->
     
-    <!--<category name="org.apache.qpid.server.store">
+    <!--<category additivity="true" name="org.apache.qpid.server.store">
         <priority value="debug"/>
     </category-->
 

Modified: qpid/branches/qpid-1673/qpid/java/broker/etc/persistent_config.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/etc/persistent_config.xml?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/etc/persistent_config.xml (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/etc/persistent_config.xml Tue Mar 10 23:10:57 2009
@@ -37,7 +37,6 @@
     <management>
         <enabled>true</enabled>
         <jmxport>8999</jmxport>
-        <security-enabled>false</security-enabled>
         <ssl>
             <enabled>true</enabled>
             <!-- Update below path to your keystore location, eg ${conf}/qpid.keystore  -->

Modified: qpid/branches/qpid-1673/qpid/java/broker/etc/transient_config.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/etc/transient_config.xml?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/etc/transient_config.xml (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/etc/transient_config.xml Tue Mar 10 23:10:57 2009
@@ -37,7 +37,6 @@
     <management>
         <enabled>true</enabled>
         <jmxport>8999</jmxport>
-        <security-enabled>false</security-enabled>
         <ssl>
             <enabled>true</enabled>
             <!-- Update below path to your keystore location, eg ${conf}/qpid.keystore  -->

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java Tue Mar 10 23:10:57 2009
@@ -77,7 +77,7 @@
     @MBeanConstructor("Creates the Broker Manager MBean")
     public AMQBrokerManagerMBean(VirtualHost.VirtualHostMBean virtualHostMBean) throws JMException
     {
-        super(ManagedBroker.class, ManagedBroker.TYPE);
+        super(ManagedBroker.class, ManagedBroker.TYPE, ManagedBroker.VERSION);
 
         _virtualHostMBean = virtualHostMBean;
         VirtualHost virtualHost = virtualHostMBean.getVirtualHost();

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java Tue Mar 10 23:10:57 2009
@@ -251,7 +251,6 @@
         }
         catch (NoRouteException e)
         {
-            //_currentMessage.takeReference();
             _returnMessages.add(e);
         }
     }
@@ -432,7 +431,7 @@
             {
                 if (_log.isDebugEnabled())
                 {
-                    _log.debug(debugIdentity() + " Adding unacked message(" + entry.getMessage().toString() + " DT:" + deliveryTag
+                    _log.debug(debugIdentity() + " Adding unacked message(" + entry.toString() + " DT:" + deliveryTag
                                + ") with a queue(" + entry.getQueue() + ") for " + subscription);
                 }
             }
@@ -552,7 +551,7 @@
             }
             else
             {
-                _log.warn(System.identityHashCode(this) + " Requested requeue of message(" + unacked.getMessage().debugIdentity()
+                _log.warn(System.identityHashCode(this) + " Requested requeue of message(" + unacked.debugIdentity()
                           + "):" + deliveryTag + " but no queue defined and no DeadLetter queue so DROPPING message.");
 
                 unacked.dequeueAndDelete(_storeContext);

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java Tue Mar 10 23:10:57 2009
@@ -26,6 +26,8 @@
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 
+import javax.management.NotCompliantMBeanException;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Option;
@@ -42,10 +44,13 @@
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.apache.mina.transport.socket.nio.SocketSessionConfig;
 import org.apache.mina.util.NewThreadExecutor;
+import org.apache.qpid.AMQException;
 import org.apache.qpid.common.QpidProperties;
 import org.apache.qpid.framing.ProtocolVersion;
 import org.apache.qpid.pool.ReadWriteThreadModel;
 import org.apache.qpid.server.configuration.ServerConfiguration;
+import org.apache.qpid.server.configuration.management.ConfigurationManagementMBean;
+import org.apache.qpid.server.logging.management.LoggingManagementMBean;
 import org.apache.qpid.server.protocol.AMQPFastProtocolHandler;
 import org.apache.qpid.server.protocol.AMQPProtocolProvider;
 import org.apache.qpid.server.registry.ApplicationRegistry;
@@ -232,16 +237,29 @@
 
         String logConfig = commandLine.getOptionValue("l");
         String logWatchConfig = commandLine.getOptionValue("w", "0");
+        
+        int logWatchTime = 0;
+        try
+        {
+            logWatchTime = Integer.parseInt(logWatchConfig);
+        }
+        catch (NumberFormatException e)
+        {
+            System.err.println("Log watch configuration value of " + logWatchConfig + " is invalid. Must be "
+                               + "a non-negative integer. Using default of zero (no watching configured");
+        }
+        
+        File logConfigFile;
         if (logConfig != null)
         {
-            File logConfigFile = new File(logConfig);
-            configureLogging(logConfigFile, logWatchConfig);
+            logConfigFile = new File(logConfig);
+            configureLogging(logConfigFile, logWatchTime);
         }
         else
         {
             File configFileDirectory = configFile.getParentFile();
-            File logConfigFile = new File(configFileDirectory, DEFAULT_LOG_CONFIG_FILENAME);
-            configureLogging(logConfigFile, logWatchConfig);
+            logConfigFile = new File(configFileDirectory, DEFAULT_LOG_CONFIG_FILENAME);
+            configureLogging(logConfigFile, logWatchTime);
         }
 
         ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(configFile);
@@ -249,7 +267,12 @@
         updateManagementPort(serverConfig, commandLine.getOptionValue("m"));
 
         ApplicationRegistry.initialise(config);
+        
+        configureLoggingManagementMBean(logConfigFile, logWatchTime);
 
+        ConfigurationManagementMBean configMBean = new ConfigurationManagementMBean();
+        configMBean.register();
+        
         //fixme .. use QpidProperties.getVersionString when we have fixed the classpath issues
         // that are causing the broker build to pick up the wrong properties file and hence say
         // Starting Qpid Client 
@@ -445,19 +468,8 @@
         return ip;
     }
 
-    private void configureLogging(File logConfigFile, String logWatchConfig)
+    private void configureLogging(File logConfigFile, int logWatchTime)
     {
-        int logWatchTime = 0;
-        try
-        {
-            logWatchTime = Integer.parseInt(logWatchConfig);
-        }
-        catch (NumberFormatException e)
-        {
-            System.err.println("Log watch configuration value of " + logWatchConfig + " is invalid. Must be "
-                               + "a non-negative integer. Using default of zero (no watching configured");
-        }
-
         if (logConfigFile.exists() && logConfigFile.canRead())
         {
             System.out.println("Configuring logger using configuration file " + logConfigFile.getAbsolutePath());
@@ -481,4 +493,17 @@
         }
     }
 
+    private void configureLoggingManagementMBean(File logConfigFile, int logWatchTime) throws Exception
+    {
+        LoggingManagementMBean blm = new LoggingManagementMBean(logConfigFile.getPath(),logWatchTime);
+        
+        try
+        {
+            blm.register();
+        }
+        catch (AMQException e)
+        {
+            throw new InitException("Unable to initialise the Logging Management MBean: ", e);
+        }
+    }
 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java Tue Mar 10 23:10:57 2009
@@ -102,7 +102,7 @@
         //buffer must be marked as persistent:
         for (QueueEntry msg : _unacked.values())
         {
-            if (msg.getMessage().isPersistent())
+            if (msg.isPersistent())
             {
                 return true;
             }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java Tue Mar 10 23:10:57 2009
@@ -89,7 +89,7 @@
             QueueEntry message = _map.remove(deliveryTag);
             if(message != null)
             {
-                _unackedSize -= message.getMessage().getSize();
+                _unackedSize -= message.getSize();
 
             }
 
@@ -115,7 +115,7 @@
         synchronized (_lock)
         {
             _map.put(deliveryTag, message);
-            _unackedSize += message.getMessage().getSize();
+            _unackedSize += message.getSize();
             _lastDeliveryTag = deliveryTag;
         }
     }
@@ -181,7 +181,7 @@
 
                 it.remove();
 
-                _unackedSize -= unacked.getValue().getMessage().getSize();
+                _unackedSize -= unacked.getValue().getSize();
 
 
                 if (unacked.getKey() == deliveryTag)

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java Tue Mar 10 23:10:57 2009
@@ -21,8 +21,10 @@
 package org.apache.qpid.server.configuration;
 
 import java.util.List;
+import java.io.File;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.qpid.server.registry.ApplicationRegistry;
 
 public class QueueConfiguration
 {
@@ -31,13 +33,20 @@
     
     private Configuration _config;
     private String _name;
+    private VirtualHostConfiguration _virtualHostConfiguration;
 
-    public QueueConfiguration(String name, Configuration config)
+    public QueueConfiguration(String name, Configuration config, VirtualHostConfiguration virtualHostConfiguration)
     {
+        _virtualHostConfiguration = virtualHostConfiguration;
         _config = config;
         _name = name;
     }
 
+    public VirtualHostConfiguration getVirtualHostConfiguration()
+    {
+        return _virtualHostConfiguration;
+    }
+
     public boolean getDurable()
     {
         return _config.getBoolean("durable" ,false);
@@ -103,4 +112,13 @@
         return _config.getLong("minimumAlertRepeatGap", 0);
     }
 
+    public long getMemoryUsageMaximum()
+    {
+        return _config.getLong("maximumMemoryUsage", 100 * 1024 * 1024); //100Meg
+    }
+
+    public long getMemoryUsageMinimum()
+    {
+        return _config.getLong("minimumMemoryUsage", 0);
+    }
 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java Tue Mar 10 23:10:57 2009
@@ -33,8 +33,18 @@
 import org.apache.commons.configuration.ConfigurationFactory;
 import org.apache.commons.configuration.SystemConfiguration;
 import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.server.configuration.management.ConfigurationManagementMBean;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.apache.qpid.tools.messagestore.MessageStoreTool;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-public class ServerConfiguration
+import sun.misc.Signal;
+import sun.misc.SignalHandler;
+
+public class ServerConfiguration implements SignalHandler
 {
 
     private static Configuration _config;
@@ -52,6 +62,13 @@
     private Map<String, VirtualHostConfiguration> _virtualHosts = new HashMap<String, VirtualHostConfiguration>();
     private SecurityConfiguration _securityConfiguration = null;
 
+    private File _configFile;
+    
+    private Logger _log = LoggerFactory.getLogger(this.getClass());
+
+    private ConfigurationManagementMBean _mbean;
+    
+
     // Map of environment variables to config items
     private static final Map<String, String> envVarMap = new HashMap<String, String>();
     
@@ -82,6 +99,8 @@
     public ServerConfiguration(File configurationURL) throws ConfigurationException
     {
         this(parseConfig(configurationURL));
+        _configFile = configurationURL;
+        sun.misc.Signal.handle(new sun.misc.Signal("HUP"), this);
     }
 
     public ServerConfiguration(Configuration conf) throws ConfigurationException
@@ -94,8 +113,9 @@
         _securityConfiguration = new SecurityConfiguration(conf.subset("security"));
 
         setupVirtualHosts(conf);
+        
     }
-
+    
     private void setupVirtualHosts(Configuration conf) throws ConfigurationException
     {
         List vhosts = conf.getList("virtualhosts");
@@ -113,7 +133,7 @@
                     CompositeConfiguration mungedConf = new CompositeConfiguration();
                     mungedConf.addConfiguration(conf.subset("virtualhosts.virtualhost."+name));
                     mungedConf.addConfiguration(vhostConfiguration.subset("virtualhost." + name));
-                    VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration(name, mungedConf);
+                    VirtualHostConfiguration vhostConfig = new VirtualHostConfiguration(name, mungedConf, this);
                     _virtualHosts.put(vhostConfig.getName(), vhostConfig);
                 }
             }
@@ -181,6 +201,42 @@
         return conf;
     }
 
+    @Override
+    public void handle(Signal arg0)
+    {
+        try
+        {
+            reparseConfigFile();
+        }
+        catch (ConfigurationException e)
+        {
+             _log.error("Could not reload configuration file", e);
+        }        
+    }
+
+    public void reparseConfigFile() throws ConfigurationException
+    {
+        if (_configFile != null)
+        {
+            Configuration newConfig = parseConfig(_configFile);
+            _securityConfiguration = new SecurityConfiguration(newConfig.subset("security"));
+            ApplicationRegistry.getInstance().getAccessManager().configurePlugins(_securityConfiguration);
+            
+            VirtualHostRegistry vhostRegistry = ApplicationRegistry.getInstance().getVirtualHostRegistry();
+            for (String hostname : _virtualHosts.keySet())
+            {
+                VirtualHost vhost = vhostRegistry.getVirtualHost(hostname);
+                SecurityConfiguration hostSecurityConfig = new SecurityConfiguration(newConfig.subset("virtualhosts.virtualhost."+hostname+".security"));
+                vhost.getAccessManager().configureHostPlugins(hostSecurityConfig);
+            }
+        }
+    }
+
+    public String getQpidWork()
+    {
+        return System.getProperty("QPID_WORK", System.getProperty("java.io.tmpdir"));
+    }
+
     public void setJMXManagementPort(int mport)
     {
         _jmxPort = mport;
@@ -248,11 +304,6 @@
         return _config.getInt("advanced.framesize", DEFAULT_FRAME_SIZE);
     }
 
-    public boolean getManagementSecurityEnabled()
-    {
-        return _config.getBoolean("management.security-enabled", false);
-    }
-
     public boolean getProtectIOEnabled()
     {
         return _config.getBoolean("broker.connector.protectio.enabled", false);
@@ -454,8 +505,10 @@
         _config.setProperty("housekeeping.expiredMessageCheckPeriod", value);
     }
 
-    public long getHousekeepingExpiredMessageCheckPeriod()
+    public long getHousekeepingCheckPeriod()
     {
-        return _config.getLong("housekeeping.expiredMessageCheckPeriod", DEFAULT_HOUSEKEEPING_PERIOD);
+        return _config.getLong("housekeeping.checkPeriod", 
+                   _config.getLong("housekeeping.expiredMessageCheckPeriod", 
+                           DEFAULT_HOUSEKEEPING_PERIOD));
     }
 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java Tue Mar 10 23:10:57 2009
@@ -28,6 +28,7 @@
 import org.apache.commons.configuration.CompositeConfiguration;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.MemoryMessageStore;
 
@@ -37,10 +38,12 @@
     private String _name;
     private Map<String, QueueConfiguration> _queues = new HashMap<String, QueueConfiguration>();
     private Map<String, ExchangeConfiguration> _exchanges = new HashMap<String, ExchangeConfiguration>();
+    private ServerConfiguration _serverConfiguration;
 
-
-    public VirtualHostConfiguration(String name, Configuration config) throws ConfigurationException
+    public VirtualHostConfiguration(String name, Configuration config,
+                                    ServerConfiguration serverConfiguration) throws ConfigurationException
     {
+        _serverConfiguration = serverConfiguration;
         _config = config;
         _name = name;
 
@@ -52,7 +55,7 @@
             CompositeConfiguration mungedConf = new CompositeConfiguration();
             mungedConf.addConfiguration(_config.subset("queues.queue." + queueName));
             mungedConf.addConfiguration(_config.subset("queues"));
-            _queues.put(queueName, new QueueConfiguration(queueName, mungedConf));
+            _queues.put(queueName, new QueueConfiguration(queueName, mungedConf, this));
         }
 
         i = _config.getList("exchanges.exchange.name").iterator();
@@ -67,6 +70,21 @@
         }
     }
 
+    /**
+     * All future usages should use the constructor that takes the ServerConfiguration.
+     *
+     * This can be removed after QPID-1696 has been resolved.
+     *
+     * @param name
+     * @param mungedConf
+     * @throws ConfigurationException
+     */
+    @Deprecated
+    public VirtualHostConfiguration(String name, Configuration mungedConf) throws ConfigurationException
+    {
+        this(name,mungedConf,  ApplicationRegistry.getInstance().getConfiguration());
+    }
+
     public String getName()
     {
         return _name;
@@ -74,7 +92,7 @@
 
     public long getHousekeepingExpiredMessageCheckPeriod()
     {
-        return _config.getLong("housekeeping.expiredMessageCheckPeriod", ApplicationRegistry.getInstance().getConfiguration().getHousekeepingExpiredMessageCheckPeriod());
+        return _config.getLong("housekeeping.expiredMessageCheckPeriod", _serverConfiguration.getHousekeepingCheckPeriod());
     }
 
     public String getAuthenticationDatabase()
@@ -127,4 +145,25 @@
         return _queues.get(queueName);
     }
 
+    public long getMemoryUsageMaximum()
+    {
+        return _config.getLong("queues.maximumMemoryUsage", 0);
+    }
+
+    public long getMemoryUsageMinimum()
+    {
+        return _config.getLong("queues.minimumMemoryUsage", 0);
+    }
+
+    public ServerConfiguration getServerConfiguration()
+    {
+        return _serverConfiguration;
+    }
+
+    public static final String FLOW_TO_DISK_PATH = "flowToDiskPath";
+    public String getFlowToDiskLocation()
+    {
+        return _config.getString(FLOW_TO_DISK_PATH, getServerConfiguration().getQpidWork());
+    }
+
 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java Tue Mar 10 23:10:57 2009
@@ -38,13 +38,9 @@
 import org.apache.qpid.server.management.ManagedObject;
 import org.apache.qpid.server.management.ManagedObjectRegistry;
 import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
-import java.util.List;
-import java.util.Map;
-
 public abstract class AbstractExchange implements Exchange, Managable
 {
     private AMQShortString _name;
@@ -81,7 +77,7 @@
         
         public ExchangeMBean() throws NotCompliantMBeanException
         {
-            super(ManagedExchange.class, ManagedExchange.TYPE);
+            super(ManagedExchange.class, ManagedExchange.TYPE, ManagedExchange.VERSION);
         }
 
         protected void init() throws OpenDataException

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java Tue Mar 10 23:10:57 2009
@@ -40,6 +40,7 @@
 public interface ManagedExchange
 {
     static final String TYPE = "Exchange";
+    static final int VERSION = 1;
 
     /**
      * Returns the name of the managed exchange.

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java Tue Mar 10 23:10:57 2009
@@ -1,6 +1,6 @@
 package org.apache.qpid.server.flow;
 
-import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.server.queue.QueueEntry;
 
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -49,9 +49,9 @@
         return _bytesCredit.get() > 0L;
     }
 
-    public boolean useCreditForMessage(AMQMessage msg)
+    public boolean useCreditForMessage(QueueEntry queueEntry)
     {
-        final long msgSize = msg.getSize();
+        final long msgSize = queueEntry.getSize();
         if(hasCredit())
         {
             if(_bytesCredit.addAndGet(-msgSize) >= 0)

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java Tue Mar 10 23:10:57 2009
@@ -1,6 +1,7 @@
 package org.apache.qpid.server.flow;
 
 import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.server.queue.QueueEntry;
 
 /*
 *
@@ -40,5 +41,5 @@
 
     public boolean hasCredit();
 
-    public boolean useCreditForMessage(AMQMessage msg);
+    public boolean useCreditForMessage(QueueEntry queueEntry);
 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java Tue Mar 10 23:10:57 2009
@@ -1,6 +1,6 @@
 package org.apache.qpid.server.flow;
 
-import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.server.queue.QueueEntry;
 
 /*
 *
@@ -37,7 +37,7 @@
         return true;
     }
 
-    public boolean useCreditForMessage(AMQMessage msg)
+    public boolean useCreditForMessage(QueueEntry queueEntry)
     {
         return true;
     }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java Tue Mar 10 23:10:57 2009
@@ -1,6 +1,6 @@
 package org.apache.qpid.server.flow;
 
-import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.server.queue.QueueEntry;
 
 /*
 *
@@ -52,7 +52,7 @@
         return (_messageCredit > 0L) && ( _bytesCredit > 0L );
     }
 
-    public synchronized boolean useCreditForMessage(AMQMessage msg)
+    public synchronized boolean useCreditForMessage(QueueEntry queueEntry)
     {
         if(_messageCredit == 0L)
         {
@@ -61,7 +61,7 @@
         }
         else
         {
-            final long msgSize = msg.getSize();
+            final long msgSize = queueEntry.getSize();
             if(msgSize > _bytesCredit)
             {
                 setSuspended(true);

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java Tue Mar 10 23:10:57 2009
@@ -1,6 +1,6 @@
 package org.apache.qpid.server.flow;
 
-import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.server.queue.QueueEntry;
 
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -50,7 +50,7 @@
         return _messageCredit.get() > 0L;
     }
 
-    public boolean useCreditForMessage(AMQMessage msg)
+    public boolean useCreditForMessage(QueueEntry queueEntry)
     {
         if(hasCredit())
         {

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java Tue Mar 10 23:10:57 2009
@@ -20,7 +20,7 @@
 */
 package org.apache.qpid.server.flow;
 
-import org.apache.qpid.server.queue.AMQMessage;
+import org.apache.qpid.server.queue.QueueEntry;
 
 public class Pre0_10CreditManager extends AbstractFlowCreditManager implements FlowCreditManager
 {
@@ -123,7 +123,7 @@
                 && (_messageCreditLimit == 0L || _messageCredit > 0);
     }
 
-    public synchronized boolean useCreditForMessage(final AMQMessage msg)
+    public synchronized boolean useCreditForMessage(final QueueEntry queueEntry)
     {
         if(_messageCreditLimit != 0L)
         {
@@ -137,10 +137,10 @@
                 }
                 else
                 {
-                    if((_bytesCredit >= msg.getSize()) || (_bytesCredit == _bytesCreditLimit))
+                    if((_bytesCredit >= queueEntry.getSize()) || (_bytesCredit == _bytesCreditLimit))
                     {
                         _messageCredit--;
-                        _bytesCredit -= msg.getSize();
+                        _bytesCredit -= queueEntry.getSize();
 
                         return true;
                     }
@@ -166,9 +166,9 @@
             }
             else
             {
-                if((_bytesCredit >= msg.getSize()) || (_bytesCredit == _bytesCreditLimit))
+                if((_bytesCredit >= queueEntry.getSize()) || (_bytesCredit == _bytesCreditLimit))
                 {
-                    _bytesCredit -= msg.getSize();
+                    _bytesCredit -= queueEntry.getSize();
 
                     return true;
                 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java Tue Mar 10 23:10:57 2009
@@ -129,7 +129,7 @@
             public void deliverToClient(final Subscription sub, final QueueEntry entry, final long deliveryTag)
             throws AMQException
             {
-                singleMessageCredit.useCreditForMessage(entry.getMessage());
+                singleMessageCredit.useCreditForMessage(entry);
                 session.getProtocolOutputConverter().writeGetOk(entry, channel.getChannelId(),
                                                                         deliveryTag, queue.getMessageCount());
 
@@ -181,9 +181,9 @@
             super(channel, protocolSession, consumerTag, filters, noLocal, creditManager, deliveryMethod, recordMethod);
         }
 
-        public boolean wouldSuspend(QueueEntry msg)
+        public boolean wouldSuspend(QueueEntry queueEntry)
         {
-            return !getCreditManager().useCreditForMessage(msg.getMessage());
+            return !getCreditManager().useCreditForMessage(queueEntry);
         }
 
     }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java Tue Mar 10 23:10:57 2009
@@ -96,7 +96,7 @@
 
             if (_logger.isDebugEnabled())
             {
-                _logger.debug("Rejecting: DT:" + deliveryTag + "-" + queueEntry.getMessage().debugIdentity() +
+                _logger.debug("Rejecting: DT:" + deliveryTag + "-" + queueEntry.debugIdentity() +
                               ": Requeue:" + body.getRequeue() +
                               //": Resend:" + evt.getMethod().resend +
                               " on channel:" + channel.debugIdentity());

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java Tue Mar 10 23:10:57 2009
@@ -50,10 +50,10 @@
 
     protected MBeanInfo _mbeanInfo;
 
-    protected AMQManagedObject(Class<?> managementInterface, String typeName)
+    protected AMQManagedObject(Class<?> managementInterface, String typeName, int version)
         throws NotCompliantMBeanException
     {
-        super(managementInterface, typeName);
+        super(managementInterface, typeName, version);
         buildMBeanInfo();
     }
 

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java Tue Mar 10 23:10:57 2009
@@ -39,13 +39,15 @@
     private Class<?> _managementInterface;
 
     private String _typeName;
+    private int _version;
 
-    protected DefaultManagedObject(Class<?> managementInterface, String typeName)
+    protected DefaultManagedObject(Class<?> managementInterface, String typeName, int version)
         throws NotCompliantMBeanException
     {
         super(managementInterface);
         _managementInterface = managementInterface;
         _typeName = typeName;
+        _version = version;
     }
 
     public String getType()
@@ -115,6 +117,10 @@
         objectName.append(getHierarchicalName(this));
         objectName.append("name=").append(name);
 
+        objectName.append(",");
+        objectName.append("version=").append(_version);
+
+
         return new ObjectName(objectName.toString());
     }
 
@@ -132,6 +138,9 @@
             objectName.append(hierarchyName.substring(0, hierarchyName.lastIndexOf(",")));
         }
 
+        objectName.append(",");
+        objectName.append("version=").append(_version);
+        
         return new ObjectName(objectName.toString());
     }
 

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java Tue Mar 10 23:10:57 2009
@@ -107,8 +107,6 @@
         }
 
         IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-
-        boolean jmxmpSecurity = appRegistry.getConfiguration().getManagementSecurityEnabled();
         int port = appRegistry.getConfiguration().getJMXManagementPort();
 
         //retrieve the Principal Database assigned to JMX authentication duties
@@ -119,184 +117,152 @@
         final JMXConnectorServer cs;
         HashMap<String,Object> env = new HashMap<String,Object>();
 
-        if (jmxmpSecurity)
+        //Socket factories for the RMIConnectorServer, either default or SLL depending on configuration
+        RMIClientSocketFactory csf;
+        RMIServerSocketFactory ssf;
+
+        //check ssl enabled option in config, default to true if option is not set
+        boolean sslEnabled = appRegistry.getConfiguration().getManagementSSLEnabled();
+
+        if (sslEnabled)
         {
-            // For SASL using JMXMP
-            JMXServiceURL jmxURL = new JMXServiceURL("jmxmp", null, port);
+            //set the SSL related system properties used by the SSL RMI socket factories to the values
+            //given in the configuration file, unless command line settings have already been specified
+            String keyStorePath;
 
-            String saslType = null;
-            if (db instanceof Base64MD5PasswordFilePrincipalDatabase)
+            if(System.getProperty("javax.net.ssl.keyStore") != null)
             {
-                saslType = "SASL/CRAM-MD5";
-                env.put("jmx.remote.profiles", "SASL/CRAM-MD5");
-                CRAMMD5HashedInitialiser initialiser = new CRAMMD5HashedInitialiser();
-                initialiser.initialise(db);
-                env.put("jmx.remote.sasl.callback.handler", initialiser.getCallbackHandler());
+                keyStorePath = System.getProperty("javax.net.ssl.keyStore");
             }
-            else if (db instanceof PlainPasswordFilePrincipalDatabase)
+            else
             {
-                saslType = "SASL/PLAIN";
-                PlainInitialiser initialiser = new PlainInitialiser();
-                initialiser.initialise(db);
-                env.put("jmx.remote.sasl.callback.handler", initialiser.getCallbackHandler());
-                env.put("jmx.remote.profiles", "SASL/PLAIN");
+                keyStorePath = appRegistry.getConfiguration().getManagementKeyStorePath();
             }
 
-            //workaround NPE generated from env map classloader issue when using Eclipse 3.4 to launch
-            env.put("jmx.remote.profile.provider.class.loader", this.getClass().getClassLoader());
+            //check the keystore path value is valid
+            if (keyStorePath == null)
+            {
+                throw new ConfigurationException("JMX management SSL keystore path not defined, " +
+                    		                     "unable to start SSL protected JMX ConnectorServer");
+            }
+            else
+            {
+                //ensure the system property is set
+                System.setProperty("javax.net.ssl.keyStore", keyStorePath);
 
-            _log.warn("Starting JMXMP based JMX ConnectorServer on port '" + port + "' with " + saslType);
-            _startupLog.warn("Starting JMXMP based JMX ConnectorServer on port '" + port + "' with " + saslType);
-            
-            cs = JMXConnectorServerFactory.newJMXConnectorServer(jmxURL, env, _mbeanServer);
-        }
-        else
-        {   
-            //Socket factories for the RMIConnectorServer, either default or SLL depending on configuration
-            RMIClientSocketFactory csf;
-            RMIServerSocketFactory ssf;
-            
-            //check ssl enabled option in config, default to true if option is not set
-            boolean sslEnabled = appRegistry.getConfiguration().getManagementSSLEnabled();
-
-            if (sslEnabled)
-            {
-                //set the SSL related system properties used by the SSL RMI socket factories to the values
-                //given in the configuration file, unless command line settings have already been specified
-                String keyStorePath;
-                
-                if(System.getProperty("javax.net.ssl.keyStore") != null)
+                //check the file is usable
+                File ksf = new File(keyStorePath);
+
+                if (!ksf.exists())
                 {
-                    keyStorePath = System.getProperty("javax.net.ssl.keyStore");
+                    throw new FileNotFoundException("Cannot find JMX management SSL keystore file " + ksf);
                 }
-                else{
-                    keyStorePath = appRegistry.getConfiguration().getManagementKeyStorePath();
+                if (!ksf.canRead())
+                {
+                    throw new FileNotFoundException("Cannot read JMX management SSL keystore file: " 
+                                                    + ksf +  ". Check permissions.");
                 }
                 
-                //check the keystore path value is valid
-                if (keyStorePath == null)
+                _log.info("JMX ConnectorServer using SSL keystore file " + ksf.getAbsolutePath());
+                _startupLog.info("JMX ConnectorServer using SSL keystore file " + ksf.getAbsolutePath());
+            }
+
+            //check the key store password is set
+            if (System.getProperty("javax.net.ssl.keyStorePassword") == null)
+            {
+
+                if (appRegistry.getConfiguration().getManagementKeyStorePassword() == null)
                 {
-                    throw new ConfigurationException("JMX management SSL keystore path not defined, " +
-                    		                         "unable to start SSL protected JMX ConnectorServer");
+                    throw new ConfigurationException("JMX management SSL keystore password not defined, " +
+                      		                         "unable to start requested SSL protected JMX server");
                 }
                 else
                 {
-                    //ensure the system property is set
-                    System.setProperty("javax.net.ssl.keyStore", keyStorePath);
-                    
-                    //check the file is usable
-                    File ksf = new File(keyStorePath);
-                    
-                    if (!ksf.exists())
-                    {
-                        throw new FileNotFoundException("Cannot find JMX management SSL keystore file " + ksf);
-                    }
-                    if (!ksf.canRead())
-                    {
-                        throw new FileNotFoundException("Cannot read JMX management SSL keystore file: " 
-                                                        + ksf +  ". Check permissions.");
-                    }
-                    
-                    _log.info("JMX ConnectorServer using SSL keystore file " + ksf.getAbsolutePath());
-                    _startupLog.info("JMX ConnectorServer using SSL keystore file " + ksf.getAbsolutePath());
+                   System.setProperty("javax.net.ssl.keyStorePassword",
+                           appRegistry.getConfiguration().getManagementKeyStorePassword());
                 }
+            }
 
-                //check the key store password is set
-                if (System.getProperty("javax.net.ssl.keyStorePassword") == null)
-                {
-                
-                    if (appRegistry.getConfiguration().getManagementKeyStorePassword() == null)
-                    {
-                        throw new ConfigurationException("JMX management SSL keystore password not defined, " +
-                        		                         "unable to start requested SSL protected JMX server");
-                    }
-                    else
-                    {
-                        System.setProperty("javax.net.ssl.keyStorePassword",
-                                appRegistry.getConfiguration().getManagementKeyStorePassword());
-                    }
-                }
+            //create the SSL RMI socket factories
+            csf = new SslRMIClientSocketFactory();
+            ssf = new SslRMIServerSocketFactory();
+
+            _log.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" + 
+                     (port +PORT_EXPORT_OFFSET) + ") with SSL");
+            _startupLog.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" + 
+                     (port +PORT_EXPORT_OFFSET) + ") with SSL");
+        }
+        else
+        {
+            //Do not specify any specific RMI socket factories, resulting in use of the defaults.
+            csf = null;
+            ssf = null;
 
-                //create the SSL RMI socket factories
-                csf = new SslRMIClientSocketFactory();
-                ssf = new SslRMIServerSocketFactory();
-
-                _log.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" + 
-                        (port +PORT_EXPORT_OFFSET) + ") with SSL");
-                _startupLog.warn("Starting JMX ConnectorServer on port '"+ port + "' (+" + 
-                        (port +PORT_EXPORT_OFFSET) + ") with SSL");
-            }
-            else
-            {
-                //Do not specify any specific RMI socket factories, resulting in use of the defaults.
-                csf = null;
-                ssf = null;
-                
-                _log.warn("Starting JMX ConnectorServer on port '" + port + "' (+" + (port +PORT_EXPORT_OFFSET) + ")");
-                _startupLog.warn("Starting JMX ConnectorServer on port '" + port + "' (+" + (port +PORT_EXPORT_OFFSET) + ")");
-            }
-            
-            //add a JMXAuthenticator implementation the env map to authenticate the RMI based JMX connector server
-            RMIPasswordAuthenticator rmipa = new RMIPasswordAuthenticator();
-            rmipa.setPrincipalDatabase(db);
-            env.put(JMXConnectorServer.AUTHENTICATOR, rmipa);
-            
-            /*
-             * Start a RMI registry on the management port, to hold the JMX RMI ConnectorServer stub. 
-             * Using custom socket factory to prevent anyone (including us unfortunately) binding to the registry using RMI.
-             * As a result, only binds made using the object reference will succeed, thus securing it from external change. 
-             */
-            System.setProperty("java.rmi.server.randomIDs", "true");
-            _rmiRegistry = LocateRegistry.createRegistry(port, null, new CustomRMIServerSocketFactory());
-            
-            /*
-             * We must now create the RMI ConnectorServer manually, as the JMX Factory methods use RMI calls 
-             * to bind the ConnectorServer to the registry, which will now fail as for security we have
-             * locked it from any RMI based modifications, including our own. Instead, we will manually bind 
-             * the RMIConnectorServer stub to the registry using its object reference, which will still succeed.
-             * 
-             * The registry is exported on the defined management port 'port'. We will export the RMIConnectorServer
-             * on 'port +1'. Use of these two well-defined ports will ease any navigation through firewall's. 
-             */
-            final RMIServerImpl rmiConnectorServerStub = new RMIJRMPServerImpl(port+PORT_EXPORT_OFFSET, csf, ssf, env); 
-            final String hostname = InetAddress.getLocalHost().getHostName();
-            final JMXServiceURL externalUrl = new JMXServiceURL(
-                    "service:jmx:rmi://"+hostname+":"+(port+PORT_EXPORT_OFFSET)+"/jndi/rmi://"+hostname+":"+port+"/jmxrmi");
+            _log.warn("Starting JMX ConnectorServer on port '" + port + "' (+" + (port +PORT_EXPORT_OFFSET) + ")");
+            _startupLog.warn("Starting JMX ConnectorServer on port '" + port + "' (+" + (port +PORT_EXPORT_OFFSET) + ")");
+        }
 
-            final JMXServiceURL internalUrl = new JMXServiceURL("rmi", hostname, port+PORT_EXPORT_OFFSET);
-            cs = new RMIConnectorServer(internalUrl, env, rmiConnectorServerStub, _mbeanServer)
+        //add a JMXAuthenticator implementation the env map to authenticate the RMI based JMX connector server
+        RMIPasswordAuthenticator rmipa = new RMIPasswordAuthenticator();
+        rmipa.setPrincipalDatabase(db);
+        env.put(JMXConnectorServer.AUTHENTICATOR, rmipa);
+
+        /*
+         * Start a RMI registry on the management port, to hold the JMX RMI ConnectorServer stub. 
+         * Using custom socket factory to prevent anyone (including us unfortunately) binding to the registry using RMI.
+         * As a result, only binds made using the object reference will succeed, thus securing it from external change. 
+         */
+        System.setProperty("java.rmi.server.randomIDs", "true");
+        _rmiRegistry = LocateRegistry.createRegistry(port, null, new CustomRMIServerSocketFactory());
+
+        /*
+         * We must now create the RMI ConnectorServer manually, as the JMX Factory methods use RMI calls 
+         * to bind the ConnectorServer to the registry, which will now fail as for security we have
+         * locked it from any RMI based modifications, including our own. Instead, we will manually bind 
+         * the RMIConnectorServer stub to the registry using its object reference, which will still succeed.
+         * 
+         * The registry is exported on the defined management port 'port'. We will export the RMIConnectorServer
+         * on 'port +1'. Use of these two well-defined ports will ease any navigation through firewall's. 
+         */
+        final RMIServerImpl rmiConnectorServerStub = new RMIJRMPServerImpl(port+PORT_EXPORT_OFFSET, csf, ssf, env); 
+        final String hostname = InetAddress.getLocalHost().getHostName();
+        final JMXServiceURL externalUrl = new JMXServiceURL(
+                "service:jmx:rmi://"+hostname+":"+(port+PORT_EXPORT_OFFSET)+"/jndi/rmi://"+hostname+":"+port+"/jmxrmi");
+
+        final JMXServiceURL internalUrl = new JMXServiceURL("rmi", hostname, port+PORT_EXPORT_OFFSET);
+        cs = new RMIConnectorServer(internalUrl, env, rmiConnectorServerStub, _mbeanServer)
+        {   
+            @Override  
+            public synchronized void start() throws IOException
             {   
-                @Override  
-                public synchronized void start() throws IOException
+                try
                 {   
-                    try
-                    {   
-                        //manually bind the connector server to the registry at key 'jmxrmi', like the out-of-the-box agent                        
-                        _rmiRegistry.bind("jmxrmi", rmiConnectorServerStub);   
-                    }
-                    catch (AlreadyBoundException abe)
-                    {   
-                        //key was already in use. shouldnt happen here as its a new registry, unbindable by normal means.
-                        
-                        //IOExceptions are the only checked type throwable by the method, wrap and rethrow
-                        IOException ioe = new IOException(abe.getMessage());   
-                        ioe.initCause(abe);   
-                        throw ioe;   
-                    }
-                    
-                    //now do the normal tasks
-                    super.start();   
-                }   
-                
-                @Override  
-                public JMXServiceURL getAddress()
-                {
-                    //must return our pre-crafted url that includes the full details, inc JNDI details
-                    return externalUrl;
-                }   
+                    //manually bind the connector server to the registry at key 'jmxrmi', like the out-of-the-box agent                        
+                    _rmiRegistry.bind("jmxrmi", rmiConnectorServerStub);   
+                }
+                catch (AlreadyBoundException abe)
+                {   
+                    //key was already in use. shouldnt happen here as its a new registry, unbindable by normal means.
 
-            };   
-        }
+                    //IOExceptions are the only checked type throwable by the method, wrap and rethrow
+                    IOException ioe = new IOException(abe.getMessage());   
+                    ioe.initCause(abe);   
+                    throw ioe;   
+                }
+
+                //now do the normal tasks
+                super.start();   
+            }   
+
+            @Override  
+            public JMXServiceURL getAddress()
+            {
+                //must return our pre-crafted url that includes the full details, inc JNDI details
+                return externalUrl;
+            }   
+
+        };   
+        
 
         //Add the custom invoker as an MBeanServerForwarder, and start the RMIConnectorServer.
         MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance();

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java Tue Mar 10 23:10:57 2009
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.management;
 
+import org.apache.qpid.server.configuration.management.ConfigurationManagement;
+import org.apache.qpid.server.logging.management.LoggingManagement;
 import org.apache.qpid.server.security.access.management.UserManagement;
 import org.apache.log4j.Logger;
 
@@ -37,6 +39,8 @@
 import java.security.AccessController;
 import java.security.Principal;
 import java.security.AccessControlContext;
+import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Set;
 import java.util.Properties;
 
@@ -53,9 +57,16 @@
     public final static String READWRITE = "readwrite";
     public final static String READONLY = "readonly";
     private final static String DELEGATE = "JMImplementation:type=MBeanServerDelegate";
-    private MBeanServer mbs;
+    private MBeanServer _mbs;
     private static Properties _userRoles = new Properties();
 
+    private static HashSet<String> _adminOnlyMethods = new HashSet<String>();
+    {
+        _adminOnlyMethods.add(UserManagement.TYPE); 
+        _adminOnlyMethods.add(LoggingManagement.TYPE);
+        _adminOnlyMethods.add(ConfigurationManagement.TYPE);
+    }
+    
     public static MBeanServerForwarder newProxyInstance()
     {
         final InvocationHandler handler = new MBeanInvocationHandlerImpl();
@@ -71,7 +82,7 @@
 
         if (methodName.equals("getMBeanServer"))
         {
-            return mbs;
+            return _mbs;
         }
 
         if (methodName.equals("setMBeanServer"))
@@ -80,11 +91,11 @@
             {
                 throw new IllegalArgumentException("Null MBeanServer");
             }
-            if (mbs != null)
+            if (_mbs != null)
             {
                 throw new IllegalArgumentException("MBeanServer object already initialized");
             }
-            mbs = (MBeanServer) args[0];
+            _mbs = (MBeanServer) args[0];
             return null;
         }
 
@@ -95,12 +106,12 @@
         // Allow operations performed locally on behalf of the connector server itself
         if (subject == null)
         {
-            return method.invoke(mbs, args);
+            return method.invoke(_mbs, args);
         }
 
         if (args == null || DELEGATE.equals(args[0]))
         {
-            return method.invoke(mbs, args);
+            return method.invoke(_mbs, args);
         }
 
         // Restrict access to "createMBean" and "unregisterMBean" to any user
@@ -124,7 +135,7 @@
         {
             if (isAdmin(identity))
             {
-                return method.invoke(mbs, args);
+                return method.invoke(_mbs, args);
             }
             else
             {
@@ -135,14 +146,14 @@
         // Following users can perform any operation other than "createMBean" and "unregisterMBean"
         if (isAllowedToModify(identity))
         {
-            return method.invoke(mbs, args);
+            return method.invoke(_mbs, args);
         }
 
         // These users can only call "getAttribute" on the MBeanServerDelegate MBean
         // Here we can add other fine grained permissions like specific method for a particular mbean
         if (isReadOnlyUser(identity) && isReadOnlyMethod(method, args))
         {
-            return method.invoke(mbs, args);
+            return method.invoke(_mbs, args);
         }
 
         throw new SecurityException("Access denied");
@@ -153,9 +164,9 @@
         if (args[0] instanceof ObjectName)
         {
             ObjectName object = (ObjectName) args[0];
-            return UserManagement.TYPE.equals(object.getKeyProperty("type"));
+            
+            return _adminOnlyMethods.contains(object.getKeyProperty("type"));
         }
-
         return false;
     }
 
@@ -196,7 +207,10 @@
     private boolean isReadOnlyMethod(Method method, Object[] args)
     {
         String methodName = method.getName();
-        if (methodName.startsWith("query") || methodName.startsWith("get"))
+        
+        //handle standard get/set/query and select 'is' methods from MBeanServer
+        if (methodName.startsWith("query") || methodName.startsWith("get")
+            ||methodName.startsWith("isInstanceOf") || methodName.startsWith("isRegistered"))
         {
             return true;
         }
@@ -205,8 +219,11 @@
             return false;
         }
 
+        //handle invocation of other methods on mbeans
         if ((args[0] instanceof ObjectName) && (methodName.equals("invoke")))
         {
+
+            //get invoked method name
             String mbeanMethod = (args.length > 1) ? (String) args[1] : null;
             if (mbeanMethod == null)
             {
@@ -215,7 +232,8 @@
 
             try
             {
-                MBeanInfo mbeanInfo = mbs.getMBeanInfo((ObjectName) args[0]);
+                //check if the given method is tagged with an INFO impact attribute
+                MBeanInfo mbeanInfo = _mbs.getMBeanInfo((ObjectName) args[0]);
                 if (mbeanInfo != null)
                 {
                     MBeanOperationInfo[] opInfos = mbeanInfo.getOperations();

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java Tue Mar 10 23:10:57 2009
@@ -40,12 +40,13 @@
 {
     static final String TYPE = "VirtualHostManager";
 
+    static final int VERSION = 1 ;
+
     /**
      * Creates a new Exchange.
      * @param name
      * @param type
      * @param durable
-     * @param passive
      * @throws IOException
      * @throws JMException
      */
@@ -73,7 +74,6 @@
      * @param queueName
      * @param durable
      * @param owner
-     * @param autoDelete
      * @throws IOException
      * @throws JMException
      */

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java Tue Mar 10 23:10:57 2009
@@ -35,6 +35,7 @@
 import org.apache.qpid.server.security.access.plugins.AllowAll;
 import org.apache.qpid.server.security.access.plugins.DenyAll;
 import org.apache.qpid.server.security.access.plugins.SimpleXML;
+import org.apache.qpid.server.security.access.plugins.network.FirewallPlugin;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleException;
 import org.osgi.util.tracker.ServiceTracker;
@@ -165,6 +166,7 @@
             _securityPlugins.put(SimpleXML.class.getName(), SimpleXML.FACTORY);
             _securityPlugins.put(AllowAll.class.getName(), AllowAll.FACTORY);
             _securityPlugins.put(DenyAll.class.getName(), DenyAll.FACTORY);
+            _securityPlugins.put(FirewallPlugin.class.getName(), FirewallPlugin.FACTORY);
         }
         return _securityPlugins;
     }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java Tue Mar 10 23:10:57 2009
@@ -37,7 +37,6 @@
  */
 package org.apache.qpid.server.protocol;
 
-import java.security.Principal;
 import java.util.Date;
 import java.util.List;
 
@@ -58,7 +57,6 @@
 import javax.management.openmbean.TabularType;
 
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.ConnectionCloseBody;
 import org.apache.qpid.framing.MethodRegistry;
@@ -93,7 +91,7 @@
     @MBeanConstructor("Creates an MBean exposing an AMQ Broker Connection")
     public AMQProtocolSessionMBean(AMQMinaProtocolSession session) throws NotCompliantMBeanException, OpenDataException
     {
-        super(ManagedConnection.class, ManagedConnection.TYPE);
+        super(ManagedConnection.class, ManagedConnection.TYPE, ManagedConnection.VERSION);
         _session = session;
         String remote = getRemoteAddress();
         remote = "anonymous".equals(remote) ? (remote + hashCode()) : remote;

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java Tue Mar 10 23:10:57 2009
@@ -41,6 +41,7 @@
 public interface ManagedConnection
 {
     static final String TYPE = "Connection";
+    static final int VERSION = 1;
 
     @MBeanAttribute(name = "ClientId", description = "Client Id")
     String getClientId();

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java Tue Mar 10 23:10:57 2009
@@ -60,30 +60,6 @@
 
     //Check the status of this message
 
-    /**
-     * Called selectors to determin if the message has already been sent
-     *
-     * @return _deliveredToConsumer
-     */
-    boolean getDeliveredToConsumer();
-
-    /**
-     * Called to enforce the 'immediate' flag.
-     *
-     * @returns  true if the message is marked for immediate delivery but has not been marked as delivered
-     *                              to a consumer
-     */
-    boolean immediateAndNotDelivered();
-
-    /**
-     * Checks to see if the message has expired. If it has the message is dequeued.
-     *
-     * @return true if the message has expire
-     *
-     * @throws org.apache.qpid.AMQException
-     */
-    boolean expired() throws AMQException;
-
     /** Is this a persistent message
      *
      * @return true if the message is persistent
@@ -91,13 +67,8 @@
     boolean isPersistent();
 
 
-    /**
-     * Called when this message is delivered to a consumer. (used to implement the 'immediate' flag functionality).
-     * And for selector efficiency.
-     */
-    void setDeliveredToConsumer();
+    boolean isImmediate();
 
-    void setExpiration(long expiration);
 
     void setClientIdentifier(AMQProtocolSession.ProtocolSessionIdentifier sessionIdentifier);
 
@@ -113,9 +84,16 @@
     void addContentBodyFrame(StoreContext storeContext, ContentChunk contentChunk, boolean isLastContentBody)
             throws AMQException;
 
+    void recoverFromMessageMetaData(MessageMetaData mmd);
+
+    void recoverContentBodyFrame(ContentChunk contentChunk, boolean isLastContentBody) throws AMQException;
 
 
     String toString();
 
     String debugIdentity();
+
+    void setExpiration(long expiration);
+
+    long getExpiration();
 }

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java Tue Mar 10 23:10:57 2009
@@ -36,12 +36,12 @@
                                int priorities)
             throws AMQException
     {
-        super(name, durable, owner, autoDelete, virtualHost, new PriorityQueueList.Factory(priorities));
+        super(name, durable, owner, autoDelete, virtualHost, new PriorityQueueEntryList.Factory(priorities));
     }
 
     public int getPriorities()
     {
-        return ((PriorityQueueList) _entries).getPriorities();
+        return ((PriorityQueueEntryList) _entries).getPriorities();
     }
 
     @Override

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java Tue Mar 10 23:10:57 2009
@@ -68,6 +68,8 @@
 
     boolean isEmpty();
 
+    boolean isFlowed();
+
     int getMessageCount();
 
     int getUndeliveredMessageCount();
@@ -111,7 +113,15 @@
 
     void removeMessagesFromQueue(long fromMessageId, long toMessageId, StoreContext storeContext);
 
+    long getMemoryUsageMaximum();
+
+    void setMemoryUsageMaximum(long maximumMemoryUsage);
+
+    long getMemoryUsageMinimum();
+
+    void setMemoryUsageMinimum(long minimumMemoryUsage);
 
+    long getMemoryUsageCurrent();
 
     long getMaximumMessageSize();
 

Modified: qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java?rev=752300&r1=752299&r2=752300&view=diff
==============================================================================
--- qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java (original)
+++ qpid/branches/qpid-1673/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java Tue Mar 10 23:10:57 2009
@@ -23,13 +23,17 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.protocol.AMQConstant;
 import org.apache.qpid.server.configuration.QueueConfiguration;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
-
 public class AMQQueueFactory
 {
     public static final AMQShortString X_QPID_PRIORITIES = new AMQShortString("x-qpid-priorities");
+    public static final AMQShortString QPID_MAX_COUNT = new AMQShortString("qpid.max_count");
+    public static final AMQShortString QPID_MAX_SIZE = new AMQShortString("qpid.max_size");
+    public static final AMQShortString QPID_POLICY_TYPE = new AMQShortString("qpid.policy_type");
+    public static final String QPID_FLOW_TO_DISK = "flow_to_disk";
 
     public static AMQQueue createAMQQueueImpl(AMQShortString name,
                                               boolean durable,
@@ -39,10 +43,26 @@
             throws AMQException
     {
 
-        final int priorities = arguments == null ? 1 : arguments.containsKey(X_QPID_PRIORITIES) ? arguments.getInteger(X_QPID_PRIORITIES) : 1;
+        int priorities = 1;
+
+        if (arguments != null && arguments.containsKey(X_QPID_PRIORITIES))
+        {
+            Integer priority = arguments.getInteger(X_QPID_PRIORITIES);
+
+            if (priority != null)
+            {
+                priorities = priority.intValue();
+            }
+            else
+            {
+                throw new AMQException(AMQConstant.INVALID_ARGUMENT,
+                                       "Queue create request with non integer value for :" + X_QPID_PRIORITIES + "=" + arguments.get(X_QPID_PRIORITIES), null);
+            }
+
+        }
 
         AMQQueue q = null;
-        if(priorities > 1)
+        if (priorities > 1)
         {
             q = new AMQPriorityQueue(name, durable, owner, autoDelete, virtualHost, priorities);
         }
@@ -51,6 +71,40 @@
             q = new SimpleAMQQueue(name, durable, owner, autoDelete, virtualHost);
         }
 
+        final String queuePolicyType = arguments == null ? null :
+                                       arguments.containsKey(QPID_POLICY_TYPE) ? arguments.getString(QPID_POLICY_TYPE) : null;
+
+        if (queuePolicyType != null)
+        {
+            if (queuePolicyType.equals(QPID_FLOW_TO_DISK))
+            {
+                if (arguments.containsKey(QPID_MAX_SIZE))
+                {
+
+                    final long queueSize = arguments.getInteger(QPID_MAX_SIZE);
+
+                    if (queueSize < 0)
+                    {
+                        throw new AMQException(AMQConstant.INVALID_ARGUMENT,
+                                               "Queue create request with negative size:" + queueSize, null);
+                    }
+
+                    q.setMemoryUsageMaximum(queueSize);
+                }
+                else
+                {
+                    throw new AMQException(AMQConstant.INVALID_ARGUMENT,
+                                           "Queue create request with no qpid.max_size value,", null);
+                }
+            }
+            else
+            {
+                throw new AMQException(AMQConstant.NOT_IMPLEMENTED,
+                                       "Queue create request with unknown Policy Type:" + queuePolicyType, null);
+            }
+
+        }
+
         //Register the new queue
         virtualHost.getQueueRegistry().registerQueue(q);
         return q;
@@ -66,9 +120,9 @@
         FieldTable arguments = null;
         boolean priority = config.getPriority();
         int priorities = config.getPriorities();
-        if(priority || priorities > 0)
+        if (priority || priorities > 0)
         {
-            if(arguments == null)
+            if (arguments == null)
             {
                 arguments = new FieldTable();
             }
@@ -85,6 +139,8 @@
         q.setMaximumMessageSize(config.getMaximumMessageSize());
         q.setMaximumMessageCount(config.getMaximumMessageCount());
         q.setMinimumAlertRepeatGap(config.getMinimumAlertRepeatGap());
+        q.setMemoryUsageMaximum(config.getMemoryUsageMaximum());
+        q.setMemoryUsageMinimum(config.getMemoryUsageMinimum());
         return q;
     }
 }



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