diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionView.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionView.java index f40c9d68f3..9d4debd742 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionView.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionView.java @@ -164,6 +164,65 @@ public class SubscriptionView implements SubscriptionViewMBean { } } + /** + * @return whether or not the subscriber is retroactive or not + */ + public boolean isRetroactive() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.isRetroactive() : false; + } + + /** + * @return whether or not the subscriber is an exclusive consumer + */ + public boolean isExclusive() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.isExclusive() : false; + } + + + /** + * @return whether or not the subscriber is durable (persistent) + */ + public boolean isDurable() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.isDurable() : false; + } + + /** + * @return whether or not the subscriber ignores local messages + */ + public boolean isNoLocal() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.isNoLocal() : false; + } + + + /** + * @return the maximum number of pending messages allowed in addition to the prefetch size. If enabled + * to a non-zero value then this will perform eviction of messages for slow consumers on non-durable topics. + */ + public int getMaximumPendingMessageLimit() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.getMaximumPendingMessageLimit() : 0; + } + + /** + * @return the consumer priority + */ + public byte getPriority() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.getPriority() : 0; + } + + /** + * @return the name of the consumer which is only used for durable consumers. + */ + public String getSubcriptionName() { + ConsumerInfo info = getConsumerInfo(); + return info != null ? info.getSubcriptionName() : null; + } + /** * @return number of messages pending delivery */ @@ -216,4 +275,4 @@ public class SubscriptionView implements SubscriptionViewMBean { return subscription != null ? subscription.getPrefetchSize() : 0; } -} \ No newline at end of file +} diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java index da7c1cac5e..4024d80216 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java @@ -18,12 +18,13 @@ import javax.jms.InvalidSelectorException; /** * @version $Revision: 1.5 $ */ -public interface SubscriptionViewMBean{ - +public interface SubscriptionViewMBean { + /** * @return the clientId of the Connection the Subscription is on */ public String getClientId(); + /** * @return the id of the Connection the Subscription is on */ @@ -44,18 +45,17 @@ public interface SubscriptionViewMBean{ */ public String getDestinationName(); - /** * @return the JMS selector on the current subscription */ public String getSelector(); - + /** - * Attempts to change the current active selector on the subscription. - * This operation is not supported for persistent topics. + * Attempts to change the current active selector on the subscription. This + * operation is not supported for persistent topics. */ public void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException; - + /** * @return true if the destination is a Queue */ @@ -70,7 +70,7 @@ public interface SubscriptionViewMBean{ * @return true if the destination is temporary */ public boolean isDestinationTemporary(); - + /** * @return true if the subscriber is active */ @@ -85,7 +85,7 @@ public interface SubscriptionViewMBean{ * @return number of messages dispatched */ public int getDispatchedQueueSize(); - + /** * @return number of messages that matched the subscription */ @@ -105,4 +105,43 @@ public interface SubscriptionViewMBean{ * @return the prefetch that has been configured for this subscriber */ public int getPrefetchSize(); + + /** + * @return whether or not the subscriber is retroactive or not + */ + public boolean isRetroactive(); + + /** + * @return whether or not the subscriber is an exclusive consumer + */ + public boolean isExclusive(); + + /** + * @return whether or not the subscriber is durable (persistent) + */ + public boolean isDurable(); + + /** + * @return whether or not the subscriber ignores local messages + */ + public boolean isNoLocal(); + + /** + * @return the maximum number of pending messages allowed in addition to the + * prefetch size. If enabled to a non-zero value then this will + * perform eviction of messages for slow consumers on non-durable + * topics. + */ + public int getMaximumPendingMessageLimit(); + + /** + * @return the consumer priority + */ + public byte getPriority(); + + /** + * @return the name of the consumer which is only used for durable + * consumers. + */ + public String getSubcriptionName(); } \ No newline at end of file