org.apache.activemq.broker.jmx
Class SubscriptionView

java.lang.Object
  extended by org.apache.activemq.broker.jmx.SubscriptionView
All Implemented Interfaces:
SubscriptionViewMBean
Direct Known Subclasses:
DurableSubscriptionView, TopicSubscriptionView

public class SubscriptionView
extends Object
implements SubscriptionViewMBean


Field Summary
protected  String clientId
           
protected  Subscription subscription
           
protected  String userName
           
 
Constructor Summary
SubscriptionView(String clientId, String userName, Subscription subs)
          Constructor
 
Method Summary
 void gc()
          The subscription should release as may references as it can to help the garbage collector reclaim memory.
 String getClientId()
           
 ObjectName getConnection()
          Returns the ObjectName of the Connection that created this Subscription.
 String getConnectionId()
           
protected  ConsumerInfo getConsumerInfo()
           
 long getDequeueCounter()
           
 String getDestinationName()
           
 long getDispatchedCounter()
           
 int getDispatchedQueueSize()
           
 long getEnqueueCounter()
           
 int getMaximumPendingMessageLimit()
           
 int getMessageCountAwaitingAcknowledge()
          The same as the number of messages dispatched - making it explicit
 int getPendingQueueSize()
           
 int getPrefetchSize()
           
 byte getPriority()
           
 String getSelector()
           
 long getSessionId()
           
 long getSubcriptionId()
           
 String getSubcriptionName()
           
 String getUserName()
          Returns the User Name used to authorize creation of this Subscription.
 boolean isActive()
           
 boolean isDestinationQueue()
           
 boolean isDestinationTemporary()
           
 boolean isDestinationTopic()
           
 boolean isDurable()
           
 boolean isExclusive()
           
 boolean isMatchingQueue(String queueName)
          Returns true if this subscription (which may be using wildcards) matches the given queue name
 boolean isMatchingTopic(String topicName)
          Returns true if this subscription (which may be using wildcards) matches the given topic name
 boolean isNetwork()
           
 boolean isNoLocal()
           
 boolean isRetroactive()
           
 boolean isSlowConsumer()
          Returns true if the subscription is slow
 boolean matchesDestination(ActiveMQDestination destination)
          Return true if this subscription matches the given destination
 void setSelector(String selector)
          Attempts to change the current active selector on the subscription.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subscription

protected final Subscription subscription

clientId

protected final String clientId

userName

protected final String userName
Constructor Detail

SubscriptionView

public SubscriptionView(String clientId,
                        String userName,
                        Subscription subs)
Constructor

Parameters:
subs -
Method Detail

getClientId

public String getClientId()
Specified by:
getClientId in interface SubscriptionViewMBean
Returns:
the clientId

getConnection

public ObjectName getConnection()
Description copied from interface: SubscriptionViewMBean
Returns the ObjectName of the Connection that created this Subscription. This value can be null if for instance this is an off-line durable subscription.

Specified by:
getConnection in interface SubscriptionViewMBean
Returns:
the name of the Connection that created this Subscription.

getConnectionId

public String getConnectionId()
Specified by:
getConnectionId in interface SubscriptionViewMBean
Returns:
the id of the Connection the Subscription is on

getSessionId

public long getSessionId()
Specified by:
getSessionId in interface SubscriptionViewMBean
Returns:
the id of the Session the subscription is on

getSubcriptionId

public long getSubcriptionId()
Specified by:
getSubcriptionId in interface SubscriptionViewMBean
Returns:
the id of the Subscription

getDestinationName

public String getDestinationName()
Specified by:
getDestinationName in interface SubscriptionViewMBean
Returns:
the destination name

getSelector

public String getSelector()
Specified by:
getSelector in interface SubscriptionViewMBean
Returns:
the JMS selector on the current subscription

setSelector

public void setSelector(String selector)
                 throws InvalidSelectorException,
                        UnsupportedOperationException
Description copied from interface: SubscriptionViewMBean
Attempts to change the current active selector on the subscription. This operation is not supported for persistent topics.

Specified by:
setSelector in interface SubscriptionViewMBean
Throws:
InvalidSelectorException
UnsupportedOperationException

isDestinationQueue

public boolean isDestinationQueue()
Specified by:
isDestinationQueue in interface SubscriptionViewMBean
Returns:
true if the destination is a Queue

isDestinationTopic

public boolean isDestinationTopic()
Specified by:
isDestinationTopic in interface SubscriptionViewMBean
Returns:
true of the destination is a Topic

isDestinationTemporary

public boolean isDestinationTemporary()
Specified by:
isDestinationTemporary in interface SubscriptionViewMBean
Returns:
true if the destination is temporary

isActive

public boolean isActive()
Specified by:
isActive in interface SubscriptionViewMBean
Returns:
true if the subscriber is active

isNetwork

public boolean isNetwork()
Specified by:
isNetwork in interface SubscriptionViewMBean

gc

public void gc()
The subscription should release as may references as it can to help the garbage collector reclaim memory.


isRetroactive

public boolean isRetroactive()
Specified by:
isRetroactive in interface SubscriptionViewMBean
Returns:
whether or not the subscriber is retroactive or not

isExclusive

public boolean isExclusive()
Specified by:
isExclusive in interface SubscriptionViewMBean
Returns:
whether or not the subscriber is an exclusive consumer

isDurable

public boolean isDurable()
Specified by:
isDurable in interface SubscriptionViewMBean
Returns:
whether or not the subscriber is durable (persistent)

isNoLocal

public boolean isNoLocal()
Specified by:
isNoLocal in interface SubscriptionViewMBean
Returns:
whether or not the subscriber ignores local messages

getMaximumPendingMessageLimit

public int getMaximumPendingMessageLimit()
Specified by:
getMaximumPendingMessageLimit in interface SubscriptionViewMBean
Returns:
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.

getPriority

public byte getPriority()
Specified by:
getPriority in interface SubscriptionViewMBean
Returns:
the consumer priority

getSubcriptionName

public String getSubcriptionName()
Specified by:
getSubcriptionName in interface SubscriptionViewMBean
Returns:
the name of the consumer which is only used for durable consumers.

getPendingQueueSize

public int getPendingQueueSize()
Specified by:
getPendingQueueSize in interface SubscriptionViewMBean
Returns:
number of messages pending delivery

getDispatchedQueueSize

public int getDispatchedQueueSize()
Specified by:
getDispatchedQueueSize in interface SubscriptionViewMBean
Returns:
number of messages dispatched

getMessageCountAwaitingAcknowledge

public int getMessageCountAwaitingAcknowledge()
Description copied from interface: SubscriptionViewMBean
The same as the number of messages dispatched - making it explicit

Specified by:
getMessageCountAwaitingAcknowledge in interface SubscriptionViewMBean
Returns:

getDispatchedCounter

public long getDispatchedCounter()
Specified by:
getDispatchedCounter in interface SubscriptionViewMBean
Returns:
number of messages that matched the subscription

getEnqueueCounter

public long getEnqueueCounter()
Specified by:
getEnqueueCounter in interface SubscriptionViewMBean
Returns:
number of messages that matched the subscription

getDequeueCounter

public long getDequeueCounter()
Specified by:
getDequeueCounter in interface SubscriptionViewMBean
Returns:
number of messages queued by the client

getConsumerInfo

protected ConsumerInfo getConsumerInfo()

toString

public String toString()
Overrides:
toString in class Object
Returns:
pretty print

getPrefetchSize

public int getPrefetchSize()
Specified by:
getPrefetchSize in interface SubscriptionViewMBean
Returns:
the prefetch that has been configured for this subscriber

isMatchingQueue

public boolean isMatchingQueue(String queueName)
Description copied from interface: SubscriptionViewMBean
Returns true if this subscription (which may be using wildcards) matches the given queue name

Specified by:
isMatchingQueue in interface SubscriptionViewMBean
Parameters:
queueName - the JMS queue name to match against
Returns:
true if this subscription matches the given queue or false if not

isMatchingTopic

public boolean isMatchingTopic(String topicName)
Description copied from interface: SubscriptionViewMBean
Returns true if this subscription (which may be using wildcards) matches the given topic name

Specified by:
isMatchingTopic in interface SubscriptionViewMBean
Parameters:
topicName - the JMS topic name to match against
Returns:
true if this subscription matches the given topic or false if not

matchesDestination

public boolean matchesDestination(ActiveMQDestination destination)
Return true if this subscription matches the given destination

Parameters:
destination - the destination to compare against
Returns:
true if this subscription matches the given destination

isSlowConsumer

public boolean isSlowConsumer()
Description copied from interface: SubscriptionViewMBean
Returns true if the subscription is slow

Specified by:
isSlowConsumer in interface SubscriptionViewMBean
Returns:
true if the subscription is slow

getUserName

public String getUserName()
Description copied from interface: SubscriptionViewMBean
Returns the User Name used to authorize creation of this Subscription. This value can be null if display of user name information is disabled.

Specified by:
getUserName in interface SubscriptionViewMBean
Returns:
the name of the user that created this Subscription


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.