[jboss-cvs] JBossAS SVN: r89145 - trunk/management/src/main/org/jboss/management/mejb.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 19 22:51:09 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-05-19 22:51:09 -0400 (Tue, 19 May 2009)
New Revision: 89145

Modified:
   trunk/management/src/main/org/jboss/management/mejb/PollingClientNotificationListener.java
Log:
JBAS-6950 - wrong interrupt handling

Modified: trunk/management/src/main/org/jboss/management/mejb/PollingClientNotificationListener.java
===================================================================
--- trunk/management/src/main/org/jboss/management/mejb/PollingClientNotificationListener.java	2009-05-20 02:48:47 UTC (rev 89144)
+++ trunk/management/src/main/org/jboss/management/mejb/PollingClientNotificationListener.java	2009-05-20 02:51:09 UTC (rev 89145)
@@ -71,33 +71,42 @@
 
    public void run()
    {
-      while (true)
+      boolean intr = false;
+      try
       {
-         try
+         while (true)
          {
             try
             {
-               List lNotifications = (List) mConnector.invoke(getRemoteListenerName(),
-                       "getNotifications",
-                       new Object[]{},
-                       new String[]{});
-               Iterator i = lNotifications.iterator();
-               while (i.hasNext())
+               try
                {
-                  Notification lNotification = (Notification) i.next();
-                  mClientListener.handleNotification(lNotification,
-                          mHandback);
+                  List lNotifications = (List) mConnector.invoke(getRemoteListenerName(),
+                          "getNotifications",
+                          new Object[]{},
+                          new String[]{});
+                  Iterator i = lNotifications.iterator();
+                  while (i.hasNext())
+                  {
+                     Notification lNotification = (Notification) i.next();
+                     mClientListener.handleNotification(lNotification,
+                             mHandback);
+                  }
                }
+               catch (Exception e)
+               {
+                  log.error("PollingClientNotificationListener.getNotifications() failed", e);
+               }
+               Thread.sleep(mSleepingPeriod);
             }
-            catch (Exception e)
+            catch (InterruptedException e)
             {
-               log.error("PollingClientNotificationListener.getNotifications() failed", e);
+               intr = true;
             }
-            Thread.sleep(mSleepingPeriod);
          }
-         catch (InterruptedException e)
-         {
-         }
       }
+      finally
+      {
+         if (intr) Thread.currentThread().interrupt();
+      }
    }
 }




More information about the jboss-cvs-commits mailing list