Package org.apache.activemq.broker.jmx
Class DurableSubscriptionView
- java.lang.Object
-
- org.apache.activemq.broker.jmx.SubscriptionView
-
- org.apache.activemq.broker.jmx.DurableSubscriptionView
-
- All Implemented Interfaces:
DurableSubscriptionViewMBean
,SubscriptionViewMBean
- Direct Known Subclasses:
InactiveDurableSubscriptionView
public class DurableSubscriptionView extends SubscriptionView implements DurableSubscriptionViewMBean
-
-
Field Summary
Fields Modifier and Type Field Description protected ManagedRegionBroker
broker
protected BrokerService
brokerService
protected DurableTopicSubscription
durableSub
protected String
subscriptionName
-
Fields inherited from class org.apache.activemq.broker.jmx.SubscriptionView
clientId, subscription, userName
-
-
Constructor Summary
Constructors Constructor Description DurableSubscriptionView(ManagedRegionBroker broker, BrokerService brokerService, String clientId, String userName, Subscription sub)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeData[]
browse()
Browse messages for this durable subscriberTabularData
browseAsTable()
Browse messages for this durable subscriberint
cursorSize()
void
destroy()
Destroys the durable subscription so that messages will no longer be stored for this subscriptionboolean
doesCursorHaveMessagesBuffered()
boolean
doesCursorHaveSpace()
long
getCursorMemoryUsage()
int
getCursorPercentUsage()
String
getSubscriptionName()
boolean
isActive()
boolean
isCursorFull()
void
removeMessage(String messageId)
Removes a message from the durable subscription.String
toString()
-
Methods inherited from class org.apache.activemq.broker.jmx.SubscriptionView
gc, getClientId, getConnection, getConnectionId, getConsumedCount, getConsumerInfo, getDequeueCounter, getDestinationName, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getMaximumPendingMessageLimit, getMessageCountAwaitingAcknowledge, getPendingQueueSize, getPrefetchSize, getPriority, getSelector, getSessionId, getSubscriptionId, getUserName, isDestinationQueue, isDestinationTemporary, isDestinationTopic, isDispatchAsync, isDurable, isExclusive, isMatchingQueue, isMatchingTopic, isNetwork, isNoLocal, isRetroactive, isSlowConsumer, matchesDestination, resetStatistics, setSelector
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.broker.jmx.SubscriptionViewMBean
getClientId, getConnection, getConnectionId, getConsumedCount, getDequeueCounter, getDestinationName, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getMaximumPendingMessageLimit, getMessageCountAwaitingAcknowledge, getPendingQueueSize, getPrefetchSize, getPriority, getSelector, getSessionId, getSubscriptionId, getUserName, isDestinationQueue, isDestinationTemporary, isDestinationTopic, isDispatchAsync, isDurable, isExclusive, isMatchingQueue, isMatchingTopic, isNetwork, isNoLocal, isRetroactive, isSlowConsumer, resetStatistics, setSelector
-
-
-
-
Field Detail
-
broker
protected ManagedRegionBroker broker
-
brokerService
protected BrokerService brokerService
-
subscriptionName
protected String subscriptionName
-
durableSub
protected DurableTopicSubscription durableSub
-
-
Constructor Detail
-
DurableSubscriptionView
public DurableSubscriptionView(ManagedRegionBroker broker, BrokerService brokerService, String clientId, String userName, Subscription sub)
Constructor- Parameters:
clientId
-sub
-
-
-
Method Detail
-
getSubscriptionName
public String getSubscriptionName()
- Specified by:
getSubscriptionName
in interfaceDurableSubscriptionViewMBean
- Specified by:
getSubscriptionName
in interfaceSubscriptionViewMBean
- Overrides:
getSubscriptionName
in classSubscriptionView
- Returns:
- name of the durable consumer
-
browse
public CompositeData[] browse() throws OpenDataException
Browse messages for this durable subscriber- Specified by:
browse
in interfaceDurableSubscriptionViewMBean
- Returns:
- messages
- Throws:
OpenDataException
-
browseAsTable
public TabularData browseAsTable() throws OpenDataException
Browse messages for this durable subscriber- Specified by:
browseAsTable
in interfaceDurableSubscriptionViewMBean
- Returns:
- messages
- Throws:
OpenDataException
-
destroy
public void destroy() throws Exception
Destroys the durable subscription so that messages will no longer be stored for this subscription- Specified by:
destroy
in interfaceDurableSubscriptionViewMBean
- Throws:
Exception
-
toString
public String toString()
- Overrides:
toString
in classSubscriptionView
- Returns:
- pretty print
-
cursorSize
public int cursorSize()
- Specified by:
cursorSize
in interfaceDurableSubscriptionViewMBean
- Returns:
- the number of messages available to be paged in by the cursor
-
removeMessage
public void removeMessage(String messageId) throws Exception
Description copied from interface:DurableSubscriptionViewMBean
Removes a message from the durable subscription.- Specified by:
removeMessage
in interfaceDurableSubscriptionViewMBean
- Throws:
Exception
-
doesCursorHaveMessagesBuffered
public boolean doesCursorHaveMessagesBuffered()
- Specified by:
doesCursorHaveMessagesBuffered
in interfaceDurableSubscriptionViewMBean
- Returns:
- true if the cursor has messages buffered to deliver
-
doesCursorHaveSpace
public boolean doesCursorHaveSpace()
- Specified by:
doesCursorHaveSpace
in interfaceDurableSubscriptionViewMBean
- Returns:
- true if the message cursor has memory space available to page in more messages
-
getCursorMemoryUsage
public long getCursorMemoryUsage()
- Specified by:
getCursorMemoryUsage
in interfaceDurableSubscriptionViewMBean
- Returns:
- the cursor memory usage in bytes
-
getCursorPercentUsage
public int getCursorPercentUsage()
- Specified by:
getCursorPercentUsage
in interfaceDurableSubscriptionViewMBean
- Returns:
- the cursor memory usage as a percentage
-
isCursorFull
public boolean isCursorFull()
- Specified by:
isCursorFull
in interfaceDurableSubscriptionViewMBean
- Returns:
- true if the cursor has reached its memory limit for paged in messages
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceSubscriptionViewMBean
- Overrides:
isActive
in classSubscriptionView
- Returns:
- true if the subscriber is active
-
-