Author: kstam
Date: Thu May 19 06:03:14 2011
New Revision: 1124550

URL: http://svn.apache.org/viewvc?rev=1124550&view=rev
Log:
JUDDI-482, Use the ServiceCounters to optimize how often the 
SubscriptionNotification needs to run

Modified:
    
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java

Modified: 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
URL: 
http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java?rev=1124550&r1=1124549&r2=1124550&view=diff
==============================================================================
--- 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
 (original)
+++ 
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
 Thu May 19 06:03:14 2011
@@ -23,9 +23,6 @@ import java.util.GregorianCalendar;
 import java.util.Timer;
 import java.util.TimerTask;
 
-import javax.management.AttributeNotFoundException;
-import javax.management.MBeanException;
-import javax.management.ReflectionException;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.persistence.LockModeType;
@@ -101,11 +98,11 @@ public class SubscriptionNotifier extend
                int updateCounter = 0;
                try {
                        for (String attribute : attributes) {
-                               attribute += " successful queries";
-                               String counter = 
serviceCounter.getAttribute(attribute).toString();
-                               if (counter!=null) updateCounter += 
Integer.valueOf(counter);
+                               String counter = 
serviceCounter.getAttribute(attribute + " successful queries").toString();
+                               updateCounter += Integer.valueOf(counter);
                        }
-                       //if the counts not the same something changed, this 
accounts for the case where the counters where reset.
+                       // if the counts are not the same something has 
changed, 
+                       // this accounts for the case where the counters where 
reset.
                        if (updateCounter != lastUpdateCounter) {
                                lastUpdateCounter = updateCounter;
                                isUpdated = true;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to