fix for AMQ-663 to add more attributes to the subscription MBean

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@415641 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-06-20 13:51:57 +00:00
parent 3850704161
commit b695b490b2
2 changed files with 108 additions and 10 deletions

View File

@ -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 * @return number of messages pending delivery
*/ */
@ -216,4 +275,4 @@ public class SubscriptionView implements SubscriptionViewMBean {
return subscription != null ? subscription.getPrefetchSize() : 0; return subscription != null ? subscription.getPrefetchSize() : 0;
} }
} }

View File

@ -18,12 +18,13 @@ import javax.jms.InvalidSelectorException;
/** /**
* @version $Revision: 1.5 $ * @version $Revision: 1.5 $
*/ */
public interface SubscriptionViewMBean{ public interface SubscriptionViewMBean {
/** /**
* @return the clientId of the Connection the Subscription is on * @return the clientId of the Connection the Subscription is on
*/ */
public String getClientId(); public String getClientId();
/** /**
* @return the id of the Connection the Subscription is on * @return the id of the Connection the Subscription is on
*/ */
@ -44,18 +45,17 @@ public interface SubscriptionViewMBean{
*/ */
public String getDestinationName(); public String getDestinationName();
/** /**
* @return the JMS selector on the current subscription * @return the JMS selector on the current subscription
*/ */
public String getSelector(); public String getSelector();
/** /**
* Attempts to change the current active selector on the subscription. * Attempts to change the current active selector on the subscription. This
* This operation is not supported for persistent topics. * operation is not supported for persistent topics.
*/ */
public void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException; public void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException;
/** /**
* @return true if the destination is a Queue * @return true if the destination is a Queue
*/ */
@ -70,7 +70,7 @@ public interface SubscriptionViewMBean{
* @return true if the destination is temporary * @return true if the destination is temporary
*/ */
public boolean isDestinationTemporary(); public boolean isDestinationTemporary();
/** /**
* @return true if the subscriber is active * @return true if the subscriber is active
*/ */
@ -85,7 +85,7 @@ public interface SubscriptionViewMBean{
* @return number of messages dispatched * @return number of messages dispatched
*/ */
public int getDispatchedQueueSize(); public int getDispatchedQueueSize();
/** /**
* @return number of messages that matched the subscription * @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 * @return the prefetch that has been configured for this subscriber
*/ */
public int getPrefetchSize(); 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();
} }