servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r595226 - /incubator/servicemix/branches/servicemix-3.2/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
Date Thu, 15 Nov 2007 06:57:15 GMT
Author: ffang
Date: Wed Nov 14 22:57:14 2007
New Revision: 595226

URL: http://svn.apache.org/viewvc?rev=595226&view=rev
Log:
using new added onShutDown handler to fix compilation failure

Modified:
    incubator/servicemix/branches/servicemix-3.2/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java

Modified: incubator/servicemix/branches/servicemix-3.2/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.2/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java?rev=595226&r1=595225&r2=595226&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-3.2/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
(original)
+++ incubator/servicemix/branches/servicemix-3.2/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/ServiceMixEmbeddedMojo.java
Wed Nov 14 22:57:14 2007
@@ -51,25 +51,22 @@
         try {
             startServiceMix();
 
-            Object lock = new Object();
-            container.setShutdownLock(lock);
+            container.onShutDown(new Runnable() {
+                public void run() {
+                    if (context instanceof DisposableBean) {
+                        try {
+                            ((DisposableBean) context).destroy();
+                        } catch (Exception e) {
+                            // Ignore
+                        }
+                    }
 
-            // lets wait until we're killed.
-            synchronized (lock) {
-                lock.wait();
-            }
+                }
+            });
         } catch (Exception e) {
             throw new MojoExecutionException(
                     "Apache ServiceMix was able to deploy project", e);
-        } finally {
-            if (context instanceof DisposableBean) {
-                try {
-                    ((DisposableBean) context).destroy();
-                } catch (Exception e) {
-                    // Ignore
-                }
-            }
-        }
+        } 
 
     }
 



Mime
View raw message