[jboss-cvs] JBossAS SVN: r85257 - branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 4 16:56:22 EST 2009


Author: scott.stark at jboss.org
Date: 2009-03-04 16:56:21 -0500 (Wed, 04 Mar 2009)
New Revision: 85257

Modified:
   branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
Log:
JBAS-6546, clear/restore interrupted state of calling thread to loadProfile to work around InterruptedExceptions

Modified: branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java
===================================================================
--- branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2009-03-04 21:36:45 UTC (rev 85256)
+++ branches/Branch_5_x/profileservice/src/main/org/jboss/profileservice/management/ManagementViewImpl.java	2009-03-04 21:56:21 UTC (rev 85257)
@@ -177,6 +177,10 @@
    public void loadProfile(ProfileKey key)
       throws Exception
    {
+      // Clear any thread interrupt
+      boolean wasInterrupted = Thread.interrupted();
+      if(wasInterrupted)
+         log.debug("Cleared interrupted state of calling thread");
       // If the profile is unmodified do nothing
       if(activeProfile != null && activeProfile.getKey().equals(key))
       {
@@ -262,6 +266,12 @@
       
       // Update the modified timestamp
       activeProfileLastModified = activeProfile.getLastModified();
+
+      if(wasInterrupted)
+      {
+         Thread.currentThread().interrupt();
+         log.debug("Restored interrupted state of calling thread");
+      }
    }
    public void reloadProfile() throws Exception
    {




More information about the jboss-cvs-commits mailing list