[Mulgara-svn] r1566 - trunk/src/jar/server/java/org/mulgara/server

pag at mulgara.org pag at mulgara.org
Sat Feb 28 07:04:40 UTC 2009


Author: pag
Date: 2009-02-27 23:04:39 -0800 (Fri, 27 Feb 2009)
New Revision: 1566

Modified:
   trunk/src/jar/server/java/org/mulgara/server/HttpServices.java
Log:
Honoring a port set from the command line

Modified: trunk/src/jar/server/java/org/mulgara/server/HttpServices.java
===================================================================
--- trunk/src/jar/server/java/org/mulgara/server/HttpServices.java	2009-02-28 07:03:47 UTC (rev 1565)
+++ trunk/src/jar/server/java/org/mulgara/server/HttpServices.java	2009-02-28 07:04:39 UTC (rev 1566)
@@ -252,7 +252,7 @@
     if (!disabled) {
       if (cfg != null) {
         s = new Server();
-        addConnector(s, cfg);
+        addConnector(s, cfg, port);
       } else {
         s = new Server(port);
       }
@@ -307,9 +307,11 @@
    * Adds a listener to the <code>httpServer</code>. The listener is created and configured
    * according to the Jetty configuration.
    * @param httpServer the server to add the listener to
+   * @param jettyConfig The configuraton for the server. Do not read the port at this point.
+   * @param port The port to listen on. The configuration may have been overriden by this value.
    * @throws UnknownHostException if an invalid hostname was specified in the Mulgara server configuration
    */
-  private void addConnector(Server httpServer, JettyConnector jettyConfig) throws UnknownHostException {
+  private void addConnector(Server httpServer, JettyConnector jettyConfig, int port) throws UnknownHostException {
     if (httpServer == null) throw new IllegalArgumentException("Null \"httpServer\" parameter");
 
     if (logger.isDebugEnabled()) logger.debug("Adding socket listener");
@@ -333,7 +335,7 @@
     }
     connector.setThreadPool(threadPool);
 
-    if (jettyConfig.hasPort()) connector.setPort(jettyConfig.getPort());
+    connector.setPort(port);
     if (jettyConfig.hasMaxIdleTimeMs()) connector.setMaxIdleTime(jettyConfig.getMaxIdleTimeMs());
     if (jettyConfig.hasLowResourceMaxIdleTimeMs()) connector.setLowResourceMaxIdleTime(jettyConfig.getLowResourceMaxIdleTimeMs());
     if (jettyConfig.hasAcceptors()) {




More information about the Mulgara-svn mailing list