activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r800339 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/ broker/jmx/ network/ transport/
Date Mon, 03 Aug 2009 12:40:13 GMT
Author: dejanb
Date: Mon Aug  3 12:40:13 2009
New Revision: 800339

URL: http://svn.apache.org/viewvc?rev=800339&view=rev
Log:
fix for https://issues.apache.org/activemq/browse/AMQ-2330 - mbean descriptions

Added:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/MBeanInfo.java
Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerView.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java Mon Aug  3 12:40:13 2009
@@ -39,6 +39,7 @@
 import org.apache.activemq.advisory.AdvisoryBroker;
 import org.apache.activemq.broker.cluster.ConnectionSplitBroker;
 import org.apache.activemq.broker.ft.MasterConnector;
+import org.apache.activemq.broker.jmx.AnnotatedMBean;
 import org.apache.activemq.broker.jmx.BrokerView;
 import org.apache.activemq.broker.jmx.ConnectorView;
 import org.apache.activemq.broker.jmx.ConnectorViewMBean;
@@ -452,7 +453,7 @@
                 managedBroker.setContextBroker(broker);
                 adminView = new BrokerView(this, managedBroker);
                 ObjectName objectName = getBrokerObjectName();
-                getManagementContext().registerMBean(adminView, objectName);
+                AnnotatedMBean.registerMBean(getManagementContext(), adminView, objectName);
             }
             BrokerRegistry.getInstance().bind(getBrokerName(), this);
             // see if there is a MasterBroker service and if so, configure
@@ -1427,7 +1428,7 @@
             ObjectName objectName = createConnectorObjectName(connector);
             connector = connector.asManagedConnector(getManagementContext(), objectName);
             ConnectorViewMBean view = new ConnectorView(connector);
-            getManagementContext().registerMBean(view, objectName);
+            AnnotatedMBean.registerMBean(getManagementContext(), view, objectName);
             return connector;
         } catch (Throwable e) {
             throw IOExceptionSupport.create("Transport Connector could not be registered in JMX: " + e.getMessage(), e);
@@ -1466,7 +1467,7 @@
         try {
             ObjectName objectName = createNetworkConnectorObjectName(connector);
             connector.setObjectName(objectName);
-            getManagementContext().registerMBean(view, objectName);
+            AnnotatedMBean.registerMBean(getManagementContext(), view, objectName);
         } catch (Throwable e) {
             throw IOExceptionSupport.create("Network Connector could not be registered in JMX: " + e.getMessage(), e);
         }
@@ -1496,7 +1497,7 @@
             ObjectName objectName = new ObjectName(getManagementContext().getJmxDomainName() + ":" + "BrokerName="
                     + JMXSupport.encodeObjectNamePart(getBrokerName()) + "," + "Type=ProxyConnector,"
                     + "ProxyConnectorName=" + JMXSupport.encodeObjectNamePart(connector.getName()));
-            getManagementContext().registerMBean(view, objectName);
+            AnnotatedMBean.registerMBean(getManagementContext(), view, objectName);
         } catch (Throwable e) {
             throw IOExceptionSupport.create("Broker could not be registered in JMX: " + e.getMessage(), e);
         }
@@ -1507,7 +1508,7 @@
         try {
             ObjectName objectName = new ObjectName(getManagementContext().getJmxDomainName() + ":" + "BrokerName="
                     + JMXSupport.encodeObjectNamePart(getBrokerName()) + "," + "Type=MasterConnector");
-            getManagementContext().registerMBean(view, objectName);
+            AnnotatedMBean.registerMBean(getManagementContext(), view, objectName);
         } catch (Throwable e) {
             throw IOExceptionSupport.create("Broker could not be registered in JMX: " + e.getMessage(), e);
         }
@@ -1519,7 +1520,7 @@
             ObjectName objectName = new ObjectName(getManagementContext().getJmxDomainName() + ":" + "BrokerName="
                     + JMXSupport.encodeObjectNamePart(getBrokerName()) + "," + "Type=JmsConnector,"
                     + "JmsConnectorName=" + JMXSupport.encodeObjectNamePart(connector.getName()));
-            getManagementContext().registerMBean(view, objectName);
+            AnnotatedMBean.registerMBean(getManagementContext(), view, objectName);
         } catch (Throwable e) {
             throw IOExceptionSupport.create("Broker could not be registered in JMX: " + e.getMessage(), e);
         }

Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java?rev=800339&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java (added)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/AnnotatedMBean.java Mon Aug  3 12:40:13 2009
@@ -0,0 +1,141 @@
+package org.apache.activemq.broker.jmx;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
+import javax.management.StandardMBean;
+
+/**
+ * MBean that looks for method/parameter descriptions in the Info annotation.
+ */
+public class AnnotatedMBean extends StandardMBean {
+
+  private static final Map<String, Class<?>> primitives = new HashMap<String, Class<?>>();
+  static {
+    Class<?>[] p = { byte.class, short.class, int.class, long.class, float.class, double.class, char.class, boolean.class, };
+    for (Class<?> c : p)
+      primitives.put(c.getName(), c);
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) 
+    throws Exception {
+
+    String mbeanName = object.getClass().getName() + "MBean";
+    
+    for (Class c : object.getClass().getInterfaces()) {
+      if (mbeanName.equals(c.getName())) {
+        context.registerMBean(new AnnotatedMBean(object, c), objectName);
+        return;
+      }
+    }
+
+    context.registerMBean(object, objectName);
+  }
+  
+  /** Instance where the MBean interface is implemented by another object. */
+  public <T> AnnotatedMBean(T impl, Class<T> mbeanInterface) throws NotCompliantMBeanException {
+    super(impl, mbeanInterface);
+  }
+
+  /** Instance where the MBean interface is implemented by this object. */
+  protected AnnotatedMBean(Class<?> mbeanInterface) throws NotCompliantMBeanException {
+    super(mbeanInterface);
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  protected String getDescription(MBeanAttributeInfo info) {
+
+    String descr = info.getDescription();
+    Method m = getMethod(getMBeanInterface(), "get"+info.getName().substring(0, 1).toUpperCase()+info.getName().substring(1));
+    if (m == null)
+      m = getMethod(getMBeanInterface(), "is"+info.getName().substring(0, 1).toUpperCase()+info.getName().substring(1));
+    if (m == null)
+      m = getMethod(getMBeanInterface(), "does"+info.getName().substring(0, 1).toUpperCase()+info.getName().substring(1));
+      
+    if (m != null) {
+      MBeanInfo d = m.getAnnotation(MBeanInfo.class);
+      if (d != null)
+        descr = d.value();
+    }
+    return descr;
+  }
+  
+  /** {@inheritDoc} */
+  @Override
+  protected String getDescription(MBeanOperationInfo op) {
+
+    String descr = op.getDescription();
+    Method m = getMethod(op);
+    if (m != null) {
+      MBeanInfo d = m.getAnnotation(MBeanInfo.class);
+      if (d != null)
+        descr = d.value();
+    }
+    return descr;
+  }
+
+  /** {@inheritDoc} */
+  @Override
+  protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int paramNo) {
+    String name = param.getName();
+    Method m = getMethod(op);
+    if (m != null) {
+      for (Annotation a : m.getParameterAnnotations()[paramNo]) {
+        if (MBeanInfo.class.isInstance(a))
+          name = MBeanInfo.class.cast(a).value();
+      }
+    }
+    return name;
+  }
+
+  /**
+   * Extracts the Method from the MBeanOperationInfo
+   * @param op
+   * @return
+   */
+  private Method getMethod(MBeanOperationInfo op) {
+    final MBeanParameterInfo[] params = op.getSignature();
+    final String[] paramTypes = new String[params.length];
+    for (int i = 0; i < params.length; i++)
+      paramTypes[i] = params[i].getType();
+
+    return getMethod(getMBeanInterface(), op.getName(), paramTypes);
+  }
+
+  /**
+   * Returns the Method with the specified name and parameter types for the given class,
+   * null if it doesn't exist.
+   * @param mbean
+   * @param method
+   * @param params
+   * @return
+   */
+  private static Method getMethod(Class<?> mbean, String method, String... params) {
+    try {
+      final ClassLoader loader = mbean.getClassLoader();
+      final Class<?>[] paramClasses = new Class<?>[params.length];
+      for (int i = 0; i < params.length; i++) {
+        paramClasses[i] = primitives.get(params[i]);
+        if (paramClasses[i] == null)
+          paramClasses[i] = Class.forName(params[i], false, loader);
+      }
+      return mbean.getMethod(method, paramClasses);
+    } catch (RuntimeException e) {
+      throw e;
+    } catch (Exception e) {
+      return null;
+    }
+  }
+}

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java Mon Aug  3 12:40:13 2009
@@ -30,11 +30,13 @@
     /**
      * @return The unique id of the broker.
      */
+    @MBeanInfo("The unique id of the broker.")
     String getBrokerId();
     
     /**
      * @return The name of the broker.
      */
+    @MBeanInfo("The name of the broker.")
     String getBrokerName();    
 
     /**
@@ -43,44 +45,61 @@
      * 
      * @throws Exception
      */
+    @MBeanInfo("Runs the Garbage Collector.")
     void gc() throws Exception;
 
+    @MBeanInfo("Reset all broker statistics.")
     void resetStatistics();
 
+    @MBeanInfo("Enable broker statistics.")
     void enableStatistics();
 
+    @MBeanInfo("Disable broker statistics.")
     void disableStatistics();
 
+    @MBeanInfo("Broker statistics enabled.")
     boolean isStatisticsEnabled();
 
+    @MBeanInfo("Number of messages that have been sent to the broker.")
     long getTotalEnqueueCount();
 
+    @MBeanInfo("Number of messages that have been acknowledged on the broker.")
     long getTotalDequeueCount();
 
+    @MBeanInfo("Number of message consumers subscribed to destinations on the broker.")
     long getTotalConsumerCount();
 
+    @MBeanInfo("Number of unacknowledged messages on the broker.")
     long getTotalMessageCount();
 
+    @MBeanInfo("Percent of memory limit used.")
     int getMemoryPercentUsage();
 
+    @MBeanInfo("Memory limit, in bytes, used for holding undelivered messages before paging to temporary storage.")
     long getMemoryLimit();
 
-    void setMemoryLimit(long limit);
-        
+    void setMemoryLimit(@MBeanInfo("bytes") long limit);
+
+    @MBeanInfo("Percent of store limit used.")
     int getStorePercentUsage();
 
+    @MBeanInfo("Disk limit, in bytes, used for persistent messages before producers are blocked.")
     long getStoreLimit();
 
-    void setStoreLimit(long limit);
-    
+    void setStoreLimit(@MBeanInfo("bytes") long limit);
+
+    @MBeanInfo("Percent of temp limit used.")
     int getTempPercentUsage();
 
+    @MBeanInfo("Disk limit, in bytes, used for non-persistent messages and temporary date before producers are blocked.")
     long getTempLimit();
 
-    void setTempLimit(long limit);
+    void setTempLimit(@MBeanInfo("bytes") long limit);
     
+    @MBeanInfo("Messages are synchronized to disk.")
     boolean isPersistent();
-    
+
+    @MBeanInfo("Slave broker.")
     boolean isSlave();
 
     /**
@@ -89,40 +108,55 @@
      * @param exitCode the exit code that will be reported by the JVM process
      *                when it exits.
      */
-    void terminateJVM(int exitCode);
+    @MBeanInfo("Shuts down the JVM.")
+    void terminateJVM(@MBeanInfo("exitCode") int exitCode);
 
     /**
      * Stop the broker and all it's components.
      */
     void stop() throws Exception;
 
+    @MBeanInfo("Topics (broadcasted 'queues'); generally system information.")
     ObjectName[] getTopics();
 
+    @MBeanInfo("Standard Queues containing AIE messages.")
     ObjectName[] getQueues();
 
+    @MBeanInfo("Temporary Topics; generally unused.")
     ObjectName[] getTemporaryTopics();
 
+    @MBeanInfo("Temporary Queues; generally temporary message response holders.")
     ObjectName[] getTemporaryQueues();
 
+    @MBeanInfo("Topic Subscribers")
     ObjectName[] getTopicSubscribers();
 
+    @MBeanInfo("Durable (persistent) topic subscribers")
     ObjectName[] getDurableTopicSubscribers();
 
+    @MBeanInfo("Inactive (disconnected persistent) topic subscribers")
     ObjectName[] getInactiveDurableTopicSubscribers();
 
+    @MBeanInfo("Queue Subscribers.")
     ObjectName[] getQueueSubscribers();
 
+    @MBeanInfo("Temporary Topic Subscribers.")
     ObjectName[] getTemporaryTopicSubscribers();
 
+    @MBeanInfo("Temporary Queue Subscribers.")
     ObjectName[] getTemporaryQueueSubscribers();
 
-    String addConnector(String discoveryAddress) throws Exception;
+    @MBeanInfo("Adds a Connector to the broker.")
+    String addConnector(@MBeanInfo("discoveryAddress") String discoveryAddress) throws Exception;
 
-    String addNetworkConnector(String discoveryAddress) throws Exception;
+    @MBeanInfo("Adds a Network Connector to the broker.")
+    String addNetworkConnector(@MBeanInfo("discoveryAddress") String discoveryAddress) throws Exception;
 
-    boolean removeConnector(String connectorName) throws Exception;
+    @MBeanInfo("Removes a Connector from the broker.")
+    boolean removeConnector(@MBeanInfo("connectorName") String connectorName) throws Exception;
 
-    boolean removeNetworkConnector(String connectorName) throws Exception;
+    @MBeanInfo("Removes a Network Connector from the broker.")
+    boolean removeNetworkConnector(@MBeanInfo("connectorName") String connectorName) throws Exception;
 
     /**
      * Adds a Topic destination to the broker.
@@ -130,7 +164,8 @@
      * @param name The name of the Topic
      * @throws Exception
      */
-    void addTopic(String name) throws Exception;
+    @MBeanInfo("Adds a Topic destination to the broker.")
+    void addTopic(@MBeanInfo("name") String name) throws Exception;
 
     /**
      * Adds a Queue destination to the broker.
@@ -138,7 +173,8 @@
      * @param name The name of the Queue
      * @throws Exception
      */
-    void addQueue(String name) throws Exception;
+    @MBeanInfo("Adds a Queue destination to the broker.")
+    void addQueue(@MBeanInfo("name") String name) throws Exception;
 
     /**
      * Removes a Topic destination from the broker.
@@ -146,7 +182,8 @@
      * @param name The name of the Topic
      * @throws Exception
      */
-    void removeTopic(String name) throws Exception;
+    @MBeanInfo("Removes a Topic destination from the broker.")
+    void removeTopic(@MBeanInfo("name") String name) throws Exception;
 
     /**
      * Removes a Queue destination from the broker.
@@ -154,7 +191,8 @@
      * @param name The name of the Queue
      * @throws Exception
      */
-    void removeQueue(String name) throws Exception;
+    @MBeanInfo("Removes a Queue destination from the broker.")
+    void removeQueue(@MBeanInfo("name") String name) throws Exception;
 
     /**
      * Creates a new durable topic subscriber
@@ -165,7 +203,8 @@
      * @param selector a selector or null
      * @return the object name of the MBean registered in JMX
      */
-    ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName, String selector) throws Exception;
+    @MBeanInfo(value="Creates a new durable topic subscriber.")
+    ObjectName createDurableSubscriber(@MBeanInfo("clientId") String clientId, @MBeanInfo("subscriberName") String subscriberName, @MBeanInfo("topicName") String topicName, @MBeanInfo("selector") String selector) throws Exception;
 
     /**
      * Destroys a durable subscriber
@@ -173,13 +212,15 @@
      * @param clientId the JMS client ID
      * @param subscriberName the durable subscriber name
      */
-    void destroyDurableSubscriber(String clientId, String subscriberName) throws Exception;
+    @MBeanInfo(value="Destroys a durable subscriber.")
+    void destroyDurableSubscriber(@MBeanInfo("clientId") String clientId, @MBeanInfo("subscriberName") String subscriberName) throws Exception;
 
     /**
      * Reloads log4j.properties from the classpath.
      * This methods calls org.apache.activemq.transport.TransportLoggerControl.reloadLog4jProperties
      * @throws Throwable 
      */
+    @MBeanInfo(value="Reloads log4j.properties from the classpath.")
     public void reloadLog4jProperties() throws Throwable;
     
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectionViewMBean.java Mon Aug  3 12:40:13 2009
@@ -22,31 +22,37 @@
     /**
      * @return true if the Connection is slow
      */
+    @MBeanInfo("Connection is slow.")
     boolean isSlow();
 
     /**
      * @return if after being marked, the Connection is still writing
      */
+    @MBeanInfo("Connection is blocked.")
     boolean isBlocked();
 
     /**
      * @return true if the Connection is connected
      */
+    @MBeanInfo("Connection is connected to the broker.")
     boolean isConnected();
 
     /**
      * @return true if the Connection is active
      */
+    @MBeanInfo("Connection is active (both connected and receiving messages).")
     boolean isActive();
 
     /**
      * Returns the number of messages to be dispatched to this connection
      */
+    @MBeanInfo("The number of messages dispatched to this connection")
     int getDispatchQueueSize();
     
     /**
      * Resets the statistics
      */
+    @MBeanInfo("Resets the statistics")
     void resetStatistics();
 
     /**
@@ -54,6 +60,7 @@
      * 
      * @return the number of messages enqueued on this connection
      */
+    @MBeanInfo("Number of messages enqueued on this connection")
     long getEnqueueCount();
 
     /**
@@ -61,6 +68,7 @@
      * 
      * @return the number of messages dequeued on this connection
      */
+    @MBeanInfo("Number of messages dequeued on this connection")
     long getDequeueCount();
     
     /**
@@ -68,6 +76,7 @@
      * 
      * @return the souce address for this connection
      */
+    @MBeanInfo("Source address for this connection")
     String getRemoteAddress();
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ConnectorViewMBean.java Mon Aug  3 12:40:13 2009
@@ -23,16 +23,19 @@
     /**
      * Resets the statistics
      */
+    @MBeanInfo("Resets the statistics")
     void resetStatistics();
     
     /**
      * enable statistics gathering
-     */   
+     */
+    @MBeanInfo("Enables statistics gathering")
     void enableStatistics();
 
     /**
      * disable statistics gathering
      */  
+    @MBeanInfo("Disables statistics gathering")
     void disableStatistics();
     
     /**
@@ -40,6 +43,7 @@
      * 
      * @return true if statistics is enabled
      */  
+    @MBeanInfo("Statistics gathering enabled")
     boolean isStatisticsEnabled();
 
     /**
@@ -47,6 +51,7 @@
      * 
      * @return the number of messages enqueued on this connector
      */
+    @MBeanInfo("Number of messages enqueued on this connector")
     long getEnqueueCount();
 
     /**
@@ -54,6 +59,7 @@
      * 
      * @return the number of messages dequeued on this connector
      */
+    @MBeanInfo("Number of messages dequeued on this connector")
     long getDequeueCount();
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java Mon Aug  3 12:40:13 2009
@@ -32,11 +32,13 @@
     /**
      * Returns the name of this destination
      */
+    @MBeanInfo("Name of this destination.")
     String getName();
 
     /**
      * Resets the managment counters.
      */
+    @MBeanInfo("Resets statistics.")
     void resetStatistics();
 
     /**
@@ -44,6 +46,7 @@
      * 
      * @return The number of messages that have been sent to the destination.
      */
+    @MBeanInfo("Number of messages that have been sent to the destination.")
     long getEnqueueCount();
 
     /**
@@ -53,6 +56,7 @@
      * @return The number of messages that have been delivered (potentially not
      *         acknowledged) to consumers.
      */
+    @MBeanInfo("Number of messages that have been delivered (but potentially not acknowledged) to consumers.")
     long getDispatchCount();
 
     /**
@@ -62,6 +66,7 @@
      * @return The number of messages that have been acknowledged from the
      *         destination.
      */
+    @MBeanInfo("Number of messages that have been acknowledged (and removed from) from the destination.")
     long getDequeueCount();
     
     /**
@@ -71,26 +76,29 @@
      * @return The number of messages that have been dispatched but not
      * acknowledged
      */
+    @MBeanInfo("Number of messages that have been dispatched to, but not acknowledged by, consumers.")
     long getInFlightCount();
 
-    
     /**
      * Returns the number of messages that have expired
      * 
      * @return The number of messages that have expired
      */
+    @MBeanInfo("Number of messages that have been expired.")
     long getExpiredCount();
-
+    
     /**
      * Returns the number of consumers subscribed this destination.
      * 
      * @return The number of consumers subscribed this destination.
      */
+    @MBeanInfo("Number of consumers subscribed to this destination.")
     long getConsumerCount();
     
     /**
      * @return the number of producers publishing to the destination
      */
+    @MBeanInfo("Number of producers publishing to this destination")
     long getProducerCount();
 
     /**
@@ -100,29 +108,34 @@
      * @return Returns the number of messages in this destination which are yet
      *         to be consumed
      */
+    @MBeanInfo("Number of messages in the destination which are yet to be consumed.  Potentially dispatched but unacknowledged.")
     long getQueueSize();
 
     /**
      * @return An array of all the messages in the destination's queue.
      */
+    @MBeanInfo("An array of all messages in the destination. Not HTML friendly.")
     CompositeData[] browse() throws OpenDataException;
 
     /**
      * @return A list of all the messages in the destination's queue.
      */
+    @MBeanInfo("A list of all messages in the destination. Not HTML friendly.")
     TabularData browseAsTable() throws OpenDataException;
 
     /**
      * @return An array of all the messages in the destination's queue.
      * @throws InvalidSelectorException
      */
-    CompositeData[] browse(String selector) throws OpenDataException, InvalidSelectorException;
+    @MBeanInfo("An array of all messages in the destination based on an SQL-92 selection on the message headers or XPATH on the body. Not HTML friendly.")
+    CompositeData[] browse(@MBeanInfo("selector") String selector) throws OpenDataException, InvalidSelectorException;
 
     /**
      * @return A list of all the messages in the destination's queue.
      * @throws InvalidSelectorException
      */
-    TabularData browseAsTable(String selector) throws OpenDataException, InvalidSelectorException;
+    @MBeanInfo("A list of all messages in the destination based on an SQL-92 selection on the message headers or XPATH on the body. Not HTML friendly.")
+    TabularData browseAsTable(@MBeanInfo("selector") String selector) throws OpenDataException, InvalidSelectorException;
 
     /**
      * Sends a TextMesage to the destination.
@@ -131,7 +144,8 @@
      * @return the message id of the message sent.
      * @throws Exception
      */
-    String sendTextMessage(String body) throws Exception;
+    @MBeanInfo("Sends a TextMessage to the destination.")
+    String sendTextMessage(@MBeanInfo("body") String body) throws Exception;
 
     /**
      * Sends a TextMesage to the destination.
@@ -142,7 +156,8 @@
      * @return the message id of the message sent.
      * @throws Exception
      */
-    String sendTextMessage(Map headers, String body) throws Exception;
+    @MBeanInfo("Sends a TextMessage to the destination.")
+    String sendTextMessage(@MBeanInfo("headers") Map<?,?> headers, @MBeanInfo("body") String body) throws Exception;
 
     /**
      * Sends a TextMesage to the destination.
@@ -152,7 +167,8 @@
      * @return
      * @throws Exception
      */
-    String sendTextMessage(String body, String user, String password) throws Exception;
+    @MBeanInfo("Sends a TextMessage to a password-protected destination.")
+    String sendTextMessage(@MBeanInfo("body") String body, @MBeanInfo("user") String user, @MBeanInfo("password") String password) throws Exception;
     
     /**
      * 
@@ -164,15 +180,18 @@
      * @return
      * @throws Exception
      */
-    String sendTextMessage(Map headers, String body, String user, String password) throws Exception;
+    @MBeanInfo("Sends a TextMessage to a password-protected destination.")
+    String sendTextMessage(@MBeanInfo("headers") Map<?,?> headers, @MBeanInfo("body") String body, @MBeanInfo("user") String user, @MBeanInfo("password") String password) throws Exception;
     /**
      * @return the percentage of amount of memory used
      */
+    @MBeanInfo("The percentage of the memory limit used")
     int getMemoryPercentUsage();
 
     /**
      * @return the amount of memory allocated to this destination
      */
+    @MBeanInfo("Memory limit, in bytes, used for holding undelivered messages before paging to temporary storage.")
     long getMemoryLimit();
 
     /**
@@ -184,97 +203,109 @@
     /**
      * @return the portion of memory from the broker memory limit for this destination
      */
+    @MBeanInfo("Portion of memory from the broker memory limit for this destination")
     float getMemoryUsagePortion();
     
     /**
      * set the portion of memory from the broker memory limit for this destination
      * @param value
      */
-    void setMemoryUsagePortion(float value);
+    void setMemoryUsagePortion(@MBeanInfo("bytes") float value);
 
     /**
      * Browses the current destination returning a list of messages
      */
-    List browseMessages() throws InvalidSelectorException;
+    @MBeanInfo("A list of all messages in the destination. Not HTML friendly.")
+    List<?> browseMessages() throws InvalidSelectorException;
 
     /**
      * Browses the current destination with the given selector returning a list
      * of messages
      */
-    List browseMessages(String selector) throws InvalidSelectorException;
+    @MBeanInfo("A list of all messages in the destination based on an SQL-92 selection on the message headers or XPATH on the body. Not HTML friendly.")
+    List<?> browseMessages(String selector) throws InvalidSelectorException;
 
     /**
      * @return longest time a message is held by a destination
      */
+    @MBeanInfo("The longest time a message has been held this destination.")
     long getMaxEnqueueTime();
 
     /**
      * @return shortest time a message is held by a destination
      */
+    @MBeanInfo("The shortest time a message has been held this destination.")
     long getMinEnqueueTime();
 
     /**
      * @return average time a message is held by a destination
      */
+    @MBeanInfo("Average time a message has been held this destination.")
     double getAverageEnqueueTime();
     
     /**
      * @return the producerFlowControl
      */
+    @MBeanInfo("Producers are flow controlled")
     boolean isProducerFlowControl();
     /**
      * @param producerFlowControl the producerFlowControl to set
      */
-    public void setProducerFlowControl(boolean producerFlowControl);
+    public void setProducerFlowControl(@MBeanInfo("producerFlowControl") boolean producerFlowControl);
     
     /**
      * @return the maxProducersToAudit
      */
+    @MBeanInfo("Maximum number of producers to audit") 
     public int getMaxProducersToAudit();
     
     /**
      * @param maxProducersToAudit the maxProducersToAudit to set
      */
-    public void setMaxProducersToAudit(int maxProducersToAudit);
+    public void setMaxProducersToAudit(@MBeanInfo("maxProducersToAudit") int maxProducersToAudit);
     
     /**
      * @return the maxAuditDepth
      */
+    @MBeanInfo("Max audit depth")
     public int getMaxAuditDepth();
     
     /**
      * @param maxAuditDepth the maxAuditDepth to set
      */
-    public void setMaxAuditDepth(int maxAuditDepth);
+    public void setMaxAuditDepth(@MBeanInfo("maxAuditDepth") int maxAuditDepth);
     
     /**
      * @return the maximum number of message to be paged into the 
      * destination
      */
+    @MBeanInfo("Maximum number of messages to be paged in")
     public int getMaxPageSize();
     
     /**
      * @param pageSize
      * Set the maximum number of messages to page into the destination
      */
-    public void setMaxPageSize(int pageSize);
+    public void setMaxPageSize(@MBeanInfo("pageSize") int pageSize);
     
     /**
      * @return true if caching is enabled of for the destination
      */
+    @MBeanInfo("Caching is enabled")
     public boolean isUseCache();
     
     /**
      * @param value
      * enable/disable caching on the destination
      */
-    public void setUseCache(boolean value);
+    public void setUseCache(@MBeanInfo("cache") boolean value);
 
     /**
      * Returns all the current subscription MBeans matching this destination
      * 
      * @return the names of the subscriptions for this destination
      */
+    @MBeanInfo("returns all the current subscription MBeans matching this destination")
     ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException;
 
 }

Added: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/MBeanInfo.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/MBeanInfo.java?rev=800339&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/MBeanInfo.java (added)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/MBeanInfo.java Mon Aug  3 12:40:13 2009
@@ -0,0 +1,13 @@
+package org.apache.activemq.broker.jmx;
+
+import static java.lang.annotation.ElementType.*;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(value=RetentionPolicy.RUNTIME)
+@Target({CONSTRUCTOR, METHOD, PARAMETER, TYPE, FIELD})
+public @interface MBeanInfo {
+    String value();
+}

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java Mon Aug  3 12:40:13 2009
@@ -242,7 +242,7 @@
             }
         }
         try {
-            managementContext.registerMBean(view, key);
+            AnnotatedMBean.registerMBean(managementContext, view, key);
             registeredMBeans.add(key);
         } catch (Throwable e) {
             LOG.warn("Failed to register MBean: " + key);
@@ -297,7 +297,7 @@
         }
 
         try {
-            managementContext.registerMBean(view, key);
+            AnnotatedMBean.registerMBean(managementContext, view, key);
             registeredMBeans.add(key);
         } catch (Throwable e) {
             LOG.warn("Failed to register MBean: " + key);
@@ -367,7 +367,7 @@
             SubscriptionView view = new InactiveDurableSubscriptionView(this, key.getClientId(), info);
 
             try {
-                managementContext.registerMBean(view, objectName);
+                AnnotatedMBean.registerMBean(managementContext, view, objectName);
                 registeredMBeans.add(objectName);
             } catch (Throwable e) {
                 LOG.warn("Failed to register MBean: " + key);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnection.java Mon Aug  3 12:40:13 2009
@@ -96,7 +96,7 @@
     protected void registerMBean(ObjectName name) {
         if (name != null) {
             try {
-                managementContext.registerMBean(mbean, name);
+                AnnotatedMBean.registerMBean(managementContext, mbean, name);
             } catch (Throwable e) {
                 LOG.warn("Failed to register MBean: " + name);
                 LOG.debug("Failure reason: " + e, e);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java Mon Aug  3 12:40:13 2009
@@ -23,20 +23,15 @@
 import java.rmi.registry.Registry;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.management.Attribute;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
 import javax.management.JMException;
-import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.MBeanServerInvocationHandler;
 import javax.management.MalformedObjectNameException;
-import javax.management.NotCompliantMBeanException;
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.QueryExp;
@@ -47,7 +42,6 @@
 import org.apache.activemq.Service;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import sun.security.action.GetBooleanAction;
 
 /**
  * A Flow provides different dispatch policies within the NMR

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/QueueViewMBean.java Mon Aug  3 12:40:13 2009
@@ -28,7 +28,8 @@
      * @return A CompositeData object which is a JMX version of the messages
      * @throws OpenDataException
      */
-    CompositeData getMessage(String messageId) throws OpenDataException;
+    @MBeanInfo("View a message from the destination by JMS message ID.")
+    CompositeData getMessage(@MBeanInfo("messageId") String messageId) throws OpenDataException;
 
     /**
      * Removes a message from the queue. If the message has already been
@@ -39,14 +40,16 @@
      * @return true if the message was found and could be successfully deleted.
      * @throws Exception
      */
-    boolean removeMessage(String messageId) throws Exception;
+    @MBeanInfo("Remove a message from the destination by JMS message ID.  If the message has been dispatched, it cannot be deleted and false is returned.")
+    boolean removeMessage(@MBeanInfo("messageId") String messageId) throws Exception;
 
     /**
      * Removes the messages matching the given selector
      * 
      * @return the number of messages removed
      */
-    int removeMatchingMessages(String selector) throws Exception;
+    @MBeanInfo("Removes messages from the destination based on an SQL-92 selection on the message headers or XPATH on the body.")
+    int removeMatchingMessages(@MBeanInfo("selector") String selector) throws Exception;
 
     /**
      * Removes the messages matching the given selector up to the maximum number
@@ -54,13 +57,15 @@
      * 
      * @return the number of messages removed
      */
-    int removeMatchingMessages(String selector, int maximumMessages) throws Exception;
+    @MBeanInfo("Removes up to a specified number of messages from the destination based on an SQL-92 selection on the message headers or XPATH on the body.")
+    int removeMatchingMessages(@MBeanInfo("selector") String selector, @MBeanInfo("maximumMessages") int maximumMessages) throws Exception;
 
     /**
      * Removes all of the messages in the queue.
      * 
      * @throws Exception
      */
+    @MBeanInfo("Removes all of the messages in the queue.")
     void purge() throws Exception;
 
     /**
@@ -72,14 +77,16 @@
      *         other destination.
      * @throws Exception
      */
-    boolean copyMessageTo(String messageId, String destinationName) throws Exception;
+    @MBeanInfo("Copies a message with the given JMS message ID into the specified destination.")
+    boolean copyMessageTo(@MBeanInfo("messageId") String messageId, @MBeanInfo("destinationName") String destinationName) throws Exception;
 
     /**
      * Copies the messages matching the given selector
      * 
      * @return the number of messages copied
      */
-    int copyMatchingMessagesTo(String selector, String destinationName) throws Exception;
+    @MBeanInfo("Copies messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.")
+    int copyMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName) throws Exception;
 
     /**
      * Copies the messages matching the given selector up to the maximum number
@@ -87,7 +94,8 @@
      * 
      * @return the number of messages copied
      */
-    int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception;
+    @MBeanInfo("Copies up to a specified number of messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.")
+    int copyMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName, @MBeanInfo("maximumMessages") int maximumMessages) throws Exception;
 
     /**
      * Moves the message to another destination.
@@ -98,57 +106,67 @@
      *         other destination.
      * @throws Exception
      */
-    boolean moveMessageTo(String messageId, String destinationName) throws Exception;
+    @MBeanInfo("Moves a message with the given JMS message ID into the specified destination.")
+    boolean moveMessageTo(@MBeanInfo("messageId") String messageId, @MBeanInfo("destinationName") String destinationName) throws Exception;
 
     /**
      * Moves a message back to its original destination
      */
-    boolean retryMessage(String messageId) throws Exception;
+    @MBeanInfo("Moves a message with the given JMS message back to its original destination")
+    boolean retryMessage(@MBeanInfo("messageId") String messageId) throws Exception;
     
     /**
      * Moves the messages matching the given selector
      * 
      * @return the number of messages removed
      */
-    int moveMatchingMessagesTo(String selector, String destinationName) throws Exception;
+    @MBeanInfo("Moves messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.")
+    int moveMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName) throws Exception;
 
     /**
      * Moves the messages matching the given selector up to the maximum number
      * of matched messages
      */
-    int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception;
+    @MBeanInfo("Moves up to a specified number of messages based on an SQL-92 selecton on the message headers or XPATH on the body into the specified destination.")
+    int moveMatchingMessagesTo(@MBeanInfo("selector") String selector, @MBeanInfo("destinationName") String destinationName, @MBeanInfo("maximumMessages") int maximumMessages) throws Exception;
     
     /**
      * @return true if the message cursor has memory space available
      * to page in more messages
      */
+    @MBeanInfo("Message cursor has memory space available")
     public boolean doesCursorHaveSpace();
     
     /**
      * @return true if the cursor has reached its memory limit for
      * paged in messages
      */
+    @MBeanInfo("Message cusor has reached its memory limit for paged in messages")
     public boolean isCursorFull();
     
     /**
      * @return true if the cursor has messages buffered to deliver
      */
+    @MBeanInfo("Message cursor has buffered messages to deliver")
     public boolean doesCursorHaveMessagesBuffered();
     
     /**
      * @return the cursor memory usage in bytes
      */
+    @MBeanInfo("Message cursor memory usage, in bytes.")
     public long getCursorMemoryUsage();
     
     /**
      * @return the cursor memory usage as a percentage
      */
+    @MBeanInfo("Percentage of memory limit used")
     public int getCursorPercentUsage();
     
     /**
      * @return the number of messages available to be paged in 
      * by the cursor
      */
+    @MBeanInfo("Number of messages available to be paged in by the cursor.")
     public int cursorSize();
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/SubscriptionViewMBean.java Mon Aug  3 12:40:13 2009
@@ -26,67 +26,79 @@
     /**
      * @return the clientId of the Connection the Subscription is on
      */
+    @MBeanInfo("JMS Client id of the Connection the Subscription is on.")
     String getClientId();
 
     /**
      * @return the id of the Connection the Subscription is on
      */
+    @MBeanInfo("ID of the Connection the Subscription is on.")
     String getConnectionId();
 
     /**
      * @return the id of the Session the subscription is on
      */
+    @MBeanInfo("ID of the Session the Subscription is on.")
     long getSessionId();
 
     /**
      * @return the id of the Subscription
      */
+    @MBeanInfo("ID of the Subscription.")
     long getSubcriptionId();
 
     /**
      * @return the destination name
      */
+    @MBeanInfo("The name of the destionation the subscription is on.")
     String getDestinationName();
 
     /**
      * @return the JMS selector on the current subscription
      */
+    @MBeanInfo("The SQL-92 message header selector or XPATH body selector of the subscription.")
     String getSelector();
 
     /**
      * Attempts to change the current active selector on the subscription. This
      * operation is not supported for persistent topics.
      */
-    void setSelector(String selector) throws InvalidSelectorException, UnsupportedOperationException;
+    void setSelector(@MBeanInfo("selector") String selector) throws InvalidSelectorException, UnsupportedOperationException;
 
     /**
      * @return true if the destination is a Queue
      */
+    @MBeanInfo("Subscription is on a Queue")
     boolean isDestinationQueue();
 
     /**
      * @return true of the destination is a Topic
      */
+    @MBeanInfo("Subscription is on a Topic")
     boolean isDestinationTopic();
 
     /**
      * @return true if the destination is temporary
      */
+    @MBeanInfo("Subscription is on a temporary Queue/Topic")
     boolean isDestinationTemporary();
 
     /**
      * @return true if the subscriber is active
      */
+    @MBeanInfo("Subscription is active (connected and receiving messages).")
     boolean isActive();
 
     /**
      * @return number of messages pending delivery
      */
+    @MBeanInfo("Number of messages pending delivery.")
     int getPendingQueueSize();
 
     /**
      * @return number of messages dispatched
      */
+    @MBeanInfo("Number of messages dispatched awaiting acknowledgement.")
     int getDispatchedQueueSize();
     
     /**
@@ -94,46 +106,55 @@
      * making it explicit
      * @return
      */
+    @MBeanInfo("Number of messages dispatched awaiting acknowledgement.")
     int getMessageCountAwaitingAcknowledge();
 
     /**
      * @return number of messages that matched the subscription
      */
+    @MBeanInfo("Number of messages that sent to the client.")
     long getDispachedCounter();
 
     /**
      * @return number of messages that matched the subscription
      */
+    @MBeanInfo("Number of messages that matched the subscription.")
     long getEnqueueCounter();
 
     /**
      * @return number of messages queued by the client
      */
+    @MBeanInfo("Number of messages were sent to and acknowledge by the client.")
     long getDequeueCounter();
 
     /**
      * @return the prefetch that has been configured for this subscriber
      */
+    @MBeanInfo("Number of messages to pre-fetch and dispatch to the client.")
     int getPrefetchSize();
 
     /**
      * @return whether or not the subscriber is retroactive or not
      */
+    @MBeanInfo("The subscriber is retroactive (tries to receive broadcasted topic messages sent prior to connecting)")
     boolean isRetroactive();
 
     /**
      * @return whether or not the subscriber is an exclusive consumer
      */
+    @MBeanInfo("The subscriber is exclusive (no other subscribers may receive messages from the destination as long as this one is)")
     boolean isExclusive();
 
     /**
      * @return whether or not the subscriber is durable (persistent)
      */
+    @MBeanInfo("The subsription is persistent.")
     boolean isDurable();
 
     /**
      * @return whether or not the subscriber ignores local messages
      */
+    @MBeanInfo("The subsription ignores local messages.")
     boolean isNoLocal();
 
     /**
@@ -142,17 +163,20 @@
      *         perform eviction of messages for slow consumers on non-durable
      *         topics.
      */
+    @MBeanInfo("The maximum number of pending messages allowed (in addition to the prefetch size).")
     int getMaximumPendingMessageLimit();
 
     /**
      * @return the consumer priority
      */
+    @MBeanInfo("The subscription priority")
     byte getPriority();
 
     /**
      * @return the name of the consumer which is only used for durable
      *         consumers.
      */
+    @MBeanInfo("The name of the subscription (durable subscriptions only).")
     String getSubcriptionName();
 
     /**
@@ -161,6 +185,7 @@
      * @param queueName the JMS queue name to match against
      * @return true if this subscription matches the given queue or false if not
      */
+    @MBeanInfo("Returns true if the subscription (which may be using wildcards) matches the given queue name")
     boolean isMatchingQueue(String queueName);
 
     /**
@@ -169,5 +194,6 @@
      * @param topicName the JMS topic name to match against
      * @return true if this subscription matches the given topic or false if not
      */
+    @MBeanInfo("Returns true if the subscription (which may be using wildcards) matches the given topic name")
     boolean isMatchingTopic(String topicName);
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicSubscriptionViewMBean.java Mon Aug  3 12:40:13 2009
@@ -25,12 +25,15 @@
     /**
      * @return the number of messages discarded due to being a slow consumer
      */
+    @MBeanInfo("Number of messages discared due to being a slow consumer")
     int getDiscardedCount();
 
     /**
      * @return the maximun number of messages that can be pending.
      */
+    @MBeanInfo("Maximum number of messages that can be pending")
     int getMaximumPendingQueueSize();
+    
     void setMaximumPendingQueueSize(int max);
     
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java Mon Aug  3 12:40:13 2009
@@ -18,6 +18,7 @@
 
 import org.apache.activemq.Service;
 import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.jmx.AnnotatedMBean;
 import org.apache.activemq.broker.jmx.NetworkBridgeView;
 import org.apache.activemq.broker.jmx.NetworkBridgeViewMBean;
 import org.apache.activemq.command.ActiveMQDestination;
@@ -236,7 +237,7 @@
         NetworkBridgeViewMBean view = new NetworkBridgeView(bridge);
         try {
             ObjectName objectName = createNetworkBridgeObjectName(bridge);
-            getBrokerService().getManagementContext().registerMBean(view, objectName);
+            AnnotatedMBean.registerMBean(getBrokerService().getManagementContext(), view, objectName);
         } catch (Throwable e) {
             LOG.debug("Network bridge could not be registered in JMX: " + e.getMessage(), e);
         }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerFactory.java Mon Aug  3 12:40:13 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.transport;
 
+import org.apache.activemq.broker.jmx.AnnotatedMBean;
 import org.apache.activemq.broker.jmx.ManagementContext;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.LogWriterFinder;
@@ -199,7 +200,7 @@
 
          try {
              this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl");
-             this.managementContext.registerMBean(new TransportLoggerControl(this.managementContext),this.objectName);
+             AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName);
              
              this.transportLoggerControlCreated = true;
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerView.java?rev=800339&r1=800338&r2=800339&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerView.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/TransportLoggerView.java Mon Aug  3 12:40:13 2009
@@ -23,6 +23,7 @@
 
 import javax.management.ObjectName;
 
+import org.apache.activemq.broker.jmx.AnnotatedMBean;
 import org.apache.activemq.broker.jmx.ManagementContext;
 import org.apache.activemq.util.JMXSupport;
 import org.apache.commons.logging.Log;
@@ -119,7 +120,7 @@
      */
     private void register() {
         try {
-            this.managementContext.registerMBean(this, this.name);
+        	AnnotatedMBean.registerMBean(this.managementContext, this, this.name);
         } catch (Exception e) {
             log.error("Could not register MBean for TransportLoggerView " + id + "with name " + this.name.toString() + ", reason: " + e, e);
         }



Mime
View raw message