This is an automated email from the ASF dual-hosted git repository. billblough pushed a commit to branch 1_5 in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
commit d113d79f55ccde75e87455e3dde11ae3ec0a5c3b Author: Andreas Veithen <veit...@apache.org> AuthorDate: Sun Mar 11 18:50:06 2012 +0000 Merged r1299392 to the 1.5 branch to avoid hanging builds. --- .../axis2/transport/http/server/DefaultConnectionListener.java | 6 +++--- .../org/apache/axis2/transport/http/server/SimpleHttpServer.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/transport/http/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java b/modules/transport/http/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java index 2c39991..da095b2 100644 --- a/modules/transport/http/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java +++ b/modules/transport/http/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java @@ -106,7 +106,7 @@ public class DefaultConnectionListener implements IOProcessor { } public synchronized void awaitSocketOpen() throws InterruptedException { - while (serversocket == null) { + while (serversocket == null && !destroyed) { wait(); } } @@ -122,7 +122,7 @@ public class DefaultConnectionListener implements IOProcessor { } } - public void destroy() { + public synchronized void destroy() { this.destroyed = true; try { close(); @@ -133,7 +133,7 @@ public class DefaultConnectionListener implements IOProcessor { } } - public boolean isDestroyed() { + public synchronized boolean isDestroyed() { return this.destroyed; } diff --git a/modules/transport/http/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java b/modules/transport/http/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java index 7debb56..0ad04c3 100644 --- a/modules/transport/http/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java +++ b/modules/transport/http/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java @@ -100,7 +100,9 @@ public class SimpleHttpServer { this.listenerExecutor.execute(listener); try { listener.awaitSocketOpen(); - port = listener.getPort(); + if (!listener.isDestroyed()) { + port = listener.getPort(); + } } catch (InterruptedException ex) { Thread.currentThread().interrupt(); }