org.apache.qpid.server.queue
Class AMQQueueMBean

java.lang.Object
  extended by javax.management.StandardMBean
      extended by org.apache.qpid.server.management.DefaultManagedObject
          extended by org.apache.qpid.server.management.AMQManagedObject
              extended by org.apache.qpid.server.queue.AMQQueueMBean
All Implemented Interfaces:
DynamicMBean, MBeanRegistration, NotificationBroadcaster, org.apache.qpid.management.common.mbeans.ManagedQueue, ManagedObject, QueueNotificationListener

public class AMQQueueMBean
extends AMQManagedObject
implements org.apache.qpid.management.common.mbeans.ManagedQueue, QueueNotificationListener

AMQQueueMBean is the management bean for an AMQQueue.

CRC Caption Responsibilities Collaborations


Field Summary
 
Fields inherited from class org.apache.qpid.server.management.AMQManagedObject
_broadcaster, _logActor, _mbeanInfo, _notificationSequenceNumber
 
Fields inherited from interface org.apache.qpid.management.common.mbeans.ManagedQueue
ATTR_ACTIVE_CONSUMER_COUNT, ATTR_AUTODELETE, ATTR_CAPACITY, ATTR_CONSUMER_COUNT, ATTR_DURABLE, ATTR_EXCLUSIVE, ATTR_FLOW_OVERFULL, ATTR_FLOW_RESUME_CAPACITY, ATTR_MAX_MSG_AGE, ATTR_MAX_MSG_COUNT, ATTR_MAX_MSG_SIZE, ATTR_MAX_QUEUE_DEPTH, ATTR_MSG_COUNT, ATTR_NAME, ATTR_OWNER, ATTR_QUEUE_DEPTH, ATTR_RCVD_MSG_COUNT, CONTENT, ENCODING, MIME, MSG_AMQ_ID, MSG_HEADER, MSG_QUEUE_POS, MSG_REDELIVERED, MSG_SIZE, QUEUE_ATTRIBUTES, TYPE, VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES_DESC, VIEW_MSGS_COMPOSITE_ITEM_NAMES_DESC, VIEW_MSGS_TABULAR_UNIQUE_INDEX
 
Fields inherited from interface org.apache.qpid.server.management.ManagedObject
DOMAIN
 
Constructor Summary
AMQQueueMBean(AMQQueue queue)
           
 
Method Summary
 void checkForNotification(ServerMessage msg)
          Checks if there is any notification to be send to the listeners
 Long clearQueue()
          Clears the queue of non-acquired messages
 void copyMessages(long fromMessageId, long toMessageId, String toQueueName)
           
 void deleteMessageFromTop()
           
 void deleteMessages(long fromMessageId, long toMessageId)
           
 Integer getActiveConsumerCount()
           
 Long getCapacity()
           
 Integer getConsumerCount()
           
 Long getFlowResumeCapacity()
           
 Notification getLastNotification()
           
 Long getMaximumMessageAge()
           
 Long getMaximumMessageCount()
           
 Long getMaximumMessageSize()
           
 Long getMaximumQueueDepth()
          returns the maximum total size of messages(bytes) in the queue.
 Integer getMessageCount()
           
 String getName()
           
 MBeanNotificationInfo[] getNotificationInfo()
          returns Notifications sent by this MBean.
 String getObjectInstanceName()
           
 String getOwner()
           
 ManagedObject getParentObject()
           
 Long getQueueDepth()
          returns the total size of messages(bytes) in the queue.
 Long getReceivedMessageCount()
           
 boolean isAutoDelete()
           
 boolean isDurable()
           
 boolean isExclusive()
           
 boolean isFlowOverfull()
           
 void moveMessages(long fromMessageId, long toMessageId, String toQueueName)
           
 void notifyClients(NotificationCheck notification, AMQQueue queue, String notificationMsg)
          Sends the notification to the listeners
 void setCapacity(Long capacity)
           
 void setExclusive(boolean exclusive)
           
 void setFlowResumeCapacity(Long flowResumeCapacity)
           
 void setMaximumMessageAge(Long maximumMessageAge)
           
 void setMaximumMessageCount(Long value)
           
 void setMaximumMessageSize(Long value)
           
 void setMaximumQueueDepth(Long value)
           
 CompositeData viewMessageContent(long msgId)
          returns message content as byte array and related attributes for the given message id.
 TabularData viewMessages(int beginIndex, int endIndex)
          Deprecated. 
 TabularData viewMessages(long startPosition, long endPosition)
          Returns the header contents of the messages stored in this queue in tabular form.
 
Methods inherited from class org.apache.qpid.server.management.AMQManagedObject
addNotificationListener, getMBeanInfo, removeNotificationListener
 
Methods inherited from class org.apache.qpid.server.management.DefaultManagedObject
getHierarchicalName, getHierarchicalType, getManagedObjectRegistry, getManagementInterface, getObjectName, getObjectNameForSingleInstanceMBean, getType, jmxEncode, register, toString, unregister
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMQQueueMBean

public AMQQueueMBean(AMQQueue queue)
              throws JMException
Throws:
JMException
Method Detail

getParentObject

public ManagedObject getParentObject()
Specified by:
getParentObject in interface ManagedObject
Overrides:
getParentObject in class DefaultManagedObject

getObjectInstanceName

public String getObjectInstanceName()
Specified by:
getObjectInstanceName in interface ManagedObject
Returns:
the name that uniquely identifies this object instance. It must be unique only among objects of this type at this level in the hierarchy so the uniqueness should not be too difficult to ensure.

getName

public String getName()
Specified by:
getName in interface org.apache.qpid.management.common.mbeans.ManagedQueue

isDurable

public boolean isDurable()
Specified by:
isDurable in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getOwner

public String getOwner()
Specified by:
getOwner in interface org.apache.qpid.management.common.mbeans.ManagedQueue

isAutoDelete

public boolean isAutoDelete()
Specified by:
isAutoDelete in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getMessageCount

public Integer getMessageCount()
Specified by:
getMessageCount in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getMaximumMessageSize

public Long getMaximumMessageSize()
Specified by:
getMaximumMessageSize in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getMaximumMessageAge

public Long getMaximumMessageAge()
Specified by:
getMaximumMessageAge in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setMaximumMessageAge

public void setMaximumMessageAge(Long maximumMessageAge)
Specified by:
setMaximumMessageAge in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setMaximumMessageSize

public void setMaximumMessageSize(Long value)
Specified by:
setMaximumMessageSize in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getConsumerCount

public Integer getConsumerCount()
Specified by:
getConsumerCount in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getActiveConsumerCount

public Integer getActiveConsumerCount()
Specified by:
getActiveConsumerCount in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getReceivedMessageCount

public Long getReceivedMessageCount()
Specified by:
getReceivedMessageCount in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getMaximumMessageCount

public Long getMaximumMessageCount()
Specified by:
getMaximumMessageCount in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setMaximumMessageCount

public void setMaximumMessageCount(Long value)
Specified by:
setMaximumMessageCount in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getMaximumQueueDepth

public Long getMaximumQueueDepth()
returns the maximum total size of messages(bytes) in the queue.

Specified by:
getMaximumQueueDepth in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setMaximumQueueDepth

public void setMaximumQueueDepth(Long value)
Specified by:
setMaximumQueueDepth in interface org.apache.qpid.management.common.mbeans.ManagedQueue

getQueueDepth

public Long getQueueDepth()
                   throws JMException
returns the total size of messages(bytes) in the queue.

Specified by:
getQueueDepth in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
JMException

getCapacity

public Long getCapacity()
Specified by:
getCapacity in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setCapacity

public void setCapacity(Long capacity)
                 throws IllegalArgumentException
Specified by:
setCapacity in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
IllegalArgumentException

getFlowResumeCapacity

public Long getFlowResumeCapacity()
Specified by:
getFlowResumeCapacity in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setFlowResumeCapacity

public void setFlowResumeCapacity(Long flowResumeCapacity)
                           throws IllegalArgumentException
Specified by:
setFlowResumeCapacity in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
IllegalArgumentException

isFlowOverfull

public boolean isFlowOverfull()
Specified by:
isFlowOverfull in interface org.apache.qpid.management.common.mbeans.ManagedQueue

isExclusive

public boolean isExclusive()
Specified by:
isExclusive in interface org.apache.qpid.management.common.mbeans.ManagedQueue

setExclusive

public void setExclusive(boolean exclusive)
                  throws JMException
Specified by:
setExclusive in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
JMException

checkForNotification

public void checkForNotification(ServerMessage msg)
                          throws org.apache.qpid.AMQException
Checks if there is any notification to be send to the listeners

Throws:
org.apache.qpid.AMQException

notifyClients

public void notifyClients(NotificationCheck notification,
                          AMQQueue queue,
                          String notificationMsg)
Sends the notification to the listeners

Specified by:
notifyClients in interface QueueNotificationListener

getLastNotification

public Notification getLastNotification()

deleteMessageFromTop

public void deleteMessageFromTop()
                          throws JMException
Specified by:
deleteMessageFromTop in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
JMException
See Also:
AMQQueue.deleteMessageFromTop()

clearQueue

public Long clearQueue()
                throws JMException
Clears the queue of non-acquired messages

Specified by:
clearQueue in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Returns:
the number of messages deleted
Throws:
JMException
See Also:
AMQQueue.clearQueue()

viewMessageContent

public CompositeData viewMessageContent(long msgId)
                                 throws JMException
returns message content as byte array and related attributes for the given message id.

Specified by:
viewMessageContent in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
JMException

viewMessages

@Deprecated
public TabularData viewMessages(int beginIndex,
                                           int endIndex)
                         throws JMException
Deprecated. 

Returns the header contents of the messages stored in this queue in tabular form. Deprecated as of Qpid JMX API 1.3

Specified by:
viewMessages in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Throws:
JMException

viewMessages

public TabularData viewMessages(long startPosition,
                                long endPosition)
                         throws JMException
Returns the header contents of the messages stored in this queue in tabular form.

Specified by:
viewMessages in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Parameters:
startPosition - The queue position of the first message to be viewed
endPosition - The queue position of the last message to be viewed
Throws:
JMException

moveMessages

public void moveMessages(long fromMessageId,
                         long toMessageId,
                         String toQueueName)
                  throws JMException
Specified by:
moveMessages in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Parameters:
fromMessageId -
toMessageId -
toQueueName -
Throws:
JMException
See Also:
ManagedQueue.moveMessages(long, long, java.lang.String)

deleteMessages

public void deleteMessages(long fromMessageId,
                           long toMessageId)
                    throws JMException
Specified by:
deleteMessages in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Parameters:
fromMessageId -
toMessageId -
Throws:
JMException
See Also:
ManagedQueue.deleteMessages(long, long)

copyMessages

public void copyMessages(long fromMessageId,
                         long toMessageId,
                         String toQueueName)
                  throws JMException
Specified by:
copyMessages in interface org.apache.qpid.management.common.mbeans.ManagedQueue
Parameters:
fromMessageId -
toMessageId -
toQueueName -
Throws:
JMException
See Also:
ManagedQueue.copyMessages(long, long, java.lang.String)

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
returns Notifications sent by this MBean.

Specified by:
getNotificationInfo in interface NotificationBroadcaster
Overrides:
getNotificationInfo in class AMQManagedObject


Licensed to the Apache Software Foundation