You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Jonathan Anstey <ja...@iona.com> on 2007/02/06 00:24:30 UTC
Re: svn commit: r503790 - in /incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server:
AMQBrokerManagerMBean.java management/ManagedBroker.java protocol/AMQProtocolSessionMBean.java
queue/AMQQueueMBean.java queue/ManagedQueue.java
Hi,
This particular commit is causing compile errors for Qpid java. I
attached a *very* simple patch for this :^) Could someone apply it for me?
Thanks,
Jonathan Anstey
bhupendrab@apache.org wrote:
> Author: bhupendrab
> Date: Mon Feb 5 09:45:09 2007
> New Revision: 503790
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=503790
> Log:
> QPID-326
> AMQQueueMBean updated with attribute MaximumMessageAge
>
> Modified:
> incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
> incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
> incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
> incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
> incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
>
> Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
> URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java?view=diff&rev=503790&r1=503789&r2=503790
> ==============================================================================
> --- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java (original)
> +++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java Mon Feb 5 09:45:09 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/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
> URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java?view=diff&rev=503790&r1=503789&r2=503790
> ==============================================================================
> --- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java (original)
> +++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java Mon Feb 5 09:45:09 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/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
> URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java?view=diff&rev=503790&r1=503789&r2=503790
> ==============================================================================
> --- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java (original)
> +++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java Mon Feb 5 09:45:09 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/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
> URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java?view=diff&rev=503790&r1=503789&r2=503790
> ==============================================================================
> --- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java (original)
> +++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java Mon Feb 5 09:45:09 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/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
> URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java?view=diff&rev=503790&r1=503789&r2=503790
> ==============================================================================
> --- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java (original)
> +++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java Mon Feb 5 09:45:09 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
>
>
>
>
Re: svn commit: r503790 - in /incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server:
AMQBrokerManagerMBean.java management/ManagedBroker.java protocol/AMQProtocolSessionMBean.java
queue/AMQQueueMBean.java queue/ManagedQueue.java
Posted by Gordon Sim <gs...@redhat.com>.
Jonathan Anstey wrote:
> This particular commit is causing compile errors for Qpid java. I
> attached a *very* simple patch for this :^) Could someone apply it for me?
Thanks Jonathan! Applied as rev 504025.