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
- }
- }
- }
+ }
}