[jboss-cvs] JBoss Messaging SVN: r3881 - in branches/Branch_JBossMessaging_1_4_0_SP3_CP: src/etc/server/default/deploy and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 14 12:01:44 EDT 2008


Author: timfox
Date: 2008-03-14 12:01:43 -0400 (Fri, 14 Mar 2008)
New Revision: 3881

Modified:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/configuration.xml
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/messaging-service.xml
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/ServerPeer-xmbean.xml
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1248


Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/configuration.xml
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/configuration.xml	2008-03-14 15:55:42 UTC (rev 3880)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/docs/userguide/en/modules/configuration.xml	2008-03-14 16:01:43 UTC (rev 3881)
@@ -114,6 +114,8 @@
       
       <attribute name="RecoverDeliveriesTimeout">300000</attribute>
       
+      <attribute name="EnableMessageCounters">false</attribute>           
+      
       <!-- The password used by the message sucker connections to create connections.
            THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
       <attribute name="SuckerPassword"></attribute>
@@ -282,6 +284,11 @@
             these messages will timeout and be added back to the queue. The
             value is in ms. The default is 5 mins.</para>
          </section>
+	 <section id="conf.serverpeer.attributes.enablemessagecounters">
+            <title>EnableMessageCounters</title>		 
+	    <para>Set this to true to enable message counters when the server starts</para>
+         </section>	 
+	 
          <section id="conf.serverpeer.attributes.suckerpassword">
             <title>SuckerPassword</title>
             <para>JBoss Messaging internally makes connections between nodes

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/messaging-service.xml
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/messaging-service.xml	2008-03-14 15:55:42 UTC (rev 3880)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/server/default/deploy/messaging-service.xml	2008-03-14 16:01:43 UTC (rev 3881)
@@ -90,6 +90,10 @@
       
       <attribute name="RecoverDeliveriesTimeout">300000</attribute>
       
+      <!-- Set to true to enable message counters that can be viewed via JMX -->
+      
+      <attribute name="EnableMessageCounters">false</attribute>
+      
       <!-- The password used by the message sucker connections to create connections.
            THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
       <attribute name="SuckerPassword"></attribute>

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/ServerPeer-xmbean.xml	2008-03-14 15:55:42 UTC (rev 3880)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/etc/xmdesc/ServerPeer-xmbean.xml	2008-03-14 16:01:43 UTC (rev 3881)
@@ -212,6 +212,12 @@
       <type>boolean</type>
    </attribute>
    
+   <attribute access="read-write" getMethod="isEnableMessageCounters" setMethod="setEnableMessageCounters">
+	<description>Enable message counters</description>
+	<name>EnableMessageCounters</name>
+	<type>boolean</type>
+   </attribute>
+   
    <attribute access="write-only" setMethod="setSuckerPassword">
       <description>The password used for message suckers</description>
       <name>SuckerPassword</name>
@@ -408,10 +414,10 @@
    
    <operation>
       <description>
-         Disable message counters
+	 Disable message counters
       </description>
       <name>disableMessageCounters</name>
-   </operation>       
+   </operation>    
    
    <operation>
       <description>

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java	2008-03-14 15:55:42 UTC (rev 3880)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/src/main/org/jboss/jms/server/ServerPeer.java	2008-03-14 16:01:43 UTC (rev 3881)
@@ -139,7 +139,9 @@
    private long defaultRedeliveryDelay;
 
    private long messageCounterSamplePeriod = 10000;
-
+   
+   private boolean enableMessageCounters;
+   
    private int defaultMessageCounterHistoryDayLimit;
 
    private String clusterPullConnectionFactoryName;
@@ -313,6 +315,11 @@
          //Now everything is started we can tell the invocation handler to start handling invocations
          //We do this right at the end otherwise it can start handling invocations before we are properly started
          JMSServerInvocationHandler.setClosed(false);
+         
+         if (enableMessageCounters)
+         {
+         	startMessageCounters();
+         }
 
          started = true;
 
@@ -731,26 +738,43 @@
    {
    	return strictTck || strictTckProperty;
    }
-
+   
+   public RotatingID getMessageIDMgr()
+   {
+      return messageIDMgr;
+   }
+   
+   public synchronized void setEnableMessageCounters(boolean enable) 
+   {
+   	if (started)
+   	{
+      	if (enableMessageCounters && !enable)
+      	{
+      		stopMessageCounters();
+      	}
+      	else if (!enableMessageCounters && enable)
+      	{
+      		startMessageCounters();
+      	}      	
+   	}
+   	enableMessageCounters = enable;
+   }
+   
+   public boolean isEnableMessageCounters()
+   {
+   	return enableMessageCounters;
+   }      
+   
    public void enableMessageCounters()
    {
-      messageCounterManager.start();
+      setEnableMessageCounters(true);
    }
 
    public void disableMessageCounters()
    {
-      messageCounterManager.stop();
-
-      messageCounterManager.resetAllCounters();
-
-      messageCounterManager.resetAllCounterHistories();
+      setEnableMessageCounters(false);
    }
 
-   public RotatingID getMessageIDMgr()
-   {
-      return messageIDMgr;
-   }
-
    // JMX Operations -------------------------------------------------------------------------------
 
    public String deployQueue(String name, String jndiName) throws Exception
@@ -1367,6 +1391,20 @@
 
    // Private --------------------------------------------------------------------------------------
      
+   private void startMessageCounters()
+   {
+   	messageCounterManager.start();
+   }
+   
+   private void stopMessageCounters()
+   {
+   	messageCounterManager.stop();
+      
+      messageCounterManager.resetAllCounters();
+
+      messageCounterManager.resetAllCounterHistories();
+   }
+   
    private void loadServerAOPConfig() throws Exception
    {
       URL url = this.getClass().getClassLoader().getResource("aop-messaging-server.xml");




More information about the jboss-cvs-commits mailing list