diff options
author | Bhupendra Bhusman Bhardwaj <bhupendrab@apache.org> | 2007-02-05 17:45:09 +0000 |
---|---|---|
committer | Bhupendra Bhusman Bhardwaj <bhupendrab@apache.org> | 2007-02-05 17:45:09 +0000 |
commit | 2b4a06465970ef59e92b0b5f33cd03c5a1891195 (patch) | |
tree | 93cae1e71646ccf9fe16736299b8e6dd3d338011 | |
parent | 4bfeb525ac30d53e3e628082649a459f9320ebd1 (diff) | |
download | qpid-python-2b4a06465970ef59e92b0b5f33cd03c5a1891195.tar.gz |
QPID-326
AMQQueueMBean updated with attribute MaximumMessageAge
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@503790 13f79535-47bb-0310-9956-ffa450edef68
5 files changed, 53 insertions, 19 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java b/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java index 0b8aac67b6..ece4a3212b 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java +++ b/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/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java b/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java index 87d9a577e5..1b7e906e98 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java +++ b/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/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java index 0b21d26d32..f62edb2d78 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java +++ b/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/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java index bee2e3950c..a263350cb0 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java +++ b/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/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java b/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java index c36cc6bd7b..81580d8db5 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java +++ b/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 |