gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r617130 - /gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java
Date Thu, 31 Jan 2008 14:07:04 GMT
Author: bodewig
Date: Thu Jan 31 06:07:03 2008
New Revision: 617130

URL: http://svn.apache.org/viewvc?rev=617130&view=rev
Log:
If Jetty fails to bind to the port, the process doesn't terminate.  Looks as if some non-daemon
threads must be still alive.  Force exit.

Modified:
    gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java

Modified: gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java?rev=617130&r1=617129&r2=617130&view=diff
==============================================================================
--- gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java (original)
+++ gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepoproxy/Main.java Thu Jan 31 06:07:03
2008
@@ -47,11 +47,18 @@
             System.err.println("org.apache.gump.mvnrepoproxyproxy.Main [port]");
             System.exit(0);
         }
-        int port = args.length > 0 ? Integer.valueOf(args[0]) : 8192;
-        Component c = getRepositoryComponent();
-        c.getServers().add(Protocol.HTTP, port);
-        c.getClients().add(Protocol.HTTP);
-        c.start();
+        int exitCode = 0;
+        try {
+            int port = args.length > 0 ? Integer.valueOf(args[0]) : 8192;
+            Component c = getRepositoryComponent();
+            c.getServers().add(Protocol.HTTP, port);
+            c.getClients().add(Protocol.HTTP);
+            c.start();
+        } catch (Throwable t) {
+            t.printStackTrace();
+            exitCode = -1;
+        }
+        System.exit(exitCode);
     }
 
     /**



Mime
View raw message