summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-02-06 10:13:11 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-02-06 10:13:11 +0000
commit6ef9eafa3cd1cc865fdc91fdb99c26a89da4ee6a (patch)
tree4e29570a585eac73b3adce42c5852671ae5fa3df
parent1f4e634e6b86a4aff2b2553d5b44b1a1d5855779 (diff)
downloadqpid-python-6ef9eafa3cd1cc865fdc91fdb99c26a89da4ee6a.tar.gz
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 <janstey@iona.com> to fix trivial compile error. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/perftesting_persistent@504062 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java5
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java2
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java40
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java10
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java15
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java2
6 files changed, 54 insertions, 20 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
index 0b8aac67b6..ece4a3212b 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
@@ -61,9 +61,6 @@ public class AMQBrokerManagerMBean extends AMQManagedObject implements ManagedBr
_virtualHostMBean = virtualHostMBean;
VirtualHost virtualHost = virtualHostMBean.getVirtualHost();
-
-
-
_queueRegistry = virtualHost.getQueueRegistry();
_exchangeRegistry = virtualHost.getExchangeRegistry();
_messageStore = virtualHost.getMessageStore();
@@ -142,7 +139,7 @@ public class AMQBrokerManagerMBean extends AMQManagedObject implements ManagedBr
* @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));
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
index 87d9a577e5..1b7e906e98 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
@@ -79,8 +79,8 @@ public interface ManagedBroker
*/
@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;
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
index 0b21d26d32..f62edb2d78 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
@@ -55,30 +55,43 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed
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 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed
* @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 @@ public class AMQProtocolSessionMBean extends AMQManagedObject implements Managed
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);
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
index bee2e3950c..a263350cb0 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
@@ -152,6 +152,16 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, Que
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);
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
index c36cc6bd7b..81580d8db5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
@@ -114,6 +114,21 @@ public interface ManagedQueue
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
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
index 62dc44e23f..7c14de23a6 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
@@ -70,7 +70,7 @@ public class AMQBrokerManagerMBeanTest extends TestCase
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);