[jboss-svn-commits] JBL Code SVN: r9186 - labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jan 31 03:35:35 EST 2007


Author: kurt.stam at jboss.com
Date: 2007-01-31 03:35:34 -0500 (Wed, 31 Jan 2007)
New Revision: 9186

Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/Aggregator.java
Log:
small optimization

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/Aggregator.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/Aggregator.java	2007-01-31 08:29:18 UTC (rev 9185)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/Aggregator.java	2007-01-31 08:35:34 UTC (rev 9186)
@@ -209,28 +209,31 @@
     class TimeoutChecker extends Thread {
         public void run() {
             while(true) {
-                for (ConcurrentHashMap< String, Message > messageMap : _aggregatedMessageMap.values()) {
-                    //Check the first message, they all have the same time stamp
-                    Message message = messageMap.values().iterator().next();
-                    if (isTimedOut(message)) {
-                        //We found a timed-out message. Let's go notify ourselves about by resending a message,
-                        //it if we haven't done so already
-                        String aggregatorTag = (String) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
-                        String[] tag = aggregatorTag.split(":");
-                        String uuId = tag[0];
-                        if (!_notified.contains(uuId)) {
-                            _notified.add(uuId);
-                            logger.debug("Found timeout message.");
-                            try {
-                                EPR epr = registry.findEPR(serviceCategoryName, serviceName);
-                                Courier courier = CourierFactory.getCourier(epr);
-                                courier.deliver(message);
-                            } catch (Exception e) {
-                                logger.error(e.getMessage(), e);
-                                //If we can't notify then drop this data
-                                logger.debug("Deleting data for message series with uuId=" + uuId);
-                                _notified.remove(uuId);
-                                _aggregatedMessageMap.remove(uuId);
+                //no need to check if no timeout is set
+                if (timeoutInMillies!=null) {
+                    for (ConcurrentHashMap< String, Message > messageMap : _aggregatedMessageMap.values()) {
+                        //Check the first message, they all have the same time stamp
+                        Message message = messageMap.values().iterator().next();
+                        if (isTimedOut(message)) {
+                            //We found a timed-out message. Let's go notify ourselves about by resending a message,
+                            //it if we haven't done so already
+                            String aggregatorTag = (String) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
+                            String[] tag = aggregatorTag.split(":");
+                            String uuId = tag[0];
+                            if (!_notified.contains(uuId)) {
+                                _notified.add(uuId);
+                                logger.debug("Found timeout message.");
+                                try {
+                                    EPR epr = registry.findEPR(serviceCategoryName, serviceName);
+                                    Courier courier = CourierFactory.getCourier(epr);
+                                    courier.deliver(message);
+                                } catch (Exception e) {
+                                    logger.error(e.getMessage(), e);
+                                    //If we can't notify then drop this data
+                                    logger.debug("Deleting data for message series with uuId=" + uuId);
+                                    _notified.remove(uuId);
+                                    _aggregatedMessageMap.remove(uuId);
+                                }
                             }
                         }
                     }




More information about the jboss-svn-commits mailing list