portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r932113 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/deployment/impl/StandardDeploymentManager.java
Date Thu, 08 Apr 2010 21:07:55 GMT
Author: rwatler
Date: Thu Apr  8 21:07:55 2010
New Revision: 932113

URL: http://svn.apache.org/viewvc?rev=932113&view=rev
Log:
JS2-1183: shutdown Autodeployment File Scanner Thread during Spring bean lifecycle

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/deployment/impl/StandardDeploymentManager.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/deployment/impl/StandardDeploymentManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/deployment/impl/StandardDeploymentManager.java?rev=932113&r1=932112&r2=932113&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/deployment/impl/StandardDeploymentManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/deployment/impl/StandardDeploymentManager.java
Thu Apr  8 21:07:55 2010
@@ -332,7 +332,7 @@ public class StandardDeploymentManager i
         /**
          * @see java.lang.Runnable#run()
          */
-        public void run()
+        public synchronized void run()
         {
             // use a double scanningDelay at startup to give the App Server some time to
wake up...
             // see: http://issues.apache.org/jira/browse/JS2-261
@@ -346,8 +346,8 @@ public class StandardDeploymentManager i
                 //
                 // autodeployment.delay=10000
                 //
-                //sleep(scanningDelay*2);
-                sleep(scanningDelay);
+                //wait(scanningDelay*2);
+                wait(scanningDelay);
             }
             catch (InterruptedException e)
             {
@@ -355,10 +355,9 @@ public class StandardDeploymentManager i
             while (started)
             {
                 fireDeploymentEvent();
-
                 try
                 {
-                    sleep(scanningDelay);
+                    wait(scanningDelay);
                 }
                 catch (InterruptedException e)
                 {
@@ -368,11 +367,24 @@ public class StandardDeploymentManager i
         }
 
         /**
-         * notifies a switch variable that exits the watcher's montior loop started in the
<code>run()</code> method.
+         * notifies a switch variable that exits the watcher's monitor loop started in the
<code>run()</code> method.
          */
         public void safeStop()
         {
-            started = false;
+            // stop this monitor thread
+            synchronized (this)
+            {
+                started = false;
+                notifyAll();
+            }
+            // wait for monitor thread stop
+            try
+            {
+                join(scanningDelay);
+            }
+            catch (InterruptedException ie)
+            {
+            }
         }
 
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message