1 18 package org.apache.activemq.broker.jmx; 19 20 import org.apache.activemq.broker.region.TopicSubscription; 21 22 26 public class TopicSubscriptionView extends SubscriptionView implements TopicSubscriptionViewMBean { 27 28 public TopicSubscriptionView(String clientId, TopicSubscription subs) { 29 super(clientId, subs); 30 } 31 32 protected TopicSubscription getTopicSubscription() { 33 return (TopicSubscription) subscription; 34 } 35 36 39 public int getDiscardedCount() { 40 TopicSubscription topicSubscription = getTopicSubscription(); 41 return topicSubscription != null ? topicSubscription.discarded() : 0; 42 } 43 44 47 public int getMaximumPendingQueueSize() { 48 TopicSubscription topicSubscription = getTopicSubscription(); 49 return topicSubscription != null ? topicSubscription.getMaximumPendingMessages() : 0; 50 } 51 52 55 public void setMaximumPendingQueueSize(int max) { 56 TopicSubscription topicSubscription = getTopicSubscription(); 57 if ( topicSubscription != null ) { 58 topicSubscription.setMaximumPendingMessages(max); 59 } 60 } 61 } 62 | Popular Tags |