Author: ritchiem
Date: Tue Feb  6 02:13:11 2007
New Revision: 504062

URL: http://svn.apache.org/viewvc?view=rev&rev=504062
Log:
Merged revisions 503718-504056 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/qpid/trunk

........
  r503790 | bhupendrab | 2007-02-05 17:45:09 +0000 (Mon, 05 Feb 2007) | 2 lines
  
  QPID-326
  AMQQueueMBean updated with attribute MaximumMessageAge
........
  r504025 | gsim | 2007-02-06 08:24:41 +0000 (Tue, 06 Feb 2007) | 3 lines
  
  Applied patch from Jonathan Anstey <[EMAIL PROTECTED]> to fix trivial compile 
error.
........

Modified:
    incubator/qpid/branches/perftesting_persistent/   (props changed)
    
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
    
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
    
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
    
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
    
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
    
incubator/qpid/branches/perftesting_persistent/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java

Propchange: incubator/qpid/branches/perftesting_persistent/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb  6 02:13:11 2007
@@ -1 +1 @@
-/incubator/qpid/trunk:1-503717
+/incubator/qpid/trunk:1-504056

Modified: 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java?view=diff&rev=504062&r1=504061&r2=504062
==============================================================================
--- 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
 (original)
+++ 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
 Tue Feb  6 02:13:11 2007
@@ -61,9 +61,6 @@
         _virtualHostMBean = virtualHostMBean;
         VirtualHost virtualHost = virtualHostMBean.getVirtualHost();
 
-
-
-
         _queueRegistry = virtualHost.getQueueRegistry();
         _exchangeRegistry = virtualHost.getExchangeRegistry();
         _messageStore = virtualHost.getMessageStore();
@@ -142,7 +139,7 @@
      * @param autoDelete
      * @throws JMException
      */
-    public void createNewQueue(String queueName, boolean durable, String 
owner, boolean autoDelete)
+    public void createNewQueue(String queueName, String owner, boolean 
durable,boolean autoDelete)
             throws JMException
     {
         AMQQueue queue = _queueRegistry.getQueue(new 
AMQShortString(queueName));

Modified: 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java?view=diff&rev=504062&r1=504061&r2=504062
==============================================================================
--- 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
 (original)
+++ 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
 Tue Feb  6 02:13:11 2007
@@ -79,8 +79,8 @@
      */
     @MBeanOperation(name="createNewQueue", description="Create a new Queue on 
the Broker server", impact= MBeanOperationInfo.ACTION)
     void createNewQueue(@MBeanOperationParameter(name="queue name", 
description="Name of the new queue")String queueName,
-                        @MBeanOperationParameter(name="durable", 
description="true if the queue should be durable")boolean durable,
                         @MBeanOperationParameter(name="owner", 
description="Owner name")String owner,
+                        @MBeanOperationParameter(name="durable", 
description="true if the queue should be durable")boolean durable,
                         @MBeanOperationParameter(name="autoDelete", 
description="true if the queue should be auto delete") boolean autoDelete)
         throws IOException, JMException;
 

Modified: 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java?view=diff&rev=504062&r1=504061&r2=504062
==============================================================================
--- 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
 (original)
+++ 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
 Tue Feb  6 02:13:11 2007
@@ -55,30 +55,43 @@
     private AMQMinaProtocolSession _session = null;
     private String _name = null;
     //openmbean data types for representing the channel attributes
-    private String[] _channelAtttibuteNames = {"Channel Id", "Transactional", 
"Default Queue", "Unacknowledged Message Count"};
-    private String[] _indexNames = {_channelAtttibuteNames[0]};
-    private OpenType[] _channelAttributeTypes = {SimpleType.INTEGER, 
SimpleType.BOOLEAN, SimpleType.STRING, SimpleType.INTEGER};
-    private CompositeType _channelType = null;      // represents the data 
type for channel data
-    private TabularType _channelsType = null;       // Data type for list of 
channels type
-    private static final AMQShortString 
BROKER_MANAGEMENT_CONSOLE_HAS_CLOSING_THE_CONNECTION =
-            new AMQShortString("Broker Management Console has closing the 
connection.");
+    private final static String[] _channelAtttibuteNames = {"Channel Id", 
"Transactional", "Default Queue", "Unacknowledged Message Count"};
+    private final static String[] _indexNames = {_channelAtttibuteNames[0]};
+    private final static OpenType[] _channelAttributeTypes = 
{SimpleType.INTEGER, SimpleType.BOOLEAN, SimpleType.STRING, SimpleType.INTEGER};
+    private static CompositeType _channelType = null;      // represents the 
data type for channel data
+    private static TabularType _channelsType = null;       // Data type for 
list of channels type
+    private static final AMQShortString 
BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION =
+            new AMQShortString("Broker Management Console has closed the 
connection.");
 
     @MBeanConstructor("Creates an MBean exposing an AMQ Broker Connection")
     public AMQProtocolSessionMBean(AMQMinaProtocolSession session) throws 
JMException
     {
         super(ManagedConnection.class, ManagedConnection.TYPE);
         _session = session;
+        String remote = getRemoteAddress();
+        remote = "anonymous".equals(remote) ? remote + hashCode() : remote;
+        _name = jmxEncode(new StringBuffer(remote), 0).toString();
         init();
     }
+    static
+    {
+        try
+        {
+            init();
+        }
+        catch(JMException ex)
+        {
+            // It should never occur
+            System.out.println(ex.getMessage());
+        }
+    }
 
     /**
      * initialises the openmbean data types
      */
-    private void init() throws OpenDataException
+    private static void init() throws OpenDataException
     {
-        String remote = getRemoteAddress();
-        remote = "anonymous".equals(remote) ? remote + hashCode() : remote;
-        _name = jmxEncode(new StringBuffer(remote), 0).toString();
+
         _channelType = new CompositeType("Channel", "Channel Details", 
_channelAtttibuteNames,
                 _channelAtttibuteNames, _channelAttributeTypes);
         _channelsType = new TabularType("Channels", "Channels", _channelType, 
_indexNames);
@@ -200,8 +213,7 @@
      * @throws JMException
      */
     public void closeConnection() throws JMException
-    {
-        
+    {        
         // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
         // TODO: Connect this to the session version obtained from 
ProtocolInitiation for this session.
         // Be aware of possible changes to parameter order as versions change.
@@ -211,7 +223,7 @@
             0, // classId
             0, // methodId
                AMQConstant.REPLY_SUCCESS.getCode(),    // replyCode
-            BROKER_MANAGEMENT_CONSOLE_HAS_CLOSING_THE_CONNECTION    // 
replyText
+            BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION    // replyText
             );
         _session.writeFrame(response);
 

Modified: 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java?view=diff&rev=504062&r1=504061&r2=504062
==============================================================================
--- 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
 (original)
+++ 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
 Tue Feb  6 02:13:11 2007
@@ -152,6 +152,16 @@
         return _queue.getMaximumMessageSize();
     }
 
+    public Long getMaximumMessageAge()
+    {
+        return _queue.getMaximumMessageAge();
+    }
+
+    public void setMaximumMessageAge(Long maximumMessageAge)
+    {
+        _queue.setMaximumMessageAge(maximumMessageAge);
+    }
+
     public void setMaximumMessageSize(Long value)
     {
         _queue.setMaximumMessageSize(value);

Modified: 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java?view=diff&rev=504062&r1=504061&r2=504062
==============================================================================
--- 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
 (original)
+++ 
incubator/qpid/branches/perftesting_persistent/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
 Tue Feb  6 02:13:11 2007
@@ -114,6 +114,21 @@
     boolean isAutoDelete() throws IOException;
 
     /**
+     * Returns the maximum age of a message (expiration time)
+     * @return the maximum age
+     * @throws IOException
+     */
+    Long getMaximumMessageAge() throws IOException;
+
+    /**
+     * Sets the maximum age of a message
+     * @param age  maximum age of message.
+     * @throws IOException
+     */
+    @MBeanAttribute(name="MaximumMessageAge", description="Threshold high 
value for message age on thr broker")
+    void setMaximumMessageAge(Long age) throws IOException;
+
+    /**
      * Returns the maximum size of a message (in kbytes) allowed to be 
accepted by the
      * ManagedQueue. This is useful in setting notifications or taking
      * appropriate action, if the size of the message received is more than

Modified: 
incubator/qpid/branches/perftesting_persistent/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting_persistent/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java?view=diff&rev=504062&r1=504061&r2=504062
==============================================================================
--- 
incubator/qpid/branches/perftesting_persistent/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
 (original)
+++ 
incubator/qpid/branches/perftesting_persistent/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
 Tue Feb  6 02:13:11 2007
@@ -70,7 +70,7 @@
 
         assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) == 
null);
                 
-        mbean.createNewQueue(queueName, false, "test", true);
+        mbean.createNewQueue(queueName, "test", false, true);
         assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) != 
null);
 
         mbean.deleteQueue(queueName);


Reply via email to